From de77d58b8418c787910bd5fd5fa8c1d9ad45663e Mon Sep 17 00:00:00 2001 From: Carol Eidt Date: Wed, 1 Aug 2018 21:59:18 -0700 Subject: 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 --- src/jit/compiler.h | 1 + src/jit/regset.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/jit') 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; -- cgit v1.2.3