aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-alpha/compiler.h
diff options
context:
space:
mode:
authorIvan Kokshaysky <ink@jurassic.park.msu.ru>2007-04-17 01:53:21 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-17 19:36:27 -0400
commit88ed39b064575b4f42ecb737ec2daa66717de173 (patch)
treea9c181fc229fbe6f1f6d70372256d3fd7a3150b9 /include/asm-alpha/compiler.h
parent7fc1a1abc1eca1278d6d37ec54b72005d15b5c1e (diff)
alpha: build fixes - force architecture
Override compiler .arch directive for generic kernel build. Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-alpha/compiler.h')
-rw-r--r--include/asm-alpha/compiler.h47
1 files changed, 35 insertions, 12 deletions
diff --git a/include/asm-alpha/compiler.h b/include/asm-alpha/compiler.h
index d2768cc3d7a4..da6bb199839c 100644
--- a/include/asm-alpha/compiler.h
+++ b/include/asm-alpha/compiler.h
@@ -17,9 +17,6 @@
17# define __kernel_extbl(val, shift) __builtin_alpha_extbl(val, shift) 17# define __kernel_extbl(val, shift) __builtin_alpha_extbl(val, shift)
18# define __kernel_extwl(val, shift) __builtin_alpha_extwl(val, shift) 18# define __kernel_extwl(val, shift) __builtin_alpha_extwl(val, shift)
19# define __kernel_cmpbge(a, b) __builtin_alpha_cmpbge(a, b) 19# define __kernel_cmpbge(a, b) __builtin_alpha_cmpbge(a, b)
20# define __kernel_cttz(x) __builtin_ctzl(x)
21# define __kernel_ctlz(x) __builtin_clzl(x)
22# define __kernel_ctpop(x) __builtin_popcountl(x)
23#else 20#else
24# define __kernel_insbl(val, shift) \ 21# define __kernel_insbl(val, shift) \
25 ({ unsigned long __kir; \ 22 ({ unsigned long __kir; \
@@ -49,17 +46,39 @@
49 ({ unsigned long __kir; \ 46 ({ unsigned long __kir; \
50 __asm__("cmpbge %r2,%1,%0" : "=r"(__kir) : "rI"(b), "rJ"(a)); \ 47 __asm__("cmpbge %r2,%1,%0" : "=r"(__kir) : "rI"(b), "rJ"(a)); \
51 __kir; }) 48 __kir; })
49#endif
50
51#ifdef __alpha_cix__
52# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3
53# define __kernel_cttz(x) __builtin_ctzl(x)
54# define __kernel_ctlz(x) __builtin_clzl(x)
55# define __kernel_ctpop(x) __builtin_popcountl(x)
56# else
57# define __kernel_cttz(x) \
58 ({ unsigned long __kir; \
59 __asm__("cttz %1,%0" : "=r"(__kir) : "r"(x)); \
60 __kir; })
61# define __kernel_ctlz(x) \
62 ({ unsigned long __kir; \
63 __asm__("ctlz %1,%0" : "=r"(__kir) : "r"(x)); \
64 __kir; })
65# define __kernel_ctpop(x) \
66 ({ unsigned long __kir; \
67 __asm__("ctpop %1,%0" : "=r"(__kir) : "r"(x)); \
68 __kir; })
69# endif
70#else
52# define __kernel_cttz(x) \ 71# define __kernel_cttz(x) \
53 ({ unsigned long __kir; \ 72 ({ unsigned long __kir; \
54 __asm__("cttz %1,%0" : "=r"(__kir) : "r"(x)); \ 73 __asm__(".arch ev67; cttz %1,%0" : "=r"(__kir) : "r"(x)); \
55 __kir; }) 74 __kir; })
56# define __kernel_ctlz(x) \ 75# define __kernel_ctlz(x) \
57 ({ unsigned long __kir; \ 76 ({ unsigned long __kir; \
58 __asm__("ctlz %1,%0" : "=r"(__kir) : "r"(x)); \ 77 __asm__(".arch ev67; ctlz %1,%0" : "=r"(__kir) : "r"(x)); \
59 __kir; }) 78 __kir; })
60# define __kernel_ctpop(x) \ 79# define __kernel_ctpop(x) \
61 ({ unsigned long __kir; \ 80 ({ unsigned long __kir; \
62 __asm__("ctpop %1,%0" : "=r"(__kir) : "r"(x)); \ 81 __asm__(".arch ev67; ctpop %1,%0" : "=r"(__kir) : "r"(x)); \
63 __kir; }) 82 __kir; })
64#endif 83#endif
65 84
@@ -78,16 +97,20 @@
78#else 97#else
79#define __kernel_ldbu(mem) \ 98#define __kernel_ldbu(mem) \
80 ({ unsigned char __kir; \ 99 ({ unsigned char __kir; \
81 __asm__("ldbu %0,%1" : "=r"(__kir) : "m"(mem)); \ 100 __asm__(".arch ev56; \
101 ldbu %0,%1" : "=r"(__kir) : "m"(mem)); \
82 __kir; }) 102 __kir; })
83#define __kernel_ldwu(mem) \ 103#define __kernel_ldwu(mem) \
84 ({ unsigned short __kir; \ 104 ({ unsigned short __kir; \
85 __asm__("ldwu %0,%1" : "=r"(__kir) : "m"(mem)); \ 105 __asm__(".arch ev56; \
106 ldwu %0,%1" : "=r"(__kir) : "m"(mem)); \
86 __kir; }) 107 __kir; })
87#define __kernel_stb(val,mem) \ 108#define __kernel_stb(val,mem) \
88 __asm__("stb %1,%0" : "=m"(mem) : "r"(val)) 109 __asm__(".arch ev56; \
89#define __kernel_stw(val,mem) \ 110 stb %1,%0" : "=m"(mem) : "r"(val))
90 __asm__("stw %1,%0" : "=m"(mem) : "r"(val)) 111#define __kernel_stw(val,mem) \
112 __asm__(".arch ev56; \
113 stw %1,%0" : "=m"(mem) : "r"(val))
91#endif 114#endif
92 115
93#ifdef __KERNEL__ 116#ifdef __KERNEL__