1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl,+prefer-256-bit | FileCheck %s --check-prefix=AVX256NOBW 3; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl,-prefer-256-bit | FileCheck %s --check-prefix=AVX512NOBW 4; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+prefer-256-bit | FileCheck %s --check-prefix=AVX512NOBW 5; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,-prefer-256-bit | FileCheck %s --check-prefix=AVX512NOBW 6; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw,+prefer-256-bit | FileCheck %s --check-prefix=AVX512BW 7; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw,-prefer-256-bit | FileCheck %s --check-prefix=AVX512BW 8; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw,+avx512vl,+prefer-256-bit | FileCheck %s --check-prefix=AVX256BWVL 9; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw,+avx512vl,-prefer-256-bit | FileCheck %s --check-prefix=AVX512BWVL 10 11define <16 x i8> @testv16i16_trunc_v16i8(<16 x i16> %x) { 12; AVX256NOBW-LABEL: testv16i16_trunc_v16i8: 13; AVX256NOBW: # %bb.0: 14; AVX256NOBW-NEXT: vpand {{.*}}(%rip), %ymm0, %ymm0 15; AVX256NOBW-NEXT: vextracti128 $1, %ymm0, %xmm1 16; AVX256NOBW-NEXT: vpackuswb %xmm1, %xmm0, %xmm0 17; AVX256NOBW-NEXT: vzeroupper 18; AVX256NOBW-NEXT: retq 19; 20; AVX512NOBW-LABEL: testv16i16_trunc_v16i8: 21; AVX512NOBW: # %bb.0: 22; AVX512NOBW-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero 23; AVX512NOBW-NEXT: vpmovdb %zmm0, %xmm0 24; AVX512NOBW-NEXT: vzeroupper 25; AVX512NOBW-NEXT: retq 26; 27; AVX512BW-LABEL: testv16i16_trunc_v16i8: 28; AVX512BW: # %bb.0: 29; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0 30; AVX512BW-NEXT: vpmovwb %zmm0, %ymm0 31; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0 32; AVX512BW-NEXT: vzeroupper 33; AVX512BW-NEXT: retq 34; 35; AVX256BWVL-LABEL: testv16i16_trunc_v16i8: 36; AVX256BWVL: # %bb.0: 37; AVX256BWVL-NEXT: vpmovwb %ymm0, %xmm0 38; AVX256BWVL-NEXT: vzeroupper 39; AVX256BWVL-NEXT: retq 40; 41; AVX512BWVL-LABEL: testv16i16_trunc_v16i8: 42; AVX512BWVL: # %bb.0: 43; AVX512BWVL-NEXT: vpmovwb %ymm0, %xmm0 44; AVX512BWVL-NEXT: vzeroupper 45; AVX512BWVL-NEXT: retq 46 %trunc = trunc <16 x i16> %x to <16 x i8> 47 ret <16 x i8> %trunc 48} 49