From: dotnet-bot Date: Thu, 20 Oct 2016 23:18:59 +0000 (-0700) Subject: Updating the macro redefinition for _isnanf and _copysignf in floatsingle.cpp. This... X-Git-Tag: accepted/tizen/base/20180629.140029~3279^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=890e5f93914396ac2cdd502809d15984d2d4db15;p=platform%2Fupstream%2Fcoreclr.git Updating the macro redefinition for _isnanf and _copysignf in floatsingle.cpp. This is required for the scenario when the system CRT header files are used instead of the newer MSVCRT header files. [tfs-changeset: 1634419] --- diff --git a/src/classlibnative/float/floatsingle.cpp b/src/classlibnative/float/floatsingle.cpp index ebae724..7e2ea0a 100644 --- a/src/classlibnative/float/floatsingle.cpp +++ b/src/classlibnative/float/floatsingle.cpp @@ -11,16 +11,21 @@ #define IS_FLT_INFINITY(x) (((*((INT32*)((void*)&x))) & 0x7FFFFFFF) == 0x7F800000) -// Windows x86 and Windows ARM don't define _isnanf() but they do define a generic macro isnan() -#if (defined(_TARGET_X86_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)) && !defined(FEATURE_PAL) && !defined(_isnanf) -#if defined(_TARGET_ARM64_) || defined(_TARGET_ARM_) +// Windows x86 and Windows ARM/ARM64 may not define _isnanf() or _copysignf() but they do +// define _isnan() and _copysign(). We will redirect the macros to these other functions if +// the macro is not defined for the platform. This has the side effect of a possible implicit +// upcasting for arguments passed in and an explicit downcasting for the _copysign() call. +#if (defined(_TARGET_X86_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)) && !defined(FEATURE_PAL) + +#if !defined(_isnanf) #define _isnanf _isnan -#else -#define _isnanf isnan #endif + +#if !defined(_copysignf) +#define _copysignf (float)_copysign #endif -# +#endif // The default compilation mode is /fp:precise, which disables floating-point intrinsics. This // default compilation mode has previously caused performance regressions in floating-point code.