summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-06-04 17:02:27 +0000
committerjake <jake@FreeBSD.org>2002-06-04 17:02:27 +0000
commit4c4cc525a823b444d0fbbc9c0abb98dc943e4e99 (patch)
tree3b5b4ebbeb70e062d1e7d028c44d5019c4296977 /lib
parent71a01dad7b9d812736d7085becbebc7432b3e4ab (diff)
downloadFreeBSD-src-4c4cc525a823b444d0fbbc9c0abb98dc943e4e99.zip
FreeBSD-src-4c4cc525a823b444d0fbbc9c0abb98dc943e4e99.tar.gz
Implement _Qp_sqrt. I've been unable to find a C program that gcc generates
a call to this for, but apparently somehing in libstdc++ does.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sparc64/fpu/fpu_qp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/libc/sparc64/fpu/fpu_qp.c b/lib/libc/sparc64/fpu/fpu_qp.c
index 48551ad..055df8e 100644
--- a/lib/libc/sparc64/fpu/fpu_qp.c
+++ b/lib/libc/sparc64/fpu/fpu_qp.c
@@ -108,6 +108,20 @@ _Qp_f ## name(u_int *a, u_int *b) \
return (test(FSR_GET_FCC0(fe.fe_fsr))); \
}
+void _Qp_sqrt(u_int *c, u_int *a);
+void
+_Qp_sqrt(u_int *c, u_int *a)
+{
+ struct fpemu fe;
+ struct fpn *r;
+ __asm __volatile("stx %%fsr, %0" : "=m" (fe.fe_fsr) :);
+ fe.fe_f1.fp_sign = a[0] >> 31;
+ fe.fe_f1.fp_sticky = 0;
+ fe.fe_f1.fp_class = __fpu_qtof(&fe.fe_f1, a[0], a[1], a[2], a[3]);
+ r = __fpu_sqrt(&fe);
+ c[0] = __fpu_ftoq(&fe, r, c);
+}
+
_QP_OP(add)
_QP_OP(div)
_QP_OP(mul)
OpenPOWER on IntegriCloud