Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx | FileCheck %s
      2 
      3 ; Check that we generate vector conversion from float to narrower int types
      4 
      5 %f32vec_t = type <8 x float>
      6 %i16vec_t = type <8 x i16>
      7 %i8vec_t =  type <8 x i8>
      8 
      9 define void @fptoui16(%f32vec_t %a, %i16vec_t *%p) {
     10 ; CHECK-LABEL: fptoui16:
     11 ; CHECK: vcvttps2dq %ymm
     12 ; CHECK-NOT: vcvttss2si
     13   %b = fptoui %f32vec_t %a to %i16vec_t
     14   store %i16vec_t %b, %i16vec_t * %p
     15   ret void
     16 }
     17 
     18 define void @fptosi16(%f32vec_t %a, %i16vec_t *%p) {
     19 ; CHECK-LABEL: fptosi16:
     20 ; CHECK: vcvttps2dq %ymm
     21 ; CHECK-NOT: vcvttss2si
     22   %b = fptosi %f32vec_t %a to %i16vec_t
     23   store %i16vec_t %b, %i16vec_t * %p
     24   ret void
     25 }
     26 
     27 define void @fptoui8(%f32vec_t %a, %i8vec_t *%p) {
     28 ; CHECK-LABEL: fptoui8:
     29 ; CHECK: vcvttps2dq %ymm
     30 ; CHECK-NOT: vcvttss2si
     31   %b = fptoui %f32vec_t %a to %i8vec_t
     32   store %i8vec_t %b, %i8vec_t * %p
     33   ret void
     34 }
     35 
     36 define void @fptosi8(%f32vec_t %a, %i8vec_t *%p) {
     37 ; CHECK-LABEL: fptosi8:
     38 ; CHECK: vcvttps2dq %ymm
     39 ; CHECK-NOT: vcvttss2si
     40   %b = fptosi %f32vec_t %a to %i8vec_t
     41   store %i8vec_t %b, %i8vec_t * %p
     42   ret void
     43 }
     44