+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.
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 *);
return NULL;
}
- *amountp = int_log2 (*amountp);
+ *amountp = exact_log2 (*amountp);
+ gcc_assert (IN_RANGE (*amountp, 0, 31));
return ARM_LSL_NAME;
default:
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
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;