This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PPC32 Linuxthreads Chance MALLOC_ALIGNMENT for VMX

The Altivec/VMX instructions require 16-byte alignment. So we need to change the default alignment for malloc/calloc/realloc to avoid SIGILL when uses malloc for vector types.

Any problems with this change?

2004-03-11  Steven Munroe  <>

	* sysdeps/unix/sysv/linux/powerpc/powerpc32/malloc-machine.h: New file.
	Define MALLOC_ALIGNMENT as 16 for VMX.

diff -urN libc23-cvstip-20040301/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/malloc-machine.h libc23/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/malloc-machine.h
--- libc23-cvstip-20040301/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/malloc-machine.h	Wed Dec 31 18:00:00 1969
+++ libc23/linuxthreads/sysdeps/unix/sysv/linux/powerpc/powerpc32/malloc-machine.h	Thu Mar 11 08:51:25 2004
@@ -0,0 +1,29 @@
+/* Basic platform-independent macro definitions for mutexes,
+   thread-specific data and parameters for malloc.
+   Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   Lesser General Public License for more details.
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+/* Altivec/VMX support requires 16 byte alignment to avoid alignment exceptions */
+#include <linuxthreads/sysdeps/pthread/malloc-machine.h>
+#endif /* !defined(_POWERPC32_MALLOC_MACHINE_H) */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]