Skip to content

Commit

Permalink
cranelift: Use emit helper function on aarch64
Browse files Browse the repository at this point in the history
...instead of pushing to the `emitted_insts` vec directly.
  • Loading branch information
fitzgen authored and alexcrichton committed Feb 2, 2022
1 parent 4d263a9 commit 688c6b8
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cranelift/codegen/src/isa/aarch64/lower/isle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,14 @@ where
let imm =
MoveWideConst::maybe_with_shift(((!imm16) & 0xffff) as u16, i * 16)
.unwrap();
self.emitted_insts
.push((MInst::MovN { rd, imm, size }, false));
self.emit(&MInst::MovN { rd, imm, size });
} else {
let imm = MoveWideConst::maybe_with_shift(imm16 as u16, i * 16).unwrap();
self.emitted_insts
.push((MInst::MovZ { rd, imm, size }, false));
self.emit(&MInst::MovZ { rd, imm, size });
}
} else {
let imm = MoveWideConst::maybe_with_shift(imm16 as u16, i * 16).unwrap();
self.emitted_insts
.push((MInst::MovK { rd, imm, size }, false));
self.emit(&MInst::MovK { rd, imm, size });
}
}
}
Expand Down

0 comments on commit 688c6b8

Please sign in to comment.