OPTIMIZER IS WORKING
This commit is contained in:
@@ -17,6 +17,20 @@ class X86_64Optimizer(Optimizer):
|
||||
Instruction("jg", ["y"])
|
||||
]
|
||||
),
|
||||
PeepholeRule(
|
||||
match=[
|
||||
Instruction("setg",["al"]),
|
||||
Instruction("movzx", ["rax", "al"]),
|
||||
Instruction("mov", ["z", "rax"]),
|
||||
Instruction("mov", ["eax", "x"]),
|
||||
Instruction("test", ["eax", "eax"]),
|
||||
Instruction("jnz", ["y"])
|
||||
],
|
||||
replace=[
|
||||
Instruction("jg", ["y"])
|
||||
]
|
||||
),
|
||||
|
||||
PeepholeRule(
|
||||
match=[
|
||||
Instruction("setl",["al"]),
|
||||
@@ -30,6 +44,20 @@ class X86_64Optimizer(Optimizer):
|
||||
Instruction("jl", ["y"])
|
||||
]
|
||||
),
|
||||
PeepholeRule(
|
||||
match=[
|
||||
Instruction("setl",["al"]),
|
||||
Instruction("movzx", ["rax", "al"]),
|
||||
Instruction("mov", ["z", "rax"]),
|
||||
Instruction("mov", ["eax", "x"]),
|
||||
Instruction("test", ["eax", "eax"]),
|
||||
Instruction("jnz", ["y"])
|
||||
],
|
||||
replace=[
|
||||
Instruction("jl", ["y"])
|
||||
]
|
||||
),
|
||||
|
||||
PeepholeRule(
|
||||
match=[
|
||||
Instruction("sete",["al"]),
|
||||
@@ -43,6 +71,20 @@ class X86_64Optimizer(Optimizer):
|
||||
Instruction("je", ["y"])
|
||||
]
|
||||
),
|
||||
PeepholeRule(
|
||||
match=[
|
||||
Instruction("sete",["al"]),
|
||||
Instruction("movzx", ["rax", "al"]),
|
||||
Instruction("mov", ["z", "rax"]),
|
||||
Instruction("mov", ["eax", "x"]),
|
||||
Instruction("test", ["eax", "eax"]),
|
||||
Instruction("jnz", ["y"])
|
||||
],
|
||||
replace=[
|
||||
Instruction("je", ["y"])
|
||||
]
|
||||
),
|
||||
|
||||
PeepholeRule(
|
||||
match=[
|
||||
Instruction("setne",["al"]),
|
||||
@@ -56,4 +98,27 @@ class X86_64Optimizer(Optimizer):
|
||||
Instruction("jne", ["y"])
|
||||
]
|
||||
),
|
||||
PeepholeRule(
|
||||
match=[
|
||||
Instruction("setne",["al"]),
|
||||
Instruction("movzx", ["rax", "al"]),
|
||||
Instruction("mov", ["z", "rax"]),
|
||||
Instruction("mov", ["eax", "x"]),
|
||||
Instruction("test", ["eax", "eax"]),
|
||||
Instruction("jnz", ["y"])
|
||||
],
|
||||
replace=[
|
||||
Instruction("jne", ["y"])
|
||||
]
|
||||
),
|
||||
|
||||
PeepholeRule(
|
||||
match=[
|
||||
Instruction("mov", ["rax", "x"]),
|
||||
Instruction("push", ["rax"])
|
||||
],
|
||||
replace=[
|
||||
Instruction("push", ["x"])
|
||||
]
|
||||
)
|
||||
]
|
Reference in New Issue
Block a user