Home | History | Annotate | Download | only in X86
      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=CHECK --check-prefix=AVX256 --check-prefix=AVX256NOBW
      3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl,-prefer-256-bit | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512NOBW --check-prefix=AVX512VL
      4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+prefer-256-bit | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512NOBW --check-prefix=AVX512F
      5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,-prefer-256-bit | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512NOBW --check-prefix=AVX512F
      6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw,+prefer-256-bit | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW
      7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw,-prefer-256-bit | FileCheck %s --check-prefix=CHECK --check-prefix=AVX512 --check-prefix=AVX512BW
      8 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw,+avx512vl,+prefer-256-bit | FileCheck %s --check-prefix=CHECK --check-prefix=AVX256 --check-prefix=AVX256BWVL
      9 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512bw,+avx512vl,-prefer-256-bit | FileCheck %s --check-prefix=CHECK --check-prefix=AVX256 --check-prefix=AVX512BWVL
     10 
     11 define <16 x i8> @testv16i16_trunc_v16i8(<16 x i16> %x) {
     12 ; AVX256NOBW-LABEL: testv16i16_trunc_v16i8:
     13 ; AVX256NOBW:       # %bb.0:
     14 ; AVX256NOBW-NEXT:    vextracti128 $1, %ymm0, %xmm1
     15 ; AVX256NOBW-NEXT:    vmovdqa {{.*#+}} xmm2 = <0,2,4,6,8,10,12,14,u,u,u,u,u,u,u,u>
     16 ; AVX256NOBW-NEXT:    vpshufb %xmm2, %xmm1, %xmm1
     17 ; AVX256NOBW-NEXT:    vpshufb %xmm2, %xmm0, %xmm0
     18 ; AVX256NOBW-NEXT:    vpunpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
     19 ; AVX256NOBW-NEXT:    vzeroupper
     20 ; AVX256NOBW-NEXT:    retq
     21 ;
     22 ; AVX512NOBW-LABEL: testv16i16_trunc_v16i8:
     23 ; AVX512NOBW:       # %bb.0:
     24 ; AVX512NOBW-NEXT:    vpmovsxwd %ymm0, %zmm0
     25 ; AVX512NOBW-NEXT:    vpmovdb %zmm0, %xmm0
     26 ; AVX512NOBW-NEXT:    vzeroupper
     27 ; AVX512NOBW-NEXT:    retq
     28 ;
     29 ; AVX512BW-LABEL: testv16i16_trunc_v16i8:
     30 ; AVX512BW:       # %bb.0:
     31 ; AVX512BW-NEXT:    # kill: def $ymm0 killed $ymm0 def $zmm0
     32 ; AVX512BW-NEXT:    vpmovwb %zmm0, %ymm0
     33 ; AVX512BW-NEXT:    # kill: def $xmm0 killed $xmm0 killed $ymm0
     34 ; AVX512BW-NEXT:    vzeroupper
     35 ; AVX512BW-NEXT:    retq
     36 ;
     37 ; AVX256BWVL-LABEL: testv16i16_trunc_v16i8:
     38 ; AVX256BWVL:       # %bb.0:
     39 ; AVX256BWVL-NEXT:    vpmovwb %ymm0, %xmm0
     40 ; AVX256BWVL-NEXT:    vzeroupper
     41 ; AVX256BWVL-NEXT:    retq
     42 ;
     43 ; AVX512BWVL-LABEL: testv16i16_trunc_v16i8:
     44 ; AVX512BWVL:       # %bb.0:
     45 ; AVX512BWVL-NEXT:    vpmovwb %ymm0, %xmm0
     46 ; AVX512BWVL-NEXT:    vzeroupper
     47 ; AVX512BWVL-NEXT:    retq
     48   %trunc = trunc <16 x i16> %x to <16 x i8>
     49   ret <16 x i8> %trunc
     50 }
     51