1995-04-07 18:57:16 +04:00
|
|
|
/*
|
|
|
|
* Written by J.T. Conklin, Apr 4, 1995
|
|
|
|
* Public domain.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <machine/asm.h>
|
|
|
|
|
|
|
|
.text
|
|
|
|
.align 2
|
|
|
|
_map:
|
1995-04-09 23:18:49 +04:00
|
|
|
.byte 1 /* round to nearest */
|
|
|
|
.byte 3 /* round to negative infinity */
|
|
|
|
.byte 2 /* round to positive infinity */
|
|
|
|
.byte 0 /* round to zero */
|
1995-04-07 18:57:16 +04:00
|
|
|
|
|
|
|
ENTRY(__flt_rounds)
|
|
|
|
subl $4,%esp
|
1995-04-09 23:18:49 +04:00
|
|
|
fnstcw (%esp)
|
|
|
|
movw (%esp),%ax
|
1995-04-07 18:57:16 +04:00
|
|
|
shrl $10,%eax
|
|
|
|
andl $3,%eax
|
1995-04-09 23:18:49 +04:00
|
|
|
movb _map(,%eax,1),%al
|
1995-04-07 18:57:16 +04:00
|
|
|
addl $4,%esp
|
|
|
|
ret
|