Home | History | Annotate | Download | only in X86
      1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
      2 ; RUN: llc -verify-machineinstrs -mtriple=x86_64-unknown-unknown -mcpu=generic -mattr=+avx512f -fast-isel --fast-isel-abort=1 < %s | FileCheck %s --check-prefix=ALL --check-prefix=AVX
      3 
      4 
      5 define double @long_to_double_rr(i64 %a) {
      6 ; ALL-LABEL: long_to_double_rr:
      7 ; ALL:       # %bb.0: # %entry
      8 ; ALL-NEXT:    vcvtusi2sdq %rdi, %xmm0, %xmm0
      9 ; ALL-NEXT:    retq
     10 entry:
     11   %0 = uitofp i64 %a to double
     12   ret double %0
     13 }
     14 
     15 define double @long_to_double_rm(i64* %a) {
     16 ; ALL-LABEL: long_to_double_rm:
     17 ; ALL:       # %bb.0: # %entry
     18 ; ALL-NEXT:    movq (%rdi), %rax
     19 ; ALL-NEXT:    vcvtusi2sdq %rax, %xmm0, %xmm0
     20 ; ALL-NEXT:    retq
     21 entry:
     22   %0 = load i64, i64* %a
     23   %1 = uitofp i64 %0 to double
     24   ret double %1
     25 }
     26 
     27 define double @long_to_double_rm_optsize(i64* %a) optsize {
     28 ; ALL-LABEL: long_to_double_rm_optsize:
     29 ; ALL:       # %bb.0: # %entry
     30 ; ALL-NEXT:    vcvtusi2sdq (%rdi), %xmm0, %xmm0
     31 ; ALL-NEXT:    retq
     32 entry:
     33   %0 = load i64, i64* %a
     34   %1 = uitofp i64 %0 to double
     35   ret double %1
     36 }
     37 
     38 define float @long_to_float_rr(i64 %a) {
     39 ; ALL-LABEL: long_to_float_rr:
     40 ; ALL:       # %bb.0: # %entry
     41 ; ALL-NEXT:    vcvtusi2ssq %rdi, %xmm0, %xmm0
     42 ; ALL-NEXT:    retq
     43 entry:
     44   %0 = uitofp i64 %a to float
     45   ret float %0
     46 }
     47 
     48 define float @long_to_float_rm(i64* %a) {
     49 ; ALL-LABEL: long_to_float_rm:
     50 ; ALL:       # %bb.0: # %entry
     51 ; ALL-NEXT:    movq (%rdi), %rax
     52 ; ALL-NEXT:    vcvtusi2ssq %rax, %xmm0, %xmm0
     53 ; ALL-NEXT:    retq
     54 entry:
     55   %0 = load i64, i64* %a
     56   %1 = uitofp i64 %0 to float
     57   ret float %1
     58 }
     59 
     60 define float @long_to_float_rm_optsize(i64* %a) optsize {
     61 ; ALL-LABEL: long_to_float_rm_optsize:
     62 ; ALL:       # %bb.0: # %entry
     63 ; ALL-NEXT:    vcvtusi2ssq (%rdi), %xmm0, %xmm0
     64 ; ALL-NEXT:    retq
     65 entry:
     66   %0 = load i64, i64* %a
     67   %1 = uitofp i64 %0 to float
     68   ret float %1
     69 }
     70