Blame SOURCES/valgrind-3.14.0-get_otrack_shadow_offset_wrk-ppc.patch

cb589a
commit 7f1dd9d5aec1f1fd4eb0ae3a311358a914f1d73f
cb589a
Author: Julian Seward <jseward@acm.org>
cb589a
Date:   Tue Nov 20 10:18:29 2018 +0100
cb589a
cb589a
    get_otrack_shadow_offset_wrk for ppc32 and ppc64: add missing cases for XER_OV32, XER_CA32 and C_FPCC.
cb589a
    
cb589a
    The missing cases were discovered whilst testing fixes for bug 386945, but are
cb589a
    otherwise unrelated to that bug.
cb589a
cb589a
diff --git a/memcheck/mc_machine.c b/memcheck/mc_machine.c
cb589a
index 5ed101f..4ce746e 100644
cb589a
--- a/memcheck/mc_machine.c
cb589a
+++ b/memcheck/mc_machine.c
cb589a
@@ -120,11 +120,11 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
cb589a
    Int  o    = offset;
cb589a
    tl_assert(sz > 0);
cb589a
 
cb589a
-#if defined(VGA_ppc64be)
cb589a
+#  if defined(VGA_ppc64be)
cb589a
    tl_assert(host_is_big_endian());
cb589a
-#elif defined(VGA_ppc64le)
cb589a
+#  elif defined(VGA_ppc64le)
cb589a
    tl_assert(host_is_little_endian());
cb589a
-#endif
cb589a
+#  endif
cb589a
 
cb589a
    if (sz == 8 || sz == 4) {
cb589a
       /* The point of this is to achieve
cb589a
@@ -132,11 +132,11 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
cb589a
             return GOF(GPRn);
cb589a
          by testing ox instead of o, and setting ox back 4 bytes when sz == 4.
cb589a
       */
cb589a
-#if defined(VGA_ppc64le)
cb589a
+#     if defined(VGA_ppc64le)
cb589a
       Int ox = o;
cb589a
-#else
cb589a
+#     else
cb589a
       Int ox = sz == 8 ? o : (o - 4);
cb589a
-#endif
cb589a
+#     endif
cb589a
       if (ox == GOF(GPR0)) return ox;
cb589a
       if (ox == GOF(GPR1)) return ox;
cb589a
       if (ox == GOF(GPR2)) return ox;
cb589a
@@ -240,11 +240,13 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
cb589a
    if (o == GOF(VSR31) && sz == 8) return o;
cb589a
 
cb589a
    /* For the various byte sized XER/CR pieces, use offset 8
cb589a
-      in VSR0 .. VSR19. */
cb589a
+      in VSR0 .. VSR21. */
cb589a
    tl_assert(SZB(VSR0) == 16);
cb589a
    if (o == GOF(XER_SO) && sz == 1) return 8 +GOF(VSR0);
cb589a
    if (o == GOF(XER_OV) && sz == 1) return 8 +GOF(VSR1);
cb589a
+   if (o == GOF(XER_OV32) && sz == 1) return 8 +GOF(VSR20);
cb589a
    if (o == GOF(XER_CA) && sz == 1) return 8 +GOF(VSR2);
cb589a
+   if (o == GOF(XER_CA32) && sz == 1) return 8 +GOF(VSR21);
cb589a
    if (o == GOF(XER_BC) && sz == 1) return 8 +GOF(VSR3);
cb589a
 
cb589a
    if (o == GOF(CR0_321) && sz == 1) return 8 +GOF(VSR4);
cb589a
@@ -388,6 +390,7 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
cb589a
    if (o == GOF(IP_AT_SYSCALL) && sz == 4) return -1; /* slot unused */
cb589a
    if (o == GOF(FPROUND)   && sz == 1) return -1;
cb589a
    if (o == GOF(DFPROUND)  && sz == 1) return -1;
cb589a
+   if (o == GOF(C_FPCC)    && sz == 1) return -1;
cb589a
    if (o == GOF(VRSAVE)    && sz == 4) return -1;
cb589a
    if (o == GOF(EMNOTE)    && sz == 4) return -1;
cb589a
    if (o == GOF(CMSTART)   && sz == 4) return -1;
cb589a
@@ -440,11 +443,13 @@ static Int get_otrack_shadow_offset_wrk ( Int offset, Int szB )
cb589a
    if (o == GOF(VSR31) && sz == 8) return o;
cb589a
 
cb589a
    /* For the various byte sized XER/CR pieces, use offset 8
cb589a
-      in VSR0 .. VSR19. */
cb589a
+      in VSR0 .. VSR21. */
cb589a
    tl_assert(SZB(VSR0) == 16);
cb589a
    if (o == GOF(XER_SO) && sz == 1) return 8 +GOF(VSR0);
cb589a
    if (o == GOF(XER_OV) && sz == 1) return 8 +GOF(VSR1);
cb589a
+   if (o == GOF(XER_OV32) && sz == 1) return 8 +GOF(VSR20);
cb589a
    if (o == GOF(XER_CA) && sz == 1) return 8 +GOF(VSR2);
cb589a
+   if (o == GOF(XER_CA32) && sz == 1) return 8 +GOF(VSR21);
cb589a
    if (o == GOF(XER_BC) && sz == 1) return 8 +GOF(VSR3);
cb589a
 
cb589a
    if (o == GOF(CR0_321) && sz == 1) return 8 +GOF(VSR4);