Update of /cvsroot/hppaqemu/hppaqemu/target-hppa
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv4568
Modified Files:
op.c
Log Message:
Better (bitwise) signed overflow tests.
Index: op.c
===================================================================
RCS file: /cvsroot/hppaqemu/hppaqemu/target-hppa/op.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** op.c 16 Mar 2007 21:01:54 -0000 1.25
--- op.c 16 Mar 2007 21:33:42 -0000 1.26
***************
*** 753,762 ****
#define signed_overflow_add(op1, op2, res) \
! ((((int32_t)(op1) < 0) == ((int32_t)(op2) < 0)) && \
! (((int32_t)(op1) < 0) != ((int32_t)(res) < 0)))
#define signed_overflow_sub(op1, op2, res) \
! ((((int32_t)(op1) < 0) != ((int32_t)(op2) < 0)) && \
! (((int32_t)(op1) < 0) != ((int32_t)(res) < 0)))
void OPPROTO op_eval_never(void)
--- 753,760 ----
#define signed_overflow_add(op1, op2, res) \
! (!!(((op1 ^ op2 ^ ~0) & (op1 ^ res)) >> 31))
#define signed_overflow_sub(op1, op2, res) \
! (!!(((op1 ^ op2) & (op1 ^ res)) >> 31))
void OPPROTO op_eval_never(void)
***************
*** 814,818 ****
int32_t res = T0 + T1;
T2 = signed_overflow_add(T0, T1, res);
- FORCE_RET();
}
--- 812,815 ----
|