3 * Creation Date: <2001/02/03 19:38:07 samuel>
4 * Time-stamp: <2003/07/08 18:55:50 samuel>
8 * Common assembly definitions
10 * Copyright (C) 2001, 2002, 2003 Samuel Rydh (samuel@ibrium.se)
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation
21 /************************************************************************/
22 /* High/low halfword compatibility macros */
23 /************************************************************************/
26 #define ha16( v ) (v)##@ha
27 #define hi16( v ) (v)##@h
28 #define lo16( v ) (v)##@l
34 /* from Linux: include/asm-powerpc/ppc_asm.h */
36 * Copyright (C) 1995-1999 Gary Thomas, Paul Mackerras, Cort Dougan.
39 /* General Purpose Registers (GPRs) */
74 /************************************************************************/
76 /************************************************************************/
80 #define LOAD_REG_IMMEDIATE(D, x) \
81 lis (D), (x)@highest ; \
82 ori (D), (D), (x)@higher ; \
84 oris (D), (D), (x)@h ; \
87 #define LOAD_REG_FUNC(D, x) \
88 LOAD_REG_IMMEDIATE((D), (x)) ; \
93 #define LOAD_REG_IMMEDIATE(D, x) \
97 #define LOAD_REG_FUNC(D, x) \
98 LOAD_REG_IMMEDIATE((D), (x))
105 #define PPC_STLU stdu
107 #define MTMSRD(r) mtmsrd r
108 #define DATA_LONG(x) .quad x
109 #define BRANCH_LABEL(name) . ## name
110 #define PPC_LR_STKOFF 16
114 #define PPC_STLU stwu
116 #define MTMSRD(r) mtmsr r
117 #define DATA_LONG(x) .long x
118 #define BRANCH_LABEL(name) name
119 #define PPC_LR_STKOFF 4
123 #define GLOBL( name ) .globl name ; name
124 #define EXTERN( name ) name
126 /* an underscore is needed on Darwin */
127 #define GLOBL( name ) .globl _##name ; name: ; _##name
128 #define EXTERN( name ) _##name
131 #if defined(__powerpc64__) && !defined(__darwin__)
132 #define _GLOBAL(name) \
134 .section ".opd", "aw" ; \
139 .quad .TOC.@tocbase ; \
142 .type .##name, @function ; \
145 #define _GLOBAL(name) \
149 #define BIT(n) (1<<(31-(n)))
151 #endif /* _H_ASMDEFS */