This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: PR libc/12872: Wrong alignment of La_x86_64_vector
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 14 Jul 2011 21:55:55 -0700
- Subject: Re: PATCH: PR libc/12872: Wrong alignment of La_x86_64_vector
- References: <20110610160440.GA5500@intel.com>
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
On Fri, Jun 10, 2011 at 09:04:40AM -0700, H.J. Lu wrote:
> Hi,
>
> We need to align La_x86_64_vector to 32byte. Otherwise, any access
> to ymm field may cause unaligned access. This patch aligns
> La_x86_64_vector to 32byte. It won't change layout of La_x86_64_regs.
> But it will change layout of La_x86_64_retval.
>
According to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49699
the aligned attribute cannot be reliably used to decrease alignment.
This aligns La_x86_64_ymm to 16byte instead
H.J.
----
2011-07-14 H.J. Lu <hongjiu.lu@intel.com>
PR libc/12872
* sysdeps/x86_64/bits/link.h (La_x86_64_ymm): Aligned to 16byte.
diff --git a/sysdeps/x86_64/bits/link.h b/sysdeps/x86_64/bits/link.h
index a9cc8e0..60da8d4 100644
--- a/sysdeps/x86_64/bits/link.h
+++ b/sysdeps/x86_64/bits/link.h
@@ -65,7 +65,7 @@ __END_DECLS
/* Registers for entry into PLT on x86-64. */
# if __GNUC_PREREQ (4,0)
typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16)));
-typedef float La_x86_64_ymm __attribute__ ((__vector_size__ (32)));
+typedef float La_x86_64_ymm __attribute__ ((__vector_size__ (32), aligned(16)));
# else
typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__)));
# endif