Mark Wielaard ce75de
commit 321771ee63740333ad355244e0764295218843b8
Mark Wielaard ce75de
Author: Mark Wielaard <mark@klomp.org>
Mark Wielaard ce75de
Date:   Sun Dec 9 14:26:39 2018 +0100
Mark Wielaard ce75de
Mark Wielaard ce75de
    memcheck: Allow unaligned loads of 128bit vectors on ppc64[le].
Mark Wielaard ce75de
    
Mark Wielaard ce75de
    On powerpc partial unaligned loads of vectors from partially invalid
Mark Wielaard ce75de
    addresses are OK and could be generated by our translation of lxvd2x.
Mark Wielaard ce75de
    
Mark Wielaard ce75de
    Adjust partial_load memcheck tests to allow partial loads of 16 byte
Mark Wielaard ce75de
    vectors on powerpc64.
Mark Wielaard ce75de
    
Mark Wielaard ce75de
    Part of resolving bug #386945.
Mark Wielaard ce75de
Mark Wielaard ce75de
diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c
Mark Wielaard ce75de
index 737f79d..101916b 100644
Mark Wielaard ce75de
--- a/memcheck/mc_main.c
Mark Wielaard ce75de
+++ b/memcheck/mc_main.c
Mark Wielaard ce75de
@@ -1354,6 +1354,9 @@ void mc_LOADV_128_or_256_slow ( /*OUT*/ULong* res,
Mark Wielaard ce75de
    tl_assert(szB == 16); // s390 doesn't have > 128 bit SIMD
Mark Wielaard ce75de
    /* OK if all loaded bytes are from the same page. */
Mark Wielaard ce75de
    Bool alignedOK = ((a & 0xfff) <= 0x1000 - szB);
Mark Wielaard ce75de
+#  elif defined(VGA_ppc64be) || defined(VGA_ppc64le)
Mark Wielaard ce75de
+   /* lxvd2x might generate an unaligned 128 bit vector load.  */
Mark Wielaard ce75de
+   Bool alignedOK = (szB == 16);
Mark Wielaard ce75de
 #  else
Mark Wielaard ce75de
    /* OK if the address is aligned by the load size. */
Mark Wielaard ce75de
    Bool alignedOK = (0 == (a & (szB - 1)));