mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-10 08:50:07 +08:00
riscv64: fcvt.d.s doesn't need a rounding mode
it doesn't round so the RM field can be zero. According to some sourcs it should be set to zero by software in these cases, and the binutils disassembler doesn't like us setting it to 7. This shouldn't matter in practice, but who knows.
This commit is contained in:
parent
2f94390223
commit
fb1fb8219c
@ -1176,9 +1176,9 @@ ST_FUNC void gen_cvt_ftof(int dt)
|
||||
rs = gv(RC_FLOAT);
|
||||
rd = get_reg(RC_FLOAT);
|
||||
if (dt == VT_DOUBLE)
|
||||
EI(0x53, 7, freg(rd), freg(rs), 0x21 << 5); // fcvt.d.s RD, RS (dyn rm)
|
||||
EI(0x53, 0, freg(rd), freg(rs), 0x21 << 5); // fcvt.d.s RD, RS (no rm)
|
||||
else
|
||||
EI(0x53, 7, freg(rd), freg(rs), (0x20 << 5) | 1); // fcvt.s.d RD, RS
|
||||
EI(0x53, 7, freg(rd), freg(rs), (0x20 << 5) | 1); // fcvt.s.d RD, RS (dyn rm)
|
||||
vtop->r = rd;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user