1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -verify-machineinstrs -ppc-asm-full-reg-names \
3 ; RUN: -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s
4 define dso_local void @calc_buffer() local_unnamed_addr #0 {
5 ; CHECK-LABEL: calc_buffer:
7 ; CHECK-NEXT: ld r3, 0(r3)
8 ; CHECK-NEXT: sradi r4, r3, 53
9 ; CHECK-NEXT: addi r4, r4, 1
10 ; CHECK-NEXT: cmpldi r4, 1
11 ; CHECK-NEXT: bgt cr0, .LBB0_2
12 ; CHECK-NEXT: # %bb.1:
13 ; CHECK-NEXT: mr r4, r3
14 ; CHECK-NEXT: b .LBB0_3
15 ; CHECK-NEXT: .LBB0_2:
16 ; CHECK-NEXT: clrldi r4, r3, 53
17 ; CHECK-NEXT: addi r4, r4, 2047
18 ; CHECK-NEXT: or r4, r4, r3
19 ; CHECK-NEXT: rldicr r4, r4, 0, 52
20 ; CHECK-NEXT: .LBB0_3:
21 ; CHECK-NEXT: rldicl r6, r3, 10, 54
22 ; CHECK-NEXT: std r4, -32(r1)
23 ; CHECK-NEXT: rldicl r5, r3, 63, 1
24 ; CHECK-NEXT: clrldi r4, r3, 63
25 ; CHECK-NEXT: addi r6, r6, 1
26 ; CHECK-NEXT: cmpldi r6, 1
27 ; CHECK-NEXT: or r4, r4, r5
28 ; CHECK-NEXT: ble cr0, .LBB0_5
29 ; CHECK-NEXT: # %bb.4:
30 ; CHECK-NEXT: clrldi r4, r4, 53
31 ; CHECK-NEXT: addi r4, r4, 2047
32 ; CHECK-NEXT: or r4, r4, r5
33 ; CHECK-NEXT: rldicl r4, r4, 53, 11
34 ; CHECK-NEXT: rldicl r4, r4, 11, 1
35 ; CHECK-NEXT: .LBB0_5:
36 ; CHECK-NEXT: cmpdi r3, 0
37 ; CHECK-NEXT: std r4, -24(r1)
38 ; CHECK-NEXT: bc 12, lt, .LBB0_7
39 ; CHECK-NEXT: # %bb.6:
40 ; CHECK-NEXT: lfd f0, -32(r1)
41 ; CHECK-NEXT: fcfid f0, f0
42 ; CHECK-NEXT: frsp f0, f0
43 ; CHECK-NEXT: b .LBB0_8
44 ; CHECK-NEXT: .LBB0_7:
45 ; CHECK-NEXT: lfd f0, -24(r1)
46 ; CHECK-NEXT: fcfid f0, f0
47 ; CHECK-NEXT: frsp f0, f0
48 ; CHECK-NEXT: fadds f0, f0, f0
49 ; CHECK-NEXT: .LBB0_8:
50 ; CHECK-NEXT: addis r3, r2, .LCPI0_0@toc@ha
51 ; CHECK-NEXT: lfs f1, .LCPI0_0@toc@l(r3)
52 ; CHECK-NEXT: fsubs f2, f0, f1
53 ; CHECK-NEXT: fctidz f2, f2
54 ; CHECK-NEXT: stfd f2, -8(r1)
55 ; CHECK-NEXT: fctidz f2, f0
56 ; CHECK-NEXT: fcmpu cr0, f0, f1
57 ; CHECK-NEXT: stfd f2, -16(r1)
58 ; CHECK-NEXT: blt cr0, .LBB0_10
59 ; CHECK-NEXT: # %bb.9:
60 ; CHECK-NEXT: ld r3, -8(r1)
61 ; CHECK-NEXT: li r4, 1
62 ; CHECK-NEXT: rldic r4, r4, 63, 0
63 ; CHECK-NEXT: xor r3, r3, r4
64 ; CHECK-NEXT: std r3, 0(r3)
65 ; CHECK-NEXT: .LBB0_10:
66 ; CHECK-NEXT: ld r3, -16(r1)
67 ; CHECK-NEXT: std r3, 0(r3)
68 %load_initial = load i64, ptr poison, align 8
69 %conv39 = uitofp i64 %load_initial to float
70 %add48 = fadd float 0.000000e+00, %conv39
71 %conv49 = fptoui float %add48 to i64
72 store i64 %conv49, ptr poison, align 8