public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/94343] [10 Regression] invalid AVX512VL vpternlogd instruction emitted for -march=knl
Date: Fri, 27 Mar 2020 09:11:46 +0000	[thread overview]
Message-ID: <bug-94343-4-FoGnmScytR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94343-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to jbeulich from comment #11)
> (In reply to Jakub Jelinek from comment #7)
> > Though, there are other issues.  There is only vpternlog{d,q}, so for
> > V*[QH]Imode we shouldn't pretend we have masking support.
> 
> Why would this be? The element mode doesn't matter at all for bitwise
> operations. Just like there's no VPANDB / VPANDW, but VPANDD/VPANDQ are
> quite fine to use on vectors of QI or HI. Afaict the existence of VPAND{D,Q}
> in AVX512 (as opposed to {,V}PAND in MMX/SSE2/AVX) is merely an oddity
> resulting from EVEX.W handling (besides of course the element width's effect
> on embedded broadcasting).

For masked instructions, the element mode is significant, it determines which
bits of the mask register apply to which bits in the destination register.
So, if the masked variant is ever matched (e.g. by combine), then it will
expect to do something different from what the insn will actually do.
(define_insn ("one_cmplv64qi2_mask")
     [
        (set (match_operand:V64QI 0 ("register_operand") ("=v"))
            (vec_merge:V64QI (xor:V64QI (match_operand:V64QI 1
("nonimmediate_operand") ("vm"))
                    (match_operand:V64QI 2 ("vector_all_ones_operand") ("BC")))
                (match_operand:V64QI 3 ("nonimm_or_0_operand") ("0C"))
                (match_operand:DI 4 ("register_operand") ("Yk"))))
    ] ("(TARGET_AVX512F) && ((TARGET_AVX512F) && (TARGET_AVX512BW))")
("vpternlogd\t{$0x55, %1, %0, %0%{%4%}%N3|%0%{%4%}%N3, %0, %1, 0x55}")
     [
        (set_attr ("type") ("sselog"))
        (set_attr ("prefix") ("evex"))
        (set_attr ("mode") ("XI"))
        (set_attr ("mask") ("no"))
    ])
The above says in RTL that for say the last operand of 0x5555555555555555ULL,
first 8 bits in the vector will be the result of the ternlog operation, next 8
bits will be cleared or unmodified (depending on operand 3), etc.
The instruction used for that will do something different, will ignore the
upper 48 bits of the mask register and the low 32 bits of the destination will
be the result of the ternlog operation, next 32 bits will be cleared or
unmodified, etc.

  parent reply	other threads:[~2020-03-27  9:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 15:24 [Bug target/94343] New: " kretz at kde dot org
2020-03-26 15:39 ` [Bug target/94343] " marxin at gcc dot gnu.org
2020-03-26 15:58 ` jakub at gcc dot gnu.org
2020-03-26 16:34 ` hjl.tools at gmail dot com
2020-03-26 16:41 ` jakub at gcc dot gnu.org
2020-03-26 17:08 ` jakub at gcc dot gnu.org
2020-03-26 17:14 ` hjl.tools at gmail dot com
2020-03-26 17:52 ` jakub at gcc dot gnu.org
2020-03-26 17:59 ` jakub at gcc dot gnu.org
2020-03-26 19:30 ` kretz at kde dot org
2020-03-26 19:44 ` jakub at gcc dot gnu.org
2020-03-27  7:00 ` jbeulich at suse dot com
2020-03-27  7:07 ` jbeulich at suse dot com
2020-03-27  7:31 ` jbeulich at suse dot com
2020-03-27  8:45 ` jakub at gcc dot gnu.org
2020-03-27  9:11 ` jakub at gcc dot gnu.org [this message]
2020-03-27  9:17 ` jbeulich at suse dot com
2020-03-27  9:21 ` jakub at gcc dot gnu.org
2020-03-30 16:05 ` cvs-commit at gcc dot gnu.org
2020-03-30 16:06 ` jakub at gcc dot gnu.org

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-94343-4-FoGnmScytR@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).