1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -verify-machineinstrs -mattr=-vsx -mattr=+allow-unaligned-fp-access | FileCheck %s
6 target triple = "powerpc-unknown-linux-gnu"
8 %struct.anon = type <{ i8, float }>
9 @s = global %struct.anon <{ i8 3, float 0x4014666660000000 }> ; <ptr> [#uses=1]
10 @u = global <{ i8, double }> <{ i8 3, double 5.100000e+00 }> ; <ptr> [#uses=1]
11 @t = weak global %struct.anon zeroinitializer ; <ptr> [#uses=2]
12 @v = weak global <{ i8, double }> zeroinitializer ; <ptr> [#uses=2]
13 @.str = internal constant [8 x i8] c"%f %lf\0A\00" ; <ptr> [#uses=1]
17 ; CHECK: # %bb.0: # %entry
18 ; CHECK-NEXT: stwu 1, -16(1)
19 ; CHECK-NEXT: .cfi_def_cfa_offset 16
20 ; CHECK-NEXT: lis 3, s@ha
21 ; CHECK-NEXT: la 3, s@l(3)
22 ; CHECK-NEXT: lis 4, u@ha
23 ; CHECK-NEXT: lwz 3, 1(3)
24 ; CHECK-NEXT: la 4, u@l(4)
25 ; CHECK-NEXT: lfd 0, 1(4)
26 ; CHECK-NEXT: lis 4, t@ha
27 ; CHECK-NEXT: la 4, t@l(4)
28 ; CHECK-NEXT: stw 3, 1(4)
29 ; CHECK-NEXT: lis 3, v@ha
30 ; CHECK-NEXT: la 3, v@l(3)
31 ; CHECK-NEXT: stfd 0, 1(3)
32 ; CHECK-NEXT: lwz 3, 12(1)
33 ; CHECK-NEXT: addi 1, 1, 16
36 %retval = alloca i32, align 4 ; <ptr> [#uses=1]
37 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
38 %tmp = getelementptr %struct.anon, ptr @s, i32 0, i32 1 ; <ptr> [#uses=1]
39 %tmp1 = load float, ptr %tmp, align 1 ; <float> [#uses=1]
40 %tmp2 = getelementptr %struct.anon, ptr @t, i32 0, i32 1 ; <ptr> [#uses=1]
41 store float %tmp1, ptr %tmp2, align 1
42 %tmp3 = getelementptr <{ i8, double }>, ptr @u, i32 0, i32 1 ; <ptr> [#uses=1]
43 %tmp4 = load double, ptr %tmp3, align 1 ; <double> [#uses=1]
44 %tmp5 = getelementptr <{ i8, double }>, ptr @v, i32 0, i32 1 ; <ptr> [#uses=1]
45 store double %tmp4, ptr %tmp5, align 1
48 return: ; preds = %entry
49 %retval6 = load i32, ptr %retval ; <i32> [#uses=1]
55 ; CHECK: # %bb.0: # %entry
57 ; CHECK-NEXT: stwu 1, -16(1)
58 ; CHECK-NEXT: stw 0, 20(1)
59 ; CHECK-NEXT: .cfi_def_cfa_offset 16
60 ; CHECK-NEXT: .cfi_offset lr, 4
62 ; CHECK-NEXT: lis 3, t@ha
63 ; CHECK-NEXT: la 3, t@l(3)
64 ; CHECK-NEXT: lfs 1, 1(3)
65 ; CHECK-NEXT: lis 3, v@ha
66 ; CHECK-NEXT: la 3, v@l(3)
67 ; CHECK-NEXT: lfd 2, 1(3)
68 ; CHECK-NEXT: lis 3, .str@ha
69 ; CHECK-NEXT: la 3, .str@l(3)
70 ; CHECK-NEXT: creqv 6, 6, 6
71 ; CHECK-NEXT: bl printf
72 ; CHECK-NEXT: lwz 3, 12(1)
73 ; CHECK-NEXT: lwz 0, 20(1)
74 ; CHECK-NEXT: addi 1, 1, 16
78 %retval = alloca i32, align 4 ; <ptr> [#uses=1]
79 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
80 %tmp = call i32 @foo( ) ; <i32> [#uses=0]
81 %tmp1 = getelementptr %struct.anon, ptr @t, i32 0, i32 1 ; <ptr> [#uses=1]
82 %tmp2 = load float, ptr %tmp1, align 1 ; <float> [#uses=1]
83 %tmp23 = fpext float %tmp2 to double ; <double> [#uses=1]
84 %tmp4 = getelementptr <{ i8, double }>, ptr @v, i32 0, i32 1 ; <ptr> [#uses=1]
85 %tmp5 = load double, ptr %tmp4, align 1 ; <double> [#uses=1]
86 %tmp6 = getelementptr [8 x i8], ptr @.str, i32 0, i32 0 ; <ptr> [#uses=1]
87 %tmp7 = call i32 (ptr, ...) @printf( ptr %tmp6, double %tmp23, double %tmp5 ) ; <i32> [#uses=0]
90 return: ; preds = %entry
91 %retval8 = load i32, ptr %retval ; <i32> [#uses=1]
95 declare i32 @printf(ptr, ...)