Skip to content

Commit

Permalink
sparc64: fix udiv and sdiv insns
Browse files Browse the repository at this point in the history
- truncate second operand to 32bit

Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
  • Loading branch information
i-garrison authored and blueswirl committed Jun 2, 2010
1 parent 0e2fa9c commit 0948720
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions target-sparc/op_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 0948720

Please sign in to comment.