Imported Upstream version 2.9.0
[debian/cc1111] / src / izt / aop.h
1 /** @file izt/aop.h
2  */
3 #ifndef IZT_AOP_INCLUDE
4 #define IZT_AOP_INCLUDE
5
6 typedef enum {
7     AOP_TYPE_REG,
8     AOP_TYPE_CARRY,
9     AOP_TYPE_LITERAL,
10     AOP_TYPE_STACK,
11     AOP_TYPE_SCRATCH_PTR,
12     AOP_TYPE_IMMEDIATE
13 } AOP_TYPE;
14
15 typedef struct asmop {
16     AOP_TYPE type;
17     int size;
18     union {
19         value *literal;
20         REG *reg;
21         int stack;
22         const char *immediate;
23         const char *scratch;
24     } u;
25 } asmop;
26
27 #define AOP(op) op->aop
28 #define AOP_TYPE(op) AOP(op)->type
29 #define AOP_SIZE(op) AOP(op)->size
30
31 /** Bind a new AOP to the given operand.
32  */
33 void izt_bindAop(operand *op, iCode *ic);
34
35 /** Creates a new asmop that wraps the return value registers.
36  */
37 asmop *izt_getAopForReturn(int size);
38
39 #endif