Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] bitops: alpha: use config options instead of __alpha_fix__ and __alpha_cix__

Use config options instead of gcc builtin definition to tell the use of
instruction set extensions (CIX and FIX).

This is introduced to tell the kbuild system the use of opmized hweight*()
routines on alpha architecture.

Signed-off-by: Akinobu Mita <mita@miraclelinux.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Akinobu Mita and committed by
Linus Torvalds
4b417d0c 20548664

+12 -12
+1 -1
arch/alpha/lib/ev6-memchr.S
··· 84 84 beq $2, $not_found # U : U L U L 85 85 86 86 $found_it: 87 - #if defined(__alpha_fix__) && defined(__alpha_cix__) 87 + #ifdef CONFIG_ALPHA_EV67 88 88 /* 89 89 * Since we are guaranteed to have set one of the bits, we don't 90 90 * have to worry about coming back with a 0x40 out of cttz...
+4 -4
arch/alpha/lib/fpreg.c
··· 4 4 * (C) Copyright 1998 Linus Torvalds 5 5 */ 6 6 7 - #if defined(__alpha_cix__) || defined(__alpha_fix__) 7 + #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67) 8 8 #define STT(reg,val) asm volatile ("ftoit $f"#reg",%0" : "=r"(val)); 9 9 #else 10 10 #define STT(reg,val) asm volatile ("stt $f"#reg",%0" : "=m"(val)); ··· 53 53 return val; 54 54 } 55 55 56 - #if defined(__alpha_cix__) || defined(__alpha_fix__) 56 + #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67) 57 57 #define LDT(reg,val) asm volatile ("itoft %0,$f"#reg : : "r"(val)); 58 58 #else 59 59 #define LDT(reg,val) asm volatile ("ldt $f"#reg",%0" : : "m"(val)); ··· 98 98 } 99 99 } 100 100 101 - #if defined(__alpha_cix__) || defined(__alpha_fix__) 101 + #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67) 102 102 #define STS(reg,val) asm volatile ("ftois $f"#reg",%0" : "=r"(val)); 103 103 #else 104 104 #define STS(reg,val) asm volatile ("sts $f"#reg",%0" : "=m"(val)); ··· 147 147 return val; 148 148 } 149 149 150 - #if defined(__alpha_cix__) || defined(__alpha_fix__) 150 + #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67) 151 151 #define LDS(reg,val) asm volatile ("itofs %0,$f"#reg : : "r"(val)); 152 152 #else 153 153 #define LDS(reg,val) asm volatile ("lds $f"#reg",%0" : : "m"(val));
+5 -5
include/asm-alpha/bitops.h
··· 261 261 262 262 static inline unsigned long ffz(unsigned long word) 263 263 { 264 - #if defined(__alpha_cix__) && defined(__alpha_fix__) 264 + #if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67) 265 265 /* Whee. EV67 can calculate it directly. */ 266 266 return __kernel_cttz(~word); 267 267 #else ··· 281 281 */ 282 282 static inline unsigned long __ffs(unsigned long word) 283 283 { 284 - #if defined(__alpha_cix__) && defined(__alpha_fix__) 284 + #if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67) 285 285 /* Whee. EV67 can calculate it directly. */ 286 286 return __kernel_cttz(word); 287 287 #else ··· 313 313 /* 314 314 * fls: find last bit set. 315 315 */ 316 - #if defined(__alpha_cix__) && defined(__alpha_fix__) 316 + #if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67) 317 317 static inline int fls(int word) 318 318 { 319 319 return 64 - __kernel_ctlz(word & 0xffffffff); ··· 326 326 /* Compute powers of two for the given integer. */ 327 327 static inline long floor_log2(unsigned long word) 328 328 { 329 - #if defined(__alpha_cix__) && defined(__alpha_fix__) 329 + #if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67) 330 330 return 63 - __kernel_ctlz(word); 331 331 #else 332 332 long bit; ··· 347 347 * of bits set) of a N-bit word 348 348 */ 349 349 350 - #if defined(__alpha_cix__) && defined(__alpha_fix__) 350 + #if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67) 351 351 /* Whee. EV67 can calculate it directly. */ 352 352 static inline unsigned long hweight64(unsigned long w) 353 353 {
+2 -2
include/asm-alpha/fpu.h
··· 130 130 { 131 131 unsigned long tmp, ret; 132 132 133 - #if defined(__alpha_cix__) || defined(__alpha_fix__) 133 + #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67) 134 134 __asm__ __volatile__ ( 135 135 "ftoit $f0,%0\n\t" 136 136 "mf_fpcr $f0\n\t" ··· 154 154 { 155 155 unsigned long tmp; 156 156 157 - #if defined(__alpha_cix__) || defined(__alpha_fix__) 157 + #if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67) 158 158 __asm__ __volatile__ ( 159 159 "ftoit $f0,%0\n\t" 160 160 "itoft %1,$f0\n\t"