28 lines
933 B
Diff
28 lines
933 B
Diff
From 9858ad81f34061f7835a16d309babc9b85ffe038 Mon Sep 17 00:00:00 2001
|
|
From: ImperatorS79 <fevrier.simon@gmail.com>
|
|
Date: Thu, 24 Oct 2024 11:59:16 +0200
|
|
Subject: [PATCH] SSE2 detection gcc See
|
|
https://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/X86-Built-in-Functions.html
|
|
|
|
--- a/src/Standard/Standard.cxx
|
|
+++ b/src/Standard/Standard.cxx
|
|
@@ -239,6 +239,7 @@
|
|
// platform, if not then use MMgrRaw instead of MMgrTBBalloc. It is to avoid runtime crash when
|
|
// running on a CPU that supports SSE but does not support SSE2 (some modifications of AMD
|
|
// Sempron).
|
|
+ #if defined(_MSC_VER)
|
|
static const DWORD _SSE2_FEATURE_BIT(0x04000000);
|
|
DWORD volatile dwFeature;
|
|
_asm
|
|
@@ -259,6 +260,10 @@
|
|
pop eax
|
|
}
|
|
if ((dwFeature & _SSE2_FEATURE_BIT) == 0) anAllocId = 0;
|
|
+ #elif defined(__GNUC__)
|
|
+ __builtin_cpu_init();
|
|
+ if (__builtin_cpu_supports("sse2")) anAllocId = 0;
|
|
+ #endif
|
|
}
|
|
#endif
|
|
|