http://llvm.org/bugs/show_bug.cgi?id=15434
Bug ID: 15434
Summary: Alignment of float arrays in pentium3 mode
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Consider the following snippet:
#include <xmmintrin.h>
#include <stdio.h>
void f() {
UNALIGN_TYPE unalign;
float step[32];
printf("%lld\n", (long long)(&step[0]) % 16);
__m128 result[8];
_mm_store_ps(&step[0], result[0]);
}
int main() {
f();
}
$ g++ -DUNALIGN_TYPE=float t.cc -o t -m32 -march=pentium3 -O0 && ./t &&
~/build/llvm-opt/bin/clang++ -DUNALIGN_TYPE=float t.cc -o t -m32
-march=pentium3 -O0 && ./t
0
12
Segmentation fault (core dumped)
$ g++ -DUNALIGN_TYPE=double t.cc -o t -m32 -march=pentium3 -O0 && ./t &&
~/build/llvm-opt/bin/clang++ -DUNALIGN_TYPE=double t.cc -o t -m32
-march=pentium3 -O0 && ./t
0
8
Segmentation fault (core dumped)
GCC seems to 16-byte align the float arrays. Chandler mentioned that this thus
is part of the implicit ABI.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs