# comment => "any comment for constructor",
# reg_req => { in => [ "reg_class|register" ], out => [ "reg_class|register|in_rX" ] },
# cmp_attr => "c source code for comparing node attributes",
+# outs => { "out1", "out2" } # optional, creates pn_op_out1, ... consts
+# ins => { "in1", "in2" } # optional, creates n_op_in1, ... consts
+# mode => "mode_Iu" # optional, predefines the mode
# emit => "emit code with templates",
-# attr => "attitional attribute arguments for constructor"
-# init_attr => "emit attribute initialization template"
-# rd_constructor => "c source code which constructs an ir_node"
+# attr => "attitional attribute arguments for constructor",
+# init_attr => "emit attribute initialization template",
+# rd_constructor => "c source code which constructs an ir_node",
+# hash_func => "name of the hash function for this operation",
+# latency => "latency of this operation (can be float)"
# attr_type => "name of the attribute struct",
# },
#
{ mode => "mode_E" }
],
vfp => [
- { name => "vf0", type => 1 | 16 },
- { name => "vf1", type => 1 | 16 },
- { name => "vf2", type => 1 | 16 },
- { name => "vf3", type => 1 | 16 },
- { name => "vf4", type => 1 | 16 },
- { name => "vf5", type => 1 | 16 },
- { name => "vf6", type => 1 | 16 },
- { name => "vf7", type => 1 | 16 },
+ { name => "vf0", type => 1 },
+ { name => "vf1", type => 1 },
+ { name => "vf2", type => 1 },
+ { name => "vf3", type => 1 },
+ { name => "vf4", type => 1 },
+ { name => "vf5", type => 1 },
+ { name => "vf6", type => 1 },
+ { name => "vf7", type => 1 },
{ name => "vfp_NOREG", type => 4 | 8 | 16 }, # we need a dummy register for NoReg nodes
{ name => "vfp_UKNWN", type => 4 | 8 | 16 }, # we need a dummy register for Unknown nodes
{ mode => "mode_E" }
XXM => "${arch}_emit_xmm_mode_suffix(node);",
XSD => "${arch}_emit_xmm_mode_suffix_s(node);",
AM => "${arch}_emit_am(node);",
- unop3 => "${arch}_emit_unop(node, 3);",
- unop4 => "${arch}_emit_unop(node, 4);",
+ unop3 => "${arch}_emit_unop(node, n_ia32_unary_op);",
+ unop4 => "${arch}_emit_unop(node, n_ia32_binary_right);",
binop => "${arch}_emit_binop(node);",
x87_binop => "${arch}_emit_x87_binop(node);",
CMP0 => "${arch}_emit_cmp_suffix_node(node, 0);",
$custom_init_attr_func = \&ia32_custom_init_attr;
%init_attr = (
- ia32_attr_t => "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res);",
- ia32_x87_attr_t =>
- "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res);\n".
- "\tinit_ia32_x87_attributes(res);",
ia32_asm_attr_t =>
"\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res);\n".
"\tinit_ia32_x87_attributes(res);".
"\tinit_ia32_asm_attributes(res);",
- ia32_immediate_attr_t =>
+ ia32_attr_t =>
+ "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res);",
+ ia32_condcode_attr_t =>
"\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res);\n".
- "\tinit_ia32_immediate_attributes(res, symconst, symconst_sign, offset);",
+ "\tinit_ia32_condcode_attributes(res, pnc);",
ia32_copyb_attr_t =>
"\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res);\n".
"\tinit_ia32_copyb_attributes(res, size);",
- ia32_condcode_attr_t =>
+ ia32_immediate_attr_t =>
"\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res);\n".
- "\tinit_ia32_condcode_attributes(res, pnc);",
+ "\tinit_ia32_immediate_attributes(res, symconst, symconst_sign, offset);",
+ ia32_x87_attr_t =>
+ "\tinit_ia32_attributes(res, flags, in_reqs, out_reqs, exec_units, n_res);\n".
+ "\tinit_ia32_x87_attributes(res);",
);
%compare_attr = (
- ia32_attr_t => "ia32_compare_nodes_attr",
- ia32_x87_attr_t => "ia32_compare_x87_attr",
ia32_asm_attr_t => "ia32_compare_asm_attr",
- ia32_immediate_attr_t => "ia32_compare_immediate_attr",
- ia32_copyb_attr_t => "ia32_compare_copyb_attr",
+ ia32_attr_t => "ia32_compare_nodes_attr",
ia32_condcode_attr_t => "ia32_compare_condcode_attr",
+ ia32_copyb_attr_t => "ia32_compare_copyb_attr",
+ ia32_immediate_attr_t => "ia32_compare_immediate_attr",
+ ia32_x87_attr_t => "ia32_compare_x87_attr",
);
%operands = (
reg_req => { out => [ "gp_NOREG" ] },
attr => "ir_entity *symconst, int symconst_sign, long offset",
attr_type => "ia32_immediate_attr_t",
+ hash_func => "ia32_hash_Immediate",
latency => 0,
mode => $mode_gp,
},
Mul => {
# we should not rematrialize this node. It produces 2 results and has
- # very strict constrains
+ # very strict constraints
state => "exc_pinned",
reg_req => { in => [ "gp", "gp", "none", "eax", "gp" ],
out => [ "eax", "edx", "none" ] },
- ins => [ "base", "index", "mem", "val_high", "val_low" ],
+ ins => [ "base", "index", "mem", "left", "right" ],
emit => '. mul%M %unop4',
outs => [ "res_low", "res_high", "M" ],
am => "source,binary",
l_Mul => {
# we should not rematrialize this node. It produces 2 results and has
- # very strict constrains
+ # very strict constraints
op_flags => "C",
cmp_attr => "return 1;",
outs => [ "EAX", "EDX", "M" ],
state => "exc_pinned",
reg_req => { in => [ "gp", "gp", "none", "eax", "gp" ],
out => [ "eax", "edx", "none" ] },
- ins => [ "base", "index", "mem", "val_high", "val_low" ],
+ ins => [ "base", "index", "mem", "left", "right" ],
emit => '. imul%M %unop4',
outs => [ "res_low", "res_high", "M" ],
am => "source,binary",
Minus64Bit => {
irn_flags => "R",
- reg_req => { in => [ "gp", "gp" ], out => [ "in_r1", "gp" ] },
+ reg_req => { in => [ "gp", "gp" ], out => [ "in_r1", "in_r2" ] },
outs => [ "low_res", "high_res" ],
units => [ "GP" ],
latency => 3,
units => [ "GP" ],
},
-l_Load => {
- op_flags => "L|F",
- cmp_attr => "return 1;",
- outs => [ "res", "M" ],
- arity => 2,
-},
-
-l_Store => {
- op_flags => "L|F",
- cmp_attr => "return 1;",
- state => "exc_pinned",
- arity => 3,
- mode => "mode_M",
-},
-
Store => {
op_flags => "L|F",
state => "exc_pinned",
ins => [ "base", "index", "mem", "val", "stack" ],
emit => '. push%M %unop3',
outs => [ "stack:I|S", "M" ],
- am => "source,binary",
+ am => "source,unary",
latency => 2,
units => [ "GP" ],
},
},
Leave => {
- reg_req => { in => [ "esp", "ebp" ], out => [ "ebp", "esp" ] },
+ reg_req => { in => [ "ebp" ], out => [ "ebp", "esp" ] },
emit => '. leave',
outs => [ "frame:I", "stack:I|S" ],
latency => 3,
attr_type => "ia32_x87_attr_t",
},
-l_vfild => {
- cmp_attr => "return 1;",
- outs => [ "res", "M" ],
- arity => 2,
-},
-
vfist => {
state => "exc_pinned",
reg_req => { in => [ "gp", "gp", "none", "vfp", "fpcw" ] },
attr_type => "ia32_x87_attr_t",
},
-l_vfist => {
- cmp_attr => "return 1;",
- state => "exc_pinned",
- arity => 3,
- mode => "mode_M",
-},
-
# constants