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
Arm64Emitter: Improve MOVI2R #9412
Conversation
102ff59
to
d530025
Compare
d530025
to
8df264b
Compare
|
Now that PR #9423 exists, ideally this PR should be merged after that one. |
ce22608
to
f521822
Compare
|
Added ORR support, made us prefer ADRP+ADD over ADR+MOVK and ADRP+MOVK, and fixed a bug in my ADRP code. |
f521822
to
e77cc82
Compare
|
If I calculated correctly, this code will call malloc 8 times per MOVI2R. I fear this might have a significat time hit in code compilation. |
|
What do you think about replacing |
|
I assume the std::array will make this a lot faster. I'm also fine with the vector if you tell me that it has no large impact in your profile ;) |
e77cc82
to
45f5d3c
Compare
|
Done. |
I don't really see the use of this. (Maybe in the past it was used for when we need a constant number of instructions for backpatching? But we don't use MOVI2R for that now.)
45f5d3c
to
fb4c00a
Compare
More or less a complete rewrite of the function which aims to be equally good or better for each given input, without relying on special cases like the old implementation did. In particular, we now have more extensive support for MOVN, as mentioned in a TODO comment.
This tests for a bug with ADRP which was present in an earlier version of this pull request. Also adding the MOVI2R unit test to the VS build.
fb4c00a
to
eff66c2
Compare
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.
Changes LGTM. The unit tests still pass, I hope?
|
Yes, the PowerPC tests pass. (The VertexLoader tests still aren't passing, like in master, but that has no relation to this PR.) |
|
@JosJuice not building on Arm64 |
|
@dovart This is an |
|
@degasus gcc version 8.3.0 (Debian 8.3.0-6) |
|
@degasus was building fine before the commits from 2 days ago. |
|
I wonder if it works fine on newer versions of GCC... If so, maybe it's time to simply drop support for GCC 8. (See PR #9294) |
|
I can reproduce the above ICE on Reduced to minimal testcase: Required command line: a.cpp: class ARM64XEmitter
{
void MOVZ();
template <typename T>
void MOVI2RImpl(T imm);
};
void ARM64XEmitter::MOVZ()
{
}
template <typename T>
void ARM64XEmitter::MOVI2RImpl(T imm)
{
enum class Approach
{
MOVZ,
};
}Bug in shadow detection. Having the member function be templated is required for ICE to occur. Submitted GCC bug. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99120 |
More or less a complete rewrite of the function which aims to be equally good or better for each given input, without relying on special cases like the old implementation did.
In particular, we now have more extensive support for MOVN, as mentioned in a TODO comment.