summaryrefslogtreecommitdiff
path: root/lib/libm/arch/vax/n_cbrt.S
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-07-05 21:10:51 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-07-05 21:10:51 +0000
commita4ad12e3d1a512b89d9d85f6febc3f1c1bf7ea22 (patch)
tree081554f6ab8a597fdf4025181d92fd919da94a3e /lib/libm/arch/vax/n_cbrt.S
parent50508fdc39c1c58bc7a03b6cad331ab7b3917975 (diff)
VAX ELF userland bits. Consists mostly of register prefix additions.
Diffstat (limited to 'lib/libm/arch/vax/n_cbrt.S')
-rw-r--r--lib/libm/arch/vax/n_cbrt.S62
1 files changed, 31 insertions, 31 deletions
diff --git a/lib/libm/arch/vax/n_cbrt.S b/lib/libm/arch/vax/n_cbrt.S
index dd03a8fa229..d5669952618 100644
--- a/lib/libm/arch/vax/n_cbrt.S
+++ b/lib/libm/arch/vax/n_cbrt.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: n_cbrt.S,v 1.4 2008/09/16 22:13:12 martynas Exp $ */
+/* $OpenBSD: n_cbrt.S,v 1.5 2013/07/05 21:10:50 miod Exp $ */
/* $NetBSD: n_cbrt.S,v 1.1 1995/10/10 23:40:26 ragge Exp $ */
/*
* Copyright (c) 1985, 1993
@@ -43,37 +43,37 @@
.text
_ALIGN_TEXT
ENTRY(cbrt, R2|R3|R4|R5|R6|R7)
- movq 4(ap),r0 # r0 = argument x
- bicw3 $0x807f,r0,r2 # biased exponent of x
+ movq 4(%ap),%r0 # r0 = argument x
+ bicw3 $0x807f,%r0,%r2 # biased exponent of x
jeql return # cbrt(0)=0 cbrt(res)=res. operand
- bicw3 $0x7fff,r0,ap # ap has sign(x)
- xorw2 ap,r0 # r0 is abs(x)
- movl r0,r2 # r2 has abs(x)
- rotl $16,r2,r2 # r2 = |x| with bits unscrambled
- divl2 $3,r2 # rough cbrt with bias/3
- addl2 B,r2 # restore bias, diminish fraction
- rotl $16,r2,r2 # r2=|q|=|cbrt| to 5 bits
- mulf3 r2,r2,r3 # r3 =qq
- divf2 r0,r3 # r3 = qq/x
- mulf2 r2,r3
- addf2 C,r3 # r3 = s = C + qqq/x
- divf3 r3,D,r4 # r4 = D/s
- addf2 E,r4
- addf2 r4,r3 # r3 = s + E + D/s
- divf3 r3,F,r3 # r3 = F / (s + E + D/s)
- addf2 G,r3 # r3 = G + F / (s + E + D/s)
- mulf2 r3,r2 # r2 = qr3 = new q to 23 bits
- clrl r3 # r2:r3 = q as double float
- muld3 r2,r2,r4 # r4:r5 = qq exactly
- divd2 r4,r0 # r0:r1 = x/(q*q) rounded
- subd3 r2,r0,r6 # r6:r7 = x/(q*q) - q exactly
- movq r2,r4 # r4:r5 = q
- addw2 $0x80,r4 # r4:r5 = 2 * q
- addd2 r0,r4 # r4:r5 = 2*q + x/(q*q)
- divd2 r4,r6 # r6:r7 = (x/(q*q)-q)/(2*q+x/(q*q))
- muld2 r2,r6 # r6:r7 = q*(x/(q*q)-q)/(2*q+x/(q*q))
- addd3 r6,r2,r0 # r0:r1 = q + r6:r7
- bisw2 ap,r0 # restore the sign bit
+ bicw3 $0x7fff,%r0,%ap # ap has sign(x)
+ xorw2 %ap,%r0 # r0 is abs(x)
+ movl %r0,%r2 # r2 has abs(x)
+ rotl $16,%r2,%r2 # r2 = |x| with bits unscrambled
+ divl2 $3,%r2 # rough cbrt with bias/3
+ addl2 B,%r2 # restore bias, diminish fraction
+ rotl $16,%r2,%r2 # r2=|q|=|cbrt| to 5 bits
+ mulf3 %r2,%r2,%r3 # r3 =qq
+ divf2 %r0,%r3 # r3 = qq/x
+ mulf2 %r2,%r3
+ addf2 C,%r3 # r3 = s = C + qqq/x
+ divf3 %r3,D,%r4 # r4 = D/s
+ addf2 E,%r4
+ addf2 %r4,%r3 # r3 = s + E + D/s
+ divf3 %r3,F,%r3 # r3 = F / (s + E + D/s)
+ addf2 G,%r3 # r3 = G + F / (s + E + D/s)
+ mulf2 %r3,%r2 # r2 = qr3 = new q to 23 bits
+ clrl %r3 # r2:r3 = q as double float
+ muld3 %r2,%r2,%r4 # r4:r5 = qq exactly
+ divd2 %r4,%r0 # r0:r1 = x/(q*q) rounded
+ subd3 %r2,%r0,%r6 # r6:r7 = x/(q*q) - q exactly
+ movq %r2,%r4 # r4:r5 = q
+ addw2 $0x80,%r4 # r4:r5 = 2 * q
+ addd2 %r0,%r4 # r4:r5 = 2*q + x/(q*q)
+ divd2 %r4,%r6 # r6:r7 = (x/(q*q)-q)/(2*q+x/(q*q))
+ muld2 %r2,%r6 # r6:r7 = q*(x/(q*q)-q)/(2*q+x/(q*q))
+ addd3 %r6,%r2,%r0 # r0:r1 = q + r6:r7
+ bisw2 %ap,%r0 # restore the sign bit
return:
ret # error less than 0.667 ulps