From: Simon Pilgrim Date: Mon, 11 Mar 2019 18:08:20 +0000 (+0000) Subject: [X86] Extend widening comparison test. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca9c63cecee4a16b5939c8559d88fa982e805a99;p=llvm [X86] Extend widening comparison test. Ensure we test both v2i16 unary and binary comparisons. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355849 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/X86/widen_compare-1.ll b/test/CodeGen/X86/widen_compare-1.ll index 9c0fb0e7461..8e2005753bd 100644 --- a/test/CodeGen/X86/widen_compare-1.ll +++ b/test/CodeGen/X86/widen_compare-1.ll @@ -4,13 +4,13 @@ ; compare v2i16 -define <2 x i16> @compare_v2i64_to_v2i16(<2 x i16>* %src) nounwind { -; X86-LABEL: compare_v2i64_to_v2i16: +define <2 x i16> @compare_v2i64_to_v2i16_unary(<2 x i16>* %src) nounwind { +; X86-LABEL: compare_v2i64_to_v2i16_unary: ; X86: # %bb.0: ; X86-NEXT: pcmpeqd %xmm0, %xmm0 ; X86-NEXT: retl ; -; X64-LABEL: compare_v2i64_to_v2i16: +; X64-LABEL: compare_v2i64_to_v2i16_unary: ; X64: # %bb.0: ; X64-NEXT: pcmpeqd %xmm0, %xmm0 ; X64-NEXT: retq @@ -19,3 +19,30 @@ define <2 x i16> @compare_v2i64_to_v2i16(<2 x i16>* %src) nounwind { %sel = select <2 x i1> %cmp, <2 x i16> , <2 x i16> zeroinitializer ret <2 x i16> %sel } + +define <2 x i16> @compare_v2i64_to_v2i16_binary(<2 x i16>* %src0, <2 x i16>* %src1) nounwind { +; X86-LABEL: compare_v2i64_to_v2i16_binary: +; X86: # %bb.0: +; X86-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx +; X86-NEXT: pmovzxwq {{.*#+}} xmm0 = mem[0],zero,zero,zero,mem[1],zero,zero,zero +; X86-NEXT: pmovzxwq {{.*#+}} xmm1 = mem[0],zero,zero,zero,mem[1],zero,zero,zero +; X86-NEXT: pcmpgtq %xmm0, %xmm1 +; X86-NEXT: pcmpeqd %xmm0, %xmm0 +; X86-NEXT: pxor %xmm1, %xmm0 +; X86-NEXT: retl +; +; X64-LABEL: compare_v2i64_to_v2i16_binary: +; X64: # %bb.0: +; X64-NEXT: pmovzxwq {{.*#+}} xmm0 = mem[0],zero,zero,zero,mem[1],zero,zero,zero +; X64-NEXT: pmovzxwq {{.*#+}} xmm1 = mem[0],zero,zero,zero,mem[1],zero,zero,zero +; X64-NEXT: pcmpgtq %xmm0, %xmm1 +; X64-NEXT: pcmpeqd %xmm0, %xmm0 +; X64-NEXT: pxor %xmm1, %xmm0 +; X64-NEXT: retq + %val0 = load <2 x i16>, <2 x i16>* %src0, align 4 + %val1 = load <2 x i16>, <2 x i16>* %src1, align 4 + %cmp = icmp uge <2 x i16> %val0, %val1 + %sel = select <2 x i1> %cmp, <2 x i16> , <2 x i16> zeroinitializer + ret <2 x i16> %sel +}