• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -O0 -mtriple=powerpc64-unknown-linux-gnu -fast-isel=false < %s | FileCheck %s
2
3; This verifies that single-precision floating point values that can't
4; be passed in registers are stored in the rightmost word of the parameter
5; save area slot.  There are 13 architected floating-point registers, so
6; the 14th is passed in storage.  The address of the 14th argument is
7; 48 (fixed size of the linkage area) + 13 * 8 (first 13 args) + 4
8; (offset to second word) = 156.
9
10define float @bar(float %a, float %b, float %c, float %d, float %e, float %f, float %g, float %h, float %i, float %j, float %k, float %l, float %m, float %n) nounwind {
11entry:
12  %a.addr = alloca float, align 4
13  %b.addr = alloca float, align 4
14  %c.addr = alloca float, align 4
15  %d.addr = alloca float, align 4
16  %e.addr = alloca float, align 4
17  %f.addr = alloca float, align 4
18  %g.addr = alloca float, align 4
19  %h.addr = alloca float, align 4
20  %i.addr = alloca float, align 4
21  %j.addr = alloca float, align 4
22  %k.addr = alloca float, align 4
23  %l.addr = alloca float, align 4
24  %m.addr = alloca float, align 4
25  %n.addr = alloca float, align 4
26  store float %a, float* %a.addr, align 4
27  store float %b, float* %b.addr, align 4
28  store float %c, float* %c.addr, align 4
29  store float %d, float* %d.addr, align 4
30  store float %e, float* %e.addr, align 4
31  store float %f, float* %f.addr, align 4
32  store float %g, float* %g.addr, align 4
33  store float %h, float* %h.addr, align 4
34  store float %i, float* %i.addr, align 4
35  store float %j, float* %j.addr, align 4
36  store float %k, float* %k.addr, align 4
37  store float %l, float* %l.addr, align 4
38  store float %m, float* %m.addr, align 4
39  store float %n, float* %n.addr, align 4
40  %0 = load float, float* %n.addr, align 4
41  ret float %0
42}
43
44; CHECK: lfs {{[0-9]+}}, 156(1)
45
46define float @foo() nounwind {
47entry:
48  %a = alloca float, align 4
49  %b = alloca float, align 4
50  %c = alloca float, align 4
51  %d = alloca float, align 4
52  %e = alloca float, align 4
53  %f = alloca float, align 4
54  %g = alloca float, align 4
55  %h = alloca float, align 4
56  %i = alloca float, align 4
57  %j = alloca float, align 4
58  %k = alloca float, align 4
59  %l = alloca float, align 4
60  %m = alloca float, align 4
61  %n = alloca float, align 4
62  store float 1.000000e+00, float* %a, align 4
63  store float 2.000000e+00, float* %b, align 4
64  store float 3.000000e+00, float* %c, align 4
65  store float 4.000000e+00, float* %d, align 4
66  store float 5.000000e+00, float* %e, align 4
67  store float 6.000000e+00, float* %f, align 4
68  store float 7.000000e+00, float* %g, align 4
69  store float 8.000000e+00, float* %h, align 4
70  store float 9.000000e+00, float* %i, align 4
71  store float 1.000000e+01, float* %j, align 4
72  store float 1.100000e+01, float* %k, align 4
73  store float 1.200000e+01, float* %l, align 4
74  store float 1.300000e+01, float* %m, align 4
75  store float 1.400000e+01, float* %n, align 4
76  %0 = load float, float* %a, align 4
77  %1 = load float, float* %b, align 4
78  %2 = load float, float* %c, align 4
79  %3 = load float, float* %d, align 4
80  %4 = load float, float* %e, align 4
81  %5 = load float, float* %f, align 4
82  %6 = load float, float* %g, align 4
83  %7 = load float, float* %h, align 4
84  %8 = load float, float* %i, align 4
85  %9 = load float, float* %j, align 4
86  %10 = load float, float* %k, align 4
87  %11 = load float, float* %l, align 4
88  %12 = load float, float* %m, align 4
89  %13 = load float, float* %n, align 4
90  %call = call float @bar(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8, float %9, float %10, float %11, float %12, float %13)
91  ret float %call
92}
93
94; Note that stw is used instead of stfs because the value is a simple
95; constant that can be created with a load-immediate in a GPR.
96; CHECK: stw {{[0-9]+}}, 156(1)
97
98