112 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+fma4,-fma | FileCheck %s3; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+fma4,+fma | FileCheck %s4 5declare <4 x float> @llvm.x86.fma4.vfmadd.ss(<4 x float> %a, <4 x float> %b, <4 x float> %c)6declare <2 x double> @llvm.x86.fma4.vfmadd.sd(<2 x double> %a, <2 x double> %b, <2 x double> %c)7 8; TODO this can be negated9define <4 x float> @test1(<4 x float> %a, <4 x float> %b, <4 x float> %c) {10; CHECK-LABEL: test1:11; CHECK: # %bb.0:12; CHECK-NEXT: vfmaddss {{.*#+}} xmm0 = (xmm0 * xmm1) + xmm213; CHECK-NEXT: vxorps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm014; CHECK-NEXT: retq15 %res = tail call <4 x float> @llvm.x86.fma4.vfmadd.ss(<4 x float> %a, <4 x float> %b, <4 x float> %c)16 %sub.i = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %res17 ret <4 x float> %sub.i18}19 20define <4 x float> @test2(<4 x float> %a, <4 x float> %b, <4 x float> %c) {21; CHECK-LABEL: test2:22; CHECK: # %bb.0:23; CHECK-NEXT: vfmsubss {{.*#+}} xmm0 = (xmm0 * xmm1) - xmm224; CHECK-NEXT: retq25 %sub.i = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %c26 %res = tail call <4 x float> @llvm.x86.fma4.vfmadd.ss(<4 x float> %a, <4 x float> %b, <4 x float> %sub.i)27 ret <4 x float> %res28}29 30define <4 x float> @test3(<4 x float> %a, <4 x float> %b, <4 x float> %c) {31; CHECK-LABEL: test3:32; CHECK: # %bb.0:33; CHECK-NEXT: vfnmaddss {{.*#+}} xmm0 = -(xmm0 * xmm1) + xmm234; CHECK-NEXT: retq35 %sub.i = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %b36 %res = tail call <4 x float> @llvm.x86.fma4.vfmadd.ss(<4 x float> %a, <4 x float> %sub.i, <4 x float> %c)37 ret <4 x float> %res38}39 40define <4 x float> @test4(<4 x float> %a, <4 x float> %b, <4 x float> %c) {41; CHECK-LABEL: test4:42; CHECK: # %bb.0:43; CHECK-NEXT: vfnmaddss {{.*#+}} xmm0 = -(xmm0 * xmm1) + xmm244; CHECK-NEXT: retq45 %sub.i = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %a46 %res = tail call <4 x float> @llvm.x86.fma4.vfmadd.ss(<4 x float> %sub.i, <4 x float> %b, <4 x float> %c)47 ret <4 x float> %res48}49 50define <4 x float> @test5(<4 x float> %a, <4 x float> %b, <4 x float> %c) {51; CHECK-LABEL: test5:52; CHECK: # %bb.0:53; CHECK-NEXT: vfnmsubss {{.*#+}} xmm0 = -(xmm0 * xmm1) - xmm254; CHECK-NEXT: retq55 %sub.i = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %a56 %sub.i.2 = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %c57 %res = tail call <4 x float> @llvm.x86.fma4.vfmadd.ss(<4 x float> %sub.i, <4 x float> %b, <4 x float> %sub.i.2)58 ret <4 x float> %res59}60 61define <2 x double> @test6(<2 x double> %a, <2 x double> %b, <2 x double> %c) {62; CHECK-LABEL: test6:63; CHECK: # %bb.0:64; CHECK-NEXT: vfmaddsd {{.*#+}} xmm0 = (xmm0 * xmm1) + xmm265; CHECK-NEXT: vxorpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm066; CHECK-NEXT: retq67 %res = tail call <2 x double> @llvm.x86.fma4.vfmadd.sd(<2 x double> %a, <2 x double> %b, <2 x double> %c)68 %sub.i = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %res69 ret <2 x double> %sub.i70}71 72define <2 x double> @test7(<2 x double> %a, <2 x double> %b, <2 x double> %c) {73; CHECK-LABEL: test7:74; CHECK: # %bb.0:75; CHECK-NEXT: vfmsubsd {{.*#+}} xmm0 = (xmm0 * xmm1) - xmm276; CHECK-NEXT: retq77 %sub.i = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %c78 %res = tail call <2 x double> @llvm.x86.fma4.vfmadd.sd(<2 x double> %a, <2 x double> %b, <2 x double> %sub.i)79 ret <2 x double> %res80}81 82define <2 x double> @test8(<2 x double> %a, <2 x double> %b, <2 x double> %c) {83; CHECK-LABEL: test8:84; CHECK: # %bb.0:85; CHECK-NEXT: vfnmaddsd {{.*#+}} xmm0 = -(xmm0 * xmm1) + xmm286; CHECK-NEXT: retq87 %sub.i = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %b88 %res = tail call <2 x double> @llvm.x86.fma4.vfmadd.sd(<2 x double> %a, <2 x double> %sub.i, <2 x double> %c)89 ret <2 x double> %res90}91 92define <2 x double> @test9(<2 x double> %a, <2 x double> %b, <2 x double> %c) {93; CHECK-LABEL: test9:94; CHECK: # %bb.0:95; CHECK-NEXT: vfnmaddsd {{.*#+}} xmm0 = -(xmm0 * xmm1) + xmm296; CHECK-NEXT: retq97 %sub.i = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %a98 %res = tail call <2 x double> @llvm.x86.fma4.vfmadd.sd(<2 x double> %sub.i, <2 x double> %b, <2 x double> %c)99 ret <2 x double> %res100}101 102define <2 x double> @test10(<2 x double> %a, <2 x double> %b, <2 x double> %c) {103; CHECK-LABEL: test10:104; CHECK: # %bb.0:105; CHECK-NEXT: vfnmsubsd {{.*#+}} xmm0 = -(xmm0 * xmm1) - xmm2106; CHECK-NEXT: retq107 %sub.i = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %a108 %sub.i.2 = fsub <2 x double> <double -0.000000e+00, double -0.000000e+00>, %c109 %res = tail call <2 x double> @llvm.x86.fma4.vfmadd.sd(<2 x double> %sub.i, <2 x double> %b, <2 x double> %sub.i.2)110 ret <2 x double> %res111}112