Fix li bias for certain integers

This commit is contained in:
peteraa 2019-09-09 19:06:05 +02:00
parent 559a5c8360
commit d6a135b206

View file

@ -145,10 +145,9 @@ object Parser {
val multipleInstructions: Parser[List[Op]] = List( val multipleInstructions: Parser[List[Op]] = List(
stringWs("li") ~> (reg <~ sep, (hex | int).map(_.splitHiLo(20))).mapN{ case(rd, (hi, lo)) => { stringWs("li") ~> (reg <~ sep, (hex | int).map(_.splitHiLo(20))).mapN{ case(rd, (hi, lo)) => {
say("hello?")
List( List(
ArithImm.add(rd, rd, lo), ArithImm.add(rd, rd, lo),
LUI(rd, hi), LUI(rd, if(lo>0) hi else hi+1),
)}}.map(_.widen[Op]), )}}.map(_.widen[Op]),
// NOTE: THESE ARE NOT PSEUDO-OPS IN RISC-V32I! // NOTE: THESE ARE NOT PSEUDO-OPS IN RISC-V32I!