This adds support for storing and loading all remaining primitive types as defined by TyKind::is_primitive() (bool, char, int which was already supported, uint, float). 128-bit operations are not supported in this PR.
Of particular interest are bool and char. bool in its unmanaged form in .NET has a width of 1 byte, so it is natively-compatible with Rust's representation, however managed bools are 4 bytes wide, which could make interop a bit complicated further down the line. I didn't handle marshalling here, but it'll definitely be an issue eventually. char is similar in that Rust's char is always 4 bytes, whereas .NET's is always 2 bytes.
Tests have been added for all primitives, and I verified that both ldind and stind instructions are emitted in the generated IL.
See #7.
This adds support for storing and loading all remaining primitive types as defined by
TyKind::is_primitive()
(bool
,char
,int
which was already supported,uint
,float
). 128-bit operations are not supported in this PR.Of particular interest are
bool
andchar
.bool
in its unmanaged form in .NET has a width of 1 byte, so it is natively-compatible with Rust's representation, however managedbool
s are 4 bytes wide, which could make interop a bit complicated further down the line. I didn't handle marshalling here, but it'll definitely be an issue eventually.char
is similar in that Rust'schar
is always 4 bytes, whereas .NET's is always 2 bytes.Tests have been added for all primitives, and I verified that both
ldind
andstind
instructions are emitted in the generated IL.