|
Mark Wielaard |
edad3a |
commit 8f36c464966045b51a75144ca4c65f354082194f
|
|
Mark Wielaard |
edad3a |
Author: mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9>
|
|
Mark Wielaard |
edad3a |
Date: Tue Mar 15 15:08:01 2016 +0000
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
Bug #360425 - arm64 unsupported instruction ldpsw tests.
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
Add tests for ldpsw implementation VEX svn r3212.
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15830 a5019735-40e9-0310-863c-91ae7b9d1cf9
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
diff --git a/none/tests/arm64/memory.c b/none/tests/arm64/memory.c
|
|
Mark Wielaard |
edad3a |
index cbf31fd..91949ac 100644
|
|
Mark Wielaard |
edad3a |
--- a/none/tests/arm64/memory.c
|
|
Mark Wielaard |
edad3a |
+++ b/none/tests/arm64/memory.c
|
|
Mark Wielaard |
edad3a |
@@ -280,6 +280,18 @@ TESTINST2_hide2("ldarb w21, [x22]", AREA_MID, x21,x22,0);
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
////////////////////////////////////////////////////////////////
|
|
Mark Wielaard |
edad3a |
printf("STL{R,RH,RB} (entirely MISSING)\n");
|
|
Mark Wielaard |
edad3a |
+
|
|
Mark Wielaard |
edad3a |
+////////////////////////////////////////////////////////////////
|
|
Mark Wielaard |
edad3a |
+// TESTINST2_hide2 allows use of x28 as scratch
|
|
Mark Wielaard |
edad3a |
+printf("LDPSW (immediate, simm7)\n");
|
|
Mark Wielaard |
edad3a |
+
|
|
Mark Wielaard |
d387a3 |
+TESTINST2_hide2("ldpsw x21, x28, [x22], #-24 ; add x21,x21,x28", AREA_MID, x21,x22,0);
|
|
Mark Wielaard |
d387a3 |
+TESTINST2_hide2("ldpsw x21, x28, [x22], #-24 ; eor x21,x21,x28", AREA_MID, x21,x22,0);
|
|
Mark Wielaard |
d387a3 |
+TESTINST2_hide2("ldpsw x21, x28, [x22, #-40]! ; add x21,x21,x28", AREA_MID, x21,x22,0);
|
|
Mark Wielaard |
d387a3 |
+TESTINST2_hide2("ldpsw x21, x28, [x22, #-40]! ; eor x21,x21,x28", AREA_MID, x21,x22,0);
|
|
Mark Wielaard |
d387a3 |
+TESTINST2_hide2("ldpsw x21, x28, [x22, #-40] ; add x21,x21,x28", AREA_MID, x21,x22,0);
|
|
Mark Wielaard |
d387a3 |
+TESTINST2_hide2("ldpsw x21, x28, [x22, #-40] ; eor x21,x21,x28", AREA_MID, x21,x22,0);
|
|
Mark Wielaard |
d387a3 |
+
|
|
Mark Wielaard |
edad3a |
} /* end of test_memory_old() */
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
@@ -1608,6 +1620,12 @@ MEM_TEST("prfm pstl2strm, [x5,w6,uxtw #3]", 12, 4);
|
|
Mark Wielaard |
edad3a |
MEM_TEST("prfm pstl3keep, [x5,w6,sxtw #0]", 12, 4);
|
|
Mark Wielaard |
edad3a |
MEM_TEST("prfm pstl3strm, [x5,w6,sxtw #3]", 12, -4);
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
+////////////////////////////////////////////////////////////////
|
|
Mark Wielaard |
edad3a |
+printf("LDPSW (immediate, simm7)\n");
|
|
Mark Wielaard |
d387a3 |
+MEM_TEST("ldpsw x13, x23, [x5], #-24", 0, 0);
|
|
Mark Wielaard |
d387a3 |
+MEM_TEST("ldpsw x13, x23, [x5, #-40]!", 0, 0);
|
|
Mark Wielaard |
d387a3 |
+MEM_TEST("ldpsw x13, x23, [x5, #-40]", 0, 0);
|
|
Mark Wielaard |
edad3a |
+
|
|
Mark Wielaard |
edad3a |
} /* end of test_memory2() */
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
////////////////////////////////////////////////////////////////
|
|
Mark Wielaard |
edad3a |
diff --git a/none/tests/arm64/memory.stdout.exp b/none/tests/arm64/memory.stdout.exp
|
|
Mark Wielaard |
edad3a |
index eb6ec3f..be57108 100644
|
|
Mark Wielaard |
edad3a |
--- a/none/tests/arm64/memory.stdout.exp
|
|
Mark Wielaard |
edad3a |
+++ b/none/tests/arm64/memory.stdout.exp
|
|
Mark Wielaard |
edad3a |
@@ -98,6 +98,13 @@ ldar w21, [x22] :: rd 00000000f3f2f1f0 rn (hidden), cin 0, nzcv 00000000
|
|
Mark Wielaard |
edad3a |
ldarh w21, [x22] :: rd 000000000000f1f0 rn (hidden), cin 0, nzcv 00000000
|
|
Mark Wielaard |
edad3a |
ldarb w21, [x22] :: rd 00000000000000f0 rn (hidden), cin 0, nzcv 00000000
|
|
Mark Wielaard |
edad3a |
STL{R,RH,RB} (entirely MISSING)
|
|
Mark Wielaard |
edad3a |
+LDPSW (immediate, simm7)
|
|
Mark Wielaard |
d387a3 |
+ldpsw x21, x28, [x22], #-24 ; add x21,x21,x28 :: rd ffffffffebe9e7e4 rn (hidden), cin 0, nzcv 00000000
|
|
Mark Wielaard |
d387a3 |
+ldpsw x21, x28, [x22], #-24 ; eor x21,x21,x28 :: rd 0000000004040404 rn (hidden), cin 0, nzcv 00000000
|
|
Mark Wielaard |
d387a3 |
+ldpsw x21, x28, [x22, #-40]! ; add x21,x21,x28 :: rd ffffffff9b999794 rn (hidden), cin 0, nzcv 00000000
|
|
Mark Wielaard |
d387a3 |
+ldpsw x21, x28, [x22, #-40]! ; eor x21,x21,x28 :: rd 0000000004040404 rn (hidden), cin 0, nzcv 00000000
|
|
Mark Wielaard |
d387a3 |
+ldpsw x21, x28, [x22, #-40] ; add x21,x21,x28 :: rd ffffffff9b999794 rn (hidden), cin 0, nzcv 00000000
|
|
Mark Wielaard |
d387a3 |
+ldpsw x21, x28, [x22, #-40] ; eor x21,x21,x28 :: rd 0000000004040404 rn (hidden), cin 0, nzcv 00000000
|
|
Mark Wielaard |
edad3a |
LDR,STR (immediate, uimm12)ldr x13, [x5, #24] with x5 = middle_of_block+-1, x6=0
|
|
Mark Wielaard |
edad3a |
[ 0] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
edad3a |
[ 16] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
edad3a |
@@ -26258,3 +26265,94 @@ prfm pstl3strm, [x5,w6,sxtw #3] with x5 = middle_of_block+12, x6=-4
|
|
Mark Wielaard |
d387a3 |
0 x5 (sub, base reg)
|
|
Mark Wielaard |
d387a3 |
0 x6 (sub, index reg)
|
|
Mark Wielaard |
d387a3 |
|
|
Mark Wielaard |
edad3a |
+LDPSW (immediate, simm7)
|
|
Mark Wielaard |
d387a3 |
+ldpsw x13, x23, [x5], #-24 with x5 = middle_of_block+0, x6=0
|
|
Mark Wielaard |
d387a3 |
+ [ 0] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 16] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 32] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 48] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 64] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 80] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 96] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [112] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [128] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [144] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [160] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [176] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [192] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [208] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [224] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [240] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
edad3a |
+ 5430cb99daf026bb x13 (xor, xfer intreg #1)
|
|
Mark Wielaard |
edad3a |
+ 58eb9b702726900d x23 (xor, xfer intreg #2)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v17.d[0] (xor, xfer vecreg #1)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v17.d[1] (xor, xfer vecreg #1)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v18.d[0] (xor, xfer vecreg #2)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v18.d[1] (xor, xfer vecreg #2)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v19.d[0] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v19.d[1] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v20.d[0] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v20.d[1] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ -24 x5 (sub, base reg)
|
|
Mark Wielaard |
d387a3 |
+ 0 x6 (sub, index reg)
|
|
Mark Wielaard |
d387a3 |
+
|
|
Mark Wielaard |
d387a3 |
+ldpsw x13, x23, [x5, #-40]! with x5 = middle_of_block+0, x6=0
|
|
Mark Wielaard |
d387a3 |
+ [ 0] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 16] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 32] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 48] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 64] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 80] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 96] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [112] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [128] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [144] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [160] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [176] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [192] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [208] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [224] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [240] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
edad3a |
+ 7f799c624bfa7f08 x13 (xor, xfer intreg #1)
|
|
Mark Wielaard |
edad3a |
+ 3e7857cc51fd19f0 x23 (xor, xfer intreg #2)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v17.d[0] (xor, xfer vecreg #1)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v17.d[1] (xor, xfer vecreg #1)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v18.d[0] (xor, xfer vecreg #2)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v18.d[1] (xor, xfer vecreg #2)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v19.d[0] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v19.d[1] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v20.d[0] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v20.d[1] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ -40 x5 (sub, base reg)
|
|
Mark Wielaard |
d387a3 |
+ 0 x6 (sub, index reg)
|
|
Mark Wielaard |
d387a3 |
+
|
|
Mark Wielaard |
d387a3 |
+ldpsw x13, x23, [x5, #-40] with x5 = middle_of_block+0, x6=0
|
|
Mark Wielaard |
d387a3 |
+ [ 0] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 16] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 32] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 48] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 64] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 80] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [ 96] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [112] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [128] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [144] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [160] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [176] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [192] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [208] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [224] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
d387a3 |
+ [240] .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
|
|
Mark Wielaard |
edad3a |
+ 01ba3febe99768c0 x13 (xor, xfer intreg #1)
|
|
Mark Wielaard |
edad3a |
+ 1cef424f7c21ff9b x23 (xor, xfer intreg #2)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v17.d[0] (xor, xfer vecreg #1)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v17.d[1] (xor, xfer vecreg #1)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v18.d[0] (xor, xfer vecreg #2)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v18.d[1] (xor, xfer vecreg #2)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v19.d[0] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v19.d[1] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v20.d[0] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ 0000000000000000 v20.d[1] (xor, xfer vecreg #3)
|
|
Mark Wielaard |
d387a3 |
+ 0 x5 (sub, base reg)
|
|
Mark Wielaard |
d387a3 |
+ 0 x6 (sub, index reg)
|
|
Mark Wielaard |
d387a3 |
+
|
|
Mark Wielaard |
edad3a |
commit c10b13cb0ec8b797124d8379b7f932f92341bd4b
|
|
Mark Wielaard |
edad3a |
Author: sewardj <sewardj@8f6e269a-dfd6-0310-a8e1-e2731360e62c>
|
|
Mark Wielaard |
edad3a |
Date: Tue Mar 15 14:24:56 2016 +0000
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
arm64: implement LDPSW. Fixes #360425. Initial patch+investigation by Mark Wielaard.
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
git-svn-id: svn://svn.valgrind.org/vex/trunk@3212 8f6e269a-dfd6-0310-a8e1-e2731360e62c
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
diff --git a/VEX/priv/guest_arm64_toIR.c b/VEX/priv/guest_arm64_toIR.c
|
|
Mark Wielaard |
edad3a |
index 8da9780..d4fe1b8 100644
|
|
Mark Wielaard |
edad3a |
--- a/VEX/priv/guest_arm64_toIR.c
|
|
Mark Wielaard |
edad3a |
+++ b/VEX/priv/guest_arm64_toIR.c
|
|
Mark Wielaard |
edad3a |
@@ -4804,7 +4804,6 @@ Bool dis_ARM64_load_store(/*MB_OUT*/DisResult* dres, UInt insn)
|
|
Mark Wielaard |
edad3a |
(at-EA)
|
|
Mark Wielaard |
edad3a |
x0 101 0010 L imm7 Rt2 Rn Rt1 mmP Rt1,Rt2, [Xn|SP, #imm]
|
|
Mark Wielaard |
edad3a |
*/
|
|
Mark Wielaard |
edad3a |
-
|
|
Mark Wielaard |
d387a3 |
UInt insn_30_23 = INSN(30,23);
|
|
Mark Wielaard |
d387a3 |
if (insn_30_23 == BITS8(0,1,0,1,0,0,0,1)
|
|
Mark Wielaard |
d387a3 |
|| insn_30_23 == BITS8(0,1,0,1,0,0,1,1)
|
|
Mark Wielaard |
edad3a |
@@ -4912,6 +4911,87 @@ Bool dis_ARM64_load_store(/*MB_OUT*/DisResult* dres, UInt insn)
|
|
Mark Wielaard |
d387a3 |
}
|
|
Mark Wielaard |
edad3a |
}
|
|
Mark Wielaard |
edad3a |
|
|
Mark Wielaard |
edad3a |
+ /* -------- LDPSW (immediate, simm7) (INT REGS) -------- */
|
|
Mark Wielaard |
edad3a |
+ /* Does 32 bit transfers which are sign extended to 64 bits.
|
|
Mark Wielaard |
edad3a |
+ simm7 is scaled by the (single-register) transfer size
|
|
Mark Wielaard |
edad3a |
+
|
|
Mark Wielaard |
edad3a |
+ (at-Rn-then-Rn=EA)
|
|
Mark Wielaard |
edad3a |
+ 01 101 0001 1 imm7 Rt2 Rn Rt1 LDPSW Rt1,Rt2, [Xn|SP], #imm
|
|
Mark Wielaard |
edad3a |
+
|
|
Mark Wielaard |
edad3a |
+ (at-EA-then-Rn=EA)
|
|
Mark Wielaard |
edad3a |
+ 01 101 0011 1 imm7 Rt2 Rn Rt1 LDPSW Rt1,Rt2, [Xn|SP, #imm]!
|
|
Mark Wielaard |
edad3a |
+
|
|
Mark Wielaard |
edad3a |
+ (at-EA)
|
|
Mark Wielaard |
edad3a |
+ 01 101 0010 1 imm7 Rt2 Rn Rt1 LDPSW Rt1,Rt2, [Xn|SP, #imm]
|
|
Mark Wielaard |
edad3a |
+ */
|
|
Mark Wielaard |
edad3a |
+ UInt insn_31_22 = INSN(31,22);
|
|
Mark Wielaard |
edad3a |
+ if (insn_31_22 == BITS10(0,1,1,0,1,0,0,0,1,1)
|
|
Mark Wielaard |
edad3a |
+ || insn_31_22 == BITS10(0,1,1,0,1,0,0,1,1,1)
|
|
Mark Wielaard |
edad3a |
+ || insn_31_22 == BITS10(0,1,1,0,1,0,0,1,0,1)) {
|
|
Mark Wielaard |
edad3a |
+ UInt bWBack = INSN(23,23);
|
|
Mark Wielaard |
edad3a |
+ UInt rT1 = INSN(4,0);
|
|
Mark Wielaard |
edad3a |
+ UInt rN = INSN(9,5);
|
|
Mark Wielaard |
edad3a |
+ UInt rT2 = INSN(14,10);
|
|
Mark Wielaard |
edad3a |
+ Long simm7 = (Long)sx_to_64(INSN(21,15), 7);
|
|
Mark Wielaard |
edad3a |
+ if ((bWBack && (rT1 == rN || rT2 == rN) && rN != 31)
|
|
Mark Wielaard |
edad3a |
+ || (rT1 == rT2)) {
|
|
Mark Wielaard |
edad3a |
+ /* undecodable; fall through */
|
|
Mark Wielaard |
edad3a |
+ } else {
|
|
Mark Wielaard |
edad3a |
+ if (rN == 31) { /* FIXME generate stack alignment check */ }
|
|
Mark Wielaard |
edad3a |
+
|
|
Mark Wielaard |
edad3a |
+ // Compute the transfer address TA and the writeback address WA.
|
|
Mark Wielaard |
edad3a |
+ IRTemp tRN = newTemp(Ity_I64);
|
|
Mark Wielaard |
edad3a |
+ assign(tRN, getIReg64orSP(rN));
|
|
Mark Wielaard |
edad3a |
+ IRTemp tEA = newTemp(Ity_I64);
|
|
Mark Wielaard |
edad3a |
+ simm7 = 4 * simm7;
|
|
Mark Wielaard |
edad3a |
+ assign(tEA, binop(Iop_Add64, mkexpr(tRN), mkU64(simm7)));
|
|
Mark Wielaard |
edad3a |
+
|
|
Mark Wielaard |
edad3a |
+ IRTemp tTA = newTemp(Ity_I64);
|
|
Mark Wielaard |
edad3a |
+ IRTemp tWA = newTemp(Ity_I64);
|
|
Mark Wielaard |
edad3a |
+ switch (INSN(24,23)) {
|
|
Mark Wielaard |
edad3a |
+ case BITS2(0,1):
|
|
Mark Wielaard |
edad3a |
+ assign(tTA, mkexpr(tRN)); assign(tWA, mkexpr(tEA)); break;
|
|
Mark Wielaard |
edad3a |
+ case BITS2(1,1):
|
|
Mark Wielaard |
edad3a |
+ assign(tTA, mkexpr(tEA)); assign(tWA, mkexpr(tEA)); break;
|
|
Mark Wielaard |
edad3a |
+ case BITS2(1,0):
|
|
Mark Wielaard |
edad3a |
+ assign(tTA, mkexpr(tEA)); /* tWA is unused */ break;
|
|
Mark Wielaard |
edad3a |
+ default:
|
|
Mark Wielaard |
edad3a |
+ vassert(0); /* NOTREACHED */
|
|
Mark Wielaard |
edad3a |
+ }
|
|
Mark Wielaard |
edad3a |
+
|
|
Mark Wielaard |
edad3a |
+ // 32 bit load, sign extended to 64 bits
|
|
Mark Wielaard |
edad3a |
+ putIReg64orZR(rT1, unop(Iop_32Sto64,
|
|
Mark Wielaard |
edad3a |
+ loadLE(Ity_I32, binop(Iop_Add64,
|
|
Mark Wielaard |
edad3a |
+ mkexpr(tTA),
|
|
Mark Wielaard |
edad3a |
+ mkU64(0)))));
|
|
Mark Wielaard |
edad3a |
+ putIReg64orZR(rT2, unop(Iop_32Sto64,
|
|
Mark Wielaard |
edad3a |
+ loadLE(Ity_I32, binop(Iop_Add64,
|
|
Mark Wielaard |
edad3a |
+ mkexpr(tTA),
|
|
Mark Wielaard |
edad3a |
+ mkU64(4)))));
|
|
Mark Wielaard |
edad3a |
+ if (bWBack)
|
|
Mark Wielaard |
edad3a |
+ putIReg64orSP(rN, mkexpr(tEA));
|
|
Mark Wielaard |
edad3a |
+
|
|
Mark Wielaard |
edad3a |
+ const HChar* fmt_str = NULL;
|
|
Mark Wielaard |
edad3a |
+ switch (INSN(24,23)) {
|
|
Mark Wielaard |
edad3a |
+ case BITS2(0,1):
|
|
Mark Wielaard |
edad3a |
+ fmt_str = "ldpsw %s, %s, [%s], #%lld (at-Rn-then-Rn=EA)\n";
|
|
Mark Wielaard |
edad3a |
+ break;
|
|
Mark Wielaard |
edad3a |
+ case BITS2(1,1):
|
|
Mark Wielaard |
edad3a |
+ fmt_str = "ldpsw %s, %s, [%s, #%lld]! (at-EA-then-Rn=EA)\n";
|
|
Mark Wielaard |
edad3a |
+ break;
|
|
Mark Wielaard |
edad3a |
+ case BITS2(1,0):
|
|
Mark Wielaard |
edad3a |
+ fmt_str = "ldpsw %s, %s, [%s, #%lld] (at-Rn)\n";
|
|
Mark Wielaard |
edad3a |
+ break;
|
|
Mark Wielaard |
edad3a |
+ default:
|
|
Mark Wielaard |
edad3a |
+ vassert(0);
|
|
Mark Wielaard |
edad3a |
+ }
|
|
Mark Wielaard |
edad3a |
+ DIP(fmt_str, nameIReg64orZR(rT1),
|
|
Mark Wielaard |
edad3a |
+ nameIReg64orZR(rT2),
|
|
Mark Wielaard |
edad3a |
+ nameIReg64orSP(rN), simm7);
|
|
Mark Wielaard |
edad3a |
+ return True;
|
|
Mark Wielaard |
edad3a |
+ }
|
|
Mark Wielaard |
edad3a |
+ }
|
|
Mark Wielaard |
edad3a |
+
|
|
Mark Wielaard |
edad3a |
/* ---------------- LDR (literal, int reg) ---------------- */
|
|
Mark Wielaard |
edad3a |
/* 31 29 23 4
|
|
Mark Wielaard |
edad3a |
00 011 000 imm19 Rt LDR Wt, [PC + sxTo64(imm19 << 2)]
|