aboutsummaryrefslogtreecommitdiff
path: root/target-alpha
diff options
context:
space:
mode:
Diffstat (limited to 'target-alpha')
-rw-r--r--target-alpha/op_helper.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/target-alpha/op_helper.c b/target-alpha/op_helper.c
index 7ad1b3d55c..e61fa7396c 100644
--- a/target-alpha/op_helper.c
+++ b/target-alpha/op_helper.c
@@ -158,22 +158,22 @@ uint64_t helper_addlv (uint64_t op1, uint64_t op2)
uint64_t helper_subqv (uint64_t op1, uint64_t op2)
{
- uint64_t tmp = op1;
- op1 -= op2;
- if (unlikely(((~tmp) ^ op1 ^ (-1ULL)) & ((~tmp) ^ op2) & (1ULL << 63))) {
+ uint64_t res;
+ res = op1 - op2;
+ if (unlikely((op1 ^ op2) & (res ^ op1) & (1ULL << 63))) {
helper_excp(EXCP_ARITH, EXCP_ARITH_OVERFLOW);
}
- return op1;
+ return res;
}
uint64_t helper_sublv (uint64_t op1, uint64_t op2)
{
- uint64_t tmp = op1;
- op1 = (uint32_t)(op1 - op2);
- if (unlikely(((~tmp) ^ op1 ^ (-1UL)) & ((~tmp) ^ op2) & (1UL << 31))) {
+ uint32_t res;
+ res = op1 - op2;
+ if (unlikely((op1 ^ op2) & (res ^ op1) & (1UL << 31))) {
helper_excp(EXCP_ARITH, EXCP_ARITH_OVERFLOW);
}
- return op1;
+ return res;
}
uint64_t helper_mullv (uint64_t op1, uint64_t op2)