vfp.cc (7639:8c09b7ff5b57) | vfp.cc (9515:40a194c31c91) |
---|---|
1/* 2 * Copyright (c) 2010 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 979 unchanged lines hidden (view full) --- 988 if (flush && flushToZero(op1, op2)) 989 fpscr.idc = 1; 990 VfpSavedState state = prepFpState(rMode); 991 __asm__ __volatile__ ("" : "=m" (op1), "=m" (op2), "=m" (state) 992 : "m" (op1), "m" (op2), "m" (state)); 993 fpType dest = func(op1, op2); 994 __asm__ __volatile__ ("" : "=m" (dest) : "m" (dest)); 995 | 1/* 2 * Copyright (c) 2010 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 979 unchanged lines hidden (view full) --- 988 if (flush && flushToZero(op1, op2)) 989 fpscr.idc = 1; 990 VfpSavedState state = prepFpState(rMode); 991 __asm__ __volatile__ ("" : "=m" (op1), "=m" (op2), "=m" (state) 992 : "m" (op1), "m" (op2), "m" (state)); 993 fpType dest = func(op1, op2); 994 __asm__ __volatile__ ("" : "=m" (dest) : "m" (dest)); 995 |
996 int fpClass = std::fpclassify(dest); | |
997 // Get NAN behavior right. This varies between x86 and ARM. | 996 // Get NAN behavior right. This varies between x86 and ARM. |
998 if (fpClass == FP_NAN) { | 997 if (std::isnan(dest)) { |
999 const bool single = (sizeof(fpType) == sizeof(float)); 1000 const uint64_t qnan = 1001 single ? 0x7fc00000 : ULL(0x7ff8000000000000); 1002 const bool nan1 = std::isnan(op1); 1003 const bool nan2 = std::isnan(op2); 1004 const bool signal1 = nan1 && ((fpToBits(op1) & qnan) != qnan); 1005 const bool signal2 = nan2 && ((fpToBits(op2) & qnan) != qnan); 1006 if ((!nan1 && !nan2) || (defaultNan == 1)) { --- 53 unchanged lines hidden (view full) --- 1060 if (flush && flushToZero(op1)) 1061 fpscr.idc = 1; 1062 VfpSavedState state = prepFpState(rMode); 1063 __asm__ __volatile__ ("" : "=m" (op1), "=m" (state) 1064 : "m" (op1), "m" (state)); 1065 fpType dest = func(op1); 1066 __asm__ __volatile__ ("" : "=m" (dest) : "m" (dest)); 1067 | 998 const bool single = (sizeof(fpType) == sizeof(float)); 999 const uint64_t qnan = 1000 single ? 0x7fc00000 : ULL(0x7ff8000000000000); 1001 const bool nan1 = std::isnan(op1); 1002 const bool nan2 = std::isnan(op2); 1003 const bool signal1 = nan1 && ((fpToBits(op1) & qnan) != qnan); 1004 const bool signal2 = nan2 && ((fpToBits(op2) & qnan) != qnan); 1005 if ((!nan1 && !nan2) || (defaultNan == 1)) { --- 53 unchanged lines hidden (view full) --- 1059 if (flush && flushToZero(op1)) 1060 fpscr.idc = 1; 1061 VfpSavedState state = prepFpState(rMode); 1062 __asm__ __volatile__ ("" : "=m" (op1), "=m" (state) 1063 : "m" (op1), "m" (state)); 1064 fpType dest = func(op1); 1065 __asm__ __volatile__ ("" : "=m" (dest) : "m" (dest)); 1066 |
1068 int fpClass = std::fpclassify(dest); | |
1069 // Get NAN behavior right. This varies between x86 and ARM. | 1067 // Get NAN behavior right. This varies between x86 and ARM. |
1070 if (fpClass == FP_NAN) { | 1068 if (std::isnan(dest)) { |
1071 const bool single = (sizeof(fpType) == sizeof(float)); 1072 const uint64_t qnan = 1073 single ? 0x7fc00000 : ULL(0x7ff8000000000000); 1074 const bool nan = std::isnan(op1); 1075 if (!nan || fpscr.dn == 1) { 1076 dest = bitsToFp(qnan, junk); 1077 } else if (nan) { 1078 dest = bitsToFp(fpToBits(op1) | qnan, junk); --- 78 unchanged lines hidden --- | 1069 const bool single = (sizeof(fpType) == sizeof(float)); 1070 const uint64_t qnan = 1071 single ? 0x7fc00000 : ULL(0x7ff8000000000000); 1072 const bool nan = std::isnan(op1); 1073 if (!nan || fpscr.dn == 1) { 1074 dest = bitsToFp(qnan, junk); 1075 } else if (nan) { 1076 dest = bitsToFp(fpToBits(op1) | qnan, junk); --- 78 unchanged lines hidden --- |