From 08b65c5c9e58a4f9e79a52a0fccd70e4c4ebd43b Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 8 Mar 2023 21:33:36 -0800 Subject: [PATCH] [RISCV] Remove some trailing whitespace. NFC --- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | 4 ++-- llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 10 +++++----- llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp index bd5a17a..95254d0 100644 --- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp @@ -843,9 +843,9 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) { case ISD::ConstantFP: { const APFloat &APF = cast(Node)->getValueAPF(); if (Subtarget->hasStdExtZfa()) { - if ((VT == MVT::f64 && RISCVLoadFPImm::getLoadFP64Imm(APF) != -1) || + if ((VT == MVT::f64 && RISCVLoadFPImm::getLoadFP64Imm(APF) != -1) || (VT == MVT::f16 && RISCVLoadFPImm::getLoadFP16Imm(APF) != -1) || - (VT == MVT::f32 && RISCVLoadFPImm::getLoadFP32Imm(APF) != -1 && + (VT == MVT::f32 && RISCVLoadFPImm::getLoadFP32Imm(APF) != -1 && !APF.isPosZero())) break; } diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index 2bf2ed1..9e22baf 100644 --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -1537,13 +1537,13 @@ bool RISCVTargetLowering::isOffsetFoldingLegal( bool RISCVTargetLowering::isFPImmLegal(const APFloat &Imm, EVT VT, bool ForCodeSize) const { if (Subtarget.hasStdExtZfa()) { - if ((VT == MVT::f64 && RISCVLoadFPImm::getLoadFP64Imm(Imm) != -1) || + if ((VT == MVT::f64 && RISCVLoadFPImm::getLoadFP64Imm(Imm) != -1) || (VT == MVT::f16 && RISCVLoadFPImm::getLoadFP16Imm(Imm) != -1) || - (VT == MVT::f32 && RISCVLoadFPImm::getLoadFP32Imm(Imm) != -1 && + (VT == MVT::f32 && RISCVLoadFPImm::getLoadFP32Imm(Imm) != -1 && !Imm.isPosZero())) return true; } - + if (VT == MVT::f16 && !Subtarget.hasStdExtZfhOrZfhmin()) return false; if (VT == MVT::f32 && !Subtarget.hasStdExtF()) @@ -13790,11 +13790,11 @@ bool RISCVTargetLowering::isUsedByReturnOnly(SDNode *N, SDValue &Chain) const { return false; SDNode *Copy = *N->use_begin(); - + if (Copy->getOpcode() == ISD::BITCAST) { return isUsedByReturnOnly(Copy, Chain); } - + // TODO: Handle additional opcodes in order to support tail-calling libcalls // with soft float ABIs. if (Copy->getOpcode() != ISD::CopyToReg) { diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td index 2b37a8d..f498467 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td @@ -58,13 +58,13 @@ def rtzarg : Operand { //===----------------------------------------------------------------------===// let hasSideEffects = 0, mayLoad = 0, mayStore = 0, mayRaiseFPException = 1 in -class FPBinaryOp_rr funct7, bits<3> funct3, DAGOperand rdty, +class FPBinaryOp_rr funct7, bits<3> funct3, DAGOperand rdty, DAGOperand rsty, string opcodestr> - : RVInstR; let hasSideEffects = 0, mayLoad = 0, mayStore = 0, mayRaiseFPException = 1 in -class FPUnaryOp_imm funct7, bits<5> rs2val, bits<3> funct3, RISCVOpcode opcode, +class FPUnaryOp_imm funct7, bits<5> rs2val, bits<3> funct3, RISCVOpcode opcode, dag outs, dag ins, string opcodestr, string argstr> : RVInst { bits<5> imm; @@ -179,15 +179,15 @@ def : InstAlias<"fgeq.h $rd, $rs, $rt", //===----------------------------------------------------------------------===// def fp32imm_to_loadfpimm : SDNodeXFormgetTargetConstant(RISCVLoadFPImm::getLoadFP32Imm(N->getValueAPF()), + return CurDAG->getTargetConstant(RISCVLoadFPImm::getLoadFP32Imm(N->getValueAPF()), SDLoc(N), Subtarget->getXLenVT());}]>; def fp64imm_to_loadfpimm : SDNodeXFormgetTargetConstant(RISCVLoadFPImm::getLoadFP64Imm(N->getValueAPF()), + return CurDAG->getTargetConstant(RISCVLoadFPImm::getLoadFP64Imm(N->getValueAPF()), SDLoc(N), Subtarget->getXLenVT());}]>; def fp16imm_to_loadfpimm : SDNodeXFormgetTargetConstant(RISCVLoadFPImm::getLoadFP16Imm(N->getValueAPF()), + return CurDAG->getTargetConstant(RISCVLoadFPImm::getLoadFP16Imm(N->getValueAPF()), SDLoc(N), Subtarget->getXLenVT());}]>; let Predicates = [HasStdExtZfa] in { -- 2.7.4