public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/103571] ABI: V2HF, V4HF and V8HFmode argument passing issues
Date: Wed, 08 Dec 2021 07:10:55 +0000	[thread overview]
Message-ID: <bug-103571-4-2yTLfGLhVp@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103571-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Hongtao.liu from comment #8)
> (In reply to Uroš Bizjak from comment #6)
> > (In reply to Hongtao.liu from comment #5)
> > 
> > > There're several places in i386-expand.c which assume TARGET_AVX512FP16 for
> > > case V8HF/V16HF/V32HF, if we want to put V8HF/V16HF/V32HF in
> > > VALID_SSE2/AVX256/AVX512F_REG_MODE, we need to "fix" them first.
> > 
> > These are of the type:
> > 
> >       use_vector_set = TARGET_AVX512FP16 && one_var == 0;
> >       gen_vec_set_0 = gen_vec_setv8hf_0;
> > 
> > So they look immune to the above change.
> 
> This is ok.
> 
> I mean in ix86_expand_vector_init_duplicate
> 
>     case E_V8HFmode:
>     case E_V16HFmode:
>     case E_V32HFmode:
>       return ix86_vector_duplicate_value (mode, target, val);
> 
> AVX2 is needed for V8HF/V16HFmode vpbroadcastw, AVX512BW is needed for
> V32HFmode, those modes should be handled same as V8HI/V16HI/V32HImode.
> 
> Also in ix86_expand_vector_extract, below should be under TARGET_AVX512BW,
> other wise, vector_extract go through stack.
> 
>     case E_V32HFmode:
>       tmp = gen_reg_rtx (V16HFmode);
>       if (elt < 16)
> 	emit_insn (gen_vec_extract_lo_v32hf (tmp, vec));
>       else
> 	emit_insn (gen_vec_extract_hi_v32hf (tmp, vec));
>       ix86_expand_vector_extract (false, target, tmp, elt & 15);
>       return;
> 
> 
> others seems to be ok.

Please note that the change mainly affects moves between SSE and GP registers.
Expansion is done way before register allocation, and if we allow these modes
earlier, I'm not sure I understand how it affects expand.

I propose we proceed with my patch and fix eventual fallout as a follow-up.

  parent reply	other threads:[~2021-12-08  7:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06  8:35 [Bug target/103571] New: " ubizjak at gmail dot com
2021-12-06 11:37 ` [Bug target/103571] " crazylht at gmail dot com
2021-12-07  3:05 ` crazylht at gmail dot com
2021-12-07  7:47 ` wwwhhhyyy333 at gmail dot com
2021-12-07  7:54 ` ubizjak at gmail dot com
2021-12-07  8:14 ` crazylht at gmail dot com
2021-12-07 11:04 ` ubizjak at gmail dot com
2021-12-07 11:17 ` ubizjak at gmail dot com
2021-12-08  5:27 ` crazylht at gmail dot com
2021-12-08  7:10 ` ubizjak at gmail dot com [this message]
2021-12-08  7:16 ` crazylht at gmail dot com
2021-12-08 14:25 ` ubizjak at gmail dot com
2021-12-08 14:38 ` ubizjak at gmail dot com
2021-12-08 15:05 ` ubizjak at gmail dot com
2021-12-08 15:07 ` ubizjak at gmail dot com
2021-12-09  0:39 ` crazylht at gmail dot com
2021-12-09  0:42 ` crazylht at gmail dot com
2021-12-09  4:15 ` crazylht at gmail dot com
2021-12-09  5:57 ` crazylht at gmail dot com
2021-12-09  7:07 ` crazylht at gmail dot com
2021-12-09  7:21 ` crazylht at gmail dot com
2021-12-09  8:15 ` ubizjak at gmail dot com
2021-12-09  8:36 ` crazylht at gmail dot com
2021-12-14 17:28 ` cvs-commit at gcc dot gnu.org
2021-12-14 18:30 ` ubizjak at gmail dot com
2021-12-16  8:51 ` ubizjak at gmail dot com
2021-12-16 18:35 ` cvs-commit at gcc dot gnu.org
2021-12-16 18:49 ` ubizjak at gmail dot com
2021-12-16 18:55 ` ubizjak at gmail dot com
2021-12-16 19:22 ` ubizjak 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-103571-4-2yTLfGLhVp@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).