mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-04 00:55:00 +00:00
Merge remote-tracking branch 'origin/main' into remove-nat
This commit is contained in:
commit
24a38c4a26
99 changed files with 2636 additions and 938 deletions
|
|
@ -204,7 +204,6 @@ impl<'a> LowLevelCall<'a> {
|
|||
StrCountUtf8Bytes => {
|
||||
self.load_args_and_call_zig(backend, bitcode::STR_COUNT_UTF8_BYTES)
|
||||
}
|
||||
StrGetCapacity => self.load_args_and_call_zig(backend, bitcode::STR_CAPACITY),
|
||||
StrToNum => {
|
||||
let number_layout = match backend.layout_interner.get_repr(self.ret_layout) {
|
||||
LayoutRepr::Struct(field_layouts) => field_layouts[0],
|
||||
|
|
@ -1589,6 +1588,10 @@ impl<'a> LowLevelCall<'a> {
|
|||
LayoutRepr::Builtin(Builtin::Float(width)) => {
|
||||
self.load_args_and_call_zig(backend, &bitcode::NUM_POW[width]);
|
||||
}
|
||||
LayoutRepr::Builtin(Builtin::Decimal) => {
|
||||
self.load_args_and_call_zig(backend, bitcode::DEC_POW);
|
||||
}
|
||||
|
||||
_ => panic_ret_type(),
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,21 @@ macro_rules! wasm32_sized_primitive {
|
|||
}
|
||||
}
|
||||
|
||||
wasm32_sized_primitive!(u8, i8, u16, i16, u32, i32, char, u64, i64, u128, i128, f32, f64, bool,);
|
||||
wasm32_sized_primitive!(RocDec, RocOrder, I128, U128,);
|
||||
wasm32_sized_primitive!(u8, i8, u16, i16, u32, i32, char, u64, i64, f32, f64, bool,);
|
||||
wasm32_sized_primitive!(RocOrder,);
|
||||
|
||||
macro_rules! wasm32_16byte_aligned8 {
|
||||
($($type_name:ident ,)+) => {
|
||||
$(
|
||||
impl Wasm32Sized for $type_name {
|
||||
const SIZE_OF_WASM: usize = 16;
|
||||
const ALIGN_OF_WASM: usize = 8;
|
||||
}
|
||||
)*
|
||||
}
|
||||
}
|
||||
|
||||
wasm32_16byte_aligned8!(i128, u128, I128, U128, RocDec,);
|
||||
|
||||
impl Wasm32Sized for () {
|
||||
const SIZE_OF_WASM: usize = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue