[alpha] special case remqu power of 2
rth@twiddle.net
rth@twiddle.net
Wed Mar 31 07:06:00 GMT 2004
I verified that the extra checks fit into existing schedule
bubbles on ev4 and ev6, so the common case isn't affected
at all.
r~
Index: sysdeps/alpha/remqu.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/alpha/remqu.S,v
retrieving revision 1.7
diff -c -p -d -r1.7 remqu.S
*** sysdeps/alpha/remqu.S 27 Mar 2004 00:32:28 -0000 1.7
--- sysdeps/alpha/remqu.S 31 Mar 2004 02:31:20 -0000
*************** __remqu:
*** 54,77 ****
going to use the results. */
stq X, 16(sp)
stq Y, 24(sp)
! beq Y, DIVBYZERO
stt $f0, 0(sp)
stt $f1, 8(sp)
cfi_rel_offset ($f0, 0)
cfi_rel_offset ($f1, 8)
ldt $f0, 16(sp)
ldt $f1, 24(sp)
-
cvtqt $f0, $f0
cvtqt $f1, $f1
blt X, $x_is_neg
divt/c $f0, $f1, $f0
/* Check to see if Y was mis-converted as signed value. */
ldt $f1, 8(sp)
- unop
- nop
blt Y, $y_is_neg
/* Check to see if X fit in the double as an exact value. */
--- 54,78 ----
going to use the results. */
stq X, 16(sp)
stq Y, 24(sp)
! subq Y, 1, AT
stt $f0, 0(sp)
+ and Y, AT, AT
stt $f1, 8(sp)
+ beq AT, $powerof2
cfi_rel_offset ($f0, 0)
cfi_rel_offset ($f1, 8)
+
ldt $f0, 16(sp)
ldt $f1, 24(sp)
cvtqt $f0, $f0
cvtqt $f1, $f1
+
blt X, $x_is_neg
divt/c $f0, $f1, $f0
/* Check to see if Y was mis-converted as signed value. */
ldt $f1, 8(sp)
blt Y, $y_is_neg
/* Check to see if X fit in the double as an exact value. */
*************** $y_is_neg:
*** 242,247 ****
--- 243,258 ----
lda sp, FRAME(sp)
cfi_restore ($f0)
+ cfi_def_cfa_offset (0)
+ ret $31, (RA), 1
+
+ .align 4
+ cfi_def_cfa_offset (FRAME)
+ $powerof2:
+ subq Y, 1, AT
+ beq Y, DIVBYZERO
+ and X, AT, RV
+ lda sp, FRAME(sp)
cfi_def_cfa_offset (0)
ret $31, (RA), 1
More information about the Libc-alpha
mailing list