Skip to content

Commit d4f1a4b

Browse files
committed
More stuff
1 parent 4536943 commit d4f1a4b

File tree

7 files changed

+20
-43
lines changed

7 files changed

+20
-43
lines changed

modules/yup_core/maths/yup_BigInteger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ void BigInteger::negate() noexcept
392392
negative = (! negative) && ! isZero();
393393
}
394394

395-
#if YUP_MSVC && ! defined(__INTEL_COMPILER)
395+
#if YUP_MSVC
396396
#pragma intrinsic(_BitScanReverse)
397397
#endif
398398

modules/yup_core/maths/yup_MathsFunctions.h

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,6 @@ constexpr bool isWithin (Type a, Type b, Type tolerance) noexcept
617617
//==============================================================================
618618
#if YUP_MSVC
619619
#pragma optimize("t", off)
620-
#ifndef __INTEL_COMPILER
621-
#pragma float_control(precise, on, push)
622-
#endif
623620
#endif
624621

625622
/** Fast floating-point-to-integer conversion.
@@ -633,36 +630,36 @@ constexpr bool isWithin (Type a, Type b, Type tolerance) noexcept
633630
even numbers will be rounded up or down differently.
634631
*/
635632
template <typename FloatType>
636-
int roundToInt (const FloatType value) noexcept
633+
constexpr int roundToInt (const FloatType value) noexcept
637634
{
638-
#ifdef __INTEL_COMPILER
639-
#pragma float_control(precise, on, push)
640-
#endif
641-
642-
union
635+
if (isConstantEvaluated())
636+
{
637+
return static_cast<int> (value > FloatType (0) ? value + FloatType (0.5) : value - FloatType (0.5));
638+
}
639+
else
643640
{
644-
int asInt[2];
645-
double asDouble;
646-
} n;
641+
union
642+
{
643+
int asInt[2];
644+
double asDouble;
645+
} n;
647646

648-
n.asDouble = ((double) value) + 6755399441055744.0;
647+
n.asDouble = ((double) value) + 6755399441055744.0;
649648

650649
#if YUP_BIG_ENDIAN
651-
return n.asInt[1];
650+
return n.asInt[1];
652651
#else
653-
return n.asInt[0];
652+
return n.asInt[0];
654653
#endif
654+
}
655655
}
656656

657-
inline int roundToInt (int value) noexcept
657+
constexpr int roundToInt (int value) noexcept
658658
{
659659
return value;
660660
}
661661

662662
#if YUP_MSVC
663-
#ifndef __INTEL_COMPILER
664-
#pragma float_control(pop)
665-
#endif
666663
#pragma optimize("", on) // resets optimisations to the project defaults
667664
#endif
668665

@@ -671,12 +668,8 @@ inline int roundToInt (int value) noexcept
671668
This is a slightly slower and slightly more accurate version of roundToInt(). It works
672669
fine for values above zero, but negative numbers are rounded the wrong way.
673670
*/
674-
inline int roundToIntAccurate (double value) noexcept
671+
constexpr int roundToIntAccurate (double value) noexcept
675672
{
676-
#ifdef __INTEL_COMPILER
677-
#pragma float_control(pop)
678-
#endif
679-
680673
return roundToInt (value + 1.5e-8);
681674
}
682675

modules/yup_core/memory/yup_ByteOrder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ inline double ByteOrder::swap (double v) noexcept
189189
return n.asFloat;
190190
}
191191

192-
#if YUP_MSVC && ! defined(__INTEL_COMPILER)
192+
#if YUP_MSVC
193193
#pragma intrinsic(_byteswap_ulong)
194194
#endif
195195

modules/yup_core/native/yup_SystemStats_windows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static int findNumberOfPhysicalCores() noexcept
8484

8585
//==============================================================================
8686
#if YUP_INTEL
87-
#if YUP_MSVC && ! defined(__INTEL_COMPILER)
87+
#if YUP_MSVC
8888
#pragma intrinsic(__cpuid)
8989
#pragma intrinsic(__rdtsc)
9090
#endif

modules/yup_core/system/yup_PlatformDefs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ namespace yup
101101
#elif YUP_WASM
102102
#define YUP_BREAK_IN_DEBUGGER
103103
#elif YUP_MSVC
104-
#ifndef __INTEL_COMPILER
105104
#pragma intrinsic(__debugbreak)
106-
#endif
107105
#define YUP_BREAK_IN_DEBUGGER __debugbreak();
108106
#elif YUP_INTEL && (YUP_GCC || YUP_CLANG || YUP_MAC)
109107
#if YUP_NO_INLINE_ASM

modules/yup_core/system/yup_StandardHeader.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,6 @@ YUP_BEGIN_IGNORE_WARNINGS_MSVC (4514 4245 4100)
117117
#if YUP_LINUX || YUP_BSD || YUP_WASM
118118
#include <cstring>
119119
#include <signal.h>
120-
121-
#if __INTEL_COMPILER
122-
#if __ia64__
123-
#include <ia64intrin.h>
124-
#else
125-
#include <ia32intrin.h>
126-
#endif
127-
#endif
128120
#endif
129121

130122
#if YUP_MSVC && YUP_DEBUG
@@ -156,9 +148,6 @@ YUP_END_IGNORE_WARNINGS_MSVC
156148
#define YUP_API __declspec (dllimport)
157149
#pragma warning(disable : 4251)
158150
#endif
159-
#ifdef __INTEL_COMPILER
160-
#pragma warning(disable : 1125) // (virtual override warning)
161-
#endif
162151
#elif defined(YUP_DLL) || defined(YUP_DLL_BUILD)
163152
#define YUP_API __attribute__ ((visibility ("default")))
164153
#endif

modules/yup_core/yup_core.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@
7171
#pragma warning(push)
7272
// Disable warnings for long class names, padding, and undefined preprocessor definitions.
7373
#pragma warning(disable : 4251 4786 4668 4820)
74-
#ifdef __INTEL_COMPILER
75-
#pragma warning(disable : 1125)
76-
#endif
7774
#endif
7875

7976
#include "system/yup_TargetPlatform.h"

0 commit comments

Comments
 (0)