From 9884dd1034e29a9ecb66db8bb229dac73d377d18 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Mon, 21 Jan 2019 22:12:35 +0000 Subject: [PATCH] [x86] add another test for xor with undefs; NFC llvm-svn: 351764 --- llvm/test/CodeGen/X86/vector-partial-undef.ll | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/llvm/test/CodeGen/X86/vector-partial-undef.ll b/llvm/test/CodeGen/X86/vector-partial-undef.ll index 3e9092418b63..1cd3415d082f 100644 --- a/llvm/test/CodeGen/X86/vector-partial-undef.ll +++ b/llvm/test/CodeGen/X86/vector-partial-undef.ll @@ -23,6 +23,25 @@ define <4 x i64> @xor_insert_insert(<2 x i64> %x, <2 x i64> %y) { ret <4 x i64> %r } +define <4 x i64> @xor_insert_insert_high_half(<2 x i64> %x, <2 x i64> %y) { +; SSE-LABEL: xor_insert_insert_high_half: +; SSE: # %bb.0: +; SSE-NEXT: xorps %xmm0, %xmm1 +; SSE-NEXT: xorps %xmm0, %xmm0 +; SSE-NEXT: retq +; +; AVX-LABEL: xor_insert_insert_high_half: +; AVX: # %bb.0: +; AVX-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0 +; AVX-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm1 +; AVX-NEXT: vxorps %ymm1, %ymm0, %ymm0 +; AVX-NEXT: retq + %xw = shufflevector <2 x i64> %x, <2 x i64> undef, <4 x i32> + %yw = shufflevector <2 x i64> %y, <2 x i64> undef, <4 x i32> + %r = xor <4 x i64> %xw, %yw + ret <4 x i64> %r +} + ; All elements of the add are undefined: ; x[0] , x[1] , x[2] , x[3], u , u , u , u ; + u , u , u , u , 42 , 43 , 44 , 45 -- 2.34.1