summaryrefslogtreecommitdiffstatshomepage
path: root/lib/libm_dbl/thumb_vfp_sqrt.c
blob: ccd33e97960f48a25bbb91851190ecc6baa05ee5 (plain) (blame)
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;
}