mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed '*vreg<RAX>' divisor legalization issue
This commit is contained in:
parent
dd3485af0c
commit
044d5d5f03
1 changed files with 12 additions and 4 deletions
|
@ -9878,11 +9878,19 @@ bool BeMCContext::DoLegalization()
|
||||||
auto arg0Type = GetType(arg0);
|
auto arg0Type = GetType(arg0);
|
||||||
if (arg0Type->IsInt())
|
if (arg0Type->IsInt())
|
||||||
{
|
{
|
||||||
if (arg1.mKind == BeMCOperandKind_NativeReg)
|
auto checkArg1 = arg1;
|
||||||
|
if (checkArg1.mKind == BeMCOperandKind_VRegLoad)
|
||||||
|
{
|
||||||
|
// Handle '*vreg<RAX>' case
|
||||||
|
checkArg1.mKind = BeMCOperandKind_VReg;
|
||||||
|
checkArg1 = GetFixedOperand(checkArg1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (checkArg1.mKind == BeMCOperandKind_NativeReg)
|
||||||
{
|
{
|
||||||
// We can't allow division by RDX because we need RAX:RDX for the dividend
|
// We can't allow division by RDX because we need RAX:RDX for the dividend
|
||||||
auto divisorReg = GetFullRegister(arg1.mReg);
|
auto divisorReg = GetFullRegister(checkArg1.mReg);
|
||||||
if ((arg1.IsNativeReg()) &&
|
if ((checkArg1.IsNativeReg()) &&
|
||||||
((divisorReg == X64Reg_RDX) || (divisorReg == X64Reg_RAX)))
|
((divisorReg == X64Reg_RDX) || (divisorReg == X64Reg_RAX)))
|
||||||
{
|
{
|
||||||
BF_ASSERT(inst->mArg1.IsVRegAny());
|
BF_ASSERT(inst->mArg1.IsVRegAny());
|
||||||
|
@ -15842,7 +15850,7 @@ void BeMCContext::Generate(BeFunction* function)
|
||||||
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
||||||
|
|
||||||
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
||||||
//mDebugging = (function->mName == "?Zoips@TestProgram@BeefTest@bf@@SAXXZ");
|
//mDebugging = (function->mName == "??Kint2@bf@@SA?A01@01@0@Z");
|
||||||
// || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ");
|
// || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ");
|
||||||
// || (function->mName == "?Hey@Blurg@bf@@SAXXZ")
|
// || (function->mName == "?Hey@Blurg@bf@@SAXXZ")
|
||||||
// ;
|
// ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue