mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
special-case true/false loading
This commit is contained in:
parent
b982d1a442
commit
ab2cc76717
2 changed files with 17 additions and 4 deletions
|
@ -785,9 +785,22 @@ impl<
|
|||
FloatWidth::F32 => todo!(),
|
||||
},
|
||||
Builtin::Bool => {
|
||||
// same as 8-bit integer
|
||||
let reg = self.load_to_general_reg(buf, sym);
|
||||
ASM::mov_base32_reg8(buf, to_offset, reg);
|
||||
// same as 8-bit integer, but we special-case true/false because these symbols
|
||||
// are thunks and literal values
|
||||
match *sym {
|
||||
Symbol::BOOL_FALSE => {
|
||||
let reg = self.claim_general_reg(buf, sym);
|
||||
ASM::mov_reg64_imm64(buf, reg, false as i64)
|
||||
}
|
||||
Symbol::BOOL_TRUE => {
|
||||
let reg = self.claim_general_reg(buf, sym);
|
||||
ASM::mov_reg64_imm64(buf, reg, true as i64)
|
||||
}
|
||||
_ => {
|
||||
let reg = self.load_to_general_reg(buf, sym);
|
||||
ASM::mov_base32_reg8(buf, to_offset, reg);
|
||||
}
|
||||
}
|
||||
}
|
||||
Builtin::Decimal => todo!(),
|
||||
Builtin::Str | Builtin::List(_) => {
|
||||
|
|
|
@ -969,7 +969,7 @@ fn alignment_in_multi_tag_construction_three() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn alignment_in_multi_tag_pattern_match() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue