mirror of
https://github.com/KarolS/millfork.git
synced 2024-12-24 15:29:23 +00:00
Optimization fixes
This commit is contained in:
parent
278cbcec63
commit
a16f662031
@ -118,7 +118,7 @@ object LaterOptimizations {
|
|||||||
|
|
||||||
private def TwoIdenticalLoadsWithNoFlagChangeInBetween(opcode: Opcode.Value, middle: AssemblyLinePattern) = {
|
private def TwoIdenticalLoadsWithNoFlagChangeInBetween(opcode: Opcode.Value, middle: AssemblyLinePattern) = {
|
||||||
(HasOpcode(opcode) & MatchAddrMode(0) & MatchParameter(1)) ~
|
(HasOpcode(opcode) & MatchAddrMode(0) & MatchParameter(1)) ~
|
||||||
(LinearOrLabel & Not(ChangesMemory) & middle & Not(ChangesNAndZ)).* ~
|
(LinearOrLabel & Not(ChangesMemory) & DoesntChangeIndexingInAddrMode(0) & middle & Not(ChangesNAndZ)).* ~
|
||||||
(HasOpcode(opcode) & Elidable & MatchAddrMode(0) & MatchParameter(1)) ~~> { c =>
|
(HasOpcode(opcode) & Elidable & MatchAddrMode(0) & MatchParameter(1)) ~~> { c =>
|
||||||
c.init
|
c.init
|
||||||
}
|
}
|
||||||
@ -134,7 +134,7 @@ object LaterOptimizations {
|
|||||||
|
|
||||||
private def TwoIdenticalLoadsWhoseFlagsWillNotBeChecked(opcode: Opcode.Value, middle: AssemblyLinePattern) = {
|
private def TwoIdenticalLoadsWhoseFlagsWillNotBeChecked(opcode: Opcode.Value, middle: AssemblyLinePattern) = {
|
||||||
((HasOpcode(opcode) & MatchAddrMode(0) & MatchParameter(1)) ~
|
((HasOpcode(opcode) & MatchAddrMode(0) & MatchParameter(1)) ~
|
||||||
(LinearOrLabel & Not(ChangesMemory) & middle).*).capture(2) ~
|
(LinearOrLabel & Not(ChangesMemory) & DoesntChangeIndexingInAddrMode(0) & middle).*).capture(2) ~
|
||||||
(HasOpcode(opcode) & Elidable & MatchAddrMode(0) & MatchParameter(1)) ~
|
(HasOpcode(opcode) & Elidable & MatchAddrMode(0) & MatchParameter(1)) ~
|
||||||
((LinearOrLabel & Not(ReadsNOrZ) & Not(ChangesNAndZ)).* ~ ChangesNAndZ).capture(3) ~~> { (_, ctx) =>
|
((LinearOrLabel & Not(ReadsNOrZ) & Not(ChangesNAndZ)).* ~ ChangesNAndZ).capture(3) ~~> { (_, ctx) =>
|
||||||
ctx.get[List[AssemblyLine]](2) ++ ctx.get[List[AssemblyLine]](3)
|
ctx.get[List[AssemblyLine]](2) ++ ctx.get[List[AssemblyLine]](3)
|
||||||
|
Loading…
Reference in New Issue
Block a user