ia32_nodes_attr.h 2 KB
Newer Older
1
2
3
4
5
6
#ifndef _IA32_NODES_ATTR_H_
#define _IA32_NODES_ATTR_H_

#include "firm_types.h"
#include "../bearch.h"

Christian Würdig's avatar
Christian Würdig committed
7
typedef enum { flavour_Div = 1, flavour_Mod, flavour_DivMod, flavour_Mul, flavour_Mulh } op_flavour_t;
8
typedef enum { pn_EAX, pn_EDX } pn_ia32_Register;
9
10
11
12
13
14
15
16
17
18
19
typedef enum { asmop_Normal, asmop_Const, asmop_SymConst, asmop_AddrMode } asmop_type_t;
typedef	enum {
	am_Reg = 1,          /**<<  (%reg)              */
	am_OffsReg,          /**<< o(%reg)              */
	am_RegReg,           /**<<  (%reg, %reg)        */
	am_RegConst,         /**<<  (    , %reg, const) */
	am_OffsRegConst,     /**<< o(    , %reg, const) */
	am_OffsRegReg,       /**<< o(%reg, %reg)        */
	am_RegRegConst,      /**<<  (%reg, %reg, const) */
	am_OffsRegRegConst   /**<< o(%reg, %reg, const) */
} addrmode_type_t;
20

Christian Würdig's avatar
Christian Würdig committed
21
22
23
24
typedef struct _ia32_register_req_t {
	const arch_register_req_t req;
	int pos;   /**<< in case of "should be same/different" we need to remember the pos to get the irn */
} ia32_register_req_t;
25

Christian Würdig's avatar
Christian Würdig committed
26
typedef struct _ia32_asmop_attr {
27
28
	asmop_type_t    tp;      /**<< ia32 node type */
	addrmode_type_t am_tp;   /**<< addr mode type */
29

30
31
	tarval  *am_offs;  /**<< offset for AddrMode */
	tarval  *am_const; /**<< shift const for AddrMode */
Christian Würdig's avatar
Christian Würdig committed
32

33
34
	tarval  *tv;       /**<< tarval for immediate operations */
	ir_node *old_ir;   /**<< old ir node to avoid duplicating information (symconst in case of asmop_SymConst) */
35

Christian Würdig's avatar
Christian Würdig committed
36
	op_flavour_t     op_flav;   /**<< flavour of an op (flavour_Div/Mod/DivMod/Mul/Mulh) */
37
38
39
	long             pn_code;   /**<< projnum "types" (e.g. indicate compare operators and argument numbers) */
	long             n_res;     /**<< number of results */
	arch_irn_flags_t flags;     /**<< indicating if spillable and/or rematerializeable */
40

Christian Würdig's avatar
Christian Würdig committed
41
42
	const ia32_register_req_t **in_req;  /**<< register requirements for arguments */
	const ia32_register_req_t **out_req; /**<< register requirements for results */
43

44
	const arch_register_t **slots;          /**<< register slots for assigned registers */
45
46
47
} asmop_attr;

#endif /* _IA32_NODES_ATTR_H_ */