-
Notifications
You must be signed in to change notification settings - Fork 12
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
Make exegesis conversion script use appropriate register class #37
Make exegesis conversion script use appropriate register class #37
Conversation
This patch fixes the register class that the BHive to Exegesis conversion script uses. Currently it is only pulling in registers that don't have a REX encoding, which doesn't even include R9-R15. This patch fixes that behavior by using the more generic LLVM 64-bit GPR Register class, but specifically looking at registers that don't require a REX2 encoding, as there is no hardware in the wild yet that supports APX.
This does still include |
Are we missing testing coverage here? |
There's no test coverage currently for this script. It would be best suited for lit/FileCheck based testing, but this is built with Bazel and it's less trivial to setup a lit test suite from within Bazel. It seems like Tensorflow has some infrastructure to do it (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/mlir/glob_lit_test.bzl#L66) though if we want to add something eventually. |
Do we need to filter it out somewhere? |
It's not strictly necessary as it'll just end up getting encoded as something different (I believe |
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.
One minor comment, otherwise it looks OK.
Gotcha. I'm afraid that if we try to emit code that reads or writes RIP directly, weird things would happen (and LLVM would not catch them, because (IIRC) most of the validation happens on assembly parse time; onwards, the code just assumes that the MCInsts are correct, and does not check it. |
Right. It can't be updated, using those instructions. Once they end up getting written out, the instruction encoding doesn't even attempt to write to It's a completely harmless thing (at least for us given all the registers are set to the same value), but a bit weird. There is a machine code verification step that runs within |
This patch fixes the register class that the BHive to Exegesis conversion script uses. Currently it is only pulling in registers that don't have a REX encoding, which doesn't even include R9-R15. This patch fixes that behavior by using the more generic LLVM 64-bit GPR Register class, but specifically looking at registers that don't require a REX2 encoding, as there is no hardware in the wild yet that supports APX.