This mode is just like -mcmodel=small except that it moves the
thread pointer from TPIDR_EL0 to TPIDR_EL1.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
This seems to be changing behaviour outside TPIDR_EL0, but only that gets tested so we probably need more tests of normal operation.
lib/Target/AArch64/AArch64FastISel.cpp | ||
---|---|---|
3150 | I think "aka" is a bit strong. There really is a difference, even if it doesn't affect this decision. | |
lib/Target/AArch64/AArch64Subtarget.cpp | ||
152–153 | It might be an idea to put this in a function like useSmallAddressing (or whatever bikeshed you prefer) that checks the triple too. Kernel mode seems like something reasonable kernels could disagree over. |
The intent is no changes whatosever except for using TPIDR_EL1.
All the other changes are just to accept CodeModel::Kernel and treat it exactly like CodeModel::Small. Do you see something where other behavior changes under -code-model=kernel?
Since before this change, -code-model=kernel was disallowed altogether and now it's allowed only for aarch64-fuchsia where it is the same as =small in almost all regards, the "aka small" comment seems correct to me.
I will make the change to consolidate the logic into a helper function.
Do you see something where other behavior changes under -code-model=kernel?
The behaviour change is that kernel is now supported as a mode. We want tests to make sure no-one goes in and decides that they want their kernel to use large addressing (for example) without getting told off when they run "ninja check". Adding tests might well be as simple as putting a new RUN line in an existing test of globals that also passes "-code-model=kernel".
it is the same as =small in almost all regards, the "aka small" comment seems correct to me.
IMO "aka" implies complete identity.
I think "aka" is a bit strong. There really is a difference, even if it doesn't affect this decision.