mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Merge: #21167: Fix definition of NAN when ICC used without -fp-model strict.
This commit is contained in:
commit
587748e271
3 changed files with 27 additions and 1 deletions
|
@ -150,7 +150,29 @@ PyAPI_FUNC(void) _Py_set_387controlword(unsigned short);
|
||||||
* doesn't support NaNs.
|
* doesn't support NaNs.
|
||||||
*/
|
*/
|
||||||
#if !defined(Py_NAN) && !defined(Py_NO_NAN)
|
#if !defined(Py_NAN) && !defined(Py_NO_NAN)
|
||||||
|
#if !defined(__INTEL_COMPILER)
|
||||||
#define Py_NAN (Py_HUGE_VAL * 0.)
|
#define Py_NAN (Py_HUGE_VAL * 0.)
|
||||||
|
#else /* __INTEL_COMPILER */
|
||||||
|
#if defined(ICC_NAN_STRICT)
|
||||||
|
#pragma float_control(push)
|
||||||
|
#pragma float_control(precise, on)
|
||||||
|
#pragma float_control(except, on)
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
__declspec(noinline)
|
||||||
|
#else /* Linux */
|
||||||
|
__attribute__((noinline))
|
||||||
|
#endif /* _MSC_VER */
|
||||||
|
static double __icc_nan()
|
||||||
|
{
|
||||||
|
return sqrt(-1.0);
|
||||||
|
}
|
||||||
|
#pragma float_control (pop)
|
||||||
|
#define Py_NAN __icc_nan()
|
||||||
|
#else /* ICC_NAN_RELAXED as default for Intel Compiler */
|
||||||
|
static union { unsigned char buf[8]; double __icc_nan; } __nan_store = {0,0,0,0,0,0,0xf8,0x7f};
|
||||||
|
#define Py_NAN (__nan_store.__icc_nan)
|
||||||
|
#endif /* ICC_NAN_STRICT */
|
||||||
|
#endif /* __INTEL_COMPILER */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Py_OVERFLOWED(X)
|
/* Py_OVERFLOWED(X)
|
||||||
|
|
|
@ -594,6 +594,7 @@ Gregor Hoffleit
|
||||||
Chris Hoffman
|
Chris Hoffman
|
||||||
Stefan Hoffmeister
|
Stefan Hoffmeister
|
||||||
Albert Hofkamp
|
Albert Hofkamp
|
||||||
|
Chris Hogan
|
||||||
Tomas Hoger
|
Tomas Hoger
|
||||||
Jonathan Hogg
|
Jonathan Hogg
|
||||||
Kamilla Holanda
|
Kamilla Holanda
|
||||||
|
|
|
@ -10,6 +10,9 @@ Release date: XXXX-XX-XX
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #21167: NAN operations are now handled correctly when python is
|
||||||
|
compiled with ICC even if -fp-model strict is not specified.
|
||||||
|
|
||||||
- Issue #9232: Modify Python's grammar to allow trailing commas in the
|
- Issue #9232: Modify Python's grammar to allow trailing commas in the
|
||||||
argument list of a function declaration. For example, "def f(*, a =
|
argument list of a function declaration. For example, "def f(*, a =
|
||||||
3,): pass" is now legal. Patch from Mark Dickinson.
|
3,): pass" is now legal. Patch from Mark Dickinson.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue