public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PR66791][ARM] Replace __builtin_vext* with __buitlin_shuffle in vext intrinsics
@ 2021-01-04 10:27 Prathamesh Kulkarni
  2021-01-04 10:30 ` Kyrylo Tkachov
  0 siblings, 1 reply; 4+ messages in thread
From: Prathamesh Kulkarni @ 2021-01-04 10:27 UTC (permalink / raw)
  To: gcc Patches, Kyrill Tkachov

[-- Attachment #1: Type: text/plain, Size: 252 bytes --]

Hi Kyrill,
The attached patch replaces __builtin_vextv8qi with __builtin_shuffle
for vext_s8.
Just wanted to confirm if this is in the correct direction ?
If yes, I will send a follow up patch that converts for all vext intrinsics.

Thanks,
Prathamesh

[-- Attachment #2: vext-1.diff --]
[-- Type: application/octet-stream, Size: 727 bytes --]

diff --git a/gcc/config/arm/arm_neon.h b/gcc/config/arm/arm_neon.h
index 3efcfa45229..dee805ba273 100644
--- a/gcc/config/arm/arm_neon.h
+++ b/gcc/config/arm/arm_neon.h
@@ -8733,7 +8733,12 @@ __extension__ extern __inline int8x8_t
 __attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
 vext_s8 (int8x8_t __a, int8x8_t __b, const int __c)
 {
-  return (int8x8_t)__builtin_neon_vextv8qi (__a, __b, __c);
+#ifdef __ARMEB__
+  return __builtin_shuffle (__b, __a, (uint8x8_t)
+      {8-__c, 9-__c, 10-__c, 11-__c, 12-__c, 13-__c, 14-__c, 15-__c});
+#else
+  return __builtin_shuffle (__a, __b, (uint8x8_t)
+      {__c, __c+1, __c+2, __c+3, __c+4, __c+5, __c+6, __c+7});
 }
 
 __extension__ extern __inline int16x4_t

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-05 13:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04 10:27 [PR66791][ARM] Replace __builtin_vext* with __buitlin_shuffle in vext intrinsics Prathamesh Kulkarni
2021-01-04 10:30 ` Kyrylo Tkachov
2021-01-05 11:41   ` Prathamesh Kulkarni
2021-01-05 13:07     ` Kyrylo Tkachov

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).