public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ilya Enkovich <enkovich.gnu@gmail.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [vec-cmp, patch 4/6] Support vector mask invariants
Date: Wed, 14 Oct 2015 10:50:00 -0000	[thread overview]
Message-ID: <CAMbmDYYi_AzriR351U_nCQJpduV356-Ra4Ge=hVm5EanR1B-HA@mail.gmail.com> (raw)
In-Reply-To: <CAFiYyc27DhP1tKTD8=oqgzruKK82VBu7Y6W2xTsEA5e9NFBTkQ@mail.gmail.com>

2015-10-14 11:49 GMT+03:00 Richard Biener <richard.guenther@gmail.com>:
> On Tue, Oct 13, 2015 at 4:52 PM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>> I don't understand what you mean. vect_get_vec_def_for_operand has two
>> changes made.
>> 1. For boolean invariants use build_same_sized_truth_vector_type
>> instead of get_vectype_for_scalar_type in case statement produces a
>> boolean vector. This covers cases when we use invariants in
>> comparison, AND, IOR, XOR.
>
> Yes, I understand we need this special-casing to differentiate between
> the vector type
> used for boolean-typed loads/stores and the type for boolean typed constants.
> What happens if we mix them btw, like with
>
>   _Bool b = bools[i];
>   _Bool c = b || d;
>   ...
>
> ?

Here both statements should get vector of char as a vectype and we
never go VECTOR_BOOLEAN_TYPE_P way for them

>
>> 2. COND_EXPR is an exception because it has built-in boolean vector
>> result not reflected in its vecinfo. Thus I added additional operand
>> for vect_get_vec_def_for_operand to directly specify vectype for
>> vector definition in case it is a loop invariant.
>> So what do you propose to do with these changes?
>
> This is the change I don't like and don't see why we need it.  It works today
> and the comparison operands should be of appropriate type already?

Today it works because we always create vector of integer constant.
With boolean vectors it may be either integer vector or boolean vector
depending on context. Consider:

_Bool _1;
int _2;

_2 = _1 != 0 ? 0 : 1

We have two zero constants here requiring different vectypes.

Ilya

>
> Richard.
>
>> Thanks,
>> Ilya

  reply	other threads:[~2015-10-14 10:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 15:12 Ilya Enkovich
2015-10-13 13:54 ` Richard Biener
2015-10-13 14:52   ` Ilya Enkovich
2015-10-14  8:49     ` Richard Biener
2015-10-14 10:50       ` Ilya Enkovich [this message]
2015-10-14 16:14         ` Ilya Enkovich
2015-10-26 15:25           ` Richard Biener
2015-11-09 12:11             ` Ilya Enkovich
2015-11-09 14:28               ` 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='CAMbmDYYi_AzriR351U_nCQJpduV356-Ra4Ge=hVm5EanR1B-HA@mail.gmail.com' \
    --to=enkovich.gnu@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.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).