blob: 997aa9dc83c2f327b193d5ef2eb5da6aff2090fc [file] [log] [blame]
Akira Hatanaka44b6c712012-02-28 02:55:02 +00001; RUN: llc -march=mipsel -mcpu=mips32r2 < %s | FileCheck %s
2
3%struct.S = type <{ [4 x float] }>
4
5@s = external global [4 x %struct.S]
6@gf = external global float
7@gd = external global double
8
9define float @foo0(float* nocapture %b, i32 %o) nounwind readonly {
10entry:
11; CHECK: lwxc1
12 %arrayidx = getelementptr inbounds float* %b, i32 %o
13 %0 = load float* %arrayidx, align 4
14 ret float %0
15}
16
17define double @foo1(double* nocapture %b, i32 %o) nounwind readonly {
18entry:
19; CHECK: ldxc1
20 %arrayidx = getelementptr inbounds double* %b, i32 %o
21 %0 = load double* %arrayidx, align 8
22 ret double %0
23}
24
25define float @foo2(i32 %b, i32 %c) nounwind readonly {
26entry:
27; CHECK: luxc1
28 %arrayidx1 = getelementptr inbounds [4 x %struct.S]* @s, i32 0, i32 %b, i32 0, i32 %c
29 %0 = load float* %arrayidx1, align 1
30 ret float %0
31}
32
33define void @foo3(float* nocapture %b, i32 %o) nounwind {
34entry:
35; CHECK: swxc1
36 %0 = load float* @gf, align 4
37 %arrayidx = getelementptr inbounds float* %b, i32 %o
38 store float %0, float* %arrayidx, align 4
39 ret void
40}
41
42define void @foo4(double* nocapture %b, i32 %o) nounwind {
43entry:
44; CHECK: sdxc1
45 %0 = load double* @gd, align 8
46 %arrayidx = getelementptr inbounds double* %b, i32 %o
47 store double %0, double* %arrayidx, align 8
48 ret void
49}
50
51define void @foo5(i32 %b, i32 %c) nounwind {
52entry:
53; CHECK: suxc1
54 %0 = load float* @gf, align 4
55 %arrayidx1 = getelementptr inbounds [4 x %struct.S]* @s, i32 0, i32 %b, i32 0, i32 %c
56 store float %0, float* %arrayidx1, align 1
57 ret void
58}
59