2010-03-03 15:27:30 +01:00
|
|
|
/* fpu_cw_get() - get FPU control word Author: Erik van der Kouwe */
|
|
|
|
/* fpu_cw_set() - set FPU control word 9 Dec 2009 */
|
2010-08-17 18:44:07 +02:00
|
|
|
#include <machine/asm.h>
|
2010-03-03 15:27:30 +01:00
|
|
|
|
|
|
|
/* u16_t fpu_cw_get(void) */
|
2010-08-17 18:44:07 +02:00
|
|
|
ENTRY(fpu_cw_get)
|
2010-03-03 15:27:30 +01:00
|
|
|
/* clear unused bits just to be sure */
|
|
|
|
xor %eax, %eax
|
|
|
|
push %eax
|
|
|
|
fstcw (%esp)
|
|
|
|
pop %eax
|
|
|
|
ret
|
|
|
|
|
|
|
|
/* void fpu_cw_set(u16_t fpu_cw) */
|
2010-08-17 18:44:07 +02:00
|
|
|
ENTRY(fpu_cw_set)
|
2010-03-03 15:27:30 +01:00
|
|
|
/* load control word from parameter */
|
|
|
|
fldcw 4(%esp)
|
|
|
|
ret
|