aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <aswaterman@gmail.com>2017-11-01 01:13:45 -0700
committerGitHub <noreply@github.com>2017-11-01 01:13:45 -0700
commit220b1bee10d9399864131cd1dbe5037714237f03 (patch)
treefbff0df5c1c523befdf3f150f7672fc9111a3983
parent18087efa98d77918d55127c3d7745cd6d6d9d77b (diff)
downloadriscv-pk-220b1bee10d9399864131cd1dbe5037714237f03.zip
riscv-pk-220b1bee10d9399864131cd1dbe5037714237f03.tar.gz
riscv-pk-220b1bee10d9399864131cd1dbe5037714237f03.tar.bz2
Fix(?) fcvt.s.w emulation for rs1 = -2^31 (#66)
-rw-r--r--machine/fp_emulation.c2
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;