aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/CellSPU
diff options
context:
space:
mode:
authorKalle Raiskila <kalle.raiskila@nokia.com>2010-10-26 10:45:47 +0000
committerKalle Raiskila <kalle.raiskila@nokia.com>2010-10-26 10:45:47 +0000
commit505faa6b12dcfadf59323701239ba23cd7eda932 (patch)
tree25ad34779c6bf770331b986bc45d28160d4498b3 /test/CodeGen/CellSPU
parent15b337c28da771b8426fafad58f2e2f81ca4c64e (diff)
downloadexternal_llvm-505faa6b12dcfadf59323701239ba23cd7eda932.zip
external_llvm-505faa6b12dcfadf59323701239ba23cd7eda932.tar.gz
external_llvm-505faa6b12dcfadf59323701239ba23cd7eda932.tar.bz2
Change v64 datalayout in SPU.
The SPU ABI does not mention v64, and all examples in C suggest v128 are treated similarily to arrays, we use array alignment for v64 too. This makes the alignment of e.g. [2 x <2 x i32>] behave "intuitively" and similar to as if the elements were e.g. i32s. This also makes an "unaligned store" test to be aligned, with different (but functionally equivalent) code generated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/CellSPU')
-rw-r--r--test/CodeGen/CellSPU/v2f32.ll3
-rw-r--r--test/CodeGen/CellSPU/v2i32.ll14
2 files changed, 15 insertions, 2 deletions
diff --git a/test/CodeGen/CellSPU/v2f32.ll b/test/CodeGen/CellSPU/v2f32.ll
index b81c0cd..efd0320 100644
--- a/test/CodeGen/CellSPU/v2f32.ll
+++ b/test/CodeGen/CellSPU/v2f32.ll
@@ -62,8 +62,7 @@ define %vec @test_insert(){
}
define void @test_unaligned_store() {
-;CHECK: cdd $3, 8($3)
-;CHECK: lqd
+;CHECK: cdd
;CHECK: shufb
;CHECK: stqd
%data = alloca [4 x float], align 16 ; <[4 x float]*> [#uses=1]
diff --git a/test/CodeGen/CellSPU/v2i32.ll b/test/CodeGen/CellSPU/v2i32.ll
index 8cfc490..71d4aba 100644
--- a/test/CodeGen/CellSPU/v2i32.ll
+++ b/test/CodeGen/CellSPU/v2i32.ll
@@ -61,3 +61,17 @@ define void @test_store( %vec %val, %vec* %ptr)
store %vec %val, %vec* %ptr
ret void
}
+
+;Alignment of <2 x i32> is not *directly* defined in the ABI
+;It probably is safe to interpret it as an array, thus having 8 byte
+;alignment (according to ABI). This tests that the size of
+;[2 x <2 x i32>] is 16 bytes, i.e. there is no padding between the
+;two arrays
+define <2 x i32>* @test_alignment( [2 x <2 x i32>]* %ptr)
+{
+; CHECK-NOT: ai $3, $3, 16
+; CHECK: ai $3, $3, 8
+; CHECK: bi $lr
+ %rv = getelementptr [2 x <2 x i32>]* %ptr, i32 0, i32 1
+ ret <2 x i32>* %rv
+}