Skip to content

Conversation

@nbp
Copy link
Owner

@nbp nbp commented Oct 7, 2018

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 codegen sub-project. These tests are creating LIR units which are then lowered into Cranelift IR, compiled and tested.

@nbp nbp self-assigned this Oct 7, 2018
@nbp nbp added this to the v0.1.0: Cranelift + LIR milestone Oct 7, 2018
/// can be convert to this one, including NumberValue, using the `into()`
/// method.
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum NumberType {
Copy link
Contributor

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?

Copy link
Owner Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense! Thanks.

nbp added 5 commits April 27, 2019 18:57
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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants