Commit 6fce0013 by Georg-Johann Lay Committed by Georg-Johann Lay

avr.c (avr_popcount): Remove static function.

gcc/
	* config/avr/avr.c (avr_popcount): Remove static function.
	(avr_popcount_each_byte, avr_out_bitop): Use popcount_hwi instead.

From-SVN: r242670
parent c30752be
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> 2016-11-21 Richard Earnshaw <rearnsha@arm.com>
* arm.opt (mapcs-float): Delete option. * arm.opt (mapcs-float): Delete option.
...@@ -243,23 +243,6 @@ avr_tolower (char *lo, const char *up) ...@@ -243,23 +243,6 @@ avr_tolower (char *lo, const char *up)
} }
/* 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. /* 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 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 popcount in POP_MASK and false, otherwise. POP_MASK represents a subset
...@@ -280,7 +263,7 @@ avr_popcount_each_byte (rtx xval, int n_bytes, int pop_mask) ...@@ -280,7 +263,7 @@ avr_popcount_each_byte (rtx xval, int n_bytes, int pop_mask)
rtx xval8 = simplify_gen_subreg (QImode, xval, mode, i); rtx xval8 = simplify_gen_subreg (QImode, xval, mode, i);
unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode); 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; return false;
} }
...@@ -8135,7 +8118,7 @@ avr_out_bitop (rtx insn, rtx *xop, int *plen) ...@@ -8135,7 +8118,7 @@ avr_out_bitop (rtx insn, rtx *xop, int *plen)
unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode); unsigned int val8 = UINTVAL (xval8) & GET_MODE_MASK (QImode);
/* Number of bits set in the current byte of the constant. */ /* 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. */ /* Registers R16..R31 can operate with immediate. */
bool ld_reg_p = test_hard_reg_class (LD_REGS, reg8); bool ld_reg_p = test_hard_reg_class (LD_REGS, reg8);
......
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