David Brownell <david-b@pacbell.net> Bugfix some instruction decoding ... I've crafte...
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 24 Jul 2009 16:48:12 +0000 (16:48 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 24 Jul 2009 16:48:12 +0000 (16:48 +0000)
with testcases covering several new encodings in these sections
of the ARMv7-M arch manual:

 A5.3.12 Data processing (register)
 A5.3.13 Miscellaneous operations
 A5.3.14 Multiply, and multiply accumulate
 A5.3.15 Long multiply, long multiply accumulate, and divide

The issues were mostly in '12 and '13; some new related 16-bit
opcodes had issues too.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2563 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/target/arm_disassembler.c

index 2af07c4ede2ce2add56bd613eb81499ecabfb307..149d1976678c2de093e89df232816087663c1afa 100644 (file)
@@ -2098,7 +2098,7 @@ static int evaluate_byterev_thumb(uint16_t opcode, uint32_t address,
        char *suffix;
 
        /* added in ARMv6 */
-       switch (opcode & 0x00c0) {
+       switch ((opcode >> 6) & 3) {
        case 0:
                suffix = "";
                break;
@@ -3201,7 +3201,7 @@ static int t2ev_data_reg(uint32_t opcode, uint32_t address,
                                (int) (opcode >> 0) & 0xf);
 
        } else if (opcode & (1 << 7)) {
-               switch ((opcode >> 24) & 0xf) {
+               switch ((opcode >> 20) & 0xf) {
                case 0:
                case 1:
                case 4:
@@ -3221,7 +3221,7 @@ static int t2ev_data_reg(uint32_t opcode, uint32_t address,
                                        (opcode & (1 << 24)) ? 'U' : 'S',
                                        (opcode & (1 << 26)) ? 'B' : 'H',
                                        (int) (opcode >> 8) & 0xf,
-                                       (int) (opcode >> 16) & 0xf,
+                                       (int) (opcode >> 0) & 0xf,
                                        suffix);
                        break;
                case 8:
@@ -3230,7 +3230,7 @@ static int t2ev_data_reg(uint32_t opcode, uint32_t address,
                case 0xb:
                        if (opcode & (1 << 6))
                                return ERROR_INVALID_ARGUMENTS;
-                       if (~opcode & (0xff << 12))
+                       if (((opcode >> 12) & 0xf) != 0xf)
                                return ERROR_INVALID_ARGUMENTS;
                        if (!(opcode & (1 << 20)))
                                return ERROR_INVALID_ARGUMENTS;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)