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 4 5 define <4 x double> @cmp4f64_domain(<4 x double> %a) { 6 ; X86-LABEL: cmp4f64_domain: 7 ; X86: # %bb.0: 8 ; X86-NEXT: vxorps %xmm1, %xmm1, %xmm1 9 ; X86-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1 10 ; X86-NEXT: vaddpd %ymm1, %ymm0, %ymm0 11 ; X86-NEXT: retl 12 ; 13 ; X64-LABEL: cmp4f64_domain: 14 ; X64: # %bb.0: 15 ; X64-NEXT: vxorps %xmm1, %xmm1, %xmm1 16 ; X64-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1 17 ; X64-NEXT: vaddpd %ymm1, %ymm0, %ymm0 18 ; X64-NEXT: retq 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 23 ret <4 x double> %add 24 } 25 26 define <4 x double> @cmp4f64_domain_optsize(<4 x double> %a) optsize { 27 ; X86-LABEL: cmp4f64_domain_optsize: 28 ; X86: # %bb.0: 29 ; X86-NEXT: vxorps %xmm1, %xmm1, %xmm1 30 ; X86-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1 31 ; X86-NEXT: vaddpd %ymm1, %ymm0, %ymm0 32 ; X86-NEXT: retl 33 ; 34 ; X64-LABEL: cmp4f64_domain_optsize: 35 ; X64: # %bb.0: 36 ; X64-NEXT: vxorps %xmm1, %xmm1, %xmm1 37 ; X64-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1 38 ; X64-NEXT: vaddpd %ymm1, %ymm0, %ymm0 39 ; X64-NEXT: retq 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 44 ret <4 x double> %add 45 } 46 47 define <8 x float> @cmp8f32_domain(<8 x float> %a) { 48 ; X86-LABEL: cmp8f32_domain: 49 ; X86: # %bb.0: 50 ; X86-NEXT: vxorps %xmm1, %xmm1, %xmm1 51 ; X86-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1 52 ; X86-NEXT: vaddps %ymm1, %ymm0, %ymm0 53 ; X86-NEXT: retl 54 ; 55 ; X64-LABEL: cmp8f32_domain: 56 ; X64: # %bb.0: 57 ; X64-NEXT: vxorps %xmm1, %xmm1, %xmm1 58 ; X64-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1 59 ; X64-NEXT: vaddps %ymm1, %ymm0, %ymm0 60 ; X64-NEXT: retq 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 65 ret <8 x float> %add 66 } 67 68 define <8 x float> @cmp8f32_domain_optsize(<8 x float> %a) optsize { 69 ; X86-LABEL: cmp8f32_domain_optsize: 70 ; X86: # %bb.0: 71 ; X86-NEXT: vxorps %xmm1, %xmm1, %xmm1 72 ; X86-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1 73 ; X86-NEXT: vaddps %ymm1, %ymm0, %ymm0 74 ; X86-NEXT: retl 75 ; 76 ; X64-LABEL: cmp8f32_domain_optsize: 77 ; X64: # %bb.0: 78 ; X64-NEXT: vxorps %xmm1, %xmm1, %xmm1 79 ; X64-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1 80 ; X64-NEXT: vaddps %ymm1, %ymm0, %ymm0 81 ; X64-NEXT: retq 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 86 ret <8 x float> %add 87 } 88