1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=avx | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=avx | FileCheck %s --check-prefix=X64
5 define <4 x double> @cmp4f64_domain(<4 x double> %a) {
6 ; X86-LABEL: cmp4f64_domain:
8 ; X86-NEXT: vxorps %xmm1, %xmm1, %xmm1
9 ; X86-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1
10 ; X86-NEXT: vaddpd %ymm1, %ymm0, %ymm0
13 ; X64-LABEL: cmp4f64_domain:
15 ; X64-NEXT: vxorps %xmm1, %xmm1, %xmm1
16 ; X64-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1
17 ; X64-NEXT: vaddpd %ymm1, %ymm0, %ymm0
19 %cmp = fcmp oeq <4 x double> zeroinitializer, zeroinitializer
20 %sext = sext <4 x i1> %cmp to <4 x i64>
21 %mask = bitcast <4 x i64> %sext to <4 x double>
22 %add = fadd <4 x double> %a, %mask
26 define <4 x double> @cmp4f64_domain_optsize(<4 x double> %a) optsize {
27 ; X86-LABEL: cmp4f64_domain_optsize:
29 ; X86-NEXT: vxorps %xmm1, %xmm1, %xmm1
30 ; X86-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1
31 ; X86-NEXT: vaddpd %ymm1, %ymm0, %ymm0
34 ; X64-LABEL: cmp4f64_domain_optsize:
36 ; X64-NEXT: vxorps %xmm1, %xmm1, %xmm1
37 ; X64-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1
38 ; X64-NEXT: vaddpd %ymm1, %ymm0, %ymm0
40 %cmp = fcmp oeq <4 x double> zeroinitializer, zeroinitializer
41 %sext = sext <4 x i1> %cmp to <4 x i64>
42 %mask = bitcast <4 x i64> %sext to <4 x double>
43 %add = fadd <4 x double> %a, %mask
47 define <8 x float> @cmp8f32_domain(<8 x float> %a) {
48 ; X86-LABEL: cmp8f32_domain:
50 ; X86-NEXT: vxorps %xmm1, %xmm1, %xmm1
51 ; X86-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1
52 ; X86-NEXT: vaddps %ymm1, %ymm0, %ymm0
55 ; X64-LABEL: cmp8f32_domain:
57 ; X64-NEXT: vxorps %xmm1, %xmm1, %xmm1
58 ; X64-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1
59 ; X64-NEXT: vaddps %ymm1, %ymm0, %ymm0
61 %cmp = fcmp oeq <8 x float> zeroinitializer, zeroinitializer
62 %sext = sext <8 x i1> %cmp to <8 x i32>
63 %mask = bitcast <8 x i32> %sext to <8 x float>
64 %add = fadd <8 x float> %a, %mask
68 define <8 x float> @cmp8f32_domain_optsize(<8 x float> %a) optsize {
69 ; X86-LABEL: cmp8f32_domain_optsize:
71 ; X86-NEXT: vxorps %xmm1, %xmm1, %xmm1
72 ; X86-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1
73 ; X86-NEXT: vaddps %ymm1, %ymm0, %ymm0
76 ; X64-LABEL: cmp8f32_domain_optsize:
78 ; X64-NEXT: vxorps %xmm1, %xmm1, %xmm1
79 ; X64-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1
80 ; X64-NEXT: vaddps %ymm1, %ymm0, %ymm0
82 %cmp = fcmp oeq <8 x float> zeroinitializer, zeroinitializer
83 %sext = sext <8 x i1> %cmp to <8 x i32>
84 %mask = bitcast <8 x i32> %sext to <8 x float>
85 %add = fadd <8 x float> %a, %mask