This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/53907] New: gcc uses unaligned load when aligned load was requested
- From: "neleai at seznam dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 09 Jul 2012 23:09:47 +0000
- Subject: [Bug target/53907] New: gcc uses unaligned load when aligned load was requested
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53907
Bug #: 53907
Summary: gcc uses unaligned load when aligned load was
requested
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: neleai@seznam.cz
A gcc 4.7 and 4.8 emit movdqu instead movdqa for aligned load instrinc.
#include <emmintrin.h>
__m128i x(char *s){
__m128i sz,z,mvec;
s-=((unsigned long) s)%16;
sz=_mm_load_si128(s);
return sz;
}
Output of gcc -O3 -S follows
.file "int.c"
.text
.p2align 4,,15
.globl x
.type x, @function
x:
.LFB517:
.cfi_startproc
movq %rdi, %rax
andl $15, %eax
negq %rax
movdqu (%rdi,%rax), %xmm0
ret
.cfi_endproc
.LFE517:
.size x, .-x
.ident "GCC: (Debian 20120704-1) 4.8.0 20120704 (experimental) [trunk
revision 189247]"
.section .note.GNU-stack,"",@progbits