Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
f6bb7d4
Trying to optimize Add
TIHan Nov 4, 2022
81a1bcb
Trying to optimize Add
TIHan Nov 4, 2022
1b29b47
Trying to optimize Add
TIHan Nov 4, 2022
2599997
Merge remote-tracking branch 'upstream/main' into add-opt-x64
TIHan Nov 4, 2022
5e3741c
Added IntAdd disasm tests. Expanded cast removals to all arithmetic a…
TIHan Nov 5, 2022
371ca7d
Merge branch 'main' into add-opt-x64
TIHan Nov 5, 2022
2a43021
Checked unsigned
TIHan Nov 5, 2022
5428df9
Limit arithmetic opt
TIHan Nov 7, 2022
ac58639
Merge branch 'add-opt-x64' of https://github.com/TIHan/runtime into a…
TIHan Nov 7, 2022
7badcc0
Merge remote-tracking branch 'upstream/main' into add-opt-x64
TIHan Nov 8, 2022
6d85c1a
Moving optimization to Morph
TIHan Nov 8, 2022
02dbb22
Cleanup. Allow more opts.
TIHan Nov 8, 2022
779dd21
Fix build
TIHan Nov 8, 2022
a263faa
More opts
TIHan Nov 8, 2022
f7c8b68
Added regression test. Allowing all arithmetic ops. Only do transform…
TIHan Nov 9, 2022
3eba2fa
Do not do optimization for unsigned ops
TIHan Nov 9, 2022
ec3dcda
Added more division test cases
TIHan Nov 9, 2022
183d570
Fixed test. Checking overflows on cast. Comparing actual types proper…
TIHan Nov 9, 2022
4378c1b
Added flag
TIHan Nov 10, 2022
4a0b63d
Remove flag
TIHan Nov 10, 2022
73fbc61
Formatting
TIHan Nov 10, 2022
38ec57f
Revert minor change
TIHan Nov 10, 2022
343badf
Removed ClearRegOptionalAndContained
TIHan Nov 10, 2022
2e5c716
Merge remote-tracking branch 'upstream/main' into add-opt-x64
TIHan Nov 11, 2022
e417b63
Merge remote-tracking branch 'upstream/main' into add-opt-x64
TIHan Nov 13, 2022
95840b2
Trying out lowering
TIHan Nov 13, 2022
1c2e139
Expanded lowering cast removal to arm
TIHan Nov 13, 2022
49341e6
Added regression test
TIHan Nov 13, 2022
60f48ba
Do not use disasm checks for these tests
TIHan Nov 13, 2022
b267aa5
Update lower.cpp
TIHan Nov 13, 2022
caefb4a
Fixing
TIHan Nov 13, 2022
e226f30
For JCC, do not change castOp type if it is a bool
TIHan Nov 13, 2022
84ae5a7
Added more regression tests made from Fuzzlyn. Reverted minor cast ch…
TIHan Nov 13, 2022
937596b
Remove Morph impl as we are not favoring Lowering. Do not change var …
TIHan Nov 13, 2022
6cc95ca
Formatting
TIHan Nov 13, 2022
e5c9b93
Re-arranging regression tests. Some comments. Some And and Or disasm …
TIHan Nov 14, 2022
966df08
Fixed a few minor regressions
TIHan Nov 14, 2022
94411b5
minor change
TIHan Nov 14, 2022
4cb4d6d
Merge remote-tracking branch 'upstream/main' into add-opt-x64
TIHan Nov 14, 2022
3ec0f0d
Moving optimization to simple lowering
TIHan Nov 14, 2022
cb1983c
Moving back to morph
TIHan Nov 15, 2022
6f71cff
Add print for implicit cast
TIHan Nov 16, 2022
ca60055
Do it a little earlier
TIHan Nov 16, 2022
e445092
Mark as do-not-cse to prevent the CAST from being removed on assignment
TIHan Nov 16, 2022
4b9d344
Fix test
TIHan Nov 17, 2022
7022968
Remove do-not-set cse
TIHan Nov 17, 2022
ec5088f
Moving optimization to simple lowering again for correctness
TIHan Nov 18, 2022
62938ba
Disable some of the regression tests for mono
TIHan Nov 18, 2022
e90ce88
Fixing IntOr disasm test
TIHan Nov 18, 2022
769d1c1
Formatting, fixing test again
TIHan Nov 18, 2022
6903869
Smaller size operators can contain/reg-optional operands that are larger
TIHan Nov 18, 2022
de34d34
Formatting
TIHan Nov 18, 2022
f1ef6f3
Added subtract tests
TIHan Nov 28, 2022
38386d5
Update IntAnd.cs
TIHan Nov 29, 2022
f34f943
Update IntAnd.cs
TIHan Nov 29, 2022
232fe85
Update IntOr.cs
TIHan Nov 29, 2022
476143e
Update IntSubtract.cs
TIHan Nov 30, 2022
e0d49b3
Added IsContainableMemoryOpSize
TIHan Dec 2, 2022
21f3a8b
Merged
TIHan Dec 2, 2022
aad9ca3
Merge branch 'add-opt-x64' of https://github.com/TIHan/runtime into a…
TIHan Dec 2, 2022
37fc2fb
Merge remote-tracking branch 'upstream/main' into add-opt-x64
TIHan Jan 11, 2023
23427f6
Removed unnecessary code.
TIHan Jan 13, 2023
520be33
Update IntAnd.cs
TIHan Jan 13, 2023
7cac5e2
Update Regression1.cs
TIHan Jan 13, 2023
c6a31fe
Update Regression1.cs
TIHan Jan 13, 2023
2fbe829
Update Regression2.cs
TIHan Jan 13, 2023
3384759
Update Regression2.cs
TIHan Jan 14, 2023
2ea70d4
Merge remote-tracking branch 'upstream/main' into add-opt-x64
TIHan Jan 30, 2023
40b59c2
Disable if optimizations are disabled
TIHan Jan 30, 2023
051d513
Merge branch 'add-opt-x64' of https://github.com/TIHan/runtime into a…
TIHan Jan 30, 2023
25784fb
Merge
TIHan Jan 30, 2023
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
16 changes: 7 additions & 9 deletions src/tests/JIT/opt/And/IntAnd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ static bool Test_UInt32_UInt32_And(uint x, uint y)
{
// X64-NOT: movzx

// We expect 'and r8, r8'.
// X64: and [[REG0:[^x]+]], [[REG1:[^x]+]]
// We expect 'and reg8, reg8'.
// X64: and {{[a-z]+[l|b]}}, {{[a-z]+[l|b]}}

if ((byte)(x & y) == 0)
{
Expand All @@ -34,8 +34,8 @@ static bool Test_UInt32_UInt32_CastByte_And(uint x, uint y)
{
// X64-NOT: movzx

// We expect 'and r8, r8'.
// X64: and [[REG0:[^x]+]], [[REG1:[^x]+]]
// We expect 'and reg8, reg8'.
// X64: and {{[a-z]+[l|b]}}, {{[a-z]+[l|b]}}

if ((byte)((byte)x & y) == 0)
{
Expand All @@ -50,8 +50,8 @@ static bool Test_UInt32_UInt32_CastByte_CastByte_And(uint x, uint y)
{
// X64-NOT: movzx

// We expect 'and r8, r8'.
// X64: and [[REG0:[^x]+]], [[REG1:[^x]+]]
// We expect 'and reg8, reg8'.
// X64: and {{[a-z]+[l|b]}}, {{[a-z]+[l|b]}}

if ((byte)((byte)x & (byte)y) == 0)
{
Expand Down Expand Up @@ -165,9 +165,7 @@ static int Main()
if (Test_UInt32_UInt32_CastByte_CastByte_And(0b10000000000000000000000000000010, 0b00100000000000000000000000000010))
return 0;

Console.Write("Succeeded");

return 100;
}
}
}
}
10 changes: 5 additions & 5 deletions src/tests/JIT/opt/Or/IntOr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public static bool Test_UInt32_UInt32_CastByte_Or(uint x, uint y)
{
// X64-NOT: movzx

// We expect 'or r8, r8'.
// X64: or [[REG0:[a-z]+[l|b]]], [[REG1:[a-z]+[l|b]]]
// We expect 'or reg8, reg8'.
// X64: or {{[a-z]+[l|b]}}, {{[a-z]+[l|b]}}

if ((byte)((byte)x | y) == 0)
{
Expand All @@ -34,8 +34,8 @@ public static bool Test_UInt32_ByRef_CastByte_CastByte_Or(uint x, ref uint y)
{
// X64-NOT: movzx

// We expect 'or r8, m8'.
// X64: or [[REG0:[a-z]+[l|b]]], byte ptr
// We expect 'or reg8, mem8'.
// X64: or {{[a-z]+[l|b]}}, byte ptr

if ((byte)((byte)x | (byte)y) == 0)
{
Expand Down Expand Up @@ -109,4 +109,4 @@ static int Main()
return 100;
}
}
}
}
22 changes: 17 additions & 5 deletions src/tests/JIT/opt/Subtract/IntSubtract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,35 +57,47 @@ static ushort UInt16_Subtract(ushort x, ushort y)
[MethodImpl(MethodImplOptions.NoInlining)]
static int Int32_Subtract(int x, int y)
{
// X64: mov
// X64-NOT: movsx

// X64: sub

// X64-NOT: movsx

return x - y;
}

[MethodImpl(MethodImplOptions.NoInlining)]
static uint UInt32_Subtract(uint x, uint y)
{
// X64: mov
// X64-NOT: movzx

// X64: sub

// X64-NOT: movzx

return x - y;
}

[MethodImpl(MethodImplOptions.NoInlining)]
static long Int64_Subtract(long x, long y)
{
// X64: mov
// X64-NOT: movsx

// X64: sub

// X64-NOT: movsx

return x - y;
}

[MethodImpl(MethodImplOptions.NoInlining)]
static ulong UInt64_Subtract(ulong x, ulong y)
{
// X64: mov
// X64-NOT: movzx

// X64: sub

// X64-NOT: movzx

return x - y;
}
Expand Down Expand Up @@ -151,4 +163,4 @@ static int Main()
return 100;
}
}
}
}