public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/101248] New: [AVX512]  The upper bits of FIXUPIMMS{S,D} should come from src1 not dest.
Date: Tue, 29 Jun 2021 02:09:30 +0000	[thread overview]
Message-ID: <bug-101248-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 101248
           Summary: [AVX512]  The upper bits of FIXUPIMMS{S,D} should come
                    from src1 not dest.
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
  Target Milestone: ---
            Target: x86_64-*-* i?86-*-*

currently the pattern is defined as

(define_insn "avx512f_sfixupimm<mode>_mask<round_saeonly_name>"
  [(set (match_operand:VF_128 0 "register_operand" "=v")
        (vec_merge:VF_128
          (vec_merge:VF_128
            (unspec:VF_128
               [(match_operand:VF_128 1 "register_operand" "0")
                (match_operand:VF_128 2 "register_operand" "v")
                (match_operand:<sseintvecmode> 3
"<round_saeonly_nimm_scalar_predicate>" "<round_saeonly_constraint>")
                (match_operand:SI 4 "const_0_to_255_operand")]
               UNSPEC_FIXUPIMM)
            (match_dup 2)
            (const_int 1))
          (match_dup 1)
          (match_operand:<avx512fmaskmode> 5 "register_operand" "Yk")))]
  "TARGET_AVX512F"
  "vfixupimm<ssescalarmodesuffix>\t{%4, <round_saeonly_op6>%3, %2,
%0%{%5%}|%0%{%5%}, %2, %<iptr>3<round_saeonly_op6>, %4}";
  [(set_attr "prefix" "evex")
   (set_attr "mode" "<ssescalarmode>")])

when mask is 1, current GCC will optimize

        movl    $-1, %eax
        kmovw   %eax, %k2
        vfixupimmpd     $0, %xmm2, %xmm1, %xmm0{%k2}
to
        vfixupimmsd     $0, %xmm3, %xmm1, %xmm0

But the upper 32 bits of vfixupimmsd should come from src1 not dest which means
the upper optimization is wrong.

             reply	other threads:[~2021-06-29  2:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29  2:09 crazylht at gmail dot com [this message]
2021-06-29  2:12 ` [Bug target/101248] " crazylht at gmail dot com
2021-06-29  2:14 ` crazylht at gmail dot com
2021-06-30  1:08 ` cvs-commit at gcc dot gnu.org
2021-06-30  1:14 ` crazylht at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101248-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).