summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Boddie <david@boddie.org.uk>2022-02-03 02:28:35 +0100
committerDavid Boddie <david@boddie.org.uk>2023-11-16 16:44:27 +0100
commit6efe84435572f948d631c14b2cd4a40c6bd8e298 (patch)
tree4fbcf5374f26d5e58da038e683649091a06db431
parenta14823a44843753e10db14bb36eb1e80284f4074 (diff)
Tidied up the thumbopfp function and added a case for ACMPD.
-rw-r--r--utils/tl/thumb.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/utils/tl/thumb.c b/utils/tl/thumb.c
index ff7818f5..ed2943e0 100644
--- a/utils/tl/thumb.c
+++ b/utils/tl/thumb.c
@@ -1532,35 +1532,37 @@ thumbopfp(int a, int sc)
{
long o = 0;
+ o |= 0xee << 8;
+
switch(a) {
/* VMOV (ARMv7-M ARM, A7.7.240), encoding T1, op=0 */
- case AMOVWD: return o | (0x0a<<24) | (1<<20) | (0xee<<8) | (1<<6) | (0<<4);
- case AMOVWF: return o | (0x0a<<24) | (1<<20) | (0xee<<8) | (0<<4);
+ case AMOVWD: return o | (0x0a<<24) | (1<<20) | (1<<6) | (0<<4);
+ case AMOVWF: return o | (0x0a<<24) | (1<<20) | (0<<4);
/* VMOV (ARMv7-M ARM, A7.7.240), encoding T1, op=1 */
- case AMOVDW: return o | (0x0a<<24) | (1<<20) | (0xee<<8) | (1<<6) | (1<<4);
- case AMOVFW: return o | (0x0a<<24) | (1<<20) | (0xee<<8) | (1<<4);
+ case AMOVDW: return o | (0x0a<<24) | (1<<20) | (1<<6) | (1<<4);
+ case AMOVFW: return o | (0x0a<<24) | (1<<20) | (1<<4);
/* VCVT (ARMv7-M ARM, A7.7.225), encoding T1 */
- case AMOVFD: return o | (0x0a<<24) | (0xc0<<16) | (0xee<<8) | 0xb7;
- case AMOVDF: return o | (0x0b<<24) | (0xc0<<16) | (0xee<<8) | 0xb7;
+ case AMOVFD: return o | (0x0a<<24) | (0xc0<<16) | 0xb7;
+ case AMOVDF: return o | (0x0b<<24) | (0xc0<<16) | 0xb7;
/* VMOV (register) (ARMv7-M ARM, A7.7.237) */
- case AMOVD: return o | (0x0b<<24) | (0x40<<16) | (0xee<<8) | 0xb0;
- case AMOVF: return o | (0x0a<<24) | (0x40<<16) | (0xee<<8) | 0xb0;
+ case AMOVF: return o | (0x0a<<24) | (0x40<<16) | 0xb0;
+ case AMOVD: return o | (0x0b<<24) | (0x40<<16) | 0xb0;
/* VCMP (ARMv7-M ARM, A7.7.223), encoding T1 */
- case ACMPD:
- case ACMPF: return o | (0x0a<<24) | (0x40<<16) | (0xee<<8) | 0xb4;
+ case ACMPF: return o | (0x0a<<24) | (0x40<<16) | 0xb4;
+ case ACMPD: return o | (0x0b<<24) | (0x40<<16) | 0xb4;
/* arguably, ACMPF should expand to RNDF, CMPD */
/* VADD (ARMv7-M ARM, A7.7.222) */
- case AADDD: return o | (0x0b<<24) | (0xee<<8) | 0x30;
- case AADDF: return o | (0x0a<<24) | (0xee<<8) | 0x30;
+ case AADDD: return o | (0x0b<<24) | 0x30;
+ case AADDF: return o | (0x0a<<24) | 0x30;
/* VSUB (ARMv7-M ARM, A7.7.257) */
- case ASUBD: return o | (0x0b<<24) | (0x4<<20) | (0xee<<8) | 0x30;
- case ASUBF: return o | (0x0a<<24) | (0x4<<20) | (0xee<<8) | 0x30;
+ case ASUBD: return o | (0x0b<<24) | (0x4<<20) | 0x30;
+ case ASUBF: return o | (0x0a<<24) | (0x4<<20) | 0x30;
/* VMUL (ARMv7-M ARM, A7.7.245) */
- case AMULD: return o | (0x0b<<24) | (0xee<<8) | 0x20;
- case AMULF: return o | (0x0a<<24) | (0xee<<8) | 0x20;
+ case AMULD: return o | (0x0b<<24) | 0x20;
+ case AMULF: return o | (0x0a<<24) | 0x20;
/* VDIV (ARMv7-M ARM, A7.7.229) */
- case ADIVD: return o | (0x0b<<24) | (0xee<<8) | 0x80;
- case ADIVF: return o | (0x0a<<24) | (0xee<<8) | 0x80;
+ case ADIVD: return o | (0x0b<<24) | 0x80;
+ case ADIVF: return o | (0x0a<<24) | 0x80;
}
diag("bad fp %d", a);
prasm(curp);