Skip to content

Commit

Permalink
- WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tgiphil committed Apr 29, 2024
1 parent 0cf03c7 commit 47f94f7
Show file tree
Hide file tree
Showing 90 changed files with 181 additions and 158 deletions.
16 changes: 8 additions & 8 deletions Source/Data/X64-Optimizations-ConstantMove.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Name": "Add##",
"SubName": "",
"Expression": "X64.Add## a (X64.Mov## c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Add## a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -27,7 +27,7 @@
"Name": "Sub##",
"SubName": "",
"Expression": "X64.Sub## a (X64.Mov## c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Sub## a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -37,7 +37,7 @@
"Name": "And##",
"SubName": "",
"Expression": "X64.And## a (X64.Mov## c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.And## a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -47,7 +47,7 @@
"Name": "Or##",
"SubName": "",
"Expression": "X64.Or## a (X64.Mov## c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Or## a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -57,7 +57,7 @@
"Name": "Xor##",
"SubName": "",
"Expression": "X64.Xor## a (X64.Mov## c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Xor## a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -67,7 +67,7 @@
"Name": "Sar##",
"SubName": "",
"Expression": "X64.Sar## a (X64.Mov## c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Sar## a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -77,7 +77,7 @@
"Name": "Shl##",
"SubName": "",
"Expression": "X64.Shl## a (X64.Mov## c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Shl## a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -87,7 +87,7 @@
"Name": "Shr##",
"SubName": "",
"Expression": "X64.Shr## a (X64.Mov## c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Shr## a c)",
"Variations": "No",
"Log": "No"
Expand Down
2 changes: 1 addition & 1 deletion Source/Data/X64-Optimizations-Lea.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"Name": "Mul##ToLea##",
"SubName": "By3Or5Or9",
"Expression": "X64.Mul## a b",
"Filter": "!IsResult2Used(@) && !IsZero(a) && Contains(b, 3, 5, 9) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!IsResult2Used(@) && !IsZero(a) && Contains(b, 3, 5, 9) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Lea## a a [Sub##(To##(b),1)] [To##(0)])",
"Variations": "No",
"Log": "No"
Expand Down
36 changes: 18 additions & 18 deletions Source/Data/X64-Optimizations-Standard.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"Name": "Add##",
"SubName": "ByZero",
"Expression": "X64.Add## a 0",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## a)",
"Variations": "No"
},
Expand All @@ -35,7 +35,7 @@
"Name": "Sub##",
"SubName": "ByZero",
"Expression": "X64.Sub## a 0",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## a)",
"Variations": "Yes"
},
Expand All @@ -44,7 +44,7 @@
"Name": "IMul##",
"SubName": "ByZero",
"Expression": "X64.IMul## a 0",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## 0)",
"Variations": "No",
"Log": "No"
Expand All @@ -54,7 +54,7 @@
"Name": "IMul##",
"SubName": "ByOne",
"Expression": "X64.IMul## a 1",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## 1)",
"Variations": "No",
"Log": "No"
Expand All @@ -64,7 +64,7 @@
"Name": "And##",
"SubName": "ByFF",
"Expression": "X64.And## a 0xFF",
"Filter": "!IsCPURegister(a,%ESI) && !IsCPURegister(a,%EDI) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!IsCPURegister(a,%ESI) && !IsCPURegister(a,%EDI) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Movzx8To## a)",
"Variations": "Yes",
"Log": "No",
Expand All @@ -75,7 +75,7 @@
"Name": "Add##By1Not##",
"SubName": "",
"Expression": "X64.Add## (X64.Not## x) 1",
"Filter": "IsVirtualRegister(x) && !IsCarryFlagUsed(@, 10)",
"Filter": "IsVirtualRegister(x) && !IsCarryFlagUsed(@, $Window)",
"Result": "(X64.Neg## x)",
"Variations": "Yes"
},
Expand All @@ -84,7 +84,7 @@
"Name": "Inc##Not##",
"SubName": "",
"Expression": "X64.Inc## (X64.Not## x)",
"Filter": "IsVirtualRegister(x) && !IsCarryFlagUsed(@, 10)",
"Filter": "IsVirtualRegister(x) && !IsCarryFlagUsed(@, $Window)",
"Result": "(X64.Neg## x)",
"Variations": "No"
},
Expand All @@ -93,7 +93,7 @@
"Name": "And##Add##",
"SubName": "ToBlsr##",
"Expression": "X64.And## x (X64.Add## x -1)",
"Filter": "IsVirtualRegister(x) && !IsCarryFlagUsed(@, 10)",
"Filter": "IsVirtualRegister(x) && !IsCarryFlagUsed(@, $Window)",
"Result": "(X64.Blsr## x)",
"Variations": "Yes"
},
Expand All @@ -112,7 +112,7 @@
"Name": "And##",
"SubName": "ByZero",
"Expression": "X64.And## a 0",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## 0)",
"Variations": "Yes",
"Log": "No"
Expand All @@ -122,7 +122,7 @@
"Name": "And##",
"SubName": "ByMax",
"Expression": "X64.And## a 0xFFFFFFFF",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## [To##(0xFFFFFFFF)])",
"Variations": "Yes",
"Log": "No"
Expand All @@ -132,7 +132,7 @@
"Name": "Sar##",
"SubName": "ZeroValue",
"Expression": "X64.Sar## 0 a",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## 0)",
"Priority": "80"
},
Expand All @@ -141,7 +141,7 @@
"Name": "Sar##",
"SubName": "ByZero",
"Expression": "X64.Sar## a 0",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## a)",
"Priority": "80"
},
Expand All @@ -150,7 +150,7 @@
"Name": "Shl##",
"SubName": "ZeroValue",
"Expression": "X64.Shl## 0 a",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## 0)",
"Priority": "80"
},
Expand All @@ -159,7 +159,7 @@
"Name": "Shl##",
"SubName": "ByZero",
"Expression": "X64.Shl## a 0",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## a)",
"Priority": "80"
},
Expand All @@ -168,7 +168,7 @@
"Name": "Shr##",
"SubName": "ZeroValue",
"Expression": "X64.Shr## 0 a",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## 0)",
"Priority": "80"
},
Expand All @@ -177,7 +177,7 @@
"Name": "Shr##",
"SubName": "ByZero",
"Expression": "X64.Shr## a 0",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## a)",
"Priority": "80"
},
Expand All @@ -186,7 +186,7 @@
"Name": "IMul##Mov##",
"SubName": "ByZero",
"Expression": "X64.IMul## a (X64.Mov## 0)",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## 0)",
"Variations": "No",
"Log": "No"
Expand All @@ -196,7 +196,7 @@
"Name": "IMul##Mov##",
"SubName": "ByOne",
"Expression": "X64.IMul## a (X64.Mov## 1)",
"Filter": "!AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X64.Mov## a)",
"Variations": "No",
"Log": "No"
Expand Down
16 changes: 8 additions & 8 deletions Source/Data/X86-Optimizations-ConstantMove.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"Name": "Add32",
"SubName": "",
"Expression": "X86.Add32 a (X86.Mov32 c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X86.Add32 a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -23,7 +23,7 @@
"Name": "Sub32",
"SubName": "",
"Expression": "X86.Sub32 a (X86.Mov32 c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X86.Sub32 a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -33,7 +33,7 @@
"Name": "And32",
"SubName": "",
"Expression": "X86.And32 a (X86.Mov32 c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X86.And32 a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -43,7 +43,7 @@
"Name": "Or32",
"SubName": "",
"Expression": "X86.Or32 a (X86.Mov32 c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X86.Or32 a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -53,7 +53,7 @@
"Name": "Xor32",
"SubName": "",
"Expression": "X86.Xor32 a (X86.Mov32 c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X86.Xor32 a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -63,7 +63,7 @@
"Name": "Sar32",
"SubName": "",
"Expression": "X86.Sar32 a (X86.Mov32 c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X86.Sar32 a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -73,7 +73,7 @@
"Name": "Shl32",
"SubName": "",
"Expression": "X86.Shl32 a (X86.Mov32 c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X86.Shl32 a c)",
"Variations": "No",
"Log": "No"
Expand All @@ -83,7 +83,7 @@
"Name": "Shr32",
"SubName": "",
"Expression": "X86.Shr32 a (X86.Mov32 c)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "IsConstant(c) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X86.Shr32 a c)",
"Variations": "No",
"Log": "No"
Expand Down
2 changes: 1 addition & 1 deletion Source/Data/X86-Optimizations-Lea.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"Name": "Mul32ToLea32",
"SubName": "By3Or5Or9",
"Expression": "X86.Mul32 a b",
"Filter": "!IsResult2Used(@) && !IsZero(a) && Contains(b, 3, 5, 9) && !AreAnyStatusFlagsUsed(@, 10)",
"Filter": "!IsResult2Used(@) && !IsZero(a) && Contains(b, 3, 5, 9) && !AreAnyStatusFlagsUsed(@, $Window)",
"Result": "(X86.Lea32 a a [Sub32(To32(b),1)] [To32(0)])",
"Variations": "No",
"Log": "No"
Expand Down
Loading

0 comments on commit 47f94f7

Please sign in to comment.