xref: /llvm-project/llvm/test/CodeGen/PowerPC/aix-fptoint.ll (revision bf4596bf5862c0a7092507463f6df9e80566a93d)
11324bb29SStefan Pintilie; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
21324bb29SStefan Pintilie; RUN: llc -O3 -mtriple powerpc-ibm-aix -verify-machineinstrs < %s | FileCheck --check-prefix=32BIT %s
31324bb29SStefan Pintilie; RUN: llc -O3 -mtriple powerpc64-ibm-aix -verify-machineinstrs < %s | FileCheck --check-prefix=64BIT %s
41324bb29SStefan Pintilie
51324bb29SStefan Pintilie; Function Attrs: nounwind strictfp
61324bb29SStefan Pintiliedefine i64 @tester_s(double %d) local_unnamed_addr #0 {
71324bb29SStefan Pintilie; 32BIT-LABEL: tester_s:
81324bb29SStefan Pintilie; 32BIT:       # %bb.0: # %entry
91324bb29SStefan Pintilie; 32BIT-NEXT:    xscvdpsxds 0, 1
101324bb29SStefan Pintilie; 32BIT-NEXT:    stfd 0, -8(1)
111324bb29SStefan Pintilie; 32BIT-NEXT:    lwz 3, -8(1)
121324bb29SStefan Pintilie; 32BIT-NEXT:    lwz 4, -4(1)
131324bb29SStefan Pintilie; 32BIT-NEXT:    blr
141324bb29SStefan Pintilie;
151324bb29SStefan Pintilie; 64BIT-LABEL: tester_s:
161324bb29SStefan Pintilie; 64BIT:       # %bb.0: # %entry
171324bb29SStefan Pintilie; 64BIT-NEXT:    xscvdpsxds 0, 1
181324bb29SStefan Pintilie; 64BIT-NEXT:    stfd 0, -8(1)
191324bb29SStefan Pintilie; 64BIT-NEXT:    ld 3, -8(1)
201324bb29SStefan Pintilie; 64BIT-NEXT:    blr
211324bb29SStefan Pintilieentry:
221324bb29SStefan Pintilie  %conv = tail call i64 @llvm.experimental.constrained.fptosi.i64.f64(double %d, metadata !"fpexcept.ignore") #2
231324bb29SStefan Pintilie  ret i64 %conv
241324bb29SStefan Pintilie}
251324bb29SStefan Pintilie
261324bb29SStefan Pintilie; Function Attrs: nounwind strictfp
271324bb29SStefan Pintiliedefine i64 @tester_u(double %d) local_unnamed_addr #0 {
281324bb29SStefan Pintilie; 32BIT-LABEL: tester_u:
291324bb29SStefan Pintilie; 32BIT:       # %bb.0: # %entry
301324bb29SStefan Pintilie; 32BIT-NEXT:    xscvdpuxds 0, 1
311324bb29SStefan Pintilie; 32BIT-NEXT:    stfd 0, -8(1)
321324bb29SStefan Pintilie; 32BIT-NEXT:    lwz 3, -8(1)
331324bb29SStefan Pintilie; 32BIT-NEXT:    lwz 4, -4(1)
341324bb29SStefan Pintilie; 32BIT-NEXT:    blr
351324bb29SStefan Pintilie;
361324bb29SStefan Pintilie; 64BIT-LABEL: tester_u:
371324bb29SStefan Pintilie; 64BIT:       # %bb.0: # %entry
381324bb29SStefan Pintilie; 64BIT-NEXT:    xscvdpuxds 0, 1
391324bb29SStefan Pintilie; 64BIT-NEXT:    stfd 0, -8(1)
401324bb29SStefan Pintilie; 64BIT-NEXT:    ld 3, -8(1)
411324bb29SStefan Pintilie; 64BIT-NEXT:    blr
421324bb29SStefan Pintilieentry:
431324bb29SStefan Pintilie  %conv = tail call i64 @llvm.experimental.constrained.fptoui.i64.f64(double %d, metadata !"fpexcept.ignore") #2
441324bb29SStefan Pintilie  ret i64 %conv
451324bb29SStefan Pintilie}
461324bb29SStefan Pintilie
471324bb29SStefan Pintilie; Function Attrs: nounwind
481324bb29SStefan Pintiliedeclare i64 @llvm.experimental.constrained.fptosi.i64.f64(double, metadata) #1
491324bb29SStefan Pintiliedeclare i64 @llvm.experimental.constrained.fptoui.i64.f64(double, metadata) #1
501324bb29SStefan Pintilie
51*bf4596bfSMatt Arsenaultattributes #0 = { nounwind strictfp "target-cpu"="pwr7" }
521324bb29SStefan Pintilieattributes #1 = { nounwind }
531324bb29SStefan Pintilie
541324bb29SStefan Pintilie
55