diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-04-23 15:34:40 +0000 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-04-23 15:34:40 +0000 |
commit | cca881a5316d686f0be6b437e756a9faba43aa02 (patch) | |
tree | 1c46278b51c66879e228b696dee64787fc487704 /src/arch/sparc | |
parent | f0929006965514982603fe58ebc3211acf021cce (diff) | |
parent | a006aa067a197f5ce2cd3f22ffe30ae3d9103cbf (diff) | |
download | gem5-cca881a5316d686f0be6b437e756a9faba43aa02.tar.xz |
Merge zizzer.eecs.umich.edu:/n/wexford/x/gblack/m5/newmem-o3-spec
into ahchoo.blinky.homelinux.org:/home/gblack/m5/newmem-o3-micro
--HG--
extra : convert_revision : 757e1d79033e6f8e0aaaf5ecaf14077d416cff8e
Diffstat (limited to 'src/arch/sparc')
-rw-r--r-- | src/arch/sparc/isa/formats/basic.isa | 31 | ||||
-rw-r--r-- | src/arch/sparc/isa/includes.isa | 12 |
2 files changed, 10 insertions, 33 deletions
diff --git a/src/arch/sparc/isa/formats/basic.isa b/src/arch/sparc/isa/formats/basic.isa index 7665d2d4f..5b0868132 100644 --- a/src/arch/sparc/isa/formats/basic.isa +++ b/src/arch/sparc/isa/formats/basic.isa @@ -109,37 +109,22 @@ def format FpBasic(code, *flags) {{ fp_code = """ Fsr |= bits(Fsr,4,0) << 5; Fsr = insertBits(Fsr,4,0,0); -#if defined(__sun) || defined (__OpenBSD__) - fp_rnd newrnd = FP_RN; + int newrnd = M5_FE_TONEAREST; switch (Fsr<31:30>) { - case 0: newrnd = FP_RN; break; - case 1: newrnd = FP_RZ; break; - case 2: newrnd = FP_RP; break; - case 3: newrnd = FP_RM; break; + case 0: newrnd = M5_FE_TONEAREST; break; + case 1: newrnd = M5_FE_TOWARDZERO; break; + case 2: newrnd = M5_FE_UPWARD; break; + case 3: newrnd = M5_FE_DOWNWARD; break; } - fp_rnd oldrnd = fpsetround(newrnd); -#else - int newrnd = FE_TONEAREST; - switch (Fsr<31:30>) { - case 0: newrnd = FE_TONEAREST; break; - case 1: newrnd = FE_TOWARDZERO; break; - case 2: newrnd = FE_UPWARD; break; - case 3: newrnd = FE_DOWNWARD; break; - } - int oldrnd = fegetround(); - fesetround(newrnd); -#endif + int oldrnd = m5_fegetround(); + m5_fesetround(newrnd); """ fp_code += code fp_code += """ -#if defined(__sun) || defined (__OpenBSD__) - fpsetround(oldrnd); -#else - fesetround(oldrnd); -#endif + m5_fesetround(oldrnd); """ fp_code = filterDoubles(fp_code) iop = InstObjParams(name, Name, 'SparcStaticInst', fp_code, flags) diff --git a/src/arch/sparc/isa/includes.isa b/src/arch/sparc/isa/includes.isa index 05e9e8731..e9cd660b5 100644 --- a/src/arch/sparc/isa/includes.isa +++ b/src/arch/sparc/isa/includes.isa @@ -53,22 +53,14 @@ output decoder {{ #include "cpu/thread_context.hh" // for Jump::branchTarget() #include "mem/packet.hh" -#if defined(linux) || defined(__APPLE__) -#include <fenv.h> -#endif +#include "base/fenv.hh" #include <algorithm> using namespace SparcISA; }}; output exec {{ -#if defined(linux) || defined(__APPLE__) -#include <fenv.h> -#endif - -#if defined(__sun) || defined (__OpenBSD__) -#include <ieeefp.h> -#endif +#include "base/fenv.hh" #if FULL_SYSTEM #include "sim/pseudo_inst.hh" |