diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-02-04 21:51:50 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-02-04 21:51:50 (GMT) |
commit | a1d7bc97071a4d22bb633359c749e3de84682024 (patch) | |
tree | 841744c30ac6010a4fc827fa09970e45f991c9ef /src/arch/operands/register-int.h | |
parent | 6d290a69f0b76fce34e8a2fc2c5fbec15c95d1a5 (diff) |
Reduced the size required for register operands.
Diffstat (limited to 'src/arch/operands/register-int.h')
-rw-r--r-- | src/arch/operands/register-int.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/src/arch/operands/register-int.h b/src/arch/operands/register-int.h index c728be7..bf3e9d4 100644 --- a/src/arch/operands/register-int.h +++ b/src/arch/operands/register-int.h @@ -29,19 +29,63 @@ #include "../operand-int.h" +#include "../../glibext/objhole.h" +/* Informations glissées dans la structure GObject de GArchInstruction */ +typedef union _regop_obj_extra +{ + struct + { + bool is_written; /* Changement de contenu */ + + }; + + gint lock; /* Gestion d'accès aux fanions */ + +} regop_obj_extra; + /* Définition d'un opérande visant un registre (instance) */ struct _GRegisterOperand { GArchOperand parent; /* Instance parente */ GArchRegister *reg; /* Registre représenté */ - bool is_written; /* Changement de contenu */ + +#if __SIZEOF_INT__ == __SIZEOF_LONG__ + + /** + * L'inclusion des informations suivantes dépend de l'architecture. + * + * Si la structure GObject possède un trou, on remplit de préférence + * ce dernier. + */ + + regop_obj_extra extra; /* Externalisation embarquée */ + +#endif }; +/** + * Accès aux informations éventuellement déportées. + */ + +#if __SIZEOF_INT__ == __SIZEOF_LONG__ + +# define INIT_REG_OP_EXTRA(op) op->extra.lock = 0 + +# define GET_REG_OP_EXTRA(op) &op->extra + +#else + +# define INIT_REG_OP_EXTRA(op) INIT_GOBJECT_EXTRA(G_OBJECT(op)) + +# define GET_REG_OP_EXTRA(op) GET_GOBJECT_EXTRA(G_OBJECT(op), regop_obj_extra) + +#endif + /* Définition d'un opérande visant un registre (classe) */ struct _GRegisterOperandClass { |