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

« back to all changes in this revision

Viewing changes to erts/emulator/hipe/hipe_sparc_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:
84
84
`defarg(5,`%o0')')dnl
85
85
 
86
86
/*
87
 
 * TEMP_ARG{0,1,2}:
88
 
 *      Used by NBIF_SAVE_RESCHED_ARGS to save argument
89
 
 *      registers in locations preserved by C.
90
 
 *      May be registers or process-private memory locations.
91
 
 *      Must not be C caller-save registers.
92
 
 *      Must not overlap with any Erlang global registers.
93
 
 *
94
87
 * TEMP_ARG0:
95
88
 *      Used in nbif_stack_trap_ra to preserve the return value.
96
89
 *      Must be a C callee-save register.
101
94
 *      (TEMP_RA contains the caller's saved return address).
102
95
 *      Must be a C callee-save register.
103
96
 *      Must be otherwise unused in the call path.
 
97
 *
 
98
 * TEMP_ARG0:
 
99
 *      Used to pass the callee address in native-to-BEAM traps
 
100
 *      (nbif_callemu).
 
101
 *      Must be otherwise unused in the call path.
 
102
 *
 
103
 * TEMP_ARG1:
 
104
 *      Used to pass the callee arity in native-to-BEAM traps
 
105
 *      (nbif_callemu).
 
106
 *      Must be otherwise unused in the call path.
104
107
 */
105
108
`#define TEMP_ARG0      %i4'
106
109
`#define TEMP_ARG1      %i5'
107
 
`#define TEMP_ARG2      %l7'
108
110
 
109
111
dnl XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
110
112
dnl X                                                           X
179
181
`/* #define NBIF_RET_5  'NBIF_RET(5)` */'
180
182
 
181
183
dnl
182
 
dnl NBIF_SAVE_RESCHED_ARGS(ARITY)
183
 
dnl Used in the expensive_bif_interface_{1,3}() macros to copy
184
 
dnl caller-save argument registers to non-volatile locations.
185
 
dnl Currently, 1 <= ARITY <= 3, so this simply moves the arguments
186
 
dnl to C callee-save registers.
187
 
dnl
188
 
define(NBIF_MIN,`ifelse(eval($1 > $2),0,$1,$2)')dnl
189
 
define(NBIF_SVA_1,`ifelse(eval($1 < NR_ARG_REGS),0,,`mov        ARG$1,TEMP_ARG$1; ')')dnl
190
 
define(NBIF_SVA_N,`ifelse(eval($1 >= 0),0,,`NBIF_SVA_N(eval($1-1))NBIF_SVA_1($1)')')dnl
191
 
define(NBIF_SAVE_RESCHED_ARGS,`NBIF_SVA_N(eval(NBIF_MIN($1,NR_ARG_REGS)-1))')dnl
192
 
`/* #define NBIF_SAVE_RESCHED_ARGS_1 'NBIF_SAVE_RESCHED_ARGS(1)` */'
193
 
`/* #define NBIF_SAVE_RESCHED_ARGS_2 'NBIF_SAVE_RESCHED_ARGS(2)` */'
194
 
`/* #define NBIF_SAVE_RESCHED_ARGS_3 'NBIF_SAVE_RESCHED_ARGS(3)` */'
195
 
 
196
 
dnl
197
184
dnl QUICK_CALL_RET(CFUN,ARITY)
198
185
dnl Used in nocons_nofail and noproc primop interfaces to optimise
199
186
dnl SAVE_CONTEXT_QUICK; call CFUN; nop; RESTORE_CONTEXT_QUICK; NBIF_RET(ARITY).