PATCH: PR libc/12872: Wrong alignment of La_x86_64_vector
H.J. Lu
hongjiu.lu@intel.com
Fri Jul 15 13:52:00 GMT 2011
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
More information about the Libc-alpha
mailing list