https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122715

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktkachov at gcc dot gnu.org
   Last reconfirmed|                            |2025-11-17
            Summary|X86 Missed optimization of  |Missed optimization of
                   |_mm_avg_*(x, x) --> x       |IFN_AVG_FLOOR (x, x) --> x
     Ever confirmed|0                           |1
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from ktkachov at gcc dot gnu.org ---
Confirmed, an equivalent aarch64 testcase is:
#include <arm_neon.h>

uint32x4_t
foo (uint32x4_t a, uint32x4_t b)
{
  return vhaddq_u32 (a, a);
}

It can be fixed by adding folding of IFN_AVG_FLOOR (x, x) in match.pd IMO

Reply via email to