1; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -march=ppc64le \ 2; RUN: -mattr=+altivec -mattr=+vsx | FileCheck %s 3; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -march=ppc64le \ 4; RUN: -mattr=+altivec -mattr=-vsx | FileCheck %s \ 5; RUN: -check-prefix=CHECK-NOVSX 6 7define <4 x float> @test_float(<4 x float> %aa) #0 { 8 9; CHECK-LABEL: test_float 10; CHECK-NOVSX-LABEL: test_float 11; CHECK-NOVSX-LABEL: test_float 12 13 entry: 14 %0 = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %aa) #2 15 ret <4 x float> %0 16} 17; Function Attrs: nounwind readnone 18declare <4 x float> @llvm.fabs.v4f32(<4 x float>) #1 19 20; CHECK: xvabssp 21; CHECK: blr 22; CHECK-NOVSX: fabs 23; CHECK-NOVSX: fabs 24; CHECK-NOVSX: fabs 25; CHECK-NOVSX: fabs 26; CHECK-NOVSX: blr 27 28define <4 x float> @test2_float(<4 x float> %aa) #0 { 29 30; CHECK-LABEL: test2_float 31; CHECK-NOVSX-LABEL: test2_float 32 33 entry: 34 %0 = tail call <4 x float> @llvm.fabs.v4f32(<4 x float> %aa) #2 35 %sub = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, 36 float -0.000000e+00, float -0.000000e+00>, %0 37 ret <4 x float> %sub 38} 39 40; CHECK: xvnabssp 41; CHECK: blr 42; CHECK-NOVSX: vspltisb 43; CHECK-NOVSX: fabs 44; CHECK-NOVSX: fabs 45; CHECK-NOVSX: fabs 46; CHECK-NOVSX: fabs 47; CHECK-NOVSX: vsubfp 48; CHECK-NOVSX: blr 49 50define <2 x double> @test_double(<2 x double> %aa) #0 { 51 52; CHECK-LABEL: test_double 53; CHECK-NOVSX-LABEL: test_double 54 55 entry: 56 %0 = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %aa) #2 57 ret <2 x double> %0 58} 59 60; Function Attrs: nounwind readnone 61declare <2 x double> @llvm.fabs.v2f64(<2 x double>) #1 62 63; CHECK: xvabsdp 64; CHECK: blr 65; CHECK-NOVSX: fabs 66; CHECK-NOVSX: fabs 67; CHECK-NOVSX: blr 68 69define <2 x double> @foo(<2 x double> %aa) #0 { 70 entry: 71 %0 = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %aa) #2 72 %sub = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %0 73 ret <2 x double> %sub 74} 75 76; CHECK: xvnabsdp 77; CHECK: blr 78; CHECK-NOVSX: fnabs 79; CHECK-NOVSX: fnabs 80; CHECK-NOVSX: blr 81