diff options
author | Andrew Waterman <andrew@sifive.com> | 2017-10-31 15:39:37 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2017-10-31 15:39:37 -0700 |
commit | 0f136e22addd15942c07e8fc093e03ccee495561 (patch) | |
tree | fbff0df5c1c523befdf3f150f7672fc9111a3983 | |
parent | 18087efa98d77918d55127c3d7745cd6d6d9d77b (diff) | |
download | pk-fix-fcvt-s-w.zip pk-fix-fcvt-s-w.tar.gz pk-fix-fcvt-s-w.tar.bz2 |
Fix(?) fcvt.s.w emulation for rs1 = -2^31fix-fcvt-s-w
-rw-r--r-- | machine/fp_emulation.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/machine/fp_emulation.c b/machine/fp_emulation.c index ffa431b..c83ef73 100644 --- a/machine/fp_emulation.c +++ b/machine/fp_emulation.c @@ -201,7 +201,7 @@ DECLARE_EMULATION_FUNC(emulate_fcvt_fi) { case 0: // int32 negative = (int32_t)uint_val < 0; - uint_val = negative ? -(int32_t)uint_val : (int32_t)uint_val; + uint_val = (uint32_t)(negative ? -uint_val : uint_val); break; case 1: // uint32 uint_val = (uint32_t)uint_val; |