Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b30794d
Treat System.Runtime.CompilerServices.Unsafe as intrinsic
tannergooding May 1, 2022
a9bc307
Remove duplicated logic from Get_CORINFO_SIG_INFO
tannergooding May 1, 2022
3e3c839
Don't create a multiply node if the size is 1
tannergooding May 1, 2022
9e84bdd
Remove unnecessary impBashVarAddrsToI calls over gtNewIconNode
tannergooding May 1, 2022
4d42990
Use `#ifdef TARGET_64BIT` rather than `#if (REGSIZE_BYTES == 8)`
tannergooding May 1, 2022
201217e
Don't unnecessarily call `genActualType(TYP_U_IMPL)`, just use `TYP_I…
tannergooding May 1, 2022
1bf3f3a
Only insert casts for `TYP_INT` to `TYP_I_IMPL` or `TYP_U_IMPL` on 64…
tannergooding May 1, 2022
6963037
Have Unsafe.SkipInit create a `GT_NO_OP` node
tannergooding May 1, 2022
2301adc
Have Unsafe.Subtract and Unsafe.SubtractByteOffset be intrinsic
tannergooding May 1, 2022
3c4f660
Adding a couple `CLANG_FORMAT_COMMENT_ANCHOR;` to comments that prece…
tannergooding May 1, 2022
4d91472
Applying formatting patch
tannergooding May 1, 2022
982660e
Revert "Have Unsafe.Subtract and Unsafe.SubtractByteOffset be intrinsic"
tannergooding May 1, 2022
a933fec
Fixing the operand evaluation order for NI_SRCS_UNSAFE_Add
tannergooding May 2, 2022
fff8ddc
Fixing the operand evaluation order for NI_SRCS_UNSAFE_ByteOffset
tannergooding May 2, 2022
7166b2e
Implement NI_SRCS_UNSAFE_SubtractByteOffset
tannergooding May 2, 2022
4e3303a
Fix the build failure
tannergooding May 2, 2022
66de257
Ensure impImplicitIorI4Cast is called on op2 for NI_SRCS_UNSAFE_Add
tannergooding May 2, 2022
e491b78
Don't declare a `tmp` in NI_SRCS_UNSAFE_Add to make the logic clearer
tannergooding May 2, 2022
b3e6e3c
Have NI_SRCS_UNSAFE_SkipInit return gtNewNothingNode
tannergooding May 2, 2022
0b372a5
Handle side effects for NI_SRCS_UNSAFE_SkipInit
tannergooding May 2, 2022
3e2a2ae
Revert "Implement NI_SRCS_UNSAFE_SubtractByteOffset"
tannergooding May 2, 2022
ab91385
Manually simplify some of the NI_SRCS_* import logic
tannergooding May 2, 2022
f8dd74d
Ensure NI_SRCS_SkipInit returns the unused node when its side-effecting
tannergooding May 2, 2022
77b9af1
Remove unnecessary comment anchors
tannergooding May 2, 2022
d7b4783
Applying formatting patch
tannergooding May 2, 2022
0c07847
Try to workaround the JIT issue by spilling op1/op2 for Unsafe.Add
tannergooding May 3, 2022
272bce2
Apply formatting patch
tannergooding May 3, 2022
8c964f1
Merge remote-tracking branch 'dotnet/main' into unsafe-intrinsics
tannergooding May 5, 2022
79c717b
Revert "Try to workaround the JIT issue by spilling op1/op2 for Unsaf…
tannergooding May 5, 2022
e573dd8
Have Unsafe.Subtract and Unsafe.SubtractByteOffset be intrinsic
tannergooding May 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Only insert casts for TYP_INT to TYP_I_IMPL or TYP_U_IMPL on 64…
…-bit
  • Loading branch information
tannergooding committed May 1, 2022
commit 1bf3f3a25ed132e0e1cab083e0081212476a1696
13 changes: 12 additions & 1 deletion src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4821,7 +4821,10 @@ GenTree* Compiler::impSRCSUnsafeIntrinsic(NamedIntrinsic intrinsic,
if (classSize != 1)
{
GenTree* size = gtNewIconNode(classSize, TYP_INT);

#ifdef TARGET_64BIT
size = gtNewCastNode(TYP_I_IMPL, size, /* uns */ false, TYP_I_IMPL);
#endif

type = impGetByRefResultType(GT_MUL, /* uns */ false, &op2, &size);
tmp = new (this, GT_CALL) GenTreeOp(GT_MUL, type, op2, size DEBUGARG(/* largeNode */ true));
Expand Down Expand Up @@ -5045,7 +5048,10 @@ GenTree* Compiler::impSRCSUnsafeIntrinsic(NamedIntrinsic intrinsic,
GenTree* op1 = impPopStack().val;

GenTree* cns = gtNewIconNode(0, TYP_INT);

#ifdef TARGET_64BIT
cns = gtNewCastNode(TYP_I_IMPL, cns, uns, TYP_U_IMPL);
#endif

GenTree* tmp = gtNewOperNode(GT_EQ, TYP_INT, op1, cns);
return gtFoldExpr(tmp);
Expand All @@ -5066,7 +5072,12 @@ GenTree* Compiler::impSRCSUnsafeIntrinsic(NamedIntrinsic intrinsic,
#endif

GenTree* cns = gtNewIconNode(0, TYP_INT);
return gtNewCastNode(TYP_I_IMPL, cns, uns, TYP_U_IMPL);

#ifdef TARGET_64BIT
cns = gtNewCastNode(TYP_I_IMPL, cns, uns, TYP_U_IMPL);
#endif

return cns;
}

case NI_SRCS_UNSAFE_Read:
Expand Down