From: Richard Sandiford <richard.sandiford@arm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: "Richard Biener" <richard.guenther@gmail.com>,
"Martin Liška" <mliska@suse.cz>,
"GCC Patches" <gcc-patches@gcc.gnu.org>
Subject: Re: [stage1][PATCH] Lower VEC_COND_EXPR into internal functions.
Date: Fri, 29 May 2020 18:26:55 +0100 [thread overview]
Message-ID: <mpta71qabz4.fsf@arm.com> (raw)
In-Reply-To: <20200529170936.GY31009@gate.crashing.org> (Segher Boessenkool's message of "Fri, 29 May 2020 12:09:36 -0500")
Segher Boessenkool <segher@kernel.crashing.org> writes:
> On Fri, May 29, 2020 at 05:57:13PM +0100, Richard Sandiford wrote:
>> Segher Boessenkool <segher@kernel.crashing.org> writes:
>> > On Fri, May 29, 2020 at 02:17:00PM +0200, Richard Biener wrote:
>> >> Now it looks like that those verification also simply checks optab
>> >> availability only but then this is just a preexisting issue (and we can
>> >> possibly build a testcase that FAILs RTL expansion for power...).
>> >>
>> >> So given that this means the latent bug in the powerpc backend
>> >> should be fixed and we should use a direct internal function instead?
>> >
>> > I don't see what you consider a bug in the backend here? The expansion
>> > FAILs, and it is explicitly allowed to do that.
>>
>> Well, the docs say:
>>
>> … For **certain** named patterns, it may invoke @code{FAIL} to tell the
>> compiler to use an alternate way of performing that task. …
>>
>> (my emphasis). Later on they say:
>>
>> @findex FAIL
>> @item FAIL
>> …
>>
>> Failure is currently supported only for binary (addition, multiplication,
>> shifting, etc.) and bit-field (@code{extv}, @code{extzv}, and @code{insv})
>> operations.
>>
>> which explicitly says that vcond* isn't allowed to fail.
>>
>> OK, so that list looks out of date. But still. :-)
>>
>> We now explicitly say that some patterns aren't allowed to FAIL,
>> which I guess gives the (implicit) impression that all the others can.
>> But that wasn't the intention. The lines were just added for emphasis.
>> (AFAIK 7f9844caf1ebd513 was the first patch to do this.)
>
> Most patterns *do* FAIL on some target. We cannot rewind time.
Sure. But the point is that FAILing isn't “explicitly allowed” for vcond*.
In fact it's the opposite.
If we ignore the docs and look at what the status quo actually is --
which I agree seems safest for GCC :-) -- then patterns are allowed to
FAIL if target-independent code provides an expand-time fallback for
the FAILing case. But that isn't true for vcond either.
expand_vec_cond_expr does:
icode = get_vcond_icode (mode, cmp_op_mode, unsignedp);
if (icode == CODE_FOR_nothing)
...
comparison = vector_compare_rtx (VOIDmode, tcode, op0a, op0b, unsignedp,
icode, 4);
rtx_op1 = expand_normal (op1);
rtx_op2 = expand_normal (op2);
create_output_operand (&ops[0], target, mode);
create_input_operand (&ops[1], rtx_op1, mode);
create_input_operand (&ops[2], rtx_op2, mode);
create_fixed_operand (&ops[3], comparison);
create_fixed_operand (&ops[4], XEXP (comparison, 0));
create_fixed_operand (&ops[5], XEXP (comparison, 1));
expand_insn (icode, 6, ops);
return ops[0].value;
which ICEs if the expander FAILs.
So whether you go from the docs or from what's actually implemented,
vcond* isn't currently allowed to FAIL. All Richard's gcc_unreachable
suggestion would do is change where the ICE happens.
Richard
next prev parent reply other threads:[~2020-05-29 17:26 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-24 10:25 [PATCH][RFC] Come up with VEC_COND_OP_EXPRs Martin Liška
2019-09-24 11:11 ` Richard Sandiford
2019-09-24 11:29 ` Richard Biener
2019-09-24 11:57 ` Richard Sandiford
2019-09-24 12:18 ` Richard Biener
2019-09-24 14:51 ` Richard Sandiford
2020-04-01 10:19 ` [stage1][PATCH] Lower VEC_COND_EXPR into internal functions Martin Liška
2020-04-06 9:17 ` Richard Sandiford
2020-04-06 12:30 ` Richard Biener
2020-05-21 12:51 ` Martin Liška
2020-05-21 13:29 ` Martin Liška
2020-05-21 20:16 ` Segher Boessenkool
2020-05-22 11:14 ` Richard Biener
2020-05-26 10:15 ` Richard Sandiford
2020-05-27 14:04 ` Martin Liška
2020-05-27 16:13 ` Richard Sandiford
2020-05-27 16:32 ` Richard Biener
2020-05-28 14:46 ` Martin Liška
2020-05-28 15:28 ` Richard Sandiford
2020-05-29 12:17 ` Richard Biener
2020-05-29 12:43 ` Richard Biener
2020-05-29 16:47 ` Segher Boessenkool
2020-05-29 17:05 ` Richard Sandiford
2020-05-29 17:30 ` Segher Boessenkool
2020-05-29 15:39 ` Segher Boessenkool
2020-05-29 16:57 ` Richard Sandiford
2020-05-29 17:09 ` Segher Boessenkool
2020-05-29 17:26 ` Richard Sandiford [this message]
2020-05-29 17:37 ` Segher Boessenkool
2020-05-30 7:15 ` Richard Sandiford
2020-05-30 13:08 ` Segher Boessenkool
2020-06-02 11:09 ` Richard Biener
2020-06-02 15:00 ` Martin Liška
2020-06-03 7:38 ` Richard Biener
2020-06-03 13:41 ` Richard Sandiford
2020-06-03 14:17 ` David Edelsohn
2020-06-03 14:46 ` Richard Biener
2020-06-03 17:01 ` Segher Boessenkool
2020-06-03 17:23 ` Richard Biener
2020-06-03 18:23 ` Segher Boessenkool
2020-06-03 18:38 ` Richard Biener
2020-06-03 18:46 ` David Edelsohn
2020-06-03 19:09 ` Segher Boessenkool
2020-06-03 19:13 ` Jakub Jelinek
2020-06-03 18:27 ` Segher Boessenkool
2020-06-08 11:04 ` Martin Liška
2020-06-09 13:42 ` Richard Biener
2020-06-10 8:51 ` Martin Liška
2020-06-10 10:50 ` Richard Biener
2020-06-10 12:27 ` Martin Liška
2020-06-10 13:01 ` Martin Liška
2020-06-11 8:52 ` Martin Liška
2020-06-12 9:43 ` Richard Biener
2020-06-12 13:24 ` Martin Liška
2020-06-15 7:14 ` Richard Biener
2020-06-15 11:19 ` Martin Liška
2020-06-15 11:59 ` Richard Biener
2020-06-15 12:20 ` Martin Liška
2020-06-17 8:50 ` Richard Biener
2020-06-17 13:15 ` Richard Biener
2020-06-18 8:10 ` Martin Liška
2020-06-18 8:52 ` Richard Biener
2020-06-18 9:02 ` Martin Liška
2020-06-18 9:29 ` Martin Liška
2020-04-06 12:33 ` Richard Biener
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=mpta71qabz4.fsf@arm.com \
--to=richard.sandiford@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=mliska@suse.cz \
--cc=richard.guenther@gmail.com \
--cc=segher@kernel.crashing.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).