0eead94181
`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>
11 lines
256 B
C
11 lines
256 B
C
// an implementation of sqrt for Thumb using hardware double-precision VFP instructions
|
|
|
|
double sqrt(double x) {
|
|
double ret;
|
|
__asm__ volatile (
|
|
"vsqrt.f64 %P0, %P1\n"
|
|
: "=w" (ret)
|
|
: "w" (x));
|
|
return ret;
|
|
}
|