linux-mips
[Top] [All Lists]

[PATCH 2/2] MIPS: Octeon: Define ARCH_HAS_USABLE_BUILTIN_POPCOUNT for OC

To: linux-mips@linux-mips.org, ralf@linux-mips.org
Subject: [PATCH 2/2] MIPS: Octeon: Define ARCH_HAS_USABLE_BUILTIN_POPCOUNT for OCTEON.
From: David Daney <ddaney@caviumnetworks.com>
Date: Fri, 25 Jun 2010 16:46:08 -0700
Cc: David Daney <ddaney@caviumnetworks.com>
In-reply-to: <1277509568-28927-1-git-send-email-ddaney@caviumnetworks.com>
References: <1277509568-28927-1-git-send-email-ddaney@caviumnetworks.com>
Sender: linux-mips-bounce@linux-mips.org
OCTEON implements __builtin_popcount with a single instruction, so
lets use it.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
---
 .../asm/mach-cavium-octeon/cpu-feature-overrides.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h 
b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
index e412777..b952fc7 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
@@ -66,6 +66,14 @@
 #define spin_lock_prefetch(x) prefetch(x)
 #define PREFETCH_STRIDE 128
 
+#ifdef __OCTEON__
+/*
+ * All gcc versions that have OCTEON support define __OCTEON__ and have the
+ *  __builtin_popcount support.
+ */
+#define ARCH_HAS_USABLE_BUILTIN_POPCOUNT 1
+#endif
+
 static inline int octeon_has_saa(void)
 {
        int id;
-- 
1.6.6.1


<Prev in Thread] Current Thread [Next in Thread>