96dddcf59789f8b44ba023d15008fb5e95e25ca6
[libfirm] / ir / ir / irop.h
1 /*
2 **  Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
3 **  All rights reserved.
4 **
5 **  Authors: Christian Schaefer
6 **
7 **  irop.h  operators of firm nodes
8 **
9 **  This module specifies the opcodes possible for ir nodes.  Their
10 **  definition is close to the operations specified in UKA Tech-Report
11 **  1999-14
12 **
13 */
14
15 # ifndef _IROP_H_
16 # define _IROP_H_
17
18 # include <stddef.h>
19 # include "ident.h"
20
21 typedef enum {
22   iro_Block,
23   iro_Start, iro_End, iro_Jmp, iro_Cond, iro_Return, iro_Raise,
24   iro_Const, iro_SymConst,
25   iro_Sel,
26   iro_Call, iro_Add, iro_Sub, iro_Minus, iro_Mul, iro_Quot, iro_DivMod,
27   iro_Div, iro_Mod, iro_Abs, iro_And, iro_Or, iro_Eor, iro_Not,
28   iro_Cmp, iro_Shl, iro_Shr, iro_Shrs, iro_Rot, iro_Conv,
29   iro_Phi,
30   iro_Load, iro_Store, iro_Alloc, iro_Free, iro_Sync,
31   iro_Proj, iro_Tuple, iro_Id, iro_Bad
32 } opcode;
33
34 typedef struct ir_op ir_op;
35
36 extern ir_op *op_Block;
37
38 extern ir_op *op_Start;
39 extern ir_op *op_End;
40 extern ir_op *op_Jmp;
41 extern ir_op *op_Cond;
42 extern ir_op *op_Return;
43 extern ir_op *op_Raise;
44 extern ir_op *op_Sel;
45
46 extern ir_op *op_Const;
47 extern ir_op *op_SymConst;
48
49 extern ir_op *op_Call;
50 extern ir_op *op_Add;
51 extern ir_op *op_Sub;
52 extern ir_op *op_Minus;
53 extern ir_op *op_Mul;
54 extern ir_op *op_Quot;
55 extern ir_op *op_DivMod;
56 extern ir_op *op_Div;
57 extern ir_op *op_Mod;
58 extern ir_op *op_Abs;
59 extern ir_op *op_And;
60 extern ir_op *op_Or;
61 extern ir_op *op_Eor;
62 extern ir_op *op_Not;
63 extern ir_op *op_Cmp;
64 extern ir_op *op_Shl;
65 extern ir_op *op_Shr;
66 extern ir_op *op_Shrs;
67 extern ir_op *op_Rot;
68 extern ir_op *op_Conv;
69
70 extern ir_op *op_Phi;
71
72 extern ir_op *op_Load;
73 extern ir_op *op_Store;
74 extern ir_op *op_Alloc;
75 extern ir_op *op_Free;
76
77 extern ir_op *op_Sync;
78
79 extern ir_op *op_Tuple;
80 extern ir_op *op_Proj;
81 extern ir_op *op_Id;
82 extern ir_op *op_Bad;
83
84
85 /* Returns the string for the opcode. */
86 const char *get_op_name      (ir_op *op);
87
88 /* Returns the enum for the opcode */
89 opcode get_op_code      (ir_op *op);
90
91 /* Returns the ident for the opcode name */
92 ident *get_op_ident     (ir_op *op);
93
94 /* Returns the attribute size of the opcode.
95    Use not encouraged, internal feature. */
96 int    get_op_attr_size (ir_op *op);
97
98 # endif /* _IROP_H_ */