mirror of
https://github.com/KarolS/millfork.git
synced 2024-09-11 02:55:10 +00:00
Fix optimization of ADC on 6502
This commit is contained in:
parent
215d8d92b4
commit
ca4ae4ce2e
@ -119,8 +119,8 @@ object AlwaysGoodOptimizations {
|
||||
(Elidable &
|
||||
MatchA(0) & MatchParameter(1) &
|
||||
HasOpcode(ADC) & HasAddrMode(Immediate) &
|
||||
HasClear(State.D) & HasClear(State.C) & DoesntMatterWhatItDoesWith(State.V)) ~
|
||||
Where(ctx => (ctx.get[Constant](1) + ctx.get[Int](0)).quickSimplify match {
|
||||
HasClear(State.D) & HasClear(State.C) & DoesntMatterWhatItDoesWith(State.V, State.C)) ~
|
||||
Where(ctx => (ctx.get[Constant](1).loByte.quickSimplify + ctx.get[Int](0).&(0xff)).quickSimplify match {
|
||||
case NumericConstant(x, _) => x == (x & 0xff)
|
||||
case _ => false
|
||||
}) ~~> { (code, ctx) =>
|
||||
|
Loading…
Reference in New Issue
Block a user