xref: /llvm-project/llvm/test/CodeGen/PowerPC/vec_fneg.ll (revision aa91d90cb07d72b32176a966fe798ab71ecb0a76)
1; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -mcpu=g5 | FileCheck %s -check-prefix=CHECK-NOVSX
2; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu \
3; RUN:          -mattr=+altivec -mattr=+vsx |  FileCheck %s
4; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu \
5; RUN:          -mattr=+altivec -mattr=-vsx |  FileCheck %s \
6; RUN:          -check-prefix=CHECK-NOVSX
7
8define void @test_float(ptr %A) {
9; CHECK-LABEL: test_float
10; CHECK-NOVSX-LABEL: test_float
11	%tmp2 = load <4 x float>, ptr %A
12	%tmp3 = fsub <4 x float> < float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00 >, %tmp2
13	store <4 x float> %tmp3, ptr %A
14	ret void
15
16; CHECK: xvnegsp
17; CHECK: blr
18; CHECK-NOVSX: vxor
19; CHECK-NOVSX: blr
20
21}
22
23define void @test_double(ptr %A) {
24; CHECK-LABEL: test_double
25; CHECK-NOVSX-LABEL: test_double
26	%tmp2 = load <2 x double>, ptr %A
27	%tmp3 = fsub <2 x double> < double -0.000000e+00, double -0.000000e+00 >, %tmp2
28	store <2 x double> %tmp3, ptr %A
29	ret void
30
31; CHECK: xvnegdp
32; CHECK: blr
33; CHECK-NOVSX: fneg
34; CHECK-NOVSX: fneg
35; CHECK-NOVSX: blr
36
37}
38