summaryrefslogtreecommitdiff
path: root/utils/tl
diff options
context:
space:
mode:
authorDavid Boddie <david@boddie.org.uk>2022-02-02 23:23:53 +0100
committerDavid Boddie <david@boddie.org.uk>2023-11-16 16:44:27 +0100
commita14823a44843753e10db14bb36eb1e80284f4074 (patch)
treedc1638517eecf7f5c61b54ef905cfd522c97f05f /utils/tl
parent6f8656685a07adf9aa36c24d912b4ce8f6099b46 (diff)
Brought the order of operations in line with the VFP instructions in 5l for easier comparison.
Fixed encoding of MOVD and related operations so that their execution causes a trap to occur.
Diffstat (limited to 'utils/tl')
-rw-r--r--utils/tl/thumb.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/utils/tl/thumb.c b/utils/tl/thumb.c
index cb170c98..ff7818f5 100644
--- a/utils/tl/thumb.c
+++ b/utils/tl/thumb.c
@@ -1533,35 +1533,34 @@ thumbopfp(int a, int sc)
long o = 0;
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);
+ /* 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);
+ /* 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;
+ /* 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;
+ /* VCMP (ARMv7-M ARM, A7.7.223), encoding T1 */
+ case ACMPD:
+ case ACMPF: return o | (0x0a<<24) | (0x40<<16) | (0xee<<8) | 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;
- /* 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;
/* 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;
+ /* 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;
/* 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;
- /* VCMP (ARMv7-M ARM, A7.7.223), encoding T1 */
- case ACMPD:
- case ACMPF: return o | (0x0a<<24) | (0x40<<16) | (0xee<<8) | 0xb4;
- /* arguably, ACMPF should expand to RNDF, CMPD */
-
- /* VMOV (register) (ARMv7-M ARM, A7.7.237) */
- case AMOVF:
- case AMOVDF: return o | (0x0a<<24) | (0x40<<16) | (0xee<<8) | 0xb0;
- case AMOVD:
- case AMOVFD: return o | (0xe<<24) | (0x0<<20) | (1<<15) | (1<<8) | (1<<7);
-
- /* VMOV (ARMv7-M ARM, A7.7.240), encoding T1, op=0 */
- case AMOVWF: return o | (0x0a<<24) | (1<<20) | (0xee<<8) | (0<<4);
- case AMOVWD: return o | (0x0a<<24) | (1<<20) | (0xee<<8) | (1<<6) | (0<<4);
- /* VMOV (ARMv7-M ARM, A7.7.240), encoding T1, op=1 */
- case AMOVFW: return o | (0x0a<<24) | (1<<20) | (0xee<<8) | (1<<4);
- case AMOVDW: return o | (0x0a<<24) | (1<<20) | (0xee<<8) | (1<<6) | (1<<4);
}
diag("bad fp %d", a);
prasm(curp);