Skip to content

Commit

Permalink
Fix compile error on imul.
Browse files Browse the repository at this point in the history
  • Loading branch information
losfair committed Jul 11, 2019
1 parent 0c4a8f7 commit c186e02
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/singlepass-backend/src/codegen_x64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,13 @@ impl X64FunctionCode {
BothToGPR,
}
let mode = match (src, dst) {
(Location::GPR(_), Location::GPR(_))
if (op as *const u8 == Assembler::emit_imul as *const u8) =>
{
RelaxMode::Direct
}
_ if (op as *const u8 == Assembler::emit_imul as *const u8) => RelaxMode::BothToGPR,

(Location::Memory(_, _), Location::Memory(_, _)) => RelaxMode::SrcToGPR,
(Location::Imm64(_), Location::Imm64(_)) | (Location::Imm64(_), Location::Imm32(_)) => {
RelaxMode::BothToGPR
Expand All @@ -653,7 +660,6 @@ impl X64FunctionCode {
RelaxMode::SrcToGPR
}
(_, Location::XMM(_)) => RelaxMode::SrcToGPR,
_ if (op as *const u8 == Assembler::emit_imul as *const u8) => RelaxMode::BothToGPR, // TODO: optimize this
_ => RelaxMode::Direct,
};

Expand Down

0 comments on commit c186e02

Please sign in to comment.