+2016-11-21 Georg-Johann Lay <avr@gjlay.de>
+
+ * config/avr/avr.c (avr_popcount): Remove static function.
+ (avr_popcount_each_byte, avr_out_bitop): Use popcount_hwi instead.
+
2016-11-21 Richard Earnshaw <rearnsha@arm.com>
* arm.opt (mapcs-float): Delete option.
}
-/* Custom function to count number of set bits. */
-
-static inline int
-avr_popcount (unsigned int val)
-{
- int pop = 0;
-
- while (val)
- {
- val &= val-1;
- pop++;
- }
-
- return pop;
-}
-
-
/* Constraint helper function. XVAL is a CONST_INT or a CONST_DOUBLE.
Return true if the least significant N_BYTES bytes of XVAL all have a
popcount in POP_MASK and false, otherwise. POP_MASK represents a subset
rtx xval8 = simplify_gen_subreg (QImode, xval, mode, i);
unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode);
- if (0 == (pop_mask & (1 << avr_popcount (val8))))
+ if (0 == (pop_mask & (1 << popcount_hwi (val8))))
return false;
}
unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode);
/* Number of bits set in the current byte of the constant. */
- int pop8 = avr_popcount (val8);
+ int pop8 = popcount_hwi (val8);
/* Registers R16..R31 can operate with immediate. */
bool ld_reg_p = test_hard_reg_class (LD_REGS, reg8);