blob: c46bcd18c15af5473f023130a71f0cf61c22cde2 [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() {
25 ;CHECK: brasl
26 ;CHECK: lr {{\$[0-9]*, \$3}}
27 ;CHECK: brasl
28 %rv1 = call <4 x i32>* @getv4f32ptr()
29 %rv2 = call <4 x i32>* @getv4f32ptr()
30 %rv3 = load <4 x i32>* %rv1
31 ret <4 x i32> %rv3
32}
33
Kalle Raiskilac6166c62010-06-09 08:29:41 +000034define <4 x float> @load_undef(){
35 ;CHECK lqd $3, 0($3)
36 %val = load <4 x float>* undef
37 ret <4 x float> %val
38}