~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to erts/emulator/hipe/hipe_ppc_asm.m4

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
`defarg(5,`r9')')dnl
171
171
 
172
172
/*
173
 
 * TEMP_ARG{0,1,2}:
174
 
 *      Used by NBIF_SAVE_RESCHED_ARGS to save argument
175
 
 *      registers in locations preserved by C.
176
 
 *      May be registers or process-private memory locations.
177
 
 *      Must not be C caller-save registers.
178
 
 *      Must not overlap with any Erlang global registers.
179
 
 *
180
173
 * TEMP_ARG0:
181
174
 *      Used in nbif_stack_trap_ra to preserve the return value.
182
175
 *      Must be a C callee-save register.
189
182
 *      Must be otherwise unused in the call path.
190
183
 */
191
184
`#define TEMP_ARG0      r27'
192
 
`#define TEMP_ARG1      r26'
193
 
`#define TEMP_ARG2      r25'
194
185
 
195
186
dnl XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
196
187
dnl X                                                           X
262
253
`/* #define NBIF_RET_5  'NBIF_RET(5)` */'
263
254
 
264
255
dnl
265
 
dnl NBIF_SAVE_RESCHED_ARGS(ARITY)
266
 
dnl Used in the expensive_bif_interface_{1,2,3}() macros to copy
267
 
dnl caller-save argument registers to non-volatile locations.
268
 
dnl Currently, 1 <= ARITY <= 3, so this simply moves the arguments
269
 
dnl to C callee-save registers.
270
 
dnl
271
 
define(NBIF_MIN,`ifelse(eval($1 > $2),0,$1,$2)')dnl
272
 
define(NBIF_SVA_1,`ifelse(eval($1 < NR_ARG_REGS),0,,`mr TEMP_ARG$1,ARG$1 SEMI ')')dnl
273
 
define(NBIF_SVA_N,`ifelse(eval($1 >= 0),0,,`NBIF_SVA_N(eval($1-1))NBIF_SVA_1($1)')')dnl
274
 
define(NBIF_SAVE_RESCHED_ARGS,`NBIF_SVA_N(eval(NBIF_MIN($1,NR_ARG_REGS)-1))')dnl
275
 
`/* #define NBIF_SAVE_RESCHED_ARGS_1 'NBIF_SAVE_RESCHED_ARGS(1)` */'
276
 
`/* #define NBIF_SAVE_RESCHED_ARGS_2 'NBIF_SAVE_RESCHED_ARGS(2)` */'
277
 
`/* #define NBIF_SAVE_RESCHED_ARGS_3 'NBIF_SAVE_RESCHED_ARGS(3)` */'
278
 
 
279
 
dnl
280
256
dnl QUICK_CALL_RET(CFUN,ARITY)
281
257
dnl Used in nocons_nofail and noproc primop interfaces to optimise
282
258
dnl SAVE_CONTEXT_QUICK; bl CFUN; RESTORE_CONTEXT_QUICK; NBIF_RET(ARITY).