diff options
Diffstat (limited to 'sim')
-rw-r--r-- | sim/testsuite/v850/divq.cgs | 11 | ||||
-rw-r--r-- | sim/v850/simops.c | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/sim/testsuite/v850/divq.cgs b/sim/testsuite/v850/divq.cgs new file mode 100644 index 0000000..8461f86 --- /dev/null +++ b/sim/testsuite/v850/divq.cgs @@ -0,0 +1,11 @@ +# v850 bins +# mach: v850e3v5 +# as: -mv850e3v5 + + .include "testutils.inc" + seti 0xfffffffb r11 + seti 0x32 r10 + divq r11, r10, r11 + reg r10, 0xfffffff6 + reg r11, 0x0 + pass diff --git a/sim/v850/simops.c b/sim/v850/simops.c index e9a5d48..f90a0f7 100644 --- a/sim/v850/simops.c +++ b/sim/v850/simops.c @@ -3135,8 +3135,8 @@ v850_div (SIM_DESC sd, unsigned int op0, unsigned int op1, unsigned int *op2p, u bfd_boolean overflow = FALSE; /* Compute the result. */ - divide_by = op0; - divide_this = op1; + divide_by = (int32_t)op0; + divide_this = (int32_t)op1; if (divide_by == 0 || (divide_by == -1 && divide_this == (1 << 31))) { |