summaryrefslogtreecommitdiff
path: root/src/jit/emit.h
diff options
context:
space:
mode:
authorBruce Forstall <brucefo@microsoft.com>2016-11-29 18:57:18 -0800
committerBruce Forstall <brucefo@microsoft.com>2016-11-30 14:10:16 -0800
commitb90516fe443d50cacfe6635d8c1be595d41b8a90 (patch)
treeab06a7a9af95103b4f0f7c6f892c027d6458614f /src/jit/emit.h
parent0b0d51ebfbb2dfd6defe43892d681e42ca9122d0 (diff)
downloadcoreclr-b90516fe443d50cacfe6635d8c1be595d41b8a90.tar.gz
coreclr-b90516fe443d50cacfe6635d8c1be595d41b8a90.tar.bz2
coreclr-b90516fe443d50cacfe6635d8c1be595d41b8a90.zip
Fix x86 encoder to use 64-bit type to accumulate opcode/prefix bits
The encoder was using size_t, a 32-bit type on x86, to accumulate opcode and prefix bits to emit. AVX support uses 3 bytes for prefixes that are higher than the 32-bit type can handle. So, change all code byte related types from size_t to a new code_t, defined as "unsigned __int64" on RyuJIT x86 (there is precedence for this type on the ARM architectures). Fixes #8331
Diffstat (limited to 'src/jit/emit.h')
-rw-r--r--src/jit/emit.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/jit/emit.h b/src/jit/emit.h
index b3716b81bf..5b1a395379 100644
--- a/src/jit/emit.h
+++ b/src/jit/emit.h
@@ -1664,6 +1664,18 @@ private:
unsigned char emitOutputLong(BYTE* dst, ssize_t val);
unsigned char emitOutputSizeT(BYTE* dst, ssize_t val);
+#if !defined(LEGACY_BACKEND) && defined(_TARGET_X86_)
+ unsigned char emitOutputByte(BYTE* dst, size_t val);
+ unsigned char emitOutputWord(BYTE* dst, size_t val);
+ unsigned char emitOutputLong(BYTE* dst, size_t val);
+ unsigned char emitOutputSizeT(BYTE* dst, size_t val);
+
+ unsigned char emitOutputByte(BYTE* dst, unsigned __int64 val);
+ unsigned char emitOutputWord(BYTE* dst, unsigned __int64 val);
+ unsigned char emitOutputLong(BYTE* dst, unsigned __int64 val);
+ unsigned char emitOutputSizeT(BYTE* dst, unsigned __int64 val);
+#endif // !defined(LEGACY_BACKEND) && defined(_TARGET_X86_)
+
size_t emitIssue1Instr(insGroup* ig, instrDesc* id, BYTE** dp);
size_t emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp);