riscv: Fix unsigned 32bit loads
the invariant for the risc-v codegen is, that 64bit regs generally contain the sign-extension of a 32bit value. This wasn't heeded by loads of 32bit values from memory, which used lwu and ultimately caused a miscompilation in string_test of tcctest.c. Now most of tcctest.c works (not with -run, but with linking a real executable), except some ftoi/ftof conversions.
This commit is contained in:
parent
2668eda595
commit
69c77d1597
1 changed files with 1 additions and 1 deletions
|
@ -155,7 +155,7 @@ ST_FUNC void load(int r, SValue *sv)
|
|||
if (bt == VT_FUNC)
|
||||
size = PTR_SIZE;
|
||||
func3 = size == 1 ? 0 : size == 2 ? 1 : size == 4 ? 2 : 3;
|
||||
if (size < 8 && !is_float(sv->type.t) && (sv->type.t & VT_UNSIGNED))
|
||||
if (size < 4 && !is_float(sv->type.t) && (sv->type.t & VT_UNSIGNED))
|
||||
func3 |= 4;
|
||||
}
|
||||
if (v == VT_LOCAL) {
|
||||
|
|
Loading…
Reference in a new issue