diff options
author | Igor V. Kovalenko <igor.v.kovalenko@gmail.com> | 2010-06-02 00:12:53 +0400 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-06-02 20:07:13 +0000 |
commit | 09487205bb03548d260300d32595ba17ab597337 (patch) | |
tree | e58fc13cfe577a0f5d6b2979404ff15082b4966d /target-sparc | |
parent | 0e2fa9cab9c124788077de728f1e6744d1dd8bb2 (diff) |
sparc64: fix udiv and sdiv insns
- truncate second operand to 32bit
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sparc')
-rw-r--r-- | target-sparc/op_helper.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c index 470c710755..be3c1e051b 100644 --- a/target-sparc/op_helper.c +++ b/target-sparc/op_helper.c @@ -3306,7 +3306,7 @@ target_ulong helper_udiv(target_ulong a, target_ulong b) uint32_t x1; x0 = (a & 0xffffffff) | ((int64_t) (env->y) << 32); - x1 = b; + x1 = (b & 0xffffffff); if (x1 == 0) { raise_exception(TT_DIV_ZERO); @@ -3328,7 +3328,7 @@ target_ulong helper_sdiv(target_ulong a, target_ulong b) int32_t x1; x0 = (a & 0xffffffff) | ((int64_t) (env->y) << 32); - x1 = b; + x1 = (b & 0xffffffff); if (x1 == 0) { raise_exception(TT_DIV_ZERO); |