1 ; RUN: llc -mcpu=a2 < %s | FileCheck %s -check-prefix=FPCVT
2 ; RUN: llc -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"
6 ; Function Attrs: nounwind readnone
7 define float @fool(float %X) #0 {
9 %conv = fptosi float %X to i64
10 %conv1 = sitofp i64 %conv to float
14 ; FPCVT: fctidz [[REG1:[0-9]+]], 1
15 ; FPCVT: fcfids 1, [[REG1]]
19 ; PPC64: fctidz [[REG1:[0-9]+]], 1
20 ; PPC64: fcfid [[REG2:[0-9]+]], [[REG1]]
21 ; PPC64: frsp 1, [[REG2]]
25 ; Function Attrs: nounwind readnone
26 define double @foodl(double %X) #0 {
28 %conv = fptosi double %X to i64
29 %conv1 = sitofp i64 %conv to double
33 ; FPCVT: fctidz [[REG1:[0-9]+]], 1
34 ; FPCVT: fcfid 1, [[REG1]]
38 ; PPC64: fctidz [[REG1:[0-9]+]], 1
39 ; PPC64: fcfid 1, [[REG1]]
43 ; Function Attrs: nounwind readnone
44 define float @fooul(float %X) #0 {
46 %conv = fptoui float %X to i64
47 %conv1 = uitofp i64 %conv to float
51 ; FPCVT: fctiduz [[REG1:[0-9]+]], 1
52 ; FPCVT: fcfidus 1, [[REG1]]
56 ; Function Attrs: nounwind readnone
57 define double @fooudl(double %X) #0 {
59 %conv = fptoui double %X to i64
60 %conv1 = uitofp i64 %conv to double
63 ; FPCVT-LABEL: @fooudl
64 ; FPCVT: fctiduz [[REG1:[0-9]+]], 1
65 ; FPCVT: fcfidu 1, [[REG1]]
69 attributes #0 = { nounwind readnone }