]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Support AArch64 ARMv8.3 LDAPR/LDAPRH/LDAPRB instructions
authorMark Wielaard <mark@klomp.org>
Fri, 17 Oct 2025 13:38:43 +0000 (15:38 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 17 Oct 2025 13:43:13 +0000 (15:43 +0200)
Implement them just like LDAR/LDARH/LDARB.

Patch by: Arne Juul <arnej@vespa.ai>
https://bugs.kde.org/show_bug.cgi?id=476465

NEWS
VEX/priv/guest_arm64_toIR.c

diff --git a/NEWS b/NEWS
index f6608c70fe7035286bbe441daf3f58a0b18ef14a..1306652087a4452ba2a0741e024d8fcae4a084aa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -93,6 +93,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
 369030  Wrap linux syscall: 171 (setdomainname)
 388526  Inconsistent severity in message text: "WARNING: Serious error"
 418756  MAP_FIXED_NOREPLACE mmap flag unsupported
+476465  AArch64 ARMv8.3 LDAPR/LDAPRH/LDAPRB instructions not supported
 493430  Review all syscalls that use or return (new) file descriptors
 493434  Add --track-fds=bad mode (no "leak" tracking)
 501741  syscall cachestat not wrapped
index f5b445489e29378cf0c635efa06b8abd5de3b6f8..abee07081511e34c50d4870d94a5a2691dfed342 100644 (file)
@@ -7053,14 +7053,20 @@ Bool dis_ARM64_load_store(/*MB_OUT*/DisResult* dres, UInt insn,
 
    /* ------------------ LDA{R,RH,RB} ------------------ */
    /* ------------------ STL{R,RH,RB} ------------------ */
+   /* ------------------ LDAP{R,RH,RB} ----------------- */
    /* 31 29     23  20      14    9 4
       sz 001000 110 11111 1 11111 n t   LDAR<sz> Rt, [Xn|SP]
       sz 001000 100 11111 1 11111 n t   STLR<sz> Rt, [Xn|SP]
+      sz 111000 101 11111 1 10000 n t   LDAPR<sz> Rt, [Xn|SP]
    */
-   if (INSN(29,23) == BITS7(0,0,1,0,0,0,1)
-       && INSN(21,10) == BITS12(0,1,1,1,1,1,1,1,1,1,1,1)) {
+   if ((INSN(29,23) == BITS7(0,0,1,0,0,0,1)
+        && INSN(21,10) == BITS12(0,1,1,1,1,1,1,1,1,1,1,1))
+       ||
+       (INSN(29,21) == BITS9(1,1,1,0,0,0,1,0,1)
+        && INSN(20,10) == BITS11(1,1,1,1,1,1,1,0,0,0,0)))
+   {
       UInt szBlg2 = INSN(31,30);
-      Bool isLD   = INSN(22,22) == 1;
+      Bool isLD   = INSN(23,21) != BITS3(1,0,0);
       UInt nn     = INSN(9,5);
       UInt tt     = INSN(4,0);