Line endings.
authorMatt Beaumont-Gay <matthewbg@google.com>
Wed, 1 Aug 2012 16:42:35 +0000 (16:42 +0000)
committerMatt Beaumont-Gay <matthewbg@google.com>
Wed, 1 Aug 2012 16:42:35 +0000 (16:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161117 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/X86/fma_patterns.ll

index b04663a602433d6b8fdadf1ff20a4831ba4af8ac..5d97a87b3bbfe90042d1a83121eb94df734f1eb5 100644 (file)
-; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=core-avx2 -mattr=avx2,+fma -fp-contract=fast | FileCheck %s\r
-\r
-; CHECK: test_x86_fmadd_ps\r
-; CHECK: vfmadd213ps     %xmm2, %xmm0, %xmm1\r
-; CHECK: ret\r
-define <4 x float> @test_x86_fmadd_ps(<4 x float> %a0, <4 x float> %a1, <4 x float> %a2) {\r
-  %x = fmul <4 x float> %a0, %a1\r
-  %res = fadd <4 x float> %x, %a2\r
-  ret <4 x float> %res\r
-}\r
-\r
-; CHECK: test_x86_fmsub_ps\r
-; CHECK: fmsub213ps     %xmm2, %xmm0, %xmm1\r
-; CHECK: ret\r
-define <4 x float> @test_x86_fmsub_ps(<4 x float> %a0, <4 x float> %a1, <4 x float> %a2) {\r
-  %x = fmul <4 x float> %a0, %a1\r
-  %res = fsub <4 x float> %x, %a2\r
-  ret <4 x float> %res\r
-}\r
-\r
-; CHECK: test_x86_fnmadd_ps\r
-; CHECK: fnmadd213ps     %xmm2, %xmm0, %xmm1\r
-; CHECK: ret\r
-define <4 x float> @test_x86_fnmadd_ps(<4 x float> %a0, <4 x float> %a1, <4 x float> %a2) {\r
-  %x = fmul <4 x float> %a0, %a1\r
-  %res = fsub <4 x float> %a2, %x\r
-  ret <4 x float> %res\r
-}\r
-\r
-; CHECK: test_x86_fnmsub_ps\r
-; CHECK: fnmsub213ps     %xmm2, %xmm0, %xmm1\r
-; CHECK: ret\r
-define <4 x float> @test_x86_fnmsub_ps(<4 x float> %a0, <4 x float> %a1, <4 x float> %a2) {\r
-  %x = fmul <4 x float> %a0, %a1\r
-  %y = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %x\r
-  %res = fsub <4 x float> %y, %a2\r
-  ret <4 x float> %res\r
-}\r
-\r
-; CHECK: test_x86_fmadd_ps_y\r
-; CHECK: vfmadd213ps     %ymm2, %ymm0, %ymm1\r
-; CHECK: ret\r
-define <8 x float> @test_x86_fmadd_ps_y(<8 x float> %a0, <8 x float> %a1, <8 x float> %a2) {\r
-  %x = fmul <8 x float> %a0, %a1\r
-  %res = fadd <8 x float> %x, %a2\r
-  ret <8 x float> %res\r
-}\r
-\r
-; CHECK: test_x86_fmsub_ps_y\r
-; CHECK: vfmsub213ps     %ymm2, %ymm0, %ymm1\r
-; CHECK: ret\r
-define <8 x float> @test_x86_fmsub_ps_y(<8 x float> %a0, <8 x float> %a1, <8 x float> %a2) {\r
-  %x = fmul <8 x float> %a0, %a1\r
-  %res = fsub <8 x float> %x, %a2\r
-  ret <8 x float> %res\r
-}\r
-\r
-; CHECK: test_x86_fnmadd_ps_y\r
-; CHECK: vfnmadd213ps     %ymm2, %ymm0, %ymm1\r
-; CHECK: ret\r
-define <8 x float> @test_x86_fnmadd_ps_y(<8 x float> %a0, <8 x float> %a1, <8 x float> %a2) {\r
-  %x = fmul <8 x float> %a0, %a1\r
-  %res = fsub <8 x float> %a2, %x\r
-  ret <8 x float> %res\r
-}\r
-\r
-; CHECK: test_x86_fnmsub_ps_y\r
-; CHECK: vfnmsub213ps     %ymm2, %ymm0, %ymm1\r
-; CHECK: ret\r
-define <8 x float> @test_x86_fnmsub_ps_y(<8 x float> %a0, <8 x float> %a1, <8 x float> %a2) {\r
-  %x = fmul <8 x float> %a0, %a1\r
-  %y = fsub <8 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>, %x\r
-  %res = fsub <8 x float> %y, %a2\r
-  ret <8 x float> %res\r
-}\r
-\r
-; CHECK: test_x86_fmadd_pd_y\r
-; CHECK: vfmadd213pd     %ymm2, %ymm0, %ymm1\r
-; CHECK: ret\r
-define <4 x double> @test_x86_fmadd_pd_y(<4 x double> %a0, <4 x double> %a1, <4 x double> %a2) {\r
-  %x = fmul <4 x double> %a0, %a1\r
-  %res = fadd <4 x double> %x, %a2\r
-  ret <4 x double> %res\r
-}\r
-\r
-; CHECK: test_x86_fmsub_pd_y\r
-; CHECK: vfmsub213pd     %ymm2, %ymm0, %ymm1\r
-; CHECK: ret\r
-define <4 x double> @test_x86_fmsub_pd_y(<4 x double> %a0, <4 x double> %a1, <4 x double> %a2) {\r
-  %x = fmul <4 x double> %a0, %a1\r
-  %res = fsub <4 x double> %x, %a2\r
-  ret <4 x double> %res\r
-}\r
-\r
-; CHECK: test_x86_fmsub_pd\r
-; CHECK: vfmsub213pd     %xmm2, %xmm0, %xmm1\r
-; CHECK: ret\r
-define <2 x double> @test_x86_fmsub_pd(<2 x double> %a0, <2 x double> %a1, <2 x double> %a2) {\r
-  %x = fmul <2 x double> %a0, %a1\r
-  %res = fsub <2 x double> %x, %a2\r
-  ret <2 x double> %res\r
-}\r
-\r
-; CHECK: test_x86_fnmadd_ss\r
-; CHECK: vfnmadd213ss    %xmm2, %xmm0, %xmm1\r
-; CHECK: ret\r
-define float @test_x86_fnmadd_ss(float %a0, float %a1, float %a2) {\r
-  %x = fmul float %a0, %a1\r
-  %res = fsub float %a2, %x\r
-  ret float %res\r
-}\r
-\r
-; CHECK: test_x86_fnmadd_sd\r
-; CHECK: vfnmadd213sd     %xmm2, %xmm0, %xmm1\r
-; CHECK: ret\r
-define double @test_x86_fnmadd_sd(double %a0, double %a1, double %a2) {\r
-  %x = fmul double %a0, %a1\r
-  %res = fsub double %a2, %x\r
-  ret double %res\r
-}\r
-\r
-; CHECK: test_x86_fmsub_sd\r
-; CHECK: vfmsub213sd     %xmm2, %xmm0, %xmm1\r
-; CHECK: ret\r
-define double @test_x86_fmsub_sd(double %a0, double %a1, double %a2) {\r
-  %x = fmul double %a0, %a1\r
-  %res = fsub double %x, %a2\r
-  ret double %res\r
-}\r
-\r
-; CHECK: test_x86_fnmsub_ss\r
-; CHECK: vfnmsub213ss     %xmm2, %xmm0, %xmm1\r
-; CHECK: ret\r
-define float @test_x86_fnmsub_ss(float %a0, float %a1, float %a2) {\r
-  %x = fsub float -0.000000e+00, %a0\r
-  %y = fmul float %x, %a1\r
-  %res = fsub float %y, %a2\r
-  ret float %res\r
-}\r
+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=core-avx2 -mattr=avx2,+fma -fp-contract=fast | FileCheck %s
+
+; CHECK: test_x86_fmadd_ps
+; CHECK: vfmadd213ps     %xmm2, %xmm0, %xmm1
+; CHECK: ret
+define <4 x float> @test_x86_fmadd_ps(<4 x float> %a0, <4 x float> %a1, <4 x float> %a2) {
+  %x = fmul <4 x float> %a0, %a1
+  %res = fadd <4 x float> %x, %a2
+  ret <4 x float> %res
+}
+
+; CHECK: test_x86_fmsub_ps
+; CHECK: fmsub213ps     %xmm2, %xmm0, %xmm1
+; CHECK: ret
+define <4 x float> @test_x86_fmsub_ps(<4 x float> %a0, <4 x float> %a1, <4 x float> %a2) {
+  %x = fmul <4 x float> %a0, %a1
+  %res = fsub <4 x float> %x, %a2
+  ret <4 x float> %res
+}
+
+; CHECK: test_x86_fnmadd_ps
+; CHECK: fnmadd213ps     %xmm2, %xmm0, %xmm1
+; CHECK: ret
+define <4 x float> @test_x86_fnmadd_ps(<4 x float> %a0, <4 x float> %a1, <4 x float> %a2) {
+  %x = fmul <4 x float> %a0, %a1
+  %res = fsub <4 x float> %a2, %x
+  ret <4 x float> %res
+}
+
+; CHECK: test_x86_fnmsub_ps
+; CHECK: fnmsub213ps     %xmm2, %xmm0, %xmm1
+; CHECK: ret
+define <4 x float> @test_x86_fnmsub_ps(<4 x float> %a0, <4 x float> %a1, <4 x float> %a2) {
+  %x = fmul <4 x float> %a0, %a1
+  %y = fsub <4 x float> <float -0.000000e+00, float -0.000000e+00, float -0.000000e+00, float -0.000000e+00>, %x
+  %res = fsub <4 x float> %y, %a2
+  ret <4 x float> %res
+}
+
+; CHECK: test_x86_fmadd_ps_y
+; CHECK: vfmadd213ps     %ymm2, %ymm0, %ymm1
+; CHECK: ret
+define <8 x float> @test_x86_fmadd_ps_y(<8 x float> %a0, <8 x float> %a1, <8 x float> %a2) {
+  %x = fmul <8 x float> %a0, %a1
+  %res = fadd <8 x float> %x, %a2
+  ret <8 x float> %res
+}
+
+; CHECK: test_x86_fmsub_ps_y
+; CHECK: vfmsub213ps     %ymm2, %ymm0, %ymm1
+; CHECK: ret
+define <8 x float> @test_x86_fmsub_ps_y(<8 x float> %a0, <8 x float> %a1, <8 x float> %a2) {
+  %x = fmul <8 x float> %a0, %a1
+  %res = fsub <8 x float> %x, %a2
+  ret <8 x float> %res
+}
+
+; CHECK: test_x86_fnmadd_ps_y
+; CHECK: vfnmadd213ps     %ymm2, %ymm0, %ymm1
+; CHECK: ret
+define <8 x float> @test_x86_fnmadd_ps_y(<8 x float> %a0, <8 x float> %a1, <8 x float> %a2) {
+  %x = fmul <8 x float> %a0, %a1
+  %res = fsub <8 x float> %a2, %x
+  ret <8 x float> %res
+}
+
+; CHECK: test_x86_fnmsub_ps_y
+; CHECK: vfnmsub213ps     %ymm2, %ymm0, %ymm1
+; CHECK: ret
+define <8 x float> @test_x86_fnmsub_ps_y(<8 x float> %a0, <8 x float> %a1, <8 x float> %a2) {
+  %x = fmul <8 x float> %a0, %a1
+  %y = fsub <8 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>, %x
+  %res = fsub <8 x float> %y, %a2
+  ret <8 x float> %res
+}
+
+; CHECK: test_x86_fmadd_pd_y
+; CHECK: vfmadd213pd     %ymm2, %ymm0, %ymm1
+; CHECK: ret
+define <4 x double> @test_x86_fmadd_pd_y(<4 x double> %a0, <4 x double> %a1, <4 x double> %a2) {
+  %x = fmul <4 x double> %a0, %a1
+  %res = fadd <4 x double> %x, %a2
+  ret <4 x double> %res
+}
+
+; CHECK: test_x86_fmsub_pd_y
+; CHECK: vfmsub213pd     %ymm2, %ymm0, %ymm1
+; CHECK: ret
+define <4 x double> @test_x86_fmsub_pd_y(<4 x double> %a0, <4 x double> %a1, <4 x double> %a2) {
+  %x = fmul <4 x double> %a0, %a1
+  %res = fsub <4 x double> %x, %a2
+  ret <4 x double> %res
+}
+
+; CHECK: test_x86_fmsub_pd
+; CHECK: vfmsub213pd     %xmm2, %xmm0, %xmm1
+; CHECK: ret
+define <2 x double> @test_x86_fmsub_pd(<2 x double> %a0, <2 x double> %a1, <2 x double> %a2) {
+  %x = fmul <2 x double> %a0, %a1
+  %res = fsub <2 x double> %x, %a2
+  ret <2 x double> %res
+}
+
+; CHECK: test_x86_fnmadd_ss
+; CHECK: vfnmadd213ss    %xmm2, %xmm0, %xmm1
+; CHECK: ret
+define float @test_x86_fnmadd_ss(float %a0, float %a1, float %a2) {
+  %x = fmul float %a0, %a1
+  %res = fsub float %a2, %x
+  ret float %res
+}
+
+; CHECK: test_x86_fnmadd_sd
+; CHECK: vfnmadd213sd     %xmm2, %xmm0, %xmm1
+; CHECK: ret
+define double @test_x86_fnmadd_sd(double %a0, double %a1, double %a2) {
+  %x = fmul double %a0, %a1
+  %res = fsub double %a2, %x
+  ret double %res
+}
+
+; CHECK: test_x86_fmsub_sd
+; CHECK: vfmsub213sd     %xmm2, %xmm0, %xmm1
+; CHECK: ret
+define double @test_x86_fmsub_sd(double %a0, double %a1, double %a2) {
+  %x = fmul double %a0, %a1
+  %res = fsub double %x, %a2
+  ret double %res
+}
+
+; CHECK: test_x86_fnmsub_ss
+; CHECK: vfnmsub213ss     %xmm2, %xmm0, %xmm1
+; CHECK: ret
+define float @test_x86_fnmsub_ss(float %a0, float %a1, float %a2) {
+  %x = fsub float -0.000000e+00, %a0
+  %y = fmul float %x, %a1
+  %res = fsub float %y, %a2
+  ret float %res
+}