1; RUN: llc -march=x86-64 -mattr=sse4.1 < %s | FileCheck %s -check-prefix=SSE4 2; RUN: llc -march=x86-64 -mattr=avx < %s | FileCheck %s -check-prefix=AVX1 3; RUN: llc -march=x86-64 -mattr=avx2 < %s | FileCheck %s -check-prefix=AVX2 4 5define <16 x i16> @split16(<16 x i16> %a, <16 x i16> %b, <16 x i8> %__mask) { 6; SSE4-LABEL: split16: 7; SSE4: pminuw 8; SSE4: pminuw 9; SSE4: ret 10; AVX1-LABEL: split16: 11; AVX1: vpminuw 12; AVX1: vpminuw 13; AVX1: ret 14; AVX2-LABEL: split16: 15; AVX2: vpminuw 16; AVX2: ret 17 %1 = icmp ult <16 x i16> %a, %b 18 %2 = select <16 x i1> %1, <16 x i16> %a, <16 x i16> %b 19 ret <16 x i16> %2 20} 21 22define <32 x i16> @split32(<32 x i16> %a, <32 x i16> %b, <32 x i8> %__mask) { 23; SSE4-LABEL: split32: 24; SSE4: pminuw 25; SSE4: pminuw 26; SSE4: pminuw 27; SSE4: pminuw 28; SSE4: ret 29; AVX1-LABEL: split32: 30; AVX1: vpminuw 31; AVX1: vpminuw 32; AVX1: vpminuw 33; AVX1: vpminuw 34; AVX1: ret 35; AVX2-LABEL: split32: 36; AVX2: vpminuw 37; AVX2: vpminuw 38; AVX2: ret 39 %1 = icmp ult <32 x i16> %a, %b 40 %2 = select <32 x i1> %1, <32 x i16> %a, <32 x i16> %b 41 ret <32 x i16> %2 42} 43 44; PR19492 45define i128 @split128(<2 x i128> %a, <2 x i128> %b) { 46; SSE4-LABEL: split128: 47; SSE4: addq 48; SSE4: adcq 49; SSE4: addq 50; SSE4: adcq 51; SSE4: addq 52; SSE4: adcq 53; SSE4: ret 54; AVX1-LABEL: split128: 55; AVX1: addq 56; AVX1: adcq 57; AVX1: addq 58; AVX1: adcq 59; AVX1: addq 60; AVX1: adcq 61; AVX1: ret 62; AVX2-LABEL: split128: 63; AVX2: addq 64; AVX2: adcq 65; AVX2: addq 66; AVX2: adcq 67; AVX2: addq 68; AVX2: adcq 69; AVX2: ret 70 %add = add nsw <2 x i128> %a, %b 71 %rdx.shuf = shufflevector <2 x i128> %add, <2 x i128> undef, <2 x i32> <i32 undef, i32 0> 72 %bin.rdx = add <2 x i128> %add, %rdx.shuf 73 %e = extractelement <2 x i128> %bin.rdx, i32 1 74 ret i128 %e 75} 76