1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mcpu=pwr9 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
3; RUN:    -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P9LE
4; RUN: llc -mcpu=pwr9 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
5; RUN:    -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P9BE
6; RUN: llc -mcpu=pwr8 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
7; RUN:    -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P8LE
8; RUN: llc -mcpu=pwr8 -verify-machineinstrs -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names \
9; RUN:    -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s --check-prefix=P8BE
10
11define void @test_liwzx1(<1 x float>* %A, <1 x float>* %B, <1 x float>* %C) {
12; P9LE-LABEL: test_liwzx1:
13; P9LE:       # %bb.0:
14; P9LE-NEXT:    lfs f0, 0(r3)
15; P9LE-NEXT:    lfs f1, 0(r4)
16; P9LE-NEXT:    xsaddsp f0, f0, f1
17; P9LE-NEXT:    stfs f0, 0(r5)
18; P9LE-NEXT:    blr
19;
20; P9BE-LABEL: test_liwzx1:
21; P9BE:       # %bb.0:
22; P9BE-NEXT:    lfs f0, 0(r3)
23; P9BE-NEXT:    lfs f1, 0(r4)
24; P9BE-NEXT:    xsaddsp f0, f0, f1
25; P9BE-NEXT:    stfs f0, 0(r5)
26; P9BE-NEXT:    blr
27;
28; P8LE-LABEL: test_liwzx1:
29; P8LE:       # %bb.0:
30; P8LE-NEXT:    lfsx f0, 0, r3
31; P8LE-NEXT:    lfsx f1, 0, r4
32; P8LE-NEXT:    xsaddsp f0, f0, f1
33; P8LE-NEXT:    stfsx f0, 0, r5
34; P8LE-NEXT:    blr
35;
36; P8BE-LABEL: test_liwzx1:
37; P8BE:       # %bb.0:
38; P8BE-NEXT:    lfsx f0, 0, r3
39; P8BE-NEXT:    lfsx f1, 0, r4
40; P8BE-NEXT:    xsaddsp f0, f0, f1
41; P8BE-NEXT:    stfsx f0, 0, r5
42; P8BE-NEXT:    blr
43
44
45
46  %a = load <1 x float>, <1 x float>* %A
47  %b = load <1 x float>, <1 x float>* %B
48  %X = fadd <1 x float> %a, %b
49  store <1 x float> %X, <1 x float>* %C
50  ret void
51}
52
53define <1 x float>* @test_liwzx2(<1 x float>* %A, <1 x float>* %B, <1 x float>* %C) {
54; P9LE-LABEL: test_liwzx2:
55; P9LE:       # %bb.0:
56; P9LE-NEXT:    lfs f0, 0(r3)
57; P9LE-NEXT:    mr r3, r5
58; P9LE-NEXT:    lfs f1, 0(r4)
59; P9LE-NEXT:    xssubsp f0, f0, f1
60; P9LE-NEXT:    stfs f0, 0(r5)
61; P9LE-NEXT:    blr
62;
63; P9BE-LABEL: test_liwzx2:
64; P9BE:       # %bb.0:
65; P9BE-NEXT:    lfs f0, 0(r3)
66; P9BE-NEXT:    mr r3, r5
67; P9BE-NEXT:    lfs f1, 0(r4)
68; P9BE-NEXT:    xssubsp f0, f0, f1
69; P9BE-NEXT:    stfs f0, 0(r5)
70; P9BE-NEXT:    blr
71;
72; P8LE-LABEL: test_liwzx2:
73; P8LE:       # %bb.0:
74; P8LE-NEXT:    lfsx f0, 0, r3
75; P8LE-NEXT:    lfsx f1, 0, r4
76; P8LE-NEXT:    mr r3, r5
77; P8LE-NEXT:    xssubsp f0, f0, f1
78; P8LE-NEXT:    stfsx f0, 0, r5
79; P8LE-NEXT:    blr
80;
81; P8BE-LABEL: test_liwzx2:
82; P8BE:       # %bb.0:
83; P8BE-NEXT:    lfsx f0, 0, r3
84; P8BE-NEXT:    lfsx f1, 0, r4
85; P8BE-NEXT:    mr r3, r5
86; P8BE-NEXT:    xssubsp f0, f0, f1
87; P8BE-NEXT:    stfsx f0, 0, r5
88; P8BE-NEXT:    blr
89
90
91
92
93
94  %a = load <1 x float>, <1 x float>* %A
95  %b = load <1 x float>, <1 x float>* %B
96  %X = fsub <1 x float> %a, %b
97  store <1 x float> %X, <1 x float>* %C
98  ret <1 x float>* %C
99}
100