summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Boddie <david@boddie.org.uk>2023-09-12 00:57:43 +0200
committerDavid Boddie <david@boddie.org.uk>2023-11-16 16:44:28 +0100
commit3cbc2622cf597a1d066793a87b7a6a22a2da4294 (patch)
tree7229dbf1e992ccc05555b769fcda459e7d689350
parent672743883393cfd5bdccf82cc8f5d83c0870cc16 (diff)
Adjusted transfers between doubles and register pairs.
-rw-r--r--utils/tl/thumb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/tl/thumb.c b/utils/tl/thumb.c
index 98db008e..0143d7d0 100644
--- a/utils/tl/thumb.c
+++ b/utils/tl/thumb.c
@@ -1357,7 +1357,7 @@ if(debug['G']) print("%ulx: %s: thumb\n", (ulong)(p->pc), p->from.sym->name);
SPLIT_INS(o3, o4);
break;
- case 58: /* floating point fix and float */
+ case 58: /* floating point fix and float (MOVDW/MOVWD) */
o1 = thumbopfp(p->as, p->scond);
rf = p->from.reg;
rt = p->to.reg;
@@ -1365,10 +1365,11 @@ if(debug['G']) print("%ulx: %s: thumb\n", (ulong)(p->pc), p->from.sym->name);
rt = 0;
diag("to.type==D_NONE (asm/fp)");
}
+ // ### Check that this use of register pairs is valid.
if(p->from.type == D_REG)
- o1 |= (rf<<28) | ((rt & 1)<<23) | ((rt & 0x1e)>>1);
+ o1 |= ((rt & 0x0f)<<16) | ((rf & 0x0f)<<28) | ((rf+1) & 0x0f);
else
- o1 |= (rt<<28) | ((rf & 1)<<23) | ((rf & 0x1e)>>1);
+ o1 |= ((rf & 0x0f)<<16) | ((rt & 0x0f)<<28) | ((rt+1) & 0x0f);
SPLIT_INS(o1, o2);
break;