Commit e742a703 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

iropt: Simplify test for highest bit being 0.

parent 6d07016c
...@@ -6157,10 +6157,8 @@ static ir_node *transform_node_Shrs(ir_node *n) ...@@ -6157,10 +6157,8 @@ static ir_node *transform_node_Shrs(ir_node *n)
const bitinfo *const bn = get_bitinfo(n); const bitinfo *const bn = get_bitinfo(n);
if (bn != NULL && if (bn != NULL &&
get_mode_arithmetic(mode) == irma_twos_complement) { get_mode_arithmetic(mode) == irma_twos_complement) {
ir_tarval *z = bn->z; unsigned const mode_bits = get_mode_size_bits(mode);
unsigned mode_bits = get_mode_size_bits(mode); if (tarval_get_bit(bn->z, mode_bits - 1) == 0) {
unsigned highest_bit = get_tarval_highest_bit(z);
if (highest_bit + 1U != mode_bits) {
dbg_info *const dbgi = get_irn_dbg_info(n); dbg_info *const dbgi = get_irn_dbg_info(n);
ir_node *const block = get_nodes_block(n); ir_node *const block = get_nodes_block(n);
n = new_rd_Shr(dbgi, block, a, b, mode); n = new_rd_Shr(dbgi, block, a, b, mode);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment