Home | History | Annotate | Download | only in PowerPC
      1 ; RUN: llc -verify-machineinstrs -mcpu=a2 < %s | FileCheck %s -check-prefix=FPCVT
      2 ; RUN: llc -verify-machineinstrs -mcpu=ppc64 < %s | FileCheck %s -check-prefix=PPC64
      3 target datalayout = "E-m:e-i64:64-n32:64"
      4 target triple = "powerpc64-unknown-linux-gnu"
      5 
      6 ; Function Attrs: nounwind readnone
      7 define float @fool(float %X) #0 {
      8 entry:
      9   %conv = fptosi float %X to i64
     10   %conv1 = sitofp i64 %conv to float
     11   ret float %conv1
     12 
     13 ; FPCVT-LABEL: @fool
     14 ; FPCVT: friz 1, 1
     15 ; FPCVT: blr
     16 
     17 ; PPC64-LABEL: @fool
     18 ; PPC64: fctidz [[REG1:[0-9]+]], 1
     19 ; PPC64: fcfid [[REG2:[0-9]+]], [[REG1]]
     20 ; PPC64: frsp 1, [[REG2]]
     21 ; PPC64: blr
     22 }
     23 
     24 ; Function Attrs: nounwind readnone
     25 define double @foodl(double %X) #0 {
     26 entry:
     27   %conv = fptosi double %X to i64
     28   %conv1 = sitofp i64 %conv to double
     29   ret double %conv1
     30 
     31 ; FPCVT-LABEL: @foodl
     32 ; FPCVT: friz 1, 1
     33 ; FPCVT: blr
     34 
     35 ; PPC64-LABEL: @foodl
     36 ; PPC64: fctidz [[REG1:[0-9]+]], 1
     37 ; PPC64: fcfid 1, [[REG1]]
     38 ; PPC64: blr
     39 }
     40 
     41 ; Function Attrs: nounwind readnone
     42 define float @fooul(float %X) #0 {
     43 entry:
     44   %conv = fptoui float %X to i64
     45   %conv1 = uitofp i64 %conv to float
     46   ret float %conv1
     47 
     48 ; FPCVT-LABEL: @fooul
     49 ; FPCVT: friz 1, 1
     50 ; FPCVT: blr
     51 }
     52 
     53 ; Function Attrs: nounwind readnone
     54 define double @fooudl(double %X) #0 {
     55 entry:
     56   %conv = fptoui double %X to i64
     57   %conv1 = uitofp i64 %conv to double
     58   ret double %conv1
     59 
     60 ; FPCVT-LABEL: @fooudl
     61 ; FPCVT: friz 1, 1
     62 ; FPCVT: blr
     63 }
     64 
     65 attributes #0 = { nounwind readnone "no-signed-zeros-fp-math"="true" }
     66 
     67