summaryrefslogtreecommitdiff
path: root/src/vm/util.cpp
diff options
context:
space:
mode:
authorBruce Forstall <brucefo@microsoft.com>2016-10-26 15:52:06 -0700
committerBruce Forstall <brucefo@microsoft.com>2016-10-27 12:08:20 -0700
commite72536c32676b412cfead025b577d4e8c18d1c2f (patch)
tree41c0b6f18262cdacc29070e5fa880c6ba82c1081 /src/vm/util.cpp
parent675622bb85f3c78de1967a78052d7280a2834611 (diff)
downloadcoreclr-e72536c32676b412cfead025b577d4e8c18d1c2f.tar.gz
coreclr-e72536c32676b412cfead025b577d4e8c18d1c2f.tar.bz2
coreclr-e72536c32676b412cfead025b577d4e8c18d1c2f.zip
Introduce new CORJIT_FLAGS type
The "JIT flags" currently passed between the EE and the JIT have traditionally been bit flags in a 32-bit word. Recently, a second 32-bit word was added to accommodate additional flags, but that set of flags is definitely "2nd class": they are not universally passed, and require using a separate set of bit definitions, and comparing those bits against the proper, 2nd word. This change replaces all uses of bare DWORD or 'unsigned int' types representing flags with CORJIT_FLAGS, which is now an opaque type. All flag names were renamed from CORJIT_FLG_* to CORJIT_FLAG_* to ensure all cases were changed to use the new names, which are also scoped within the CORJIT_FLAGS type itself. Another motivation to do this, besides cleaner code, is to allow enabling the SSE/AVX flags for x86. For x86, we had fewer bits available in the "first word", so would have to either put them in the "second word", which, as stated, was very much 2nd class and not plumbed through many usages, or we could move other bits to the "second word", with the same issues. Neither was a good option. RyuJIT compiles with both COR_JIT_EE_VERSION > 460 and <= 460. I introduced a JitFlags adapter class in jitee.h to handle both JIT flag types. All JIT code uses this JitFlags type, which operates identically to the new CORJIT_FLAGS type. In addition to introducing the new CORJIT_FLAGS type, the SSE/AVX flags are enabled for x86. The JIT-EE interface GUID is changed, as this is a breaking change.
Diffstat (limited to 'src/vm/util.cpp')
-rw-r--r--src/vm/util.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/vm/util.cpp b/src/vm/util.cpp
index 2cb3460122..a7c264fb67 100644
--- a/src/vm/util.cpp
+++ b/src/vm/util.cpp
@@ -2069,16 +2069,9 @@ lDone:
#define CACHE_PARTITION_BITS 0x003FF000 // number of cache Physical Partitions is returned in EBX[21:12] (10 bits) using cpuid function 4
#define CACHE_LINESIZE_BITS 0x00000FFF // Linesize returned in EBX[11:0] (12 bits) using cpuid function 4
-#if defined(_TARGET_X86_)
- // these are defined in cgenx86.cpp
- extern DWORD getcpuid(DWORD arg1, unsigned char result[16]);
- extern DWORD getextcpuid(DWORD arg1, DWORD arg2, unsigned char result[16]);
-#elif defined(_TARGET_AMD64_)
- // these are defined in src\VM\AMD64\asmhelpers.asm
- extern "C" DWORD __stdcall getcpuid(DWORD arg1, unsigned char result[16]);
- extern "C" DWORD __stdcall getextcpuid(DWORD arg1, DWORD arg2, unsigned char result[16]);
-#endif
-
+// these are defined in src\VM\AMD64\asmhelpers.asm / cgenx86.cpp
+extern "C" DWORD __stdcall getcpuid(DWORD arg1, unsigned char result[16]);
+extern "C" DWORD __stdcall getextcpuid(DWORD arg1, DWORD arg2, unsigned char result[16]);
// The following function uses a deterministic mechanism for enumerating/calculating the details of the cache hierarychy at runtime
// by using deterministic cache parameter leafs on Prescott and higher processors.