Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions llvm/lib/Target/Mips/MipsISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3060,6 +3060,11 @@ SDValue MipsTargetLowering::lowerSTRICT_FP_TO_INT(SDValue Op,
return DAG.getMergeValues({Result, Op.getOperand(0)}, Loc);
}

ArrayRef<MCPhysReg> MipsTargetLowering::getRoundingControlRegisters() const {
static const MCPhysReg RCRegs[] = {Mips::FCR31};
return RCRegs;
}

//===----------------------------------------------------------------------===//
// Calling Convention Implementation
//===----------------------------------------------------------------------===//
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/Target/Mips/MipsISelLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,8 @@ class TargetRegisterClass;
return true;
}

ArrayRef<MCPhysReg> getRoundingControlRegisters() const override;

/// Emit a sign-extension using sll/sra, seb, or seh appropriately.
MachineBasicBlock *emitSignExtendToI32InReg(MachineInstr &MI,
MachineBasicBlock *BB,
Expand Down
11 changes: 11 additions & 0 deletions llvm/test/CodeGen/Mips/strict-fp-func.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
; RUN: llc -mtriple=mips -stop-after=finalize-isel %s -o - | FileCheck %s

define float @func_02(float %x, float %y) strictfp nounwind {
; CHECK-LABEL: name: func_02
; CHECK: JAL @func_01, {{.*}}, implicit-def $fcr31
%call = call float @func_01(float %x) strictfp
%res = call float @llvm.experimental.constrained.fadd.f32(float %call, float %y, metadata !"round.dynamic", metadata !"fpexcept.ignore") strictfp
ret float %res
}

declare float @func_01(float)
Loading