public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Clarke <pc@us.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 1/3][rs6000] x86-compat vector intrinsics fixes for BE, 32bit
Date: Tue, 04 Dec 2018 20:34:00 -0000	[thread overview]
Message-ID: <f7554ac1-d9d4-9d37-2426-1e798c31e2c9@us.ibm.com> (raw)
In-Reply-To: <20181204201603.GI3803@gate.crashing.org>



On 12/04/2018 02:16 PM, Segher Boessenkool wrote:
> Hi!
> 
> On Tue, Dec 04, 2018 at 08:59:03AM -0600, Paul Clarke wrote:
>> Fix general endian and 32-bit mode issues found in the
>> compatibility implementations of the x86 vector intrinsics when running the
>> associated test suite tests.  (The tests had been inadvertently made to PASS
>> without actually running the test code.  A later patch fixes this issue.)
>>
>> In a few cases, the opportunity was taken to update the vector API used in
>> the implementations to the preferred functions from the
>> OpenPOWER 64-Bit ELF V2 ABI Specification.
>>
>> [gcc]
>>
>> 2018-12-03  Paul A. Clarke  <pc@us.ibm.com>
>>
>> 	PR target/88316
>> 	* config/rs6000/mmintrin.h (_mm_unpackhi_pi8): Fix for big-endian.
>> 	(_mm_unpacklo_pi8): Likewise.
>> 	(_mm_mulhi_pi16): Likewise.
>> 	(_mm_packs_pi16): Fix for big-endian. Use preferred API.
>> 	(_mm_packs_pi32): Likewise.
>> 	(_mm_packs_pu16): Likewise.
>> 	* config/rs6000/xmmintrin.h (_mm_cvtss_si32): Fix for big-endian.
>> 	(_mm_cvtss_si64): Likewise.
>> 	(_mm_cvtpi32x2_ps): Likewise.
>> 	(_mm_shuffle_ps): Likewise.
>> 	(_mm_movemask_pi8): Likewise.
>> 	(_mm_mulhi_pu16): Likewise.
>> 	(_mm_sad_pu8): Likewise.
>> 	(_mm_sad_pu8): Likewise.
>> 	(_mm_cvtpu16_ps): Fix for big-endian. Use preferred API.
>> 	(_mm_cvtpu8_ps): Likewise.
>> 	* config/rs6000/emmintrin.h (_mm_movemask_pd): Fix for big-endian.
>> 	(_mm_mul_epu32): Likewise.
>> 	(_mm_bsrli_si128): Likewise.
>> 	(_mm_movemask_epi8): Likewise.
>> 	(_mm_shufflehi_epi16): Likewise.
>> 	(_mm_shufflelo_epi16): Likewise.
>> 	(_mm_shuffle_epi32): Likewise.
>> 	* config/rs6000/pmmintrin.h (_mm_hadd_ps): Fix for big-endian.
>> 	(_mm_sub_ps): Likewise.
>> 	* config/rs6000/mmintrin.h (_mm_cmpeq_pi8): Fix for 32-bit mode.
> 
> 
>> @@ -1612,7 +1608,8 @@ _mm_bsrli_si128 (__m128i __A, const int __N)
>>    const __v16qu zeros = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
>>  
>>    if (__N < 16)
>> -    if (__builtin_constant_p(__N))
>> +    if (__builtin_constant_p(__N) &&
>> +        __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
> 
> Please just use __LITTLE_ENDIAN__, as the rest of these files already does.
> (More times in this patch; also BIG).

OK.  I was using the ORDER macros based on the GCC documentation at https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html, which mentions them and does not mention the shorter ENDIAN boolean macros.

> Okay for trunk with that fixed.  Thanks!

Thanks for the review!

> Do you have new testcases, too?  Or is all this caught by existing
> testcases?

Same testcases.  They catch a lot more bugs when they actually run.

PC

  reply	other threads:[~2018-12-04 20:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 14:59 Paul Clarke
2018-12-04 20:16 ` Segher Boessenkool
2018-12-04 20:34   ` Paul Clarke [this message]
2018-12-04 23:01     ` Segher Boessenkool

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=f7554ac1-d9d4-9d37-2426-1e798c31e2c9@us.ibm.com \
    --to=pc@us.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).