now it always gives -1, no matter the signedness.
-if(RS2 == 0 || (sreg_t(RS1) == INT64_MIN && sreg_t(RS2) == -1))
-{
- if(xpr64)
- RD = sreg_t(RS1) < 0 ? INT64_MIN : INT64_MAX;
- else
- RD = sreg_t(RS1) < 0 ? sext32(INT32_MIN) : INT32_MAX;
-}
+if(RS2 == 0)
+ RD = UINT64_MAX;
+else if(sreg_t(RS1) == INT64_MIN && sreg_t(RS2) == -1)
+ RD = RS1;
else
RD = sext_xprlen(sreg_t(RS1) / sreg_t(RS2));
require_xpr64;
+if(RS2 == 0)
+ RD = UINT64_MAX;
// INT64_MIN/-1 corner case shouldn't occur in correct code, since
// INT64_MIN is not a proper 32-bit signed value
-if(RS2 == 0 || (sreg_t(RS1) == INT64_MIN && sreg_t(RS2) == -1))
- RD = sext32(sreg_t(RS1) < 0 ? INT32_MIN : INT32_MAX);
+else if(sreg_t(RS1) == INT64_MIN && sreg_t(RS2) == -1)
+ RD = RS1;
else
RD = sext32(sreg_t(RS1) / sreg_t(RS2));