Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Review feedback
  • Loading branch information
kunalspathak committed Feb 12, 2024
commit b7a43f9b9f7b9d19da5a5c9b607213019cb83cd3
12 changes: 10 additions & 2 deletions src/coreclr/jit/emitarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,15 @@ void emitter::emitInsSanityCheck(instrDesc* id)
break;

case IF_BR_1B: // BR_1B ................ ......nnnnn..... Rn
assert(isGeneralRegister(id->idReg3()));
if (emitComp->IsTargetAbi(CORINFO_NATIVEAOT_ABI) && id->idIsTlsGD())
{
assert(isGeneralRegister(id->idReg1()));
assert(id->idAddr()->iiaAddr != nullptr);
}
else
{
assert(isGeneralRegister(id->idReg3()));
}
break;

case IF_LS_1A: // LS_1A .X......iiiiiiii iiiiiiiiiiittttt Rt PC imm(1MB)
Expand Down Expand Up @@ -13575,7 +13583,7 @@ void emitter::emitIns_Call(EmitCallType callType,
assert(xreg == REG_NA);
if (emitComp->IsTargetAbi(CORINFO_NATIVEAOT_ABI) && EA_IS_CNS_TLSGD_RELOC(retSize))
{
// For NativeAOT linux/arm64, we need to also record the relocation of methHnd
// For NativeAOT linux/arm64, we need to also record the relocation of methHnd.
// Since we do not have space to embed it in instrDesc, we store the register in
// reg1 and instead use the `iiaAdd` to store the method handle. Likewise, during
// emitOutputInstr, we retrieve the register from reg1 for this specific case.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2175,10 +2175,10 @@ private void getFieldInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_MET
}
else if (field.IsThreadStatic)
{
if ((MethodBeingCompiled.Context.Target.IsWindows && MethodBeingCompiled.Context.Target.Architecture == TargetArchitecture.X64) ||
((MethodBeingCompiled.Context.Target.OperatingSystem == TargetOS.Linux) &&
((MethodBeingCompiled.Context.Target.Architecture == TargetArchitecture.X64) ||
(MethodBeingCompiled.Context.Target.Architecture == TargetArchitecture.ARM64))))
var target = MethodBeingCompiled.Context.Target;
if ((target.IsWindows && target.Architecture is TargetArchitecture.X64) ||
((target.OperatingSystem == TargetOS.Linux) &&
(target.Architecture is TargetArchitecture.X64 or TargetArchitecture.ARM64)))
{
ISortableSymbolNode index = _compilation.NodeFactory.TypeThreadStaticIndex((MetadataType)field.OwningType);
if (index is TypeThreadStaticIndexNode ti)
Expand Down