summaryrefslogtreecommitdiff
path: root/portability
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-11-26 06:42:45 -0500
committerSøren Sandmann Pedersen <ssp@redhat.com>2012-11-26 06:42:45 -0500
commitab05f3a0a9a8d8a290d9aede731a02bfed90f1a1 (patch)
tree637325da7a1a0d9ba088789e0a2b9579d50d949d /portability
parentcd8b1850d74adacd80e05f0f5bdc9cd09d672c08 (diff)
portability
Diffstat (limited to 'portability')
-rw-r--r--portability62
1 files changed, 43 insertions, 19 deletions
diff --git a/portability b/portability
index 092e150..ba5e883 100644
--- a/portability
+++ b/portability
@@ -1,32 +1,46 @@
-- op_t exists on all architectures, but may have different contents;
- it is always passable by value.
+- optype_t exists on all architectures, but is arch specific. There
+ must be fewer than 32 values in it. (This may be bumped to 64
+ on all arches if 32 is not enough).
+- op_t exists on all architectures. It is always a 64 bit integer,
+ where the low 8 bits contain an op_type. The rest of the integer
+ is machine specific
+- inst_t is a struct that has three mandatory fields:
+ - name
+ - number of ops
+ - for each op, a bit field describing which optypes are acceptable
+ (remember there are only 32 different optypes).
+ It will typically have additional fields describing the encoding of
+ the instruction.
+
+
+Files:
- pixman-assembler.h:
+ - includes pixman-arch-assembler.h
+
- declaration of machine_spec_t, which is a struct that describes the
machine in question.
- declaration of general assembler methods:
- pixman_assembler_t *pixman_assembler_create (const machine_spec_t *machine);
- uint8_t *pixman_assembler_link (pixman_assembler_t *assembler,
- pixman_fragment_t *fragment,
- ...);
- pixman_fragment_t *pixman_fragment_new (const machine_spec_t *machine);
- void pixman_fragment_assemble (fragment_t *fragment,
- ...);
-- pixman-<arch>-assembler.h contains:
-
- - definition of op_type_t for the arch in question
- - definition of op_t for the architecture in question
- - constructors of op_t for the architecture in question
- - declaration of pixman_assembler_create_<arch>
+ pixman_assembler_t *_pixman_assembler_create (const machine_spec_t *machine);
+ uint8_t *_pixman_assembler_link (pixman_assembler_t *assembler,
+ pixman_fragment_t *fragment,
+ ...);
+ pixman_fragment_t *_pixman_fragment_new (const machine_spec_t *machine);
+ void pixman_fragment_assemble (fragment_t *fragment,
+ ...);
- declaration of stack manager and register allocator
+ void pixman_reg_alloc_init (reg_alloc_t *alloc,
+ stack_man_t *stack_man,
+ const machine_spec *spec,
+ const reg_pool_t *pool);
+
- pixman-assembler.c:
- - includes pixman-<arch>-assembler.h
- includes pixman-assembler.h
- has code to:
@@ -42,20 +56,30 @@
- implementation of register allcoator and stack manager.
+- pixman-<arch>-assembler.h contains:
+
+ - definition of op_type_t, inst_t for the arch in question
+ - definition of op_t for the architecture in question
+ - macros to construct op_t for the architecture in question
+ - declaration of pixman_assembler_create_<arch>
+
- pixman-arch-assembler.c contains
- definition of inst_t table
- definition of pixman_assembler_<arch>_create()
- - definition of machine_spec_t for the architecture, including
+ - definition of machine_spec_t for the architecture, with methods for
- how to spill to the stack
- how to patch up jumps
+ - definition of register pools
- user code will
- - include pixman-<arch>-assembler.h
- include pixman-assembler.h
-
+ - define pixman_reg_pools as it sees fit
- call pixman_assembler_create_<arch>
+ - call pixman_reg_alloc_init_<arch>
+
+ Should all the machine_spec stuff go in the user code? Is there any real difference?
Where should the current code-manager.c go? This is platform specific,
not machine specific. pixman-assembler.c is tempting.