Merge branch 'trunk' of github.com:rtfeldman/roc into wasm-load-128bit-numbers

This commit is contained in:
Brian Carroll 2021-11-21 20:53:38 +00:00
commit 0a5b0bdb0a
10 changed files with 156 additions and 65 deletions

View file

@ -624,6 +624,21 @@ impl<'a> WasmBackend<'a> {
}
StoredValue::StackMemory { location, .. } => match lit {
Literal::Decimal(decimal) => {
let (local_id, offset) =
location.local_and_offset(self.storage.stack_frame_pointer);
let lower_bits = decimal.0 as i64;
let upper_bits = (decimal.0 >> 64) as i64;
self.code_builder.get_local(local_id);
self.code_builder.i64_const(lower_bits);
self.code_builder.i64_store(Align::Bytes8, offset);
self.code_builder.get_local(local_id);
self.code_builder.i64_const(upper_bits);
self.code_builder.i64_store(Align::Bytes8, offset + 8);
}
Literal::Str(string) => {
let (local_id, offset) =
location.local_and_offset(self.storage.stack_frame_pointer);