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=i686-unknown -mattr=+sse4.2   | FileCheck %s --check-prefix=X32
      3 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.2 | FileCheck %s --check-prefix=X64
      4 
      5 define float @extractFloat1() nounwind {
      6 ; X32-LABEL: extractFloat1:
      7 ; X32:       # %bb.0: # %entry
      8 ; X32-NEXT:    fld1
      9 ; X32-NEXT:    retl
     10 ;
     11 ; X64-LABEL: extractFloat1:
     12 ; X64:       # %bb.0: # %entry
     13 ; X64-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
     14 ; X64-NEXT:    retq
     15 entry:
     16   %tmp0 = bitcast <1 x double> <double 0x000000003F800000> to <2 x float>
     17   %tmp1 = extractelement <2 x float> %tmp0, i32 0
     18   ret float %tmp1
     19 }
     20 
     21 define float @extractFloat2() nounwind {
     22 ; X32-LABEL: extractFloat2:
     23 ; X32:       # %bb.0: # %entry
     24 ; X32-NEXT:    fldz
     25 ; X32-NEXT:    retl
     26 ;
     27 ; X64-LABEL: extractFloat2:
     28 ; X64:       # %bb.0: # %entry
     29 ; X64-NEXT:    xorps %xmm0, %xmm0
     30 ; X64-NEXT:    retq
     31 entry:
     32   %tmp4 = bitcast <1 x double> <double 0x000000003F800000> to <2 x float>
     33   %tmp5 = extractelement <2 x float> %tmp4, i32 1
     34   ret float %tmp5
     35 }
     36 
     37 define i32 @extractInt2() nounwind {
     38 ; X32-LABEL: extractInt2:
     39 ; X32:       # %bb.0: # %entry
     40 ; X32-NEXT:    xorl %eax, %eax
     41 ; X32-NEXT:    retl
     42 ;
     43 ; X64-LABEL: extractInt2:
     44 ; X64:       # %bb.0: # %entry
     45 ; X64-NEXT:    xorl %eax, %eax
     46 ; X64-NEXT:    retq
     47 entry:
     48   %tmp4 = bitcast <1 x i64> <i64 256> to <2 x i32>
     49   %tmp5 = extractelement <2 x i32> %tmp4, i32 1
     50   ret i32 %tmp5
     51 }
     52 
     53