Fix order of multipleInstructions when NOP padding

Make sure that expanded multipleInstructions are in correct order.

Example for LI that's expanded to LUI->ADDI.
Old behavior:
nop, nop, nop, nop, ADDI
nop, nop, nop, nop, LUI

New behaviour:
nop, nop, nop, nop, LUI
nop, nop, nop, nop, ADDI
This commit is contained in:
lasse.a.eggen 2021-10-14 13:01:51 +02:00 committed by GitHub
parent e9a4e8a5b3
commit 092ef72680
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,7 +228,7 @@ object Parser {
def addOps (t: List[SourceInfo[Op]]): FoldHelper = {
if(testOptions.nopPadded){
copy(
ops = t.flatMap(x => (x :: List.fill(4)(SourceInfo("inserted NOP", NOP).widen[Op]))).reverse ::: ops,
ops = t.flatMap(x => (x :: List.fill(4)(SourceInfo("inserted NOP", NOP).widen[Op])).reverse) ::: ops,
addrCount = addrCount + t.size*4*5)
}
else {