micropython: add micropython component
This commit is contained in:
11
components/language/micropython/lib/libm/thumb_vfp_sqrtf.c
Normal file
11
components/language/micropython/lib/libm/thumb_vfp_sqrtf.c
Normal file
@@ -0,0 +1,11 @@
|
||||
// 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;
|
||||
}
|
Reference in New Issue
Block a user