OSDN Git Service

am 0d041145: am 19c6fbb3: Merge "Adds the ability to run the llvm test suite in-tree."
[android-x86/external-llvm.git] / test / CodeGen / Mips / fp-indexed-ls.ll
1 ; RUN: llc -march=mipsel -mcpu=mips32r2 < %s | FileCheck %s
2 ; RUN: llc -mtriple=mipsel-none-nacl-gnu -mcpu=mips32r2 < %s \
3 ; RUN:  | FileCheck %s -check-prefix=CHECK-NACL
4
5 %struct.S = type <{ [4 x float] }>
6 %struct.S2 = type <{ [4 x double] }>
7 %struct.S3 = type <{ i8, float }>
8
9 @s = external global [4 x %struct.S]
10 @gf = external global float
11 @gd = external global double
12 @s2 = external global [4 x %struct.S2]
13 @s3 = external global %struct.S3
14
15 define float @foo0(float* nocapture %b, i32 %o) nounwind readonly {
16 entry:
17 ; CHECK: lwxc1
18 ; CHECK-NACL-NOT: lwxc1
19   %arrayidx = getelementptr inbounds float* %b, i32 %o
20   %0 = load float* %arrayidx, align 4
21   ret float %0
22 }
23
24 define double @foo1(double* nocapture %b, i32 %o) nounwind readonly {
25 entry:
26 ; CHECK: ldxc1
27 ; CHECK-NACL-NOT: ldxc1
28   %arrayidx = getelementptr inbounds double* %b, i32 %o
29   %0 = load double* %arrayidx, align 8
30   ret double %0
31 }
32
33 define float @foo2(i32 %b, i32 %c) nounwind readonly {
34 entry:
35 ; CHECK-NOT: luxc1
36   %arrayidx1 = getelementptr inbounds [4 x %struct.S]* @s, i32 0, i32 %b, i32 0, i32 %c
37   %0 = load float* %arrayidx1, align 1
38   ret float %0
39 }
40
41 define void @foo3(float* nocapture %b, i32 %o) nounwind {
42 entry:
43 ; CHECK: swxc1
44 ; CHECK-NACL-NOT: swxc1
45   %0 = load float* @gf, align 4
46   %arrayidx = getelementptr inbounds float* %b, i32 %o
47   store float %0, float* %arrayidx, align 4
48   ret void
49 }
50
51 define void @foo4(double* nocapture %b, i32 %o) nounwind {
52 entry:
53 ; CHECK: sdxc1
54 ; CHECK-NACL-NOT: sdxc1
55   %0 = load double* @gd, align 8
56   %arrayidx = getelementptr inbounds double* %b, i32 %o
57   store double %0, double* %arrayidx, align 8
58   ret void
59 }
60
61 define void @foo5(i32 %b, i32 %c) nounwind {
62 entry:
63 ; CHECK-NOT: suxc1
64   %0 = load float* @gf, align 4
65   %arrayidx1 = getelementptr inbounds [4 x %struct.S]* @s, i32 0, i32 %b, i32 0, i32 %c
66   store float %0, float* %arrayidx1, align 1
67   ret void
68 }
69
70 define double @foo6(i32 %b, i32 %c) nounwind readonly {
71 entry:
72 ; CHECK: foo6
73 ; CHECK-NOT: luxc1
74   %arrayidx1 = getelementptr inbounds [4 x %struct.S2]* @s2, i32 0, i32 %b, i32 0, i32 %c
75   %0 = load double* %arrayidx1, align 1
76   ret double %0
77 }
78
79 define void @foo7(i32 %b, i32 %c) nounwind {
80 entry:
81 ; CHECK: foo7
82 ; CHECK-NOT: suxc1
83   %0 = load double* @gd, align 8
84   %arrayidx1 = getelementptr inbounds [4 x %struct.S2]* @s2, i32 0, i32 %b, i32 0, i32 %c
85   store double %0, double* %arrayidx1, align 1
86   ret void
87 }
88
89 define float @foo8() nounwind readonly {
90 entry:
91 ; CHECK: foo8
92 ; CHECK-NOT: luxc1
93   %0 = load float* getelementptr inbounds (%struct.S3* @s3, i32 0, i32 1), align 1
94   ret float %0
95 }
96
97 define void @foo9(float %f) nounwind {
98 entry:
99 ; CHECK: foo9
100 ; CHECK-NOT: suxc1
101   store float %f, float* getelementptr inbounds (%struct.S3* @s3, i32 0, i32 1), align 1
102   ret void
103 }
104