1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=core-avx2 -mattr=avx2,+fma -fp-contract=fast | FileCheck %s
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=bdver2 -mattr=-fma4 -fp-contract=fast | FileCheck %s
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=bdver1 -fp-contract=fast | FileCheck %s --check-prefix=CHECK_FMA4
5 ; CHECK-LABEL: test_x86_fmadd_ps_y_wide
9 ; CHECK_FMA4-LABEL: test_x86_fmadd_ps_y_wide
10 ; CHECK_FMA4: vfmaddps
11 ; CHECK_FMA4: vfmaddps
13 define <16 x float> @test_x86_fmadd_ps_y_wide(<16 x float> %a0, <16 x float> %a1, <16 x float> %a2) {
14 %x = fmul <16 x float> %a0, %a1
15 %res = fadd <16 x float> %x, %a2
19 ; CHECK-LABEL: test_x86_fmsub_ps_y_wide
23 ; CHECK_FMA4-LABEL: test_x86_fmsub_ps_y_wide
24 ; CHECK_FMA4: vfmsubps
25 ; CHECK_FMA4: vfmsubps
27 define <16 x float> @test_x86_fmsub_ps_y_wide(<16 x float> %a0, <16 x float> %a1, <16 x float> %a2) {
28 %x = fmul <16 x float> %a0, %a1
29 %res = fsub <16 x float> %x, %a2
33 ; CHECK-LABEL: test_x86_fnmadd_ps_y_wide
37 ; CHECK_FMA4-LABEL: test_x86_fnmadd_ps_y_wide
38 ; CHECK_FMA4: vfnmaddps
39 ; CHECK_FMA4: vfnmaddps
41 define <16 x float> @test_x86_fnmadd_ps_y_wide(<16 x float> %a0, <16 x float> %a1, <16 x float> %a2) {
42 %x = fmul <16 x float> %a0, %a1
43 %res = fsub <16 x float> %a2, %x
47 ; CHECK-LABEL: test_x86_fnmsub_ps_y_wide
51 define <16 x float> @test_x86_fnmsub_ps_y_wide(<16 x float> %a0, <16 x float> %a1, <16 x float> %a2) {
52 %x = fmul <16 x float> %a0, %a1
53 %y = fsub <16 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %x
54 %res = fsub <16 x float> %y, %a2
58 ; CHECK-LABEL: test_x86_fmadd_pd_y_wide
62 ; CHECK_FMA4-LABEL: test_x86_fmadd_pd_y_wide
63 ; CHECK_FMA4: vfmaddpd
64 ; CHECK_FMA4: vfmaddpd
66 define <8 x double> @test_x86_fmadd_pd_y_wide(<8 x double> %a0, <8 x double> %a1, <8 x double> %a2) {
67 %x = fmul <8 x double> %a0, %a1
68 %res = fadd <8 x double> %x, %a2
72 ; CHECK-LABEL: test_x86_fmsub_pd_y_wide
76 ; CHECK_FMA4-LABEL: test_x86_fmsub_pd_y_wide
77 ; CHECK_FMA4: vfmsubpd
78 ; CHECK_FMA4: vfmsubpd
80 define <8 x double> @test_x86_fmsub_pd_y_wide(<8 x double> %a0, <8 x double> %a1, <8 x double> %a2) {
81 %x = fmul <8 x double> %a0, %a1
82 %res = fsub <8 x double> %x, %a2