aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-10-05 20:59:19 -0400
committerPaul Mackerras <paulus@samba.org>2005-10-05 20:59:19 -0400
commitb85a046af3a260e079505e8023ccd10e01cf4f2b (patch)
tree2f5f1af4db85fca6fc88902840463b107721cb14 /include/asm-powerpc
parent6ce52e6438fd2921891648ceab700d9b867e5ed2 (diff)
powerpc: Define 32/64 bit asm macros and use them in fpu.S
These macros help in writing assembly code that works for both ppc32 and ppc64. With this we now have a common fpu.S. This takes out load_up_fpu from head_64.S. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/ppc_asm.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h
index 4efa71878fa9..6cd52c130332 100644
--- a/include/asm-powerpc/ppc_asm.h
+++ b/include/asm-powerpc/ppc_asm.h
@@ -103,12 +103,13 @@
103 oris rn,rn,name##@h; \ 103 oris rn,rn,name##@h; \
104 ori rn,rn,name##@l 104 ori rn,rn,name##@l
105 105
106#define LOADBASE(rn,name) \ 106#define LOADBASE(rn,name) \
107 lis rn,name@highest; \ 107 .section .toc,"aw"; \
108 ori rn,rn,name@higher; \ 1081: .tc name[TC],name; \
109 rldicr rn,rn,32,31; \ 109 .previous; \
110 oris rn,rn,name@ha 110 ld rn,1b@toc(r2)
111 111
112#define OFF(name) 0
112 113
113#define SET_REG_TO_CONST(reg, value) \ 114#define SET_REG_TO_CONST(reg, value) \
114 lis reg,(((value)>>48)&0xFFFF); \ 115 lis reg,(((value)>>48)&0xFFFF); \
@@ -123,6 +124,23 @@
123 rldicr reg,reg,32,31; \ 124 rldicr reg,reg,32,31; \
124 oris reg,reg,(label)@h; \ 125 oris reg,reg,(label)@h; \
125 ori reg,reg,(label)@l; 126 ori reg,reg,(label)@l;
127
128/* operations for longs and pointers */
129#define LDL ld
130#define STL std
131#define CMPI cmpdi
132
133#else /* 32-bit */
134#define LOADBASE(rn,name) \
135 lis rn,name@ha
136
137#define OFF(name) name@l
138
139/* operations for longs and pointers */
140#define LDL lwz
141#define STL stw
142#define CMPI cmpwi
143
126#endif 144#endif
127 145
128/* various errata or part fixups */ 146/* various errata or part fixups */