OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 27 matching lines...) Expand all Loading... |
38 // Linux uses a 80bit wide floating point stack on x86. This induces double | 38 // Linux uses a 80bit wide floating point stack on x86. This induces double |
39 // rounding, which in turn leads to wrong results. | 39 // rounding, which in turn leads to wrong results. |
40 // An easy way to test if the floating-point operations are correct is to | 40 // An easy way to test if the floating-point operations are correct is to |
41 // evaluate: 89255.0/1e22. If the floating-point stack is 64 bits wide then | 41 // evaluate: 89255.0/1e22. If the floating-point stack is 64 bits wide then |
42 // the result is equal to 89255e-22. | 42 // the result is equal to 89255e-22. |
43 // The best way to test this, is to create a division-function and to compare | 43 // The best way to test this, is to create a division-function and to compare |
44 // the output of the division with the expected result. (Inlining must be | 44 // the output of the division with the expected result. (Inlining must be |
45 // disabled.) | 45 // disabled.) |
46 // On Linux,x86 89255e-22 != Div_double(89255.0/1e22) | 46 // On Linux,x86 89255e-22 != Div_double(89255.0/1e22) |
47 #if defined(_M_X64) || defined(__x86_64__) || \ | 47 #if defined(_M_X64) || defined(__x86_64__) || \ |
48 defined(__ARMEL__) || \ | 48 defined(__ARMEL__) || defined(__aarch64__) || \ |
49 defined(__MIPSEL__) | 49 defined(__MIPSEL__) |
50 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 | 50 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 |
51 #elif defined(_M_IX86) || defined(__i386__) | 51 #elif defined(_M_IX86) || defined(__i386__) |
52 #if defined(_WIN32) | 52 #if defined(_WIN32) |
53 // Windows uses a 64bit wide floating point stack. | 53 // Windows uses a 64bit wide floating point stack. |
54 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 | 54 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 |
55 #else | 55 #else |
56 #undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS | 56 #undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS |
57 #endif // _WIN32 | 57 #endif // _WIN32 |
58 #else | 58 #else |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 template <class Dest, class Source> | 298 template <class Dest, class Source> |
299 inline Dest BitCast(Source* source) { | 299 inline Dest BitCast(Source* source) { |
300 return BitCast<Dest>(reinterpret_cast<uintptr_t>(source)); | 300 return BitCast<Dest>(reinterpret_cast<uintptr_t>(source)); |
301 } | 301 } |
302 | 302 |
303 } // namespace double_conversion | 303 } // namespace double_conversion |
304 | 304 |
305 } // namespace WTF | 305 } // namespace WTF |
306 | 306 |
307 #endif // DOUBLE_CONVERSION_UTILS_H_ | 307 #endif // DOUBLE_CONVERSION_UTILS_H_ |
OLD | NEW |