mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +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(_) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue