[Bug target/126959] -march=znver4 prefers load from memory for mask register

"hjl.tools at gmail dot com via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126959

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
The bug is in ix86_preferred_reload_class:

  /* All classes can load zeros.  */
  if (x == CONST0_RTX (mode))
    return regclass;

  /* Force constants into memory if we are loading a (nonzero) constant into
     an MMX, SSE or MASK register.  This is because there are no MMX/SSE/MASK
     instructions to load from a constant.  */
  if (CONSTANT_P (x)
      && (MAYBE_MMX_CLASS_P (regclass)
          || MAYBE_SSE_CLASS_P (regclass)
          || MAYBE_MASK_CLASS_P (regclass)))
    return NO_REGS;

-1 should be allowed for SSE and MASK registers.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.