From 305659427d66a6a356b1471678fa0bd6df38c36e Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Tue, 7 Jul 2020 01:55:18 +0300 Subject: [PATCH] changes according review --- cranelift/codegen/src/preopt.peepmatic | 2 +- cranelift/codegen/src/preopt.serialized | Bin 5613 -> 5613 bytes .../peepmatic/crates/runtime/src/operator.rs | 8 ++++---- .../peepmatic/crates/runtime/src/optimizer.rs | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cranelift/codegen/src/preopt.peepmatic b/cranelift/codegen/src/preopt.peepmatic index a571d82947..cd988ff7d9 100644 --- a/cranelift/codegen/src/preopt.peepmatic +++ b/cranelift/codegen/src/preopt.peepmatic @@ -196,4 +196,4 @@ (=> (when (urem_imm $C $x) (is-power-of-two $C) (fits-in-native-word $C)) - (band_imm $(isub 1 $C) $x)) + (band_imm $(isub $C 1) $x)) diff --git a/cranelift/codegen/src/preopt.serialized b/cranelift/codegen/src/preopt.serialized index 27023cfad28a1079ae5b5812c900be3f4ab4fa69..1bb11b24ad37aacd868cb3aee8c1ad33109707d7 100644 GIT binary patch delta 41 ocmaE>{Z@NJH=8H}5HK<@14$+j6HKyhUch#enUQ647FRPj0Hz2Ba{vGU delta 41 ncmaE>{Z@NJH=8Ik0|NsS5JLbXn9Z_z0ozGtM%K+)T+Q47rWFTs diff --git a/cranelift/peepmatic/crates/runtime/src/operator.rs b/cranelift/peepmatic/crates/runtime/src/operator.rs index 71fc2c4ca4..2915f36290 100644 --- a/cranelift/peepmatic/crates/runtime/src/operator.rs +++ b/cranelift/peepmatic/crates/runtime/src/operator.rs @@ -233,14 +233,14 @@ pub enum UnquoteOperator { #[peepmatic(params(iNN, iNN), result(iNN))] Iadd, - /// Compile-time `isub` of two constant values. - #[peepmatic(params(iNN, iNN), result(iNN))] - Isub, - /// Compile-time `imul` of two constant values. #[peepmatic(params(iNN, iNN), result(iNN))] Imul, + /// Compile-time `isub` of two constant values. + #[peepmatic(params(iNN, iNN), result(iNN))] + Isub, + /// Take the base-2 log of a power of two integer. #[peepmatic(params(iNN), result(iNN))] Log2, diff --git a/cranelift/peepmatic/crates/runtime/src/optimizer.rs b/cranelift/peepmatic/crates/runtime/src/optimizer.rs index ce4a6b8e57..f477db85ac 100644 --- a/cranelift/peepmatic/crates/runtime/src/optimizer.rs +++ b/cranelift/peepmatic/crates/runtime/src/optimizer.rs @@ -77,8 +77,8 @@ where | UnquoteOperator::Bor | UnquoteOperator::Bxor | UnquoteOperator::Iadd - | UnquoteOperator::Isub - | UnquoteOperator::Imul => unreachable!("not a unary unquote operator: {:?}", operator), + | UnquoteOperator::Imul + | UnquoteOperator::Isub => unreachable!("not a unary unquote operator: {:?}", operator), } } @@ -99,8 +99,8 @@ where UnquoteOperator::Bor => fold_ints!(a, b, |x, y| x | y), UnquoteOperator::Bxor => fold_ints!(a, b, |x, y| x ^ y), UnquoteOperator::Iadd => fold_ints!(a, b, |x, y| x.wrapping_add(y)), - UnquoteOperator::Isub => fold_ints!(a, b, |x, y| x.wrapping_sub(y)), UnquoteOperator::Imul => fold_ints!(a, b, |x, y| x.wrapping_mul(y)), + UnquoteOperator::Isub => fold_ints!(a, b, |x, y| x.wrapping_sub(y)), UnquoteOperator::Log2 | UnquoteOperator::Neg => { unreachable!("not a binary unquote operator: {:?}", operator) }