riscv: Optimize SetConst a bit.

This commit is contained in:
Unknown W. Brackets committed 2023-07-23 18:01:00 -07:00
1 parent f7f7531500
commit 4100767b5e
1 file changed
+3 -1
+3 -1
View File
@@ -39,7 +39,9 @@ void RiscVJit::CompIR_Basic(IRInst inst) {
switch (inst.op) {
case IROp::SetConst:
gpr.SetImm(inst.dest, inst.constant);
// Sign extend all constants. We get 0xFFFFFFFF sometimes, and it's more work to truncate.
// The register only holds 32 bits in the end anyway.
gpr.SetImm(inst.dest, (int32_t)inst.constant);
break;
case IROp::SetConstF: