You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
cd527bb324
This allows it to be used only when the hardware supports VFP instructions, preventing compile errors.
12 lines
244 B
C
12 lines
244 B
C
// an implementation of sqrtf for Thumb using hardware VFP instructions
|
|
|
|
#include <math.h>
|
|
|
|
float sqrtf(float x) {
|
|
asm volatile (
|
|
"vsqrt.f32 %[r], %[x]\n"
|
|
: [r] "=t" (x)
|
|
: [x] "t" (x));
|
|
return x;
|
|
}
|