public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: HAO CHEN GUI <guihaoc@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>,
	"Paul A. Clarke" <pc@us.ibm.com>
Cc: Peter Bergner <bergner@linux.ibm.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>, David <dje.gcc@gmail.com>
Subject: RE: [PATCH v2, rs6000] Change insn condition from TARGET_64BIT to TARGET_POWERPC64 for VSX scalar extract/insert instructions
Date: Thu, 8 Sep 2022 13:59:02 +0800	[thread overview]
Message-ID: <dbf0c525-db97-f45d-2e77-19d13ca460fb@linux.ibm.com> (raw)
In-Reply-To: <20220907142548.GI25951@gate.crashing.org>



On 7/9/2022 下午 10:25, Segher Boessenkool wrote:
> Hi!
> 
> On Wed, Sep 07, 2022 at 08:51:17AM -0500, Paul A. Clarke wrote:
>> On Tue, Sep 06, 2022 at 12:19:06PM -0500, Segher Boessenkool wrote:
>>> On Mon, Sep 05, 2022 at 02:36:30PM +0800, HAO CHEN GUI wrote:
>>>> The return type of vec_ version built-ins are different than their definition
>>>> in PVIPR. In PVIPR, they're vector unsigned int or vector unsigned long long.
>>>> Shall we correct them?
>>>>
>>>>   const vd __builtin_vsx_extract_exp_dp (vd);
>>>>     VEEDP xvxexpdp {}
>>>>
>>>>   const vf __builtin_vsx_extract_exp_sp (vf);
>>>>     VEESP xvxexpsp {}
>>>>
>>>>   const vd __builtin_vsx_extract_sig_dp (vd);
>>>>     VESDP xvxsigdp {}
>>>>
>>>>   const vf __builtin_vsx_extract_sig_sp (vf);
>>>>     VESSP xvxsigsp {}
>>>
>>> Those are the vsx_ versions.  I'm not sure what you're asking.
>>>
>>> It won't be easy at all to change types from vector integer to vector
>>> float, it will break all over.  A compatibility nightmare.  It is better
>>> if you can show the current stuff cannot ever work, it's not a problem
>>> to replace it in that case.
>>
>> I think Hao Chen is concerned about the return types:
> 
> Yes, and so am I.
> 
>>>>   const vd __builtin_vsx_extract_exp_dp (vd);
>>>>     VEEDP xvxexpdp {}
>>
>> Per PVIPR, this should return vector unsigned long long ("vull" not "vd").
> 
> But changing that will make any existing code that now works, fail
> horribly.  Of course it is possible no such code exists :-)
> 
> What did this do before the builtin rewrite?
> 
> 
>  ~ - ~ - ~
> 
> 
> It looks like it did the right thing before, but that is just based on
> reading the code, I haven't actually tried it :-)
> 
> So, changing the vsx_ code here should be okay, because obviously no one
> is using it.  OTOH, why do we have those separately at all, why do they
> not just redirect to the canonical vec_ versions?  Or, can we just get
> rid of the vsx_ version completely?

In rs6000-overload.def, the vsx_ version built-ins are overridden to vec_
version. And the return types of vec_ version is inline with those defined
in PVIPR. So there should be no problem. Sorry for that.

[VEC_VEEDP, vec_extract_exp_dp, __builtin_vec_extract_exp_dp]
  vull __builtin_vec_extract_exp_dp (vd);
    VEEDP  VEEDP_DEPR1

[VEC_VEESP, vec_extract_exp_sp, __builtin_vec_extract_exp_sp]
  vui __builtin_vec_extract_exp_sp (vf);
    VEESP  VEESP_DEPR1

[VEC_VEE, vec_extract_exp, __builtin_vec_extract_exp]
  vui __builtin_vec_extract_exp (vf);
    VEESP
  vull __builtin_vec_extract_exp (vd);
    VEEDP

Thanks
Gui Haochen

  reply	other threads:[~2022-09-08  5:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02  8:31 HAO CHEN GUI
2022-09-02 15:56 ` Segher Boessenkool
2022-09-05  6:36   ` HAO CHEN GUI
2022-09-06 17:19     ` Segher Boessenkool
2022-09-07 13:51       ` Paul A. Clarke
2022-09-07 14:25         ` Segher Boessenkool
2022-09-08  5:59           ` HAO CHEN GUI [this message]
2022-09-09 17:17             ` Segher Boessenkool
2022-09-13  2:13               ` HAO CHEN GUI
2022-09-13  2:34       ` HAO CHEN GUI
2022-09-13  7:08         ` Iain Sandoe

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=dbf0c525-db97-f45d-2e77-19d13ca460fb@linux.ibm.com \
    --to=guihaoc@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pc@us.ibm.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).