From 831460f71cc11816ee35c18b065e658325b3174b Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Fri, 30 Oct 2020 18:23:53 -0700 Subject: [PATCH 1/2] Fix asserts that were always true due to missed neg. --- src/coreclr/src/gc/gchandletable.cpp | 2 +- src/coreclr/src/jit/lowerxarch.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/src/gc/gchandletable.cpp b/src/coreclr/src/gc/gchandletable.cpp index 9934889e58e4fe..3f69dbd1ef0356 100644 --- a/src/coreclr/src/gc/gchandletable.cpp +++ b/src/coreclr/src/gc/gchandletable.cpp @@ -99,7 +99,7 @@ IGCHandleStore* GCHandleManager::CreateHandleStore() return store; #else - assert("CreateHandleStore is not implemented when FEATURE_REDHAWK is defined!"); + assert(!"CreateHandleStore is not implemented when FEATURE_REDHAWK is defined!"); return nullptr; #endif } diff --git a/src/coreclr/src/jit/lowerxarch.cpp b/src/coreclr/src/jit/lowerxarch.cpp index 971424e64c96ac..2de216b6ba48ab 100644 --- a/src/coreclr/src/jit/lowerxarch.cpp +++ b/src/coreclr/src/jit/lowerxarch.cpp @@ -5466,7 +5466,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) default: { - assert("Unhandled containment for binary hardware intrinsic with immediate operand"); + assert(!"Unhandled containment for binary hardware intrinsic with immediate operand"); break; } } @@ -5643,7 +5643,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) default: { - assert("Unhandled containment for ternary hardware intrinsic with immediate operand"); + assert(!"Unhandled containment for ternary hardware intrinsic with immediate operand"); break; } } From 7cb6c937b047e40ae9ab819ef82b5ded327e1656 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Mon, 2 Nov 2020 13:23:35 -0800 Subject: [PATCH 2/2] Ensure we don't assert for HWIntrinsics that already had the imm operand marked contained --- src/coreclr/src/jit/lowerxarch.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/coreclr/src/jit/lowerxarch.cpp b/src/coreclr/src/jit/lowerxarch.cpp index 2de216b6ba48ab..28ac2ca2d236f1 100644 --- a/src/coreclr/src/jit/lowerxarch.cpp +++ b/src/coreclr/src/jit/lowerxarch.cpp @@ -5464,6 +5464,26 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) break; } + case NI_SSE2_ShiftLeftLogical128BitLane: + case NI_SSE2_ShiftRightLogical128BitLane: + case NI_AVX2_ShiftLeftLogical128BitLane: + case NI_AVX2_ShiftRightLogical128BitLane: + { +#if DEBUG + // These intrinsics should have been marked contained by the general-purpose handling earlier in the method. + + GenTree* lastOp = HWIntrinsicInfo::lookupLastOp(node); + assert(lastOp != nullptr); + + if (HWIntrinsicInfo::isImmOp(intrinsicId, lastOp) && lastOp->IsCnsIntOrI()) + { + assert(lastOp->isContained()); + } +#endif + + break; + } + default: { assert(!"Unhandled containment for binary hardware intrinsic with immediate operand");