• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -relocation-model pic < %s | FileCheck %s
2
3; CHECK-LABEL: fred
4; CHECK: stwux 1, 1, 0
5; Save R31..R29 via R0:
6; CHECK: addic 0, 0, -12
7; CHECK: stwx 31, 0, 0
8; CHECK: addic 0, 0, -4
9; CHECK: stwx 30, 0, 0
10; CHECK: addic 0, 0, -4
11; CHECK: stwx 29, 0, 0
12; Set R29 back to the value of R0 from before the updates:
13; CHECK: addic 29, 0, 20
14; Save CR through R12 using R29 as the stack pointer (aligned base pointer).
15; CHECK: mfcr 12
16; CHECK: stw 28, -24(29)
17; CHECK: stw 12, -28(29)
18
19target datalayout = "E-m:e-p:32:32-i64:64-n32"
20target triple = "powerpc-unknown-freebsd"
21
22; Function Attrs: norecurse readnone sspstrong
23define i64 @fred(double %a0) local_unnamed_addr #0 {
24b1:
25  %v2 = alloca i64, align 128
26  store i64 0, i64* %v2
27  %a1 = tail call double asm "fadd $0, $1, $2", "=f,f,f,~{cr2}"(double %a0, double %a0)
28  %v3 = fcmp olt double %a1, 0x43E0000000000000
29  br i1 %v3, label %b4, label %b8
30
31b4:                                               ; preds = %b1
32  %v5 = fcmp olt double %a0, 0xC3E0000000000000
33  %v6 = fptosi double %a0 to i64
34  store i64 %v6, i64* %v2
35  %v7 = select i1 %v5, i64 -9223372036854775808, i64 %v6
36  br label %b15
37
38b8:                                               ; preds = %b1
39  %v9 = fcmp olt double %a0, 0x43F0000000000000
40  br i1 %v9, label %b10, label %b12
41
42b10:                                              ; preds = %b8
43  %v11 = fptoui double %a0 to i64
44  br label %b15
45
46b12:                                              ; preds = %b8
47  %v13 = fcmp ogt double %a0, 0.000000e+00
48  %v14 = sext i1 %v13 to i64
49  br label %b15
50
51b15:                                              ; preds = %b12, %b10, %b4
52  %v16 = phi i64 [ %v7, %b4 ], [ %v11, %b10 ], [ %v14, %b12 ]
53  %v17 = load i64, i64* %v2
54  %v18 = add i64 %v17, %v16
55  ret i64 %v18
56}
57
58attributes #0 = { norecurse readnone sspstrong "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "stack-protector-buffer-size"="8" "target-cpu"="ppc" }
59