summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lechner <david@pybricks.com>2022-11-09 12:03:31 -0600
committerDamien George <damien@micropython.org>2022-11-10 11:36:41 +1100
commit0eead94181127b6e4c0084dba36b3dfd60ed6660 (patch)
treed6214cd8c6d2552cf124783040b89249aa195cb6
parent71881116e6442274a7c12967f02dea00eeb7568c (diff)
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 <david@pybricks.com>
-rw-r--r--lib/libm/thumb_vfp_sqrtf.c2
-rw-r--r--lib/libm_dbl/thumb_vfp_sqrt.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libm/thumb_vfp_sqrtf.c b/lib/libm/thumb_vfp_sqrtf.c
index 12ffebf82..25b882316 100644
--- a/lib/libm/thumb_vfp_sqrtf.c
+++ b/lib/libm/thumb_vfp_sqrtf.c
@@ -3,7 +3,7 @@
#include <math.h>
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 dd37a07b0..ccd33e979 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));