1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -global-isel -o - \
3 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s
5 define float @float_add(float %a, float %b) {
6 ; CHECK-LABEL: float_add:
7 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: xsaddsp f1, f1, f2
11 %add = fadd float %a, %b
15 define double @double_add(double %a, double %b) {
16 ; CHECK-LABEL: double_add:
17 ; CHECK: # %bb.0: # %entry
18 ; CHECK-NEXT: xsadddp f1, f1, f2
21 %add = fadd double %a, %b
25 define float @float_sub(float %a, float %b) {
26 ; CHECK-LABEL: float_sub:
27 ; CHECK: # %bb.0: # %entry
28 ; CHECK-NEXT: xssubsp f1, f1, f2
31 %sub = fsub float %a, %b
35 define float @float_mul(float %a, float %b) {
36 ; CHECK-LABEL: float_mul:
37 ; CHECK: # %bb.0: # %entry
38 ; CHECK-NEXT: xsmulsp f1, f1, f2
41 %mul = fmul float %a, %b
45 define float @float_div(float %a, float %b) {
46 ; CHECK-LABEL: float_div:
47 ; CHECK: # %bb.0: # %entry
48 ; CHECK-NEXT: xsdivsp f1, f1, f2
51 %div = fdiv float %a, %b
55 define <4 x float> @test_fadd_v4f32(<4 x float> %a, <4 x float> %b) {
56 ; CHECK-LABEL: test_fadd_v4f32:
58 ; CHECK-NEXT: xvaddsp v2, v2, v3
60 %res = fadd <4 x float> %a, %b
64 define <2 x double> @test_fadd_v2f64(<2 x double> %a, <2 x double> %b) {
65 ; CHECK-LABEL: test_fadd_v2f64:
67 ; CHECK-NEXT: xvadddp v2, v2, v3
69 %res = fadd <2 x double> %a, %b
73 define <4 x float> @test_fsub_v4f32(<4 x float> %a, <4 x float> %b) {
74 ; CHECK-LABEL: test_fsub_v4f32:
76 ; CHECK-NEXT: xvsubsp v2, v2, v3
78 %res = fsub <4 x float> %a, %b
82 define <2 x double> @test_fsub_v2f64(<2 x double> %a, <2 x double> %b) {
83 ; CHECK-LABEL: test_fsub_v2f64:
85 ; CHECK-NEXT: xvsubdp v2, v2, v3
87 %res = fsub <2 x double> %a, %b
91 define <4 x float> @test_fmul_v4f32(<4 x float> %a, <4 x float> %b) {
92 ; CHECK-LABEL: test_fmul_v4f32:
94 ; CHECK-NEXT: xvmulsp v2, v2, v3
96 %res = fmul <4 x float> %a, %b
100 define <2 x double> @test_fmul_v2f64(<2 x double> %a, <2 x double> %b) {
101 ; CHECK-LABEL: test_fmul_v2f64:
103 ; CHECK-NEXT: xvmuldp v2, v2, v3
105 %res = fmul <2 x double> %a, %b
106 ret <2 x double> %res
109 define <4 x float> @test_fdiv_v4f32(<4 x float> %a, <4 x float> %b) {
110 ; CHECK-LABEL: test_fdiv_v4f32:
112 ; CHECK-NEXT: xvdivsp v2, v2, v3
114 %res = fdiv <4 x float> %a, %b
118 define <2 x double> @test_fdiv_v2f64(<2 x double> %a, <2 x double> %b) {
119 ; CHECK-LABEL: test_fdiv_v2f64:
121 ; CHECK-NEXT: xvdivdp v2, v2, v3
123 %res = fdiv <2 x double> %a, %b
124 ret <2 x double> %res