3 # This is the specification for the ia32 assembler Firm-operations
5 # the cpu architecture (ia32, ia64, mips, sparc, ppc, ...)
9 # The node description is done as a perl hash initializer with the
10 # following structure:
15 # "op_flags" => "N|L|C|X|I|F|Y|H|c",
16 # "arity" => "0|1|2|3|variable|dynamic|all",
17 # "state" => "floats|pinned",
21 # { "type" => "type 1", "name" => "name 1" },
22 # { "type" => "type 2", "name" => "name 2" },
25 # "comment" => "any comment for constructor",
26 # "rd_constructor" => "DEFAULT"
28 # "c source code which constructs an ir_node"
31 # ... # (all nodes you need to describe)
33 # ); # close the %nodes initializer
35 # the op_flags correspond to the firm irop_flags:
38 # C irop_flag_commutative
39 # X irop_flag_cfopcode
40 # I irop_flag_ip_cfopcode
43 # H irop_flag_highlevel
44 # c irop_flag_constlike
46 # arity: arity of the operation
47 # args: the arguments of the node constructor (debug, irg and block
48 # are always the first 3 arguments and are always autmatically
51 # DEFAULT will create the following arguments:
52 # for i = 1 .. arity: ir_node *op_i
54 # comment: optional comment for the node constructor
55 # rd_constructor: for every operation there will be a
56 # new_rd_<arch>_<op-name> function with the arguments from above
57 # which creates the ir_node corresponding to the defined operation
58 # you can either put the complete source code of this function here
60 # DEFAULT creates the following constructor:
62 # if (!op_<arch>_<op-name>) assert(0);
66 # res = new_ir_node(dbg, irg, block, op_<arch>_<op-name>, mode, in)
67 # res = optimize_node(res)
68 # IRN_VRFY_IRG(res, irg)
71 # NOTE: You can use DEFAULT if and only if arity is 0,1,2 or 3
73 #--------------------------------------------------#
76 # _ __ _____ __ _ _ __ ___ _ __ ___ #
77 # | '_ \ / _ \ \ /\ / / | | '__| / _ \| '_ \/ __| #
78 # | | | | __/\ V V / | | | | (_) | |_) \__ \ #
79 # |_| |_|\___| \_/\_/ |_|_| \___/| .__/|___/ #
82 #--------------------------------------------------#
86 # arithmetic operations
88 # commutative operations
95 "comment" => "construct Add: Add(a, b) = Add(b, a) = a + b",
96 "rd_constructor" => "DEFAULT"
104 "comment" => "construct Add: Add(a, const) = Add(const, a) = a + const",
105 "rd_constructor" => "DEFAULT"
113 "comment" => "construct Mul: Mul(a, b) = Mul(b, a) = a * b",
114 "rd_constructor" => "DEFAULT"
122 "comment" => "construct Mul: Mul(a, const) = Mul(const, a) = a * const",
123 "rd_constructor" => "DEFAULT"
131 "comment" => "construct And: And(a, b) = And(b, a) = a AND b",
132 "rd_constructor" => "DEFAULT"
140 "comment" => "construct And: And(a, const) = And(const, a) = a AND const",
141 "rd_constructor" => "DEFAULT"
149 "comment" => "construct Or: Or(a, b) = Or(b, a) = a OR b",
150 "rd_constructor" => "DEFAULT"
158 "comment" => "construct Or: Or(a, const) = Or(const, a) = a OR const",
159 "rd_constructor" => "DEFAULT"
167 "comment" => "construct Eor: Eor(a, b) = Eor(b, a) = a EOR b",
168 "rd_constructor" => "DEFAULT"
176 "comment" => "construct Eor: Eor(a, const) = Eor(const, a) = a EOR const",
177 "rd_constructor" => "DEFAULT"
180 # not commutative operations
187 "comment" => "construct Sub: Sub(a, b) = a - b",
188 "rd_constructor" => "DEFAULT"
196 "comment" => "construct Sub: Sub(a, const) = a - const",
197 "rd_constructor" => "DEFAULT"
205 "comment" => "construct Mod: Mod(a, b) = a % b",
206 "rd_constructor" => "DEFAULT"
214 "comment" => "construct Mod: Mod(a, const) = a % const",
215 "rd_constructor" => "DEFAULT"
223 "comment" => "construct Shl: Shl(a, b) = a << b",
224 "rd_constructor" => "DEFAULT"
232 "comment" => "construct Shl: Shl(a, const) = a << const",
233 "rd_constructor" => "DEFAULT"
241 "comment" => "construct Shr: Shr(a, b) = a >> b",
242 "rd_constructor" => "DEFAULT"
250 "comment" => "construct Shr: Shr(a, const) = a >> const",
251 "rd_constructor" => "DEFAULT"
259 "comment" => "construct Shrs: Shrs(a, b) = a >> b",
260 "rd_constructor" => "DEFAULT"
268 "comment" => "construct Shrs: Shrs(a, const) = a >> const",
269 "rd_constructor" => "DEFAULT"
277 "comment" => "construct Rot: Rot(a, b) = a ROT b",
278 "rd_constructor" => "DEFAULT"
286 "comment" => "construct Rot: Rot(a, const) = a ROT const",
287 "rd_constructor" => "DEFAULT"
295 "comment" => "construct Minus: Minus(a) = -a",
296 "rd_constructor" => "DEFAULT"
306 "comment" => "construct Conv: Conv(a) = (conv)a",
307 "rd_constructor" => "DEFAULT"
315 "comment" => "construct Cmp: Cmp(a, b) = a CMP b",
316 "rd_constructor" => "DEFAULT"
324 "comment" => "construct Cmp: Cmp(a, const) = Cmp(const, a) = a CMP const",
325 "rd_constructor" => "DEFAULT"
335 "comment" => "construct Load: Load(mem-edge, ptr) = LD ptr",
336 "rd_constructor" => "DEFAULT"
344 "comment" => "construct Store: Store(mem-edge, ptr, val) = ST ptr,val",
345 "rd_constructor" => "DEFAULT"