OSDN Git Service

ABM popcount intrinsics.
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Dec 2009 05:48:18 +0000 (05:48 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Dec 2009 05:48:18 +0000 (05:48 +0000)
* config/i386/abmintrin.h (_mm_popcnt_u32): New.
(_mm_popcnt_u64): New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154894 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/abmintrin.h

index 0125322..d04fb61 100644 (file)
@@ -1,5 +1,10 @@
 2009-12-01  Sebastian Pop  <sebastian.pop@amd.com>
 
 2009-12-01  Sebastian Pop  <sebastian.pop@amd.com>
 
+       * config/i386/abmintrin.h (_mm_popcnt_u32): New.
+       (_mm_popcnt_u64): New.
+
+2009-12-01  Sebastian Pop  <sebastian.pop@amd.com>
+
        * config/i386/abmintrin.h: New.
        * config/i386/i386-c.c (ix86_target_macros_internal): Defined __ABM__.
        * config/i386/x86intrin.h: Include abmintrin.h when __ABM__ is defined.
        * config/i386/abmintrin.h: New.
        * config/i386/i386-c.c (ix86_target_macros_internal): Defined __ABM__.
        * config/i386/x86intrin.h: Include abmintrin.h when __ABM__ is defined.
index 6c77b3c..317bb98 100644 (file)
 #define _ABMINTRIN_H_INCLUDED
 
 
 #define _ABMINTRIN_H_INCLUDED
 
 
+/* Calculate a number of bits set to 1.  */
+extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_popcnt_u32 (unsigned int __X)
+{
+  return __builtin_popcount (__X);
+}
+
+#ifdef __x86_64__
+extern __inline long long  __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_popcnt_u64 (unsigned long long __X)
+{
+  return __builtin_popcountll (__X);
+}
+#endif
+
 #endif /* _ABMINTRIN_H_INCLUDED */
 #endif /* _ABMINTRIN_H_INCLUDED */