public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jochen Barth <jpunktbarth@gmail.com>
To: Tamar Christina <Tamar.Christina@arm.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: arm_neon.h / vext_u64 (uint64x1_t __a, uint64x1_t __b, __const int __c)
Date: Thu, 10 Sep 2020 12:35:48 +0200	[thread overview]
Message-ID: <4AF21AB0-ACC1-474C-AF72-A78B6A02A1C4@gmail.com> (raw)
In-Reply-To: <VI1PR08MB5325E434921B75F6CB7321E8FF270@VI1PR08MB5325.eurprd08.prod.outlook.com>

Thanks a lot! Regards, Jochen

Von meinem iPhone gesendet

> Am 10.09.2020 um 10:35 schrieb Tamar Christina <Tamar.Christina@arm.com>:
> 
> Hi Jochen,
> 
>> -----Original Message-----
>> From: Jochen Barth <jpunktbarth@gmail.com>
>> Sent: Thursday, September 10, 2020 9:14 AM
>> To: Tamar Christina <Tamar.Christina@arm.com>
>> Cc: gcc-help <gcc-help@gcc.gnu.org>
>> Subject: Re: arm_neon.h / vext_u64 (uint64x1_t __a, uint64x1_t __b,
>> __const int __c)
>> 
>> Dear Tamar,
>> 
>> Sorry, I do no get the point:
>> 
>>>>> EXT is a byte level extract, if you have a 64 bit vector and a
>>>>> 64-bit type like uint64x1_t then the only possible index for n is 0.
>> 
> 
> Because those intrinsics are not doing byte level extraction. They are convenience functions that
> do not allow partial extraction of a type. For instance vext_s16 which takes an int16x4_t as input
> restricts the values of n to 0 to 3 because when used with the EXT instruction it always
> makes sure they're a multiple of 2 bytes since a int16 is two bytes.
> 
> A uint64x1_t is a vector of 8 bytes which the intrinsic does as a group of 8 bytes since it
> Always wants to extract whole numbers. As such the only possible index is 0.
> 
> To get the behavior you have in your example you need to do the extraction on bytes using
> vext_u8 which will allow you to corrupt the number. i.e.
> 
> what you want is
> 
> vreinterpret_u64_u8 (vext_u8 (vreinterpret_u8_u64 (a), vreinterpret_u8_u64 (b), <number>))
> 
> where your extraction happens on bytes. In this case n has the range 0-7.
> 
> Instead of looking at the Arm ARM you should look at the definition of the intrinsics
> https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics
> 
> Regards,
> Tamar
> 
>> But my previous examples with n=c=1..7 showed that different (n=c)'s are
>> possible,
>> 
>> why is "the only possible index for n=0" ?
>> 
>> Kind regards, Jochen

      reply	other threads:[~2020-09-10 10:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 21:10 Jochen Barth
2020-09-02 21:11 ` Jochen Barth
     [not found] ` <VI1PR08MB53253664D3E7644526965E27FF260@VI1PR08MB5325.eurprd08.prod.outlook.com>
     [not found]   ` <e06ec9ce-78ec-8eb2-83c4-4d3eda9e18f4@gmail.com>
2020-09-10  7:54     ` Tamar Christina
2020-09-10  8:14       ` Jochen Barth
2020-09-10  8:34         ` Tamar Christina
2020-09-10 10:35           ` Jochen Barth [this message]

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=4AF21AB0-ACC1-474C-AF72-A78B6A02A1C4@gmail.com \
    --to=jpunktbarth@gmail.com \
    --cc=Tamar.Christina@arm.com \
    --cc=gcc-help@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).