[ARM][1/4] Replace uses of int_log2 by exact_log2

* config/arm/arm.c (int_log2): Delete definition and prototype.
	(shift_op): Use exact_log2 instead of int_log2.
	(vfp3_const_double_for_fract_bits): Likewise.

From-SVN: r237757
This commit is contained in:
Kyrylo Tkachov 2016-06-24 12:46:19 +00:00 committed by Kyrylo Tkachov
parent dfee287036
commit 68a8632380
2 changed files with 13 additions and 19 deletions

View File

@ -1,3 +1,9 @@
2016-06-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.c (int_log2): Delete definition and prototype.
(shift_op): Use exact_log2 instead of int_log2.
(vfp3_const_double_for_fract_bits): Likewise.
2016-06-24 Jakub Jelinek <jakub@redhat.com>
* internal-fn.c (expand_arith_set_overflow): New function.

View File

@ -104,7 +104,6 @@ static void arm_print_operand_address (FILE *, machine_mode, rtx);
static bool arm_print_operand_punct_valid_p (unsigned char code);
static const char *fp_const_from_val (REAL_VALUE_TYPE *);
static arm_cc get_arm_condition_code (rtx);
static HOST_WIDE_INT int_log2 (HOST_WIDE_INT);
static const char *output_multi_immediate (rtx *, const char *, const char *,
int, HOST_WIDE_INT);
static const char *shift_op (rtx, HOST_WIDE_INT *);
@ -19094,7 +19093,8 @@ shift_op (rtx op, HOST_WIDE_INT *amountp)
return NULL;
}
*amountp = int_log2 (*amountp);
*amountp = exact_log2 (*amountp);
gcc_assert (IN_RANGE (*amountp, 0, 31));
return ARM_LSL_NAME;
default:
@ -19126,22 +19126,6 @@ shift_op (rtx op, HOST_WIDE_INT *amountp)
return mnem;
}
/* Obtain the shift from the POWER of two. */
static HOST_WIDE_INT
int_log2 (HOST_WIDE_INT power)
{
HOST_WIDE_INT shift = 0;
while ((((HOST_WIDE_INT) 1 << shift) & power) == 0)
{
gcc_assert (shift <= 31);
shift++;
}
return shift;
}
/* Output a .ascii pseudo-op, keeping track of lengths. This is
because /bin/as is horribly restrictive. The judgement about
whether or not each character is 'printable' (and can be output as
@ -27931,7 +27915,11 @@ vfp3_const_double_for_fract_bits (rtx operand)
HOST_WIDE_INT value = real_to_integer (&r0);
value = value & 0xffffffff;
if ((value != 0) && ( (value & (value - 1)) == 0))
return int_log2 (value);
{
int ret = exact_log2 (value);
gcc_assert (IN_RANGE (ret, 0, 31));
return ret;
}
}
}
return 0;