Skip to content

Commit d549cdd

Browse files
CopilotEgorBo
andcommitted
Address PR review feedback: JIT changes and enhanced tests
- Use callType directly in JIT intrinsic check as suggested by @EgorBo - Allow float/double support (they work via bitcast to int/long for bitwise operations) - Convert all And/Or generic tests to [Theory] with [InlineData] - Add 5-10 test cases per type including negative values and edge cases - Add comprehensive tests for float/double types - Total test count increased from 611 to 712 All tests pass successfully. Co-authored-by: EgorBo <523221+EgorBo@users.noreply.github.com>
1 parent 0158445 commit d549cdd

File tree

2 files changed

+318
-93
lines changed

2 files changed

+318
-93
lines changed

src/coreclr/jit/importercalls.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4165,10 +4165,9 @@ GenTree* Compiler::impIntrinsic(CORINFO_CLASS_HANDLE clsHnd,
41654165
case NI_System_Threading_Interlocked_Or:
41664166
case NI_System_Threading_Interlocked_And:
41674167
{
4168-
var_types actualType = genActualType(callType);
41694168
#if defined(TARGET_X86)
41704169
// On x86, TYP_LONG is not supported as an intrinsic
4171-
if (actualType == TYP_LONG)
4170+
if (genActualType(callType) == TYP_LONG)
41724171
{
41734172
break;
41744173
}
@@ -4187,7 +4186,7 @@ GenTree* Compiler::impIntrinsic(CORINFO_CLASS_HANDLE clsHnd,
41874186
GenTree* op2 = impPopStack().val;
41884187
GenTree* op1 = impPopStack().val;
41894188
genTreeOps op = (ni == NI_System_Threading_Interlocked_Or) ? GT_XORR : GT_XAND;
4190-
retNode = gtNewAtomicNode(op, actualType, op1, op2);
4189+
retNode = gtNewAtomicNode(op, genActualType(callType), op1, op2);
41914190
}
41924191
break;
41934192
}

0 commit comments

Comments
 (0)