diff options
author | Akinobu Mita <mita@miraclelinux.com> | 2006-03-26 04:39:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:57:09 -0500 |
commit | 4b417d0c7cb6af4afb7bad6463f7f3227d8a5074 (patch) | |
tree | 514ad66b1ee3286d877aa5d1cf18dc970bbe5722 | |
parent | 20548664aa2d98ba0ee3dde4482b0a96b9273b6f (diff) |
[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>
-rw-r--r-- | arch/alpha/lib/ev6-memchr.S | 2 | ||||
-rw-r--r-- | arch/alpha/lib/fpreg.c | 8 | ||||
-rw-r--r-- | include/asm-alpha/bitops.h | 10 | ||||
-rw-r--r-- | include/asm-alpha/fpu.h | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/arch/alpha/lib/ev6-memchr.S b/arch/alpha/lib/ev6-memchr.S index a8e843dbcc23..1a5f71b9d8b1 100644 --- a/arch/alpha/lib/ev6-memchr.S +++ b/arch/alpha/lib/ev6-memchr.S | |||
@@ -84,7 +84,7 @@ $last_quad: | |||
84 | beq $2, $not_found # U : U L U L | 84 | beq $2, $not_found # U : U L U L |
85 | 85 | ||
86 | $found_it: | 86 | $found_it: |
87 | #if defined(__alpha_fix__) && defined(__alpha_cix__) | 87 | #ifdef CONFIG_ALPHA_EV67 |
88 | /* | 88 | /* |
89 | * Since we are guaranteed to have set one of the bits, we don't | 89 | * Since we are guaranteed to have set one of the bits, we don't |
90 | * have to worry about coming back with a 0x40 out of cttz... | 90 | * have to worry about coming back with a 0x40 out of cttz... |
diff --git a/arch/alpha/lib/fpreg.c b/arch/alpha/lib/fpreg.c index 97c4d9d7a4d5..05017ba34c3c 100644 --- a/arch/alpha/lib/fpreg.c +++ b/arch/alpha/lib/fpreg.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * (C) Copyright 1998 Linus Torvalds | 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 | #define STT(reg,val) asm volatile ("ftoit $f"#reg",%0" : "=r"(val)); | 8 | #define STT(reg,val) asm volatile ("ftoit $f"#reg",%0" : "=r"(val)); |
9 | #else | 9 | #else |
10 | #define STT(reg,val) asm volatile ("stt $f"#reg",%0" : "=m"(val)); | 10 | #define STT(reg,val) asm volatile ("stt $f"#reg",%0" : "=m"(val)); |
@@ -53,7 +53,7 @@ alpha_read_fp_reg (unsigned long reg) | |||
53 | return val; | 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 | #define LDT(reg,val) asm volatile ("itoft %0,$f"#reg : : "r"(val)); | 57 | #define LDT(reg,val) asm volatile ("itoft %0,$f"#reg : : "r"(val)); |
58 | #else | 58 | #else |
59 | #define LDT(reg,val) asm volatile ("ldt $f"#reg",%0" : : "m"(val)); | 59 | #define LDT(reg,val) asm volatile ("ldt $f"#reg",%0" : : "m"(val)); |
@@ -98,7 +98,7 @@ alpha_write_fp_reg (unsigned long reg, unsigned long 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 | #define STS(reg,val) asm volatile ("ftois $f"#reg",%0" : "=r"(val)); | 102 | #define STS(reg,val) asm volatile ("ftois $f"#reg",%0" : "=r"(val)); |
103 | #else | 103 | #else |
104 | #define STS(reg,val) asm volatile ("sts $f"#reg",%0" : "=m"(val)); | 104 | #define STS(reg,val) asm volatile ("sts $f"#reg",%0" : "=m"(val)); |
@@ -147,7 +147,7 @@ alpha_read_fp_reg_s (unsigned long reg) | |||
147 | return val; | 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 | #define LDS(reg,val) asm volatile ("itofs %0,$f"#reg : : "r"(val)); | 151 | #define LDS(reg,val) asm volatile ("itofs %0,$f"#reg : : "r"(val)); |
152 | #else | 152 | #else |
153 | #define LDS(reg,val) asm volatile ("lds $f"#reg",%0" : : "m"(val)); | 153 | #define LDS(reg,val) asm volatile ("lds $f"#reg",%0" : : "m"(val)); |
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h index 302201f1a097..e3e602fe5060 100644 --- a/include/asm-alpha/bitops.h +++ b/include/asm-alpha/bitops.h | |||
@@ -261,7 +261,7 @@ static inline unsigned long ffz_b(unsigned long x) | |||
261 | 261 | ||
262 | static inline unsigned long ffz(unsigned long word) | 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 | /* Whee. EV67 can calculate it directly. */ | 265 | /* Whee. EV67 can calculate it directly. */ |
266 | return __kernel_cttz(~word); | 266 | return __kernel_cttz(~word); |
267 | #else | 267 | #else |
@@ -281,7 +281,7 @@ static inline unsigned long ffz(unsigned long word) | |||
281 | */ | 281 | */ |
282 | static inline unsigned long __ffs(unsigned long word) | 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 | /* Whee. EV67 can calculate it directly. */ | 285 | /* Whee. EV67 can calculate it directly. */ |
286 | return __kernel_cttz(word); | 286 | return __kernel_cttz(word); |
287 | #else | 287 | #else |
@@ -313,7 +313,7 @@ static inline int ffs(int word) | |||
313 | /* | 313 | /* |
314 | * fls: find last bit set. | 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 | static inline int fls(int word) | 317 | static inline int fls(int word) |
318 | { | 318 | { |
319 | return 64 - __kernel_ctlz(word & 0xffffffff); | 319 | return 64 - __kernel_ctlz(word & 0xffffffff); |
@@ -326,7 +326,7 @@ static inline int fls(int word) | |||
326 | /* Compute powers of two for the given integer. */ | 326 | /* Compute powers of two for the given integer. */ |
327 | static inline long floor_log2(unsigned long word) | 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 | return 63 - __kernel_ctlz(word); | 330 | return 63 - __kernel_ctlz(word); |
331 | #else | 331 | #else |
332 | long bit; | 332 | long bit; |
@@ -347,7 +347,7 @@ static inline long ceil_log2(unsigned long word) | |||
347 | * of bits set) of a N-bit word | 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 | /* Whee. EV67 can calculate it directly. */ | 351 | /* Whee. EV67 can calculate it directly. */ |
352 | static inline unsigned long hweight64(unsigned long w) | 352 | static inline unsigned long hweight64(unsigned long w) |
353 | { | 353 | { |
diff --git a/include/asm-alpha/fpu.h b/include/asm-alpha/fpu.h index c203fc2fa5cd..ecb17a72acc3 100644 --- a/include/asm-alpha/fpu.h +++ b/include/asm-alpha/fpu.h | |||
@@ -130,7 +130,7 @@ rdfpcr(void) | |||
130 | { | 130 | { |
131 | unsigned long tmp, ret; | 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 | __asm__ __volatile__ ( | 134 | __asm__ __volatile__ ( |
135 | "ftoit $f0,%0\n\t" | 135 | "ftoit $f0,%0\n\t" |
136 | "mf_fpcr $f0\n\t" | 136 | "mf_fpcr $f0\n\t" |
@@ -154,7 +154,7 @@ wrfpcr(unsigned long val) | |||
154 | { | 154 | { |
155 | unsigned long tmp; | 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 | __asm__ __volatile__ ( | 158 | __asm__ __volatile__ ( |
159 | "ftoit $f0,%0\n\t" | 159 | "ftoit $f0,%0\n\t" |
160 | "itoft %1,$f0\n\t" | 160 | "itoft %1,$f0\n\t" |