From 1947bbcd0ee4e8f6c6d1322ae9c8bc07db5da5a6 Mon Sep 17 00:00:00 2001 From: Folkert Date: Sat, 8 Apr 2023 12:57:09 +0200 Subject: [PATCH] encode Bool.true/Bool.false more intelligently --- crates/compiler/gen_dev/src/generic64/mod.rs | 3 +-- crates/compiler/test_gen/src/gen_tags.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/compiler/gen_dev/src/generic64/mod.rs b/crates/compiler/gen_dev/src/generic64/mod.rs index 81e8f6bc7a..1142b15a16 100644 --- a/crates/compiler/gen_dev/src/generic64/mod.rs +++ b/crates/compiler/gen_dev/src/generic64/mod.rs @@ -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); diff --git a/crates/compiler/test_gen/src/gen_tags.rs b/crates/compiler/test_gen/src/gen_tags.rs index 5b9e6ee834..7c7fd81b9a 100644 --- a/crates/compiler/test_gen/src/gen_tags.rs +++ b/crates/compiler/test_gen/src/gen_tags.rs @@ -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!(