LLVM 20.0.0git
Macros | Typedefs | Enumerations | Functions | Variables
Mips16HardFloat.cpp File Reference
#include "MipsTargetMachine.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ModRef.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <string>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "mips16-hard-float"
 

Typedefs

using TypeID = Type::TypeID
 

Enumerations

enum  FPReturnVariant {
  FRet , DRet , CFRet , CDRet ,
  NoFPRet
}
 
enum  FPParamVariant {
  FSig , FFSig , FDSig , DSig ,
  DDSig , DFSig , NoSig
}
 

Functions

static void emitInlineAsm (LLVMContext &C, BasicBlock *BB, StringRef AsmText)
 
static FPReturnVariant whichFPReturnVariant (Type *T)
 
static FPParamVariant whichFPParamVariantNeeded (Function &F)
 
static bool needsFPStubFromParams (Function &F)
 
static bool needsFPReturnHelper (Function &F)
 
static bool needsFPReturnHelper (FunctionType &FT)
 
static bool needsFPHelperFromSig (Function &F)
 
static std::string swapFPIntParams (FPParamVariant PV, Module *M, bool LE, bool ToFP)
 
static void assureFPCallStub (Function &F, Module *M, const MipsTargetMachine &TM)
 
static bool isIntrinsicInline (Function *F)
 
static bool fixupFPReturnAndCall (Function &F, Module *M, const MipsTargetMachine &TM)
 
static void createFPFnStub (Function *F, Module *M, FPParamVariant PV, const MipsTargetMachine &TM)
 
static void removeUseSoftFloat (Function &F)
 

Variables

const Type::TypeID FloatTyID = Type::FloatTyID
 
const Type::TypeID DoubleTyID = Type::DoubleTyID
 
static const char *const IntrinsicInline []
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "mips16-hard-float"

Definition at line 25 of file Mips16HardFloat.cpp.

Typedef Documentation

◆ TypeID

Definition at line 103 of file Mips16HardFloat.cpp.

Enumeration Type Documentation

◆ FPParamVariant

Enumerator
FSig 
FFSig 
FDSig 
DSig 
DDSig 
DFSig 
NoSig 

Definition at line 97 of file Mips16HardFloat.cpp.

◆ FPReturnVariant

Enumerator
FRet 
DRet 
CFRet 
CDRet 
NoFPRet 

Definition at line 64 of file Mips16HardFloat.cpp.

Function Documentation

◆ assureFPCallStub()

static void assureFPCallStub ( Function F,
Module M,
const MipsTargetMachine TM 
)
static

◆ createFPFnStub()

static void createFPFnStub ( Function F,
Module M,
FPParamVariant  PV,
const MipsTargetMachine TM 
)
static

◆ emitInlineAsm()

static void emitInlineAsm ( LLVMContext C,
BasicBlock BB,
StringRef  AsmText 
)
static

◆ fixupFPReturnAndCall()

static bool fixupFPReturnAndCall ( Function F,
Module M,
const MipsTargetMachine TM 
)
static

◆ isIntrinsicInline()

static bool isIntrinsicInline ( Function F)
static

Definition at line 371 of file Mips16HardFloat.cpp.

References F, and IntrinsicInline.

Referenced by fixupFPReturnAndCall().

◆ needsFPHelperFromSig()

static bool needsFPHelperFromSig ( Function F)
static

Definition at line 181 of file Mips16HardFloat.cpp.

References F, needsFPReturnHelper(), and needsFPStubFromParams().

Referenced by fixupFPReturnAndCall().

◆ needsFPReturnHelper() [1/2]

static bool needsFPReturnHelper ( Function F)
static

Definition at line 171 of file Mips16HardFloat.cpp.

References F, NoFPRet, and whichFPReturnVariant().

Referenced by fixupFPReturnAndCall(), and needsFPHelperFromSig().

◆ needsFPReturnHelper() [2/2]

static bool needsFPReturnHelper ( FunctionType FT)
static

Definition at line 176 of file Mips16HardFloat.cpp.

References NoFPRet, and whichFPReturnVariant().

◆ needsFPStubFromParams()

static bool needsFPStubFromParams ( Function F)
static

◆ removeUseSoftFloat()

static void removeUseSoftFloat ( Function F)
static

Definition at line 483 of file Mips16HardFloat.cpp.

References llvm::errs(), F, and LLVM_DEBUG.

◆ swapFPIntParams()

static std::string swapFPIntParams ( FPParamVariant  PV,
Module M,
bool  LE,
bool  ToFP 
)
static

Definition at line 187 of file Mips16HardFloat.cpp.

References DDSig, DFSig, DSig, FDSig, FFSig, FSig, MI, and NoSig.

Referenced by assureFPCallStub(), and createFPFnStub().

◆ whichFPParamVariantNeeded()

static FPParamVariant whichFPParamVariantNeeded ( Function F)
static

Definition at line 107 of file Mips16HardFloat.cpp.

References DDSig, DFSig, DoubleTyID, DSig, F, FDSig, FFSig, FloatTyID, FSig, llvm_unreachable, and NoSig.

Referenced by assureFPCallStub().

◆ whichFPReturnVariant()

static FPReturnVariant whichFPReturnVariant ( Type T)
static

Variable Documentation

◆ DoubleTyID

const Type::TypeID DoubleTyID = Type::DoubleTyID

Definition at line 105 of file Mips16HardFloat.cpp.

Referenced by whichFPParamVariantNeeded().

◆ FloatTyID

const Type::TypeID FloatTyID = Type::FloatTyID

Definition at line 104 of file Mips16HardFloat.cpp.

Referenced by whichFPParamVariantNeeded().

◆ IntrinsicInline

const char* const IntrinsicInline[]
static
Initial value:
= {
"fabs", "fabsf",
"llvm.ceil.f32", "llvm.ceil.f64",
"llvm.copysign.f32", "llvm.copysign.f64",
"llvm.cos.f32", "llvm.cos.f64",
"llvm.exp.f32", "llvm.exp.f64",
"llvm.exp2.f32", "llvm.exp2.f64",
"llvm.fabs.f32", "llvm.fabs.f64",
"llvm.floor.f32", "llvm.floor.f64",
"llvm.fma.f32", "llvm.fma.f64",
"llvm.log.f32", "llvm.log.f64",
"llvm.log10.f32", "llvm.log10.f64",
"llvm.nearbyint.f32", "llvm.nearbyint.f64",
"llvm.pow.f32", "llvm.pow.f64",
"llvm.powi.f32.i32", "llvm.powi.f64.i32",
"llvm.rint.f32", "llvm.rint.f64",
"llvm.round.f32", "llvm.round.f64",
"llvm.sin.f32", "llvm.sin.f64",
"llvm.sqrt.f32", "llvm.sqrt.f64",
"llvm.trunc.f32", "llvm.trunc.f64",
}

Definition at line 349 of file Mips16HardFloat.cpp.

Referenced by isIntrinsicInline().