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"
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
18 ; PPC64: fctidz [[REG1:[0-9]+]], 1
19 ; PPC64: fcfid [[REG2:[0-9]+]], [[REG1]]
20 ; PPC64: frsp 1, [[REG2]]
24 ; Function Attrs: nounwind readnone
25 define double @foodl(double %X) #0 {
27 %conv = fptosi double %X to i64
28 %conv1 = sitofp i64 %conv to double
36 ; PPC64: fctidz [[REG1:[0-9]+]], 1
37 ; PPC64: fcfid 1, [[REG1]]
41 ; Function Attrs: nounwind readnone
42 define float @fooul(float %X) #0 {
44 %conv = fptoui float %X to i64
45 %conv1 = uitofp i64 %conv to float
53 ; Function Attrs: nounwind readnone
54 define double @fooudl(double %X) #0 {
56 %conv = fptoui double %X to i64
57 %conv1 = uitofp i64 %conv to double
60 ; FPCVT-LABEL: @fooudl
65 attributes #0 = { nounwind readnone "no-signed-zeros-fp-math"="true" }