From: "Andre Vieira (lists)" <andre.simoesdiasvieira@arm.com>
To: Richard Biener <rguenther@suse.de>
Cc: Richard Sandiford <richard.sandiford@arm.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [AArch64] Enable generation of FRINTNZ instructions
Date: Tue, 7 Dec 2021 11:29:41 +0000 [thread overview]
Message-ID: <a86b91b3-330e-ef9e-226b-0a655e27fa0f@arm.com> (raw)
In-Reply-To: <f5312e85-b175-fbc9-8858-de611b3d99ac@arm.com>
ping
On 25/11/2021 13:53, Andre Vieira (lists) via Gcc-patches wrote:
>
> On 22/11/2021 11:41, Richard Biener wrote:
>>
>>> On 18/11/2021 11:05, Richard Biener wrote:
>>>> This is a good shout and made me think about something I hadn't
>>>> before... I
>>>> thought I could handle the vector forms later, but the problem is
>>>> if I add
>>>> support for the scalar, it will stop the vectorizer. It seems
>>>> vectorizable_call expects all arguments to have the same type,
>>>> which doesn't
>>>> work with passing the integer type as an operand work around.
>> We already special case some IFNs there (masked load/store and gather)
>> to ignore some args, so that would just add to this set.
>>
>> Richard.
> Hi,
>
> Reworked it to add support of the new IFN to the vectorizer. Was
> initially trying to make vectorizable_call and
> vectorizable_internal_function handle IFNs with different inputs more
> generically, using the information we have in the <IFN>_direct structs
> regarding what operands to get the modes from. Unfortunately, that
> wasn't straightforward because of how vectorizable_call assumes
> operands have the same type and uses the type of the DEF_STMT_INFO of
> the non-constant operands (either output operand or non-constant
> inputs) to determine the type of constants. I assume there is some
> reason why we use the DEF_STMT_INFO and not always use
> get_vectype_for_scalar_type on the argument types. That is why I ended
> up with this sort of half-way mix of both, which still allows room to
> add more IFNs that don't take inputs of the same type, but require
> adding a bit of special casing similar to the IFN_FTRUNC_INT and
> masking ones.
>
> Bootstrapped on aarch64-none-linux.
>
> OK for trunk?
>
> gcc/ChangeLog:
>
> * config/aarch64/aarch64.md (ftrunc<mode><frintnz_mode>2): New
> pattern.
> * config/aarch64/iterators.md (FRINTNZ): New iterator.
> (frintnz_mode): New int attribute.
> (VSFDF): Make iterator conditional.
> * internal-fn.def (FTRUNC_INT): New IFN.
> * internal-fn.c (ftrunc_int_direct): New define.
> (expand_ftrunc_int_optab_fn): New custom expander.
> (direct_ftrunc_int_optab_supported_p): New supported_p.
> * match.pd: Add to the existing TRUNC pattern match.
> * optabs.def (ftrunc_int): New entry.
> * stor-layout.h (element_precision): Moved from here...
> * tree.h (element_precision): ... to here.
> (element_type): New declaration.
> * tree.c (element_type): New function.
> (element_precision): Changed to use element_type.
> * tree-vect-stmts.c (vectorizable_internal_function): Add
> support for
> IFNs with different input types.
> (vectorizable_call): Teach to handle IFN_FTRUNC_INT.
> * doc/md.texi: New entry for ftrunc pattern name.
> * doc/sourcebuild.texi (aarch64_frintzx_ok): New target.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.target/aarch64/merge_trunc1.c: Adapted to skip if
> frintNz instruction available.
> * lib/target-supports.exp: Added arm_v8_5a_frintnzx_ok target.
> * gcc.target/aarch64/frintnz.c: New test.
> * gcc.target/aarch64/frintnz_vec.c: New test.
next prev parent reply other threads:[~2021-12-07 11:29 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-11 17:51 Andre Vieira (lists)
2021-11-12 10:56 ` Richard Biener
2021-11-12 11:48 ` Andre Simoes Dias Vieira
2021-11-16 12:10 ` Richard Biener
2021-11-17 13:30 ` Andre Vieira (lists)
2021-11-17 15:38 ` Richard Sandiford
2021-11-18 11:05 ` Richard Biener
2021-11-22 11:38 ` Andre Vieira (lists)
2021-11-22 11:41 ` Richard Biener
2021-11-25 13:53 ` Andre Vieira (lists)
2021-12-07 11:29 ` Andre Vieira (lists) [this message]
2021-12-17 12:44 ` Richard Sandiford
2021-12-29 15:55 ` Andre Vieira (lists)
2021-12-29 16:54 ` Richard Sandiford
2022-01-03 12:18 ` Richard Biener
2022-01-10 14:09 ` Andre Vieira (lists)
2022-01-10 14:45 ` Richard Biener
2022-01-14 10:37 ` Richard Sandiford
2022-11-04 17:40 ` Andre Vieira (lists)
2022-11-07 11:05 ` Richard Biener
2022-11-07 14:19 ` Andre Vieira (lists)
2022-11-07 14:56 ` Richard Biener
2022-11-09 11:33 ` Andre Vieira (lists)
2022-11-15 18:24 ` Richard Sandiford
2022-11-16 12:25 ` Richard Biener
2021-11-29 11:17 ` Andre Vieira (lists)
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=a86b91b3-330e-ef9e-226b-0a655e27fa0f@arm.com \
--to=andre.simoesdiasvieira@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=rguenther@suse.de \
--cc=richard.sandiford@arm.com \
/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).