Next: Delay slots, Previous: Forward references, Up: Standard macros
The core-common.h file contains hundreds of macro definitions which will spare you defining a lot of things in the files the are specific to your port. Here is a list of the features that core-common.h provides.
#define jit_extr_c_ui(d, rs)
#define jit_extr_s_ui(d, rs)
#define jit_extr_c_ul(d, rs)
#define jit_extr_s_ul(d, rs)
#define jit_extr_i_ul(d, rs)
#define jit_negr_i(d, rs)
#define jit_negr_l(d, rs)
jit_prolog, jit_leaf and jit_finish are not
mandatory. If not defined, they will be defined respectively as an
empty macro, as a synonym for jit_prolog, and as a synonym for
jit_calli. Whether to define them or not in the port-specific
header file, it depends on the underlying architecture's abi—in
general, however, you'll need to define at least jit_prolog.
#define jit_extr_c_i(d, rs)
#define jit_extr_s_i(d, rs)
#define jit_extr_c_l(d, rs)
#define jit_extr_s_l(d, rs)
#define jit_extr_i_l(d, rs)
#define jit_rsbi_i(d, rs, is)
#define jit_rsbi_l(d, rs, is)
#define jit_rsbi_p(d, rs, is)
#define jit_ntoh_ui(d, rs)
#define jit_ntoh_us(d, rs)
[%l6] is actually assembled as
[%l6+%g0]. If this is the case, you should define
JIT_RZERO to be the number of this register; core-common.h
will use it to implement all variations of the ld and st
instructions. For example:
#define jit_ldi_c(d, is) jit_ldxi_c(d, JIT_RZERO, is)
#define jit_ldr_i(d, rs) jit_ldxr_c(d, JIT_RZERO, rs)
If available, JIT_RZERO is also used to provide more efficient
definitions of the neg instruction (see “Support for common
synthetic instructions”, above).
jit_addr_i and jit_addr_ui
macros. Similarly, pointers and unsigned long integers behave in the
same way, but gnu lightning has separate instruction for the two data
types—those that operate on pointers usually include a typecast
that makes programs clearer.
neg and ext (see
“Support for common synthetic instructions”, above), which are
simply non-mandatory, you must not define these functions.
longslongs and unsigned longs are the same
as, respectively, ints and unsigned ints. In this case,
core-common.h defines operations on these types to be synonyms.
jit_statejit_state
type. Part of this struct is machine-dependent and includes
all kinds of state needed by the back-end; this part is always
accessible in a re-entrant way as _jitl. _jitl will be
of type struct jit_local_state; this struct must be defined
even if no state is required.