[eresi-dev] Some explanations about defines in evarista
Julien Vanegue
jfv at cesar.org.br
Thu Aug 21 14:22:33 UTC 2008
Hello all,
After some questions about evarista, I thought it might be useful
for you guys to get an additional explanation about the code
in evarista/lir-definition.esh:
# Attributes for ASM instructions
define b ASM_TYPE_IMPBRANCH
define cb ASM_TYPE_CONDBRANCH
define c ASM_TYPE_CALLPROC
define i ASM_TYPE_INT
define r ASM_TYPE_RETPROC
define p ASM_TYPE_PROLOG
define cmp ASM_TYPE_COMPARISON
define bs ASM_TYPE_BITSET
define a ASM_TYPE_ASSIGN
define wm ASM_TYPE_STORE
define rm ASM_TYPE_LOAD
define e ASM_TYPE_EPILOG
define s ASM_TYPE_STOP
define n ASM_TYPE_NOP
define ar ASM_TYPE_ARITH
define wf ASM_TYPE_WRITEFLAG
define rf ASM_TYPE_READFLAG
define io ASM_TYPE_IO
define sp ASM_TYPE_TOUCHSP
Those lines basically are only a renaming from the internal libasm
semantic flags to shorter names for the eresi scripting language. Its
more practical to manipulate those small names than big macros
names of libasm. If you are not familiar with libasm's macro, see
libasm/include/libasm.h.
# Combinations of flags
define i-r i r
define ar-wf ar wf
define ar-wm ar wm
define a-rm a rm
define a-wm a wm
define cmp-wf cmp wf
define io-rm io rm
define io-wm io wm
define i-rf-bt i rf bt
define a-rm-wm a rm wm
define sp-rm sp rm
define sp-rm-wf sp rm wf
define sp-wm-rf sp wm rf
define wm-rm wm rm
Those commands only defines combinations of the previously defined
flags. For example, define i-r i r means:
i-r = i | r;
Then those combinations are used in the architecture backend transformation
to the LIR intermediate form (for example, in sparc2lir.esh) to
determine the
intermediate form destination type for a given flagged instruction.
Hope this help !
-JFV
More information about the eresi-dev
mailing list