From 0eead94181127b6e4c0084dba36b3dfd60ed6660 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 9 Nov 2022 12:03:31 -0600 Subject: [PATCH] lib/libm: Use __asm__ instead of asm. `asm` is not part of the C standard and causes a complier error when `-std=c99` is used. `__asm__` is the recommended alternative. https://gcc.gnu.org/onlinedocs/gcc/extensions-to-the-c-language-family/alternate-keywords.html Signed-off-by: David Lechner --- lib/libm/thumb_vfp_sqrtf.c | 2 +- lib/libm_dbl/thumb_vfp_sqrt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libm/thumb_vfp_sqrtf.c b/lib/libm/thumb_vfp_sqrtf.c index 12ffebf827..25b8823163 100644 --- a/lib/libm/thumb_vfp_sqrtf.c +++ b/lib/libm/thumb_vfp_sqrtf.c @@ -3,7 +3,7 @@ #include float sqrtf(float x) { - asm volatile ( + __asm__ volatile ( "vsqrt.f32 %[r], %[x]\n" : [r] "=t" (x) : [x] "t" (x)); diff --git a/lib/libm_dbl/thumb_vfp_sqrt.c b/lib/libm_dbl/thumb_vfp_sqrt.c index dd37a07b05..ccd33e9796 100644 --- a/lib/libm_dbl/thumb_vfp_sqrt.c +++ b/lib/libm_dbl/thumb_vfp_sqrt.c @@ -2,7 +2,7 @@ double sqrt(double x) { double ret; - asm volatile ( + __asm__ volatile ( "vsqrt.f64 %P0, %P1\n" : "=w" (ret) : "w" (x));