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>
This commit is contained in:
David Lechner 2022-11-09 12:03:31 -06:00 committed by Damien George
parent 71881116e6
commit 0eead94181
2 changed files with 2 additions and 2 deletions

View File

@ -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));

View File

@ -2,7 +2,7 @@
double sqrt(double x) {
double ret;
asm volatile (
__asm__ volatile (
"vsqrt.f64 %P0, %P1\n"
: "=w" (ret)
: "w" (x));