Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3671df8572a299acff9c9cac2bf7279ee614d154
Commit:     3671df8572a299acff9c9cac2bf7279ee614d154
Parent:     c7f81c9453375d6416658995eafd3397cb9bba1d
Author:     Andi Kleen <[EMAIL PROTECTED]>
AuthorDate: Wed May 2 19:27:20 2007 +0200
Committer:  Andi Kleen <[EMAIL PROTECTED]>
CommitDate: Wed May 2 19:27:20 2007 +0200

    [PATCH] i386: Evaluate constant cpu features at runtime
    
    Redefine cpu_has() to evaluate cpu features already checked in early
    boot at compile time.  This way the compiler might eliminate some dead code.
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
---
 include/asm-i386/cpufeature.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/asm-i386/cpufeature.h b/include/asm-i386/cpufeature.h
index e66d004..20e849a 100644
--- a/include/asm-i386/cpufeature.h
+++ b/include/asm-i386/cpufeature.h
@@ -106,8 +106,12 @@
 #define X86_FEATURE_LAHF_LM    (6*32+ 0) /* LAHF/SAHF in long mode */
 #define X86_FEATURE_CMP_LEGACY (6*32+ 1) /* If yes HyperThreading not valid */
 
-#define cpu_has(c, bit)                test_bit(bit, (c)->x86_capability)
-#define boot_cpu_has(bit)      test_bit(bit, boot_cpu_data.x86_capability)
+#define cpu_has(c, bit)                                        \
+       ((__builtin_constant_p(bit) && (bit) < 32 &&    \
+               (1UL << (bit)) & REQUIRED_MASK1) ?      \
+               1 :                                     \
+       test_bit(bit, (c)->x86_capability))
+#define boot_cpu_has(bit)      cpu_has(&boot_cpu_data, bit)
 
 #define cpu_has_fpu            boot_cpu_has(X86_FEATURE_FPU)
 #define cpu_has_vme            boot_cpu_has(X86_FEATURE_VME)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to