diff options
author | Daniel Jacobowitz <dan@debian.org> | 2007-03-02 12:15:01 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2007-03-02 12:15:01 +0000 |
commit | 9cf37b33ab9ca4f90071c2bf6bde3448d8086d6f (patch) | |
tree | b0aeaaa2e4a248348b532daddf9145be638c1895 /sim | |
parent | 376449fb19f5905acbf5f8bd24e64d74a42bb2fb (diff) | |
download | gdb-9cf37b33ab9ca4f90071c2bf6bde3448d8086d6f.tar.gz |
2007-03-02 Andrew Stubbs <andrew.stubbs@st.com>
* gencode.c (tab): Correct pre-decrement instructions when m == n.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/sh/ChangeLog | 4 | ||||
-rw-r--r-- | sim/sh/gencode.c | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog index 0fe787786b9..8207483e99e 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,3 +1,7 @@ +2007-03-02 Andrew Stubbs <andrew.stubbs@st.com> + + * gencode.c (tab): Correct pre-decrement instructions when m == n. + 2006-12-21 Hans-Peter Nilsson <hp@axis.com> * acconfig.h: Remove. diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c index e86bd298f68..15313b0be0a 100644 --- a/sim/sh/gencode.c +++ b/sim/sh/gencode.c @@ -970,9 +970,11 @@ op tab[] = "WBAT (R[n] + R0, R[m]);", }, { "n", "nm", "mov.b <REG_M>,@-<REG_N>", "0010nnnnmmmm0100", + /* Allow for the case where m == n. */ + "int t = R[m];", "MA (1);", "R[n] -= 1;", - "WBAT (R[n], R[m]);", + "WBAT (R[n], t);", }, { "n", "n0", "mov.b R0,@<REG_N>+", "0100nnnn10001011", "MA (1);", @@ -1035,9 +1037,11 @@ op tab[] = "WLAT (R0 + R[n], R[m]);", }, { "n", "nm", "mov.l <REG_M>,@-<REG_N>", "0010nnnnmmmm0110", + /* Allow for the case where m == n. */ + "int t = R[m];", "MA (1) ;", "R[n] -= 4;", - "WLAT (R[n], R[m]);", + "WLAT (R[n], t);", }, { "n", "n0", "mov.l R0,@<REG_N>+", "0100nnnn10101011", "MA (1) ;", @@ -1099,9 +1103,11 @@ op tab[] = "WWAT (R0 + R[n], R[m]);", }, { "n", "mn", "mov.w <REG_M>,@-<REG_N>", "0010nnnnmmmm0101", + /* Allow for the case where m == n. */ + "int t = R[m];", "MA (1);", "R[n] -= 2;", - "WWAT (R[n], R[m]);", + "WWAT (R[n], t);", }, { "n", "0n", "mov.w R0,@<REG_N>+", "0100nnnn10011011", "MA (1);", |