This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][ARM] Implement CRC32 intrinsics for AArch32 in ARMv8-A


On 19/12/13 17:58, Kyrill Tkachov wrote:
On 18/12/13 15:32, Ramana Radhakrishnan wrote:
On Tue, Dec 3, 2013 at 1:46 PM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
Ping?
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg02351.html

Thanks,
Kyrill
Ok if no objections in 24 hours.
Thanks Ramana, I've committed it as r206128 together with this obvious change
that sets the conds attribute on the md pattern.

I just noticed that I committed the first version of the patch posted at:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg02250.html

instead of the second version posted at:
http://gcc.gnu.org/ml/gcc-patches/2013-11/msg02351.html

that was approved. The difference is only that the second one has underscores under the variable names in arm_acle.h.

I've committed the attached patch to add them as obvious with r206149. Tested arm-none-eabi on a model.

Sorry for the noise,
Kyrill

2013-12-20  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * config/arm/arm_acle.h: Add underscores before variables.


Kyrill


Ramana

On 26/11/13 09:44, Kyrill Tkachov wrote:
Ping?

Thanks,
Kyrill

On 19/11/13 17:04, Kyrill Tkachov wrote:
On 19/11/13 16:26, Joseph S. Myers wrote:
In any target header installed for user use, such as arm_acle.h, you
need
to be namespace-clean.  In this case, that means you need to use
implementation-namespace identifiers such as __a, __b and __d in case
the
user has defined macros with names such as a, b and d (unless the ACLE
says that identifiers a, b and d are in the implementation's namespace
when this header is included, which would be a very odd thing for it to
do).

Hi Joseph,

Thanks for the catch. ACLE doesn't expect a,b,d to be in the
implementation
namespace. I've added underscores before them.

Made sure tests pass.

Revised patch attached.
How's this?

Kyrill

gcc/
2013-11-19  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

         * Makefile.in (TEXI_GCC_FILES): Add arm-acle-intrinsics.texi.
         * config.gcc (extra_headers): Add arm_acle.h.
         * config/arm/arm.c (FL_CRC32): Define.
         (arm_have_crc): Likewise.
         (arm_option_override): Set arm_have_crc.
         (arm_builtins): Add CRC32 builtins.
         (bdesc_2arg): Likewise.
         (arm_init_crc32_builtins): New function.
         (arm_init_builtins): Initialise CRC32 builtins.
         (arm_file_start): Handle architecture extensions.
         * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define
__ARM_FEATURE_CRC32.
         Define __ARM_32BIT_STATE.
         (TARGET_CRC32): Define.
         * config/arm/arm-arches.def: Add armv8-a+crc.
         * config/arm/arm-tables.opt: Regenerate.
         * config/arm/arm.md (type): Add crc.
         (<crc_variant>): New insn.
         * config/arm/arm_acle.h: New file.
         * config/arm/iterators.md (CRC): New int iterator.
         (crc_variant, crc_mode): New int attributes.
         * confg/arm/unspecs.md (UNSPEC_CRC32B, UNSPEC_CRC32H,
UNSPEC_CRC32W,
         UNSPEC_CRC32CB, UNSPEC_CRC32CH, UNSPEC_CRC32CW): New unspecs.
         * doc/invoke.texi: Document -march=armv8-a+crc option.
         * doc/extend.texi: Document ACLE intrinsics.
         * doc/arm-acle-intrinsics.texi: New.


gcc/testsuite
2013-11-19  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

         * lib/target-supports.exp (add_options_for_arm_crc): New
procedure.
         (check_effective_target_arm_crc_ok_nocache): Likewise.
         (check_effective_target_arm_crc_ok): Likewise.
         * gcc.target/arm/acle/: New directory.
         * gcc.target/arm/acle/acle.exp: New.
         * gcc.target/arm/acle/crc32b.c: New test.
         * gcc.target/arm/acle/crc32h.c: Likewise.
         * gcc.target/arm/acle/crc32w.c: Likewise.
         * gcc.target/arm/acle/crc32d.c: Likewise.
         * gcc.target/arm/acle/crc32cb.c: Likewise.
         * gcc.target/arm/acle/crc32ch.c: Likewise.
         * gcc.target/arm/acle/crc32cw.c: Likewise.
         * gcc.target/arm/acle/crc32cd.c: Likewise.
>
Index: gcc/config/arm/arm_acle.h
===================================================================
--- gcc/config/arm/arm_acle.h	(revision 206132)
+++ gcc/config/arm/arm_acle.h	(working copy)
@@ -34,60 +34,60 @@
 
 #ifdef __ARM_FEATURE_CRC32
 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
-__crc32b (uint32_t a, uint8_t b)
+__crc32b (uint32_t __a, uint8_t __b)
 {
-  return __builtin_arm_crc32b (a, b);
+  return __builtin_arm_crc32b (__a, __b);
 }
 
 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
-__crc32h (uint32_t a, uint16_t b)
+__crc32h (uint32_t __a, uint16_t __b)
 {
-  return __builtin_arm_crc32h (a, b);
+  return __builtin_arm_crc32h (__a, __b);
 }
 
 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
-__crc32w (uint32_t a, uint32_t b)
+__crc32w (uint32_t __a, uint32_t __b)
 {
-  return __builtin_arm_crc32w (a, b);
+  return __builtin_arm_crc32w (__a, __b);
 }
 
 #ifdef __ARM_32BIT_STATE
 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
-__crc32d (uint32_t a, uint64_t b)
+__crc32d (uint32_t __a, uint64_t __b)
 {
-  uint32_t d;
+  uint32_t __d;
 
-  d = __crc32w (__crc32w (a, b & 0xffffffffULL), b >> 32);
-  return d;
+  __d = __crc32w (__crc32w (__a, __b & 0xffffffffULL), __b >> 32);
+  return __d;
 }
 #endif
 
 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
-__crc32cb (uint32_t a, uint8_t b)
+__crc32cb (uint32_t __a, uint8_t __b)
 {
-  return __builtin_arm_crc32cb (a, b);
+  return __builtin_arm_crc32cb (__a, __b);
 }
 
 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
-__crc32ch (uint32_t a, uint16_t b)
+__crc32ch (uint32_t __a, uint16_t __b)
 {
-  return __builtin_arm_crc32ch (a, b);
+  return __builtin_arm_crc32ch (__a, __b);
 }
 
 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
-__crc32cw (uint32_t a, uint32_t b)
+__crc32cw (uint32_t __a, uint32_t __b)
 {
-  return __builtin_arm_crc32cw (a, b);
+  return __builtin_arm_crc32cw (__a, __b);
 }
 
 #ifdef __ARM_32BIT_STATE
 __extension__ static __inline uint32_t __attribute__ ((__always_inline__))
-__crc32cd (uint32_t a, uint64_t b)
+__crc32cd (uint32_t __a, uint64_t __b)
 {
-  uint32_t d;
+  uint32_t __d;
 
-  d = __crc32cw (__crc32cw (a, b & 0xffffffffULL), b >> 32);
-  return d;
+  __d = __crc32cw (__crc32cw (__a, __b & 0xffffffffULL), __b >> 32);
+  return __d;
 }
 #endif
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]