Search
lxdream.org :: lxdream/src/xlat/xlat.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/xlat/xlat.h
changeset 1011:fdd58619b760
prev1006:3a169c224c12
author nkeynes
date Sun Apr 12 07:24:45 2009 +0000 (15 years ago)
branchxlat-refactor
permissions -rw-r--r--
last change Restructure operand types -
rename to forms to avoid conflict for actual data types
temporary operands are now a first class form
remove explicit types for immediates - now implied by opcode
Initial work on promote-source-reg pass
file annotate diff log raw
1.1 --- a/src/xlat/xlat.h Tue Apr 07 10:55:03 2009 +0000
1.2 +++ b/src/xlat/xlat.h Sun Apr 12 07:24:45 2009 +0000
1.3 @@ -30,7 +30,6 @@
1.4 struct xlat_source_machine {
1.5 const char *name;
1.6 void *state_data; /* Pointer to source machine state structure */
1.7 - const char **reg_names; /* Register names, indexed by offset/4 */
1.8 uint32_t pc_offset; /* Offset of source PC, relative to state_data */
1.9 uint32_t delayed_pc_offset; /* Offset of source delayed PC offset, relative to state_data */
1.10 uint32_t t_offset; /* Offset of source T reg, relative to state_data */
1.11 @@ -39,6 +38,12 @@
1.12 uint32_t s_offset;
1.13
1.14 /**
1.15 + * Return the name of the register with the given type,
1.16 + * or NULL if no such register exists
1.17 + */
1.18 + const char * (*get_register_name)( uint32_t reg, xir_type_t type );
1.19 +
1.20 + /**
1.21 * Decode a basic block of instructions from start, stopping after a
1.22 * control transfer or before the given end instruction.
1.23 * @param sd source data. This method should set the address_space field.
1.24 @@ -51,17 +56,21 @@
1.25 /* Target machine description (no these are not meant to be symmetrical) */
1.26 struct xlat_target_machine {
1.27 const char *name;
1.28 - /* Register information */
1.29 - const char **reg_names;
1.30
1.31 /* Required functions */
1.32
1.33 /**
1.34 + * Return the name of the register with the given type,
1.35 + * or NULL if no such register exists
1.36 + */
1.37 + const char * (*get_register_name)( uint32_t reg, xir_type_t type );
1.38 +
1.39 + /**
1.40 * Test if the given operands are legal for the opcode. Note that it is assumed that
1.41 * target register operands are always legal. This is used by the register allocator
1.42 * to determine when it can fuse load/stores with another operation.
1.43 */
1.44 - gboolean (*is_legal)( xir_opcode_t op, xir_operand_type_t arg0, xir_operand_type_t arg1 );
1.45 + gboolean (*is_legal)( xir_opcode_t op, xir_operand_form_t arg0, xir_operand_form_t arg1 );
1.46
1.47 /**
1.48 * Lower IR closer to the machine, handling machine-specific issues that can't
.