-
Notifications
You must be signed in to change notification settings - Fork 27
LIR definition and Cranelift backend #30
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
base: master
Are you sure you want to change the base?
Conversation
…Address instructions.
| /// can be convert to this one, including NumberValue, using the `into()` | ||
| /// method. | ||
| #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash, Clone, Copy)] | ||
| pub enum NumberType { |
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.
Is it interesting to support i128 and u128 here?
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.
The problem with having NumberType for i128 and u128 is that we need a corresponding NumberValue and at the moment NumberValue are part of the Opcode::Const, Thus increasing the size of all opcodes.
Support for 128 bits number is something which would have to be handled to support Rust fully, but this can be expressed as 64 bits operations.
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.
Make sense! Thanks.
The Library macro create an empty tuple pointer storage to reference the space which contains the value of all the statics value sused during the compilation. This implies that the library cannot use the untyped tuple type to derive the size, using mem::size_of, to assert its size when registering the memory of statics.
The debug mode is enabling `-Z dump-mir=all` flag which attemps to spew the content of the `&[u8]` array containing the serialized content. This arrau serialization is time consuming and should be removed in the future by replacing it by a `&str`.
This pull request is a work-in-progress to handle the LIR to Cranelift IR conversion. It adds a LIR representation #29 and adds a Cranelift backend #28 .
However it does not yet change the MIR to LIR mapping nor the serialization of the LIR. Thus, this pull request cannot yet be tested with a complete pipeline to handle the Brainfuck example. Tests for this pull requests are added as part of the test of the newly added
codegensub-project. These tests are creating LIR units which are then lowered into Cranelift IR, compiled and tested.