diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2013-02-15 17:40:08 -0500 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2013-02-15 17:40:08 -0500 |
commit | 68495a07487c410a5272ab917c4ab87b3c60c3af (patch) | |
tree | 8943e4314ce8b2db10180d70f2a0ae0ddb74177c /src/arch/arm/insts/vfp.cc | |
parent | 7ae06a3b3bb6c5438cd9cac7f1fe5f8cdb65e07d (diff) | |
download | gem5-68495a07487c410a5272ab917c4ab87b3c60c3af.tar.xz |
ARM: Fix an issue with clang generating wrong code.
Clang generated executables would enter the if condition when it wasn't
supposted to, resulting in the wrong simulated behavior.
Implementing the operation this way is a bit faster anyway.
Diffstat (limited to 'src/arch/arm/insts/vfp.cc')
-rw-r--r-- | src/arch/arm/insts/vfp.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/arch/arm/insts/vfp.cc b/src/arch/arm/insts/vfp.cc index f689204d9..6e15282f8 100644 --- a/src/arch/arm/insts/vfp.cc +++ b/src/arch/arm/insts/vfp.cc @@ -993,9 +993,8 @@ FpOp::binaryOp(FPSCR &fpscr, fpType op1, fpType op2, fpType dest = func(op1, op2); __asm__ __volatile__ ("" : "=m" (dest) : "m" (dest)); - int fpClass = std::fpclassify(dest); // Get NAN behavior right. This varies between x86 and ARM. - if (fpClass == FP_NAN) { + if (std::isnan(dest)) { const bool single = (sizeof(fpType) == sizeof(float)); const uint64_t qnan = single ? 0x7fc00000 : ULL(0x7ff8000000000000); @@ -1065,9 +1064,8 @@ FpOp::unaryOp(FPSCR &fpscr, fpType op1, fpType (*func)(fpType), fpType dest = func(op1); __asm__ __volatile__ ("" : "=m" (dest) : "m" (dest)); - int fpClass = std::fpclassify(dest); // Get NAN behavior right. This varies between x86 and ARM. - if (fpClass == FP_NAN) { + if (std::isnan(dest)) { const bool single = (sizeof(fpType) == sizeof(float)); const uint64_t qnan = single ? 0x7fc00000 : ULL(0x7ff8000000000000); |