summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2010-01-20 05:52:19 +0000
committerDJ Delorie <dj@redhat.com>2010-01-20 05:52:19 +0000
commit2b1a61a6cf689a85a8580e8f6de28e6e28a5a6fb (patch)
treeba2e9762f8ea876d7bf998bfcde18953b5e0600c /sim
parent692465f151fa76f678ca0b2469cd4aec199bcb75 (diff)
downloadbinutils-2b1a61a6cf689a85a8580e8f6de28e6e28a5a6fb.tar.gz
binutils-2b1a61a6cf689a85a8580e8f6de28e6e28a5a6fb.tar.bz2
binutils-2b1a61a6cf689a85a8580e8f6de28e6e28a5a6fb.zip
* m32c.opc (MATH_OP): When doing subtraction, also set carry if
the result is zero.
Diffstat (limited to 'sim')
-rw-r--r--sim/m32c/ChangeLog5
-rw-r--r--sim/m32c/m32c.opc2
2 files changed, 6 insertions, 1 deletions
diff --git a/sim/m32c/ChangeLog b/sim/m32c/ChangeLog
index 888870a5b97..e443c162da2 100644
--- a/sim/m32c/ChangeLog
+++ b/sim/m32c/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-20 DJ Delorie <dj@redhat.com>
+
+ * m32c.opc (MATH_OP): When doing subtraction, also set carry if
+ the result is zero.
+
2010-01-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
diff --git a/sim/m32c/m32c.opc b/sim/m32c/m32c.opc
index b271acfac6a..a2ddda9712f 100644
--- a/sim/m32c/m32c.opc
+++ b/sim/m32c/m32c.opc
@@ -125,7 +125,7 @@ prefix (src_allowed, dest_allowed, index_bytewidth)
mb = sign_ext (s, dc.bytes * 8); \
v = ma op mb op c; \
tprintf("%d " #op " %d " #op " %d = %d\n", ma, mb, c, v); \
- set_oszc (v, dc.bytes, ll > ((1 op 1) ? b2mask[dc.bytes] : 0)); \
+ set_oszc (v, dc.bytes, (1 op 1) ? (ll > b2mask[dc.bytes]) : (ll >= 0)); \
put_dest (dc, v); \
}