aboutsummaryrefslogtreecommitdiff
path: root/circuitpython/lib/libm_dbl/thumb_vfp_sqrt.c
blob: dd37a07b053c578a6db6a09f27908ba0a19072f4 (plain)
1
2
3
4
5
6
7
8
9
10
// 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;
}