-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NativeAOT] 32-bit platform ObjWriter and bit rot fixes #96890
Changes from 17 commits
f4974b7
0e5eae4
47eaebc
24c2a5d
5340bb6
1d3e590
35164cc
f17709b
f880ca6
ad0b3d2
c7b10be
58d9f8c
0e6ff46
fca6f2f
69e97ab
1908816
391f070
54fa66c
a7ec26a
78b9eee
17ae730
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,15 +139,24 @@ public void EmitLDR(Register destination, Register source, int offset) | |
|
||
// movw reg, [reloc] & 0x0000FFFF | ||
// movt reg, [reloc] & 0xFFFF0000 | ||
// add reg, pc | ||
// reg range: [0..12, LR] | ||
public void EmitMOV(Register destination, ISymbolNode symbol) | ||
{ | ||
Debug.Assert(destination >= Register.R0 && (destination <= Register.R12 || destination == TargetRegister.LR)); | ||
Builder.EmitReloc(symbol, RelocType.IMAGE_REL_BASED_THUMB_MOV32); | ||
Builder.EmitReloc(symbol, RelocType.IMAGE_REL_BASED_THUMB_MOV32_PCREL); // 12-byte offset is part of the relocation | ||
Builder.EmitShort(unchecked((short)0xf240)); | ||
Builder.EmitShort((short)((byte)destination << 8)); | ||
Builder.EmitShort(unchecked((short)0xf2c0)); | ||
Builder.EmitShort((short)((byte)destination << 8)); | ||
if (destination <= Register.R7) | ||
{ | ||
Builder.EmitShort(unchecked((short)(0x4478u + (byte)destination))); | ||
} | ||
else | ||
{ | ||
Builder.EmitShort(unchecked((short)(0x44f0u + (byte)destination))); | ||
} | ||
Comment on lines
+152
to
+159
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Review note: This affects R2R. It generates the same pattern as the JIT but it's one extra instruction. If you feel like we need to special-case it, I'll try to do it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is fine. This pattern is better for private working set. |
||
} | ||
|
||
// b.w symbol | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@am11 care to review this part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and neat. Other related/interesting triplets are:
of which, maybe
<CrossCompileAbi Condition="'$(CrossCompileRid)' == 'linux-musl-arm'">musleabihf</CrossCompileAbi>
could be added? We have prereq docker image available for it as well.Side note:
AFAIK, triplet is considered an archaic concept by some toolchain enthusiasts. They recommend using explicit
-march
,-mtune
,-mabi
,-mcpu
and-mfpu
options. At some point we can delve into that and bring nativeaot and mono targets to new age. :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I'll have some follow up PRs later on, so I can add the "musl" then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, take your time. Basically the next line (49) can be deleted after that, since
alpine
is unnecessary and more restrictive thanunknown
or not setting the vendor at all; which we have for gnu and bionic.