]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
PowerPC: Fix the L field for the sync and dcbf instructions.
authorCarl Love <cel@us.ibm.com>
Wed, 7 Sep 2022 16:59:03 +0000 (11:59 -0500)
committerCarl Love <cel@us.ibm.com>
Mon, 12 Sep 2022 21:15:15 +0000 (21:15 +0000)
The L field for the sync and dcbf instructions are three bits wide
starting with ISA 3.1.  The L field is two bits wide prior to ISA 3.1.

Patch based on patches from Shivaprasad Bhat <shivaprasadbhat@gmail.com>

NEWS
VEX/priv/guest_ppc_toIR.c

diff --git a/NEWS b/NEWS
index b3c3590b90044407f22fcc0b3fb36abe3c8f316d..a16cd82bd5f2dd91db3cef6b4e9232a78effa88a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -45,6 +45,8 @@ are not entered into bugzilla tend to get forgotten about or ignored.
 454040  s390x: False-positive memcheck:cond in memmem on arch13 systems 
 456171  [PATCH] FreeBSD: Don't record address errors when accessing the 'kern.ps_strings' sysctl struct
 n-i-bz  Implement vgdb invoker on FreeBSD
+458845  PowerPC: The L field for the dcbf and sync instruction should be
+        3 bits in ISA 3.1.
 
 To see details of a given bug, visit
   https://bugs.kde.org/show_bug.cgi?id=XXXXXX
index 5da4ce7fad489036d1ba63552a81143a1ba78a6e..41d7bf65c0701c0c6d3bf10e25f5243e8f12db77 100644 (file)
@@ -10821,7 +10821,8 @@ static Bool dis_memsync ( UInt prefix, UInt theInstr,
    /* X-Form, XL-Form */
    UChar opc1    = ifieldOPC(theInstr);
    UInt  b11to25 = IFIELD(theInstr, 11, 15);
-   UChar flag_L  = IFIELD(theInstr, 21, 2);   //ISA 3.0
+   /* The L-field is 2 bits in ISA 3.0 and earlier and 3 bits in ISA 3.1 */
+   UChar flag_L  = IFIELD(theInstr, 21, (allow_isa_3_1 ? 3 : 2));
    UInt  b11to20 = IFIELD(theInstr, 11, 10);
    UInt  M0      = IFIELD(theInstr, 11, 5);
    UChar rD_addr = ifieldRegDS(theInstr);
@@ -12143,7 +12144,8 @@ static Bool dis_cache_manage ( UInt prefix, UInt theInstr,
    /* X-Form */
    UChar opc1    = ifieldOPC(theInstr);
    UChar b21to25 = ifieldRegDS(theInstr);
-   UChar flag_L  = IFIELD(theInstr, 21, 2);
+   /* The L-field is 2 bits in ISA 3.0 and earlier and 3 bits in ISA 3.1 */
+   UChar flag_L  = IFIELD(theInstr, 21, (allow_isa_3_1 ? 3 : 2));
    UChar rA_addr = ifieldRegA(theInstr);
    UChar rB_addr = ifieldRegB(theInstr);
    UInt  opc2    = ifieldOPClo10(theInstr);