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

Fixed sign check on uint64->float

This commit is contained in:
Brian Fiete 2024-12-03 08:07:35 -05:00
parent 769861d3da
commit 86721ffc20

View file

@ -16589,7 +16589,7 @@ void BeMCContext::Generate(BeFunction* function)
vregInfo->mIsExpr = true;
vregInfo->mRelTo = mcValue;
}
else if ((toType->IsFloat()) && (fromType->IsIntable()) && (fromType->mSize == 8))
else if ((toType->IsFloat()) && (fromType->IsIntable()) && (fromType->mSize == 8) && (!castedInst->mValSigned))
{
// uint64 to float - basically, when we are signed then we shift down one bit (so it's unsigned) and then double the result. There's a 1-bit correction factor.
AllocInst(BeMCInstKind_Test, mcValue, mcValue);