From 1425c1e7bf5fb03a9b60cb674fad702ffd2d463f Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sun, 21 Mar 2021 17:03:25 +0200 Subject: [PATCH] fix emit_small_memset use shifts format more fix revert to multiply --- cranelift/frontend/src/frontend.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cranelift/frontend/src/frontend.rs b/cranelift/frontend/src/frontend.rs index 365e5aeffb..45937dc3f9 100644 --- a/cranelift/frontend/src/frontend.rs +++ b/cranelift/frontend/src/frontend.rs @@ -768,9 +768,9 @@ impl<'a> FunctionBuilder<'a> { let ch = u64::from(ch); let raw_value = if int_type == types::I64 { - (ch << 32) | (ch << 16) | (ch << 8) | ch + ch * 0x0101010101010101_u64 } else if int_type == types::I32 { - (ch << 16) | (ch << 8) | ch + ch * 0x01010101_u64 } else if int_type == types::I16 { (ch << 8) | ch } else { @@ -1192,7 +1192,7 @@ block0: block0: v2 = iconst.i64 0 v0 -> v2 - v1 = iconst.i64 0x0001_0001_0101 + v1 = iconst.i64 0x0101_0101_0101_0101 store aligned v1, v0 return v0 }