add -Z soft-float option

This change adds -Z soft-float option for generating
software floating point library calls.
It also implies using soft float ABI, that is the same as llc.

It is useful for targets that have no FPU.
This commit is contained in:
Jyun-Yan You 2013-09-30 13:20:52 +08:00
parent 80b6056f5d
commit 350b5438cd
5 changed files with 14 additions and 4 deletions

View file

@ -67,7 +67,8 @@ LLVMRustCreateTargetMachine(const char *triple,
CodeModel::Model CM,
Reloc::Model RM,
CodeGenOpt::Level OptLevel,
bool EnableSegmentedStacks) {
bool EnableSegmentedStacks,
bool UseSoftFloat) {
std::string Error;
Triple Trip(Triple::normalize(triple));
const llvm::Target *TheTarget = TargetRegistry::lookupTarget(Trip.getTriple(),
@ -84,6 +85,10 @@ LLVMRustCreateTargetMachine(const char *triple,
Options.FloatABIType =
(Trip.getEnvironment() == Triple::GNUEABIHF) ? FloatABI::Hard :
FloatABI::Default;
Options.UseSoftFloat = UseSoftFloat;
if (UseSoftFloat) {
Options.FloatABIType = FloatABI::Soft;
}
TargetMachine *TM = TheTarget->createTargetMachine(Trip.getTriple(),
cpu,