From 6fce0013981ae41c0b44baa4cd59904ff5762bfc Mon Sep 17 00:00:00 2001 From: Georg-Johann Lay Date: Mon, 21 Nov 2016 16:04:15 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 5 +++++ gcc/config/avr/avr.c | 21 ++------------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5957b9564ef..74fb0571662 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-11-21 Georg-Johann Lay + + * 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 * arm.opt (mapcs-float): Delete option. diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index e527a504a03..0cfebf0b84e 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -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. 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 @@ -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); 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; } @@ -8135,7 +8118,7 @@ avr_out_bitop (rtx insn, rtx *xop, int *plen) 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); -- 2.30.2