encode Bool.true/Bool.false more intelligently

This commit is contained in:
Folkert 2023-04-08 12:57:09 +02:00
parent 3b28e897c3
commit 1947bbcd0e
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 2 additions and 3 deletions

View file

@ -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);

View file

@ -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!(