mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-01 06:29:53 +00:00
Fix constant simplification
This commit is contained in:
parent
b9cd18c3c8
commit
7427231c3d
5
src/main/scala/millfork/env/Constant.scala
vendored
5
src/main/scala/millfork/env/Constant.scala
vendored
@ -563,7 +563,10 @@ case class CompoundConstant(operator: MathOperator.Value, lhs: Constant, rhs: Co
|
||||
case MathOperator.Minimum => lv min rv
|
||||
case MathOperator.Maximum => lv max rv
|
||||
case MathOperator.Plus => lv + rv
|
||||
case MathOperator.Minus => lv - rv
|
||||
case MathOperator.Minus =>
|
||||
val tmp = lv - rv
|
||||
if (size == 1 && (tmp < -128 || tmp > 255) ) return l.quickSimplify - r.quickSimplify
|
||||
tmp
|
||||
case MathOperator.Times => lv * rv
|
||||
case MathOperator.Shl => lv << rv
|
||||
case MathOperator.Shr => lv >> rv
|
||||
|
Loading…
Reference in New Issue
Block a user