|
From: <sv...@va...> - 2011-04-27 23:25:22
|
Author: sewardj
Date: 2011-04-28 00:25:15 +0100 (Thu, 28 Apr 2011)
New Revision: 11715
Log:
Change the default (minimum) client malloc alignment from 8 to 16
on ppc32-linux. This is needed to make Altivec-using code work
correctly. Noticed when running ./auxprogs/gsl16test with gcc-4.6
with args -mcpu=970 -g -O3 -ftree-vectorize on Memcheck, in
which case a few of the tests failed because malloc() returns
8 byte aligned memory when it should return 16-aligned memory.
Modified:
trunk/coregrind/pub_core_mallocfree.h
Modified: trunk/coregrind/pub_core_mallocfree.h
===================================================================
--- trunk/coregrind/pub_core_mallocfree.h 2011-04-27 19:04:31 UTC (rev 11714)
+++ trunk/coregrind/pub_core_mallocfree.h 2011-04-27 23:25:15 UTC (rev 11715)
@@ -70,12 +70,14 @@
// minimum alignment. Must be a power of 2 greater than 4, and should be
// greater than 8.
#if defined(VGP_x86_linux) || \
- defined(VGP_ppc32_linux) || \
defined(VGP_arm_linux)
# define VG_MIN_MALLOC_SZB 8
// Nb: We always use 16 bytes for Darwin, even on 32-bits, so it can be used
// for any AltiVec- or SSE-related type. This matches the Darwin libc.
+// Also, use 16 bytes for any PPC variant, since 16 is required to make
+// Altiveccery work right.
#elif defined(VGP_amd64_linux) || \
+ defined(VGP_ppc32_linux) || \
defined(VGP_ppc64_linux) || \
defined(VGP_s390x_linux) || \
defined(VGP_ppc64_aix5) || \
|