1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Disable RAX for result of int8 modulo

This commit is contained in:
Brian Fiete 2022-08-25 10:19:16 -07:00
parent a587e6249e
commit 1c794f37b1

View file

@ -10088,6 +10088,7 @@ bool BeMCContext::DoLegalization()
mcRemaindier = BeMCOperand::FromReg(ResizeRegister(X64Reg_AL, arg0Type));
preserveRAXInst->mArg1 = inst->mArg0; // RAX preserve elision exception
DisableRegister(inst->mArg0, X64Reg_SIL); // Disable Hi8
DisableRegister(inst->mArg0, X64Reg_RAX);
AllocInst(BeMCInstKind_Shr, BeMCOperand::FromReg(X64Reg_AX), BeMCOperand::FromImmediate(8), instIdx++ + 1);
AllocInst(BeMCInstKind_Mov, inst->mArg0, mcRemaindier, instIdx++ + 1);
}