summaryrefslogtreecommitdiff
path: root/src/jit
diff options
context:
space:
mode:
authorCarol Eidt <carol.eidt@microsoft.com>2018-08-01 21:59:18 -0700
committerGitHub <noreply@github.com>2018-08-01 21:59:18 -0700
commitde77d58b8418c787910bd5fd5fa8c1d9ad45663e (patch)
treeea1c342512043ecaf838c787ca952c1f99e37add /src/jit
parent87e9259abda877c2fb80ff54dc85f782e3c64df0 (diff)
downloadcoreclr-de77d58b8418c787910bd5fd5fa8c1d9ad45663e.tar.gz
coreclr-de77d58b8418c787910bd5fd5fa8c1d9ad45663e.tar.bz2
coreclr-de77d58b8418c787910bd5fd5fa8c1d9ad45663e.zip
Use 16 bytes to spill SIMD12 (#19237)
On 64-bit systems, SIMD12 locals are naturally rounded to 16 bytes, but the spill temp logic was not doing the same. Fix #19197
Diffstat (limited to 'src/jit')
-rw-r--r--src/jit/compiler.h1
-rw-r--r--src/jit/regset.cpp9
2 files changed, 6 insertions, 4 deletions
diff --git a/src/jit/compiler.h b/src/jit/compiler.h
index e5bd4436a2..ee76c2810d 100644
--- a/src/jit/compiler.h
+++ b/src/jit/compiler.h
@@ -660,6 +660,7 @@ public:
// For 32-bit architectures, we make local variable SIMD12 types 16 bytes instead of just 12. We can't do
// this for arguments, which must be passed according the defined ABI. We don't want to do this for
// dependently promoted struct fields, but we don't know that here. See lvaMapSimd12ToSimd16().
+ // (Note that for 64-bits, we are already rounding up to 16.)
if ((lvType == TYP_SIMD12) && !lvIsParam)
{
assert(lvExactSize == 12);
diff --git a/src/jit/regset.cpp b/src/jit/regset.cpp
index 81887cc94e..8e41edfb0b 100644
--- a/src/jit/regset.cpp
+++ b/src/jit/regset.cpp
@@ -619,10 +619,11 @@ var_types RegSet::tmpNormalizeType(var_types type)
{
type = genActualType(type);
-#if defined(FEATURE_SIMD) && !defined(_TARGET_64BIT_)
- // For SIMD on 32-bit platforms, we always spill SIMD12 to a 16-byte SIMD16 temp.
- // This is because we don't have a single instruction to store 12 bytes. We also
- // allocate non-argument locals as 16 bytes; see lvSize().
+#if defined(FEATURE_SIMD)
+ // We always spill SIMD12 to a 16-byte SIMD16 temp.
+ // This is because we don't have a single instruction to store 12 bytes, so we want
+ // to ensure that we always have the full 16 bytes for loading & storing the value.
+ // We also allocate non-argument locals as 16 bytes; see lvSize().
if (type == TYP_SIMD12)
{
type = TYP_SIMD16;