thumb_vfp_sqrtf.c 244 B

1234567891011
  1. // an implementation of sqrtf for Thumb using hardware VFP instructions
  2. #include <math.h>
  3. float sqrtf(float x) {
  4. asm volatile (
  5. "vsqrt.f32 %[r], %[x]\n"
  6. : [r] "=t" (x)
  7. : [x] "t" (x));
  8. return x;
  9. }