mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
encode Bool.true/Bool.false more intelligently
This commit is contained in:
parent
3b28e897c3
commit
1947bbcd0e
2 changed files with 2 additions and 3 deletions
|
@ -2263,8 +2263,7 @@ impl<
|
|||
}
|
||||
(Literal::Bool(x), Layout::Builtin(Builtin::Bool)) => {
|
||||
let reg = self.storage_manager.claim_general_reg(&mut self.buf, sym);
|
||||
let val = [*x as u8; 16];
|
||||
ASM::mov_reg64_imm64(&mut self.buf, reg, i128::from_ne_bytes(val) as i64);
|
||||
ASM::mov_reg64_imm64(&mut self.buf, reg, *x as i64);
|
||||
}
|
||||
(Literal::Float(x), Layout::Builtin(Builtin::Float(FloatWidth::F64))) => {
|
||||
let reg = self.storage_manager.claim_float_reg(&mut self.buf, sym);
|
||||
|
|
|
@ -632,7 +632,7 @@ fn if_guard_switch() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||
fn if_guard_pattern_true() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue