NetBSD/lib/libc/arch/i386/gen/flt_rounds.S

34 lines
575 B
ArmAsm
Raw Normal View History

1998-01-09 06:45:03 +03:00
/* $NetBSD: flt_rounds.S,v 1.5 1998/01/09 03:45:03 perry Exp $ */
/*
* 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 */
ENTRY(__flt_rounds)
subl $4,%esp
1995-04-09 23:18:49 +04:00
fnstcw (%esp)
1995-04-09 23:31:33 +04:00
movl (%esp),%eax
shrl $10,%eax
andl $3,%eax
1995-06-21 02:45:46 +04:00
#ifdef PIC
PIC_PROLOGUE
leal PIC_GOTOFF(_map),%ecx
PIC_EPILOGUE
movb (%ecx,%eax,1),%al
#else
1995-04-09 23:18:49 +04:00
movb _map(,%eax,1),%al
1995-06-21 02:45:46 +04:00
#endif
addl $4,%esp
ret