projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d55ada
)
target-arm: fix sdiv helper
author
Aurelien Jarno
<aurelien@aurel32.net>
Thu, 15 Oct 2009 21:08:46 +0000
(23:08 +0200)
committer
Aurelien Jarno
<aurelien@aurel32.net>
Thu, 22 Oct 2009 22:05:17 +0000
(
00:05
+0200)
(INT32_MIN / -1) triggers an overflow, and the result depends on the
host architecture (INT32_MIN on arm, -1 on ppc, SIGFPE on x86). Use a
test to output the correct value.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
target-arm/helper.c
patch
|
blob
|
history
diff --git
a/target-arm/helper.c
b/target-arm/helper.c
index
656b5df
..
021d121
100644
(file)
--- a/
target-arm/helper.c
+++ b/
target-arm/helper.c
@@
-402,6
+402,8
@@
int32_t HELPER(sdiv)(int32_t num, int32_t den)
{
if (den == 0)
return 0;
+ if (num == INT_MIN && den == -1)
+ return INT_MIN;
return num / den;
}