mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Ability to explicitly set target triple
This commit is contained in:
parent
8ce94e7076
commit
37c4074c44
4 changed files with 15 additions and 2 deletions
|
@ -697,6 +697,8 @@ namespace IDE.Compiler
|
|||
}
|
||||
|
||||
//Debug.WriteLine("HandleOptions SetOptions:{0:X}", (int)optionFlags);
|
||||
if (!options.mTargetTriple.IsWhiteSpace)
|
||||
targetTriple.Set(options.mTargetTriple);
|
||||
|
||||
SetOptions(hotBfProject, hotIdx,
|
||||
targetTriple, options.mTargetCPU, (int32)options.mToolsetType, (int32)options.mBfSIMDSetting, (int32)options.mAllocStackTraceDepth,
|
||||
|
|
|
@ -240,6 +240,8 @@ namespace IDE
|
|||
[Reflect]
|
||||
public IntermediateType mIntermediateType;
|
||||
[Reflect]
|
||||
public String mTargetTriple = new String() ~ delete _;
|
||||
[Reflect]
|
||||
public String mTargetCPU = new String() ~ delete _;
|
||||
[Reflect]
|
||||
public BuildOptions.SIMDSetting mBfSIMDSetting = .SSE2;
|
||||
|
@ -319,6 +321,7 @@ namespace IDE
|
|||
|
||||
mIncrementalBuild = prev.mIncrementalBuild;
|
||||
mIntermediateType = prev.mIntermediateType;
|
||||
mTargetTriple.Set(prev.mTargetTriple);
|
||||
mTargetCPU.Set(prev.mTargetCPU);
|
||||
mBfSIMDSetting = prev.mBfSIMDSetting;
|
||||
mBfOptimizationLevel = prev.mBfOptimizationLevel;
|
||||
|
@ -741,6 +744,7 @@ namespace IDE
|
|||
|
||||
data.ConditionalAdd("Toolset", options.mToolsetType, ToolsetType.GetDefaultFor(platformType, isRelease));
|
||||
data.ConditionalAdd("BuildKind", options.mBuildKind, isTest ? .Test : .Normal);
|
||||
data.ConditionalAdd("TargetTriple", options.mTargetTriple);
|
||||
data.ConditionalAdd("TargetCPU", options.mTargetCPU);
|
||||
data.ConditionalAdd("BfSIMDSetting", options.mBfSIMDSetting, .SSE2);
|
||||
if (platformType == .Windows)
|
||||
|
@ -1045,6 +1049,7 @@ namespace IDE
|
|||
|
||||
options.mToolsetType = data.GetEnum<ToolsetType>("Toolset", ToolsetType.GetDefaultFor(platformType, isRelease));
|
||||
options.mBuildKind = data.GetEnum<BuildKind>("BuildKind", isTest ? .Test : .Normal);
|
||||
data.GetString("TargetTriple", options.mTargetTriple);
|
||||
data.GetString("TargetCPU", options.mTargetCPU);
|
||||
options.mBfSIMDSetting = data.GetEnum<BuildOptions.SIMDSetting>("BfSIMDSetting", .SSE2);
|
||||
if (platformType == .Windows)
|
||||
|
|
|
@ -775,6 +775,7 @@ namespace IDE.ui
|
|||
return false;
|
||||
});
|
||||
allocPropEntry.mOnUpdate();
|
||||
AddPropertiesItem(category, "Target Triple", "mTargetTriple");
|
||||
AddPropertiesItem(category, "Target CPU", "mTargetCPU");
|
||||
AddPropertiesItem(category, "SIMD Instructions", "mBfSIMDSetting");
|
||||
AddPropertiesItem(category, "Optimization Level", "mBfOptimizationLevel",
|
||||
|
|
|
@ -16040,7 +16040,7 @@ BeMCOperand BeMCContext::AllocBinaryOp(BeMCInstKind instKind, const BeMCOperand&
|
|||
}
|
||||
|
||||
void BeMCContext::Generate(BeFunction* function)
|
||||
{
|
||||
{
|
||||
BP_ZONE_F("BeMCContext::Generate %s", function->mName.c_str());
|
||||
|
||||
mBeFunction = function;
|
||||
|
@ -16048,7 +16048,12 @@ void BeMCContext::Generate(BeFunction* function)
|
|||
mModule = function->mModule;
|
||||
|
||||
if (!mModule->mTargetCPU.IsEmpty())
|
||||
mModule->mBeIRCodeGen->Fail(StrFormat("Cannot set Target CPU '%s' for +Og optimization. Considering compiling under a different optimization setting.", mModule->mTargetCPU.c_str()));
|
||||
mModule->mBeIRCodeGen->Fail(StrFormat("Cannot set Target CPU to '%s' for +Og optimization. Considering compiling under a different optimization setting.", mModule->mTargetCPU.c_str()));
|
||||
if (mModule->mTargetTriple != "x86_64-pc-windows-msvc")
|
||||
{
|
||||
mModule->mBeIRCodeGen->Fail(StrFormat("Cannot set Target Triple to '%s' for +Og optimization. Considering compiling under a different optimization setting.", mModule->mTargetTriple.c_str()));
|
||||
return;
|
||||
}
|
||||
|
||||
//mDbgPreferredRegs[15] = X64Reg_RCX;
|
||||
//mDbgPreferredRegs[7] = X64Reg_RCX;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue