diff options
author | peter <peter@FreeBSD.org> | 2001-08-23 01:03:56 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-08-23 01:03:56 +0000 |
commit | 06f57e01ae212598a886c89e3f096c31719becb7 (patch) | |
tree | 7f0289bde9681b2fca6e223ae5041ee6e563908b /sys/amd64/isa | |
parent | 2c80ec8e4ac8cca86e44e46bbf5b97a9f9c5fc1f (diff) | |
download | FreeBSD-src-06f57e01ae212598a886c89e3f096c31719becb7.zip FreeBSD-src-06f57e01ae212598a886c89e3f096c31719becb7.tar.gz |
Dont compile in SSE fxsave/fxrstor instructions if CPU_ENABLE_SSE isn't
active.
Diffstat (limited to 'sys/amd64/isa')
-rw-r--r-- | sys/amd64/isa/npx.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sys/amd64/isa/npx.c b/sys/amd64/isa/npx.c index c6fdeea..a246f30 100644 --- a/sys/amd64/isa/npx.c +++ b/sys/amd64/isa/npx.c @@ -100,8 +100,10 @@ #define fnstsw(addr) __asm __volatile("fnstsw %0" : "=m" (*(addr))) #define fp_divide_by_0() __asm("fldz; fld1; fdiv %st,%st(1); fnop") #define frstor(addr) __asm("frstor %0" : : "m" (*(addr))) +#ifdef CPU_ENABLE_SSE #define fxrstor(addr) __asm("fxrstor %0" : : "m" (*(addr))) #define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr))) +#endif #define start_emulating() __asm("smsw %%ax; orb %0,%%al; lmsw %%ax" \ : : "n" (CR0_TS) : "ax") #define stop_emulating() __asm("clts") @@ -116,8 +118,10 @@ void fnstcw __P((caddr_t addr)); void fnstsw __P((caddr_t addr)); void fp_divide_by_0 __P((void)); void frstor __P((caddr_t addr)); +#ifdef CPU_ENABLE_SSE void fxsave __P((caddr_t addr)); void fxrstor __P((caddr_t addr)); +#endif void start_emulating __P((void)); void stop_emulating __P((void)); @@ -921,20 +925,25 @@ fpusave(addr) union savefpu *addr; { - if (!cpu_fxsr) - fnsave(addr); - else +#ifdef CPU_ENABLE_SSE + if (cpu_fxsr) fxsave(addr); + else +#endif + fnsave(addr); } static void fpurstor(addr) union savefpu *addr; { - if (!cpu_fxsr) - frstor(addr); - else + +#ifdef CPU_ENABLE_SSE + if (cpu_fxsr) fxrstor(addr); + else +#endif + frstor(addr); } #ifdef I586_CPU_XXX |