Optimize.

This commit is contained in:
mycroft 1995-04-09 19:18:49 +00:00
parent 907e54c9e9
commit 14e246dc4a
2 changed files with 12 additions and 12 deletions

View File

@ -8,17 +8,17 @@
.text
.align 2
_map:
.long 1 /* round to nearest */
.long 3 /* round to negative infinity */
.long 2 /* round to positive infinity */
.long 0 /* round to zero */
.byte 1 /* round to nearest */
.byte 3 /* round to negative infinity */
.byte 2 /* round to positive infinity */
.byte 0 /* round to zero */
ENTRY(__flt_rounds)
subl $4,%esp
fnstcw 2(%esp)
movw 2(%esp),%ax
fnstcw (%esp)
movw (%esp),%ax
shrl $10,%eax
andl $3,%eax
movl _map(,%eax,4),%eax
movb _map(,%eax,1),%al
addl $4,%esp
ret

View File

@ -8,14 +8,14 @@
.text
.even
_map:
.long 1 /* round to nearest */
.long 0 /* round to zero */
.long 3 /* round to negative infinity */
.long 2 /* round to positive infinity */
.byte 1 /* round to nearest */
.byte 0 /* round to zero */
.byte 3 /* round to negative infinity */
.byte 2 /* round to positive infinity */
ENTRY(__flt_rounds)
fmovel fpcr,d0
bfextu d0{#26:#2},d0
lea _map,a0
movel a0@(d0:l:4),d0
moveb a0@(d0:b:1),d0
rts