blob: 7d80d2cc8e037d96a935cac0d4f87cecf3199332 [file] [log] [blame]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -mattr=+d -verify-machineinstrs < %s \
; RUN: | FileCheck -check-prefix=RV32IFD %s
declare double @llvm.floor.f64(double)
; The call to ffloor is introduced very late, meaning this test case covers
; aspects of passing f64 on RV32D soft-float that double-calling-conv.ll
; doesn't.
define double @foo(double %a) nounwind {
; RV32IFD-LABEL: foo:
; RV32IFD: # %bb.0:
; RV32IFD-NEXT: addi sp, sp, -16
; RV32IFD-NEXT: sw ra, 12(sp)
; RV32IFD-NEXT: call floor
; RV32IFD-NEXT: lw ra, 12(sp)
; RV32IFD-NEXT: addi sp, sp, 16
; RV32IFD-NEXT: ret
%1 = call double @llvm.floor.f64(double %a)
ret double %1
}