1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown \
3; RUN:     -mcpu=pwr9 -ppc-asm-full-reg-names \
4; RUN:     -ppc-vsr-nums-as-vr < %s | FileCheck %s
5; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-unknown \
6; RUN:     -mcpu=pwr9 -ppc-asm-full-reg-names \
7; RUN:     -ppc-vsr-nums-as-vr < %s | FileCheck %s
8
9; Function Attrs: norecurse nounwind readonly
10define dso_local <2 x double> @test1(<2 x float>* nocapture readonly %Ptr) {
11; CHECK-LABEL: test1:
12; CHECK:       # %bb.0: # %entry
13; CHECK-NEXT:    lfd f0, 0(r3)
14; CHECK-NEXT:    xxmrghw vs0, vs0, vs0
15; CHECK-NEXT:    xvcvspdp v2, vs0
16; CHECK-NEXT:    blr
17entry:
18  %0 = load <2 x float>, <2 x float>* %Ptr, align 8
19  %1 = fpext <2 x float> %0 to <2 x double>
20  ret <2 x double> %1
21}
22
23; Function Attrs: norecurse nounwind readonly
24define dso_local <2 x double> @test2(<2 x float>* nocapture readonly %a, <2 x float>* nocapture readonly %b) {
25; CHECK-LABEL: test2:
26; CHECK:       # %bb.0: # %entry
27; CHECK-NEXT:    lfd f0, 0(r4)
28; CHECK-NEXT:    lfd f1, 0(r3)
29; CHECK-NEXT:    xvsubsp vs0, vs1, vs0
30; CHECK-NEXT:    xxmrghw vs0, vs0, vs0
31; CHECK-NEXT:    xvcvspdp v2, vs0
32; CHECK-NEXT:    blr
33entry:
34  %0 = load <2 x float>, <2 x float>* %a, align 8
35  %1 = load <2 x float>, <2 x float>* %b, align 8
36  %sub = fsub <2 x float> %0, %1
37  %2 = fpext <2 x float> %sub to <2 x double>
38  ret <2 x double> %2
39}
40
41; Function Attrs: norecurse nounwind readonly
42; Function Attrs: norecurse nounwind readonly
43define dso_local <2 x double> @test3(<2 x float>* nocapture readonly %a, <2 x float>* nocapture readonly %b) {
44; CHECK-LABEL: test3:
45; CHECK:       # %bb.0: # %entry
46; CHECK-NEXT:    lfd f0, 0(r4)
47; CHECK-NEXT:    lfd f1, 0(r3)
48; CHECK-NEXT:    xvaddsp vs0, vs1, vs0
49; CHECK-NEXT:    xxmrghw vs0, vs0, vs0
50; CHECK-NEXT:    xvcvspdp v2, vs0
51; CHECK-NEXT:    blr
52entry:
53  %0 = load <2 x float>, <2 x float>* %a, align 8
54  %1 = load <2 x float>, <2 x float>* %b, align 8
55  %sub = fadd <2 x float> %0, %1
56  %2 = fpext <2 x float> %sub to <2 x double>
57  ret <2 x double> %2
58}
59
60; Function Attrs: norecurse nounwind readonly
61; Function Attrs: norecurse nounwind readonly
62define dso_local <2 x double> @test4(<2 x float>* nocapture readonly %a, <2 x float>* nocapture readonly %b) {
63; CHECK-LABEL: test4:
64; CHECK:       # %bb.0: # %entry
65; CHECK-NEXT:    lfd f0, 0(r4)
66; CHECK-NEXT:    lfd f1, 0(r3)
67; CHECK-NEXT:    xvmulsp vs0, vs1, vs0
68; CHECK-NEXT:    xxmrghw vs0, vs0, vs0
69; CHECK-NEXT:    xvcvspdp v2, vs0
70; CHECK-NEXT:    blr
71entry:
72  %0 = load <2 x float>, <2 x float>* %a, align 8
73  %1 = load <2 x float>, <2 x float>* %b, align 8
74  %sub = fmul <2 x float> %0, %1
75  %2 = fpext <2 x float> %sub to <2 x double>
76  ret <2 x double> %2
77}
78