blob: 4284c22837d38bf89e7374e8feaaf0a5aad20e2c [file] [log] [blame]
Dan Gohmanb7c0b242009-09-11 18:36:27 +00001; RUN: llc < %s -march=cellspu | FileCheck %s
Scott Michel9c0c6b22008-11-21 02:56:16 +00002
3; ModuleID = 'loads.bc'
4target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128"
5target triple = "spu"
6
7define <4 x float> @load_v4f32_1(<4 x float>* %a) nounwind readonly {
8entry:
9 %tmp1 = load <4 x float>* %a
10 ret <4 x float> %tmp1
Scott Michelf6045fe82009-08-24 23:57:35 +000011; CHECK: lqd $3, 0($3)
Scott Michel9c0c6b22008-11-21 02:56:16 +000012}
13
14define <4 x float> @load_v4f32_2(<4 x float>* %a) nounwind readonly {
15entry:
Scott Michelf6045fe82009-08-24 23:57:35 +000016 %arrayidx = getelementptr <4 x float>* %a, i32 1
17 %tmp1 = load <4 x float>* %arrayidx
Scott Michel9c0c6b22008-11-21 02:56:16 +000018 ret <4 x float> %tmp1
Scott Michelf6045fe82009-08-24 23:57:35 +000019; CHECK: lqd $3, 16($3)
Scott Michel9c0c6b22008-11-21 02:56:16 +000020}
Kalle Raiskila11fe2462010-06-01 13:34:47 +000021
22
23declare <4 x i32>* @getv4f32ptr()
24define <4 x i32> @func() {
Kalle Raiskila951b2292010-06-21 15:08:16 +000025 ;CHECK: brasl
26 ; we need to have some instruction to move the result to safety.
27 ; which instruction (lr, stqd...) depends on the regalloc
28 ;CHECK: {{.*}}
29 ;CHECK: brasl
30 %rv1 = call <4 x i32>* @getv4f32ptr()
31 %rv2 = call <4 x i32>* @getv4f32ptr()
32 %rv3 = load <4 x i32>* %rv1
33 ret <4 x i32> %rv3
Kalle Raiskila11fe2462010-06-01 13:34:47 +000034}
35
Kalle Raiskilac6166c62010-06-09 08:29:41 +000036define <4 x float> @load_undef(){
37 ;CHECK lqd $3, 0($3)
38 %val = load <4 x float>* undef
39 ret <4 x float> %val
40}