1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Added Target CPU workspace override

This commit is contained in:
Brian Fiete 2022-01-25 07:04:54 -05:00
parent 91e856fc0b
commit 125d5c0c8c
14 changed files with 34 additions and 13 deletions

View file

@ -1117,7 +1117,9 @@ void BeIRCodeGen::HandleNextCmd()
case BfIRCmd_Module_SetTargetTriple:
{
CMD_PARAM(String, targetTriple);
mBeModule->mTargetTriple = targetTriple;
CMD_PARAM(String, targetCPU);
mBeModule->mTargetTriple = targetTriple;
mBeModule->mTargetCPU = targetCPU;
}
break;
case BfIRCmd_Module_AddModuleFlag:

View file

@ -16040,13 +16040,16 @@ BeMCOperand BeMCContext::AllocBinaryOp(BeMCInstKind instKind, const BeMCOperand&
}
void BeMCContext::Generate(BeFunction* function)
{
{
BP_ZONE_F("BeMCContext::Generate %s", function->mName.c_str());
mBeFunction = function;
mDbgFunction = mBeFunction->mDbgFunction;
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()));
//mDbgPreferredRegs[15] = X64Reg_RCX;
//mDbgPreferredRegs[7] = X64Reg_RCX;
/*mDbgPreferredRegs[14] = X64Reg_RAX;

View file

@ -1769,6 +1769,9 @@ BeModule::BeModule(const StringImpl& moduleName, BeContext* context)
void BeModule::Hash(BeHashContext& hashCtx)
{
hashCtx.MixinStr(mTargetTriple);
hashCtx.MixinStr(mTargetCPU);
hashCtx.Mixin(mConfigConsts64.size());
for (auto configConst : mConfigConsts64)
configConst->HashContent(hashCtx);

View file

@ -2271,6 +2271,7 @@ public:
BeContext* mContext;
String mModuleName;
String mTargetTriple;
String mTargetCPU;
BeBlock* mActiveBlock;
int mInsertPos;
BeDbgLoc* mCurDbgLoc;