mirror of
https://github.com/KarolS/millfork.git
synced 2024-08-28 05:29:06 +00:00
6502: More optimizations
This commit is contained in:
parent
a25f6ca3f6
commit
b873030b29
@ -667,21 +667,37 @@ object AlwaysGoodOptimizations {
|
|||||||
(Elidable & HasOpcode(TAY) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
(Elidable & HasOpcode(TAY) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
||||||
List(AssemblyLine.implied(TAY), AssemblyLine.implied(INY))
|
List(AssemblyLine.implied(TAY), AssemblyLine.implied(INY))
|
||||||
},
|
},
|
||||||
|
(Elidable & HasOpcode(ADC) & HasImmediate(1) & HasClear(State.D) & HasClear(State.C)) ~
|
||||||
|
(Elidable & HasOpcode(TAY) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
||||||
|
List(AssemblyLine.implied(TAY), AssemblyLine.implied(INY))
|
||||||
|
},
|
||||||
(Elidable & HasOpcode(SEC) & HasClear(State.D)) ~
|
(Elidable & HasOpcode(SEC) & HasClear(State.D)) ~
|
||||||
(Elidable & HasOpcode(SBC) & HasImmediate(1)) ~
|
(Elidable & HasOpcode(SBC) & HasImmediate(1)) ~
|
||||||
(Elidable & HasOpcode(TAY) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
(Elidable & HasOpcode(TAY) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
||||||
List(AssemblyLine.implied(TAY), AssemblyLine.implied(DEY))
|
List(AssemblyLine.implied(TAY), AssemblyLine.implied(DEY))
|
||||||
},
|
},
|
||||||
|
(Elidable & HasOpcode(SBC) & HasImmediate(1) & HasClear(State.D) & HasSet(State.C)) ~
|
||||||
|
(Elidable & HasOpcode(TAY) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
||||||
|
List(AssemblyLine.implied(TAY), AssemblyLine.implied(DEY))
|
||||||
|
},
|
||||||
(Elidable & HasOpcode(CLC) & HasClear(State.D)) ~
|
(Elidable & HasOpcode(CLC) & HasClear(State.D)) ~
|
||||||
(Elidable & HasOpcode(ADC) & HasImmediate(1)) ~
|
(Elidable & HasOpcode(ADC) & HasImmediate(1)) ~
|
||||||
(Elidable & HasOpcode(TAX) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
(Elidable & HasOpcode(TAX) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
||||||
List(AssemblyLine.implied(TAX), AssemblyLine.implied(INX))
|
List(AssemblyLine.implied(TAX), AssemblyLine.implied(INX))
|
||||||
},
|
},
|
||||||
|
(Elidable & HasOpcode(ADC) & HasImmediate(1) & HasClear(State.D) & HasClear(State.C)) ~
|
||||||
|
(Elidable & HasOpcode(TAX) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
||||||
|
List(AssemblyLine.implied(TAX), AssemblyLine.implied(INX))
|
||||||
|
},
|
||||||
(Elidable & HasOpcode(SEC) & HasClear(State.D)) ~
|
(Elidable & HasOpcode(SEC) & HasClear(State.D)) ~
|
||||||
(Elidable & HasOpcode(SBC) & HasImmediate(1)) ~
|
(Elidable & HasOpcode(SBC) & HasImmediate(1)) ~
|
||||||
(Elidable & HasOpcode(TAX) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
(Elidable & HasOpcode(TAX) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
||||||
List(AssemblyLine.implied(TAX), AssemblyLine.implied(DEX))
|
List(AssemblyLine.implied(TAX), AssemblyLine.implied(DEX))
|
||||||
},
|
},
|
||||||
|
(Elidable & HasOpcode(SBC) & HasImmediate(1) & HasClear(State.D) & HasSet(State.C)) ~
|
||||||
|
(Elidable & HasOpcode(TAX) & DoesntMatterWhatItDoesWith(State.A, State.C, State.V)) ~~> { code =>
|
||||||
|
List(AssemblyLine.implied(TAX), AssemblyLine.implied(DEX))
|
||||||
|
},
|
||||||
(Elidable & HasOpcode(TXA)) ~
|
(Elidable & HasOpcode(TXA)) ~
|
||||||
(Elidable & HasOpcode(CLC) & HasClear(State.D)) ~
|
(Elidable & HasOpcode(CLC) & HasClear(State.D)) ~
|
||||||
(Elidable & HasOpcode(ADC) & HasImmediate(1)) ~
|
(Elidable & HasOpcode(ADC) & HasImmediate(1)) ~
|
||||||
|
Loading…
Reference in New Issue
Block a user