# %nodes = (
#
# <op-name> => {
-# "op_flags" => "N|L|C|X|I|F|Y|H|c",
+# "op_flags" => "N|L|C|X|I|F|Y|H|c|K",
# "arity" => "0|1|2|3|variable|dynamic|all",
# "state" => "floats|pinned",
# "args" => [
# Y irop_flag_forking
# H irop_flag_highlevel
# c irop_flag_constlike
+# K irop_flag_keep
#
# op_flags: flags for the operation, OPTIONAL (default is "N")
#
# 2 - caller save (register must be saved by the caller of a function)
# 3 - callee save (register must be saved by the called function)
# 4 - ignore (do not assign this register)
-# NOTE: Make sure to list the registers returning the call-result at first and
-# in the correct order, otherwise it will break the magic!
+# NOTE: Make sure to list the registers returning the call-result before all other
+# caller save registers and in the correct order, otherwise it will break
+# the magic!
%reg_classes = (
"general_purpose" => [
{ "name" => "eax", "type" => 2 },
{ "name" => "edx", "type" => 2 },
{ "name" => "ebx", "type" => 3 },
{ "name" => "ecx", "type" => 2 },
- { "name" => "edi", "type" => 2 },
{ "name" => "esi", "type" => 3 },
- { "name" => "ebp", "type" => 3 }
+ { "name" => "edi", "type" => 3 },
+ { "name" => "ebp", "type" => 3 },
+ { "name" => "esp", "type" => 4 } # we don't want esp to be assigned
],
"floating_point" => [
{ "name" => "xmm0", "type" => 2 },
"emit" => '. leal %C(%S1), %D1\t\t\t/* %D1 = %S1 + %C, (%A1)*/'
},
-"RegParam" => {
- "arity" => 1,
- "comment" => "constructs a Register Parameter to cover parameters passed in register",
- "reg_req" => { "in" => [ "none" ], "out" => [ "none" ] },
- "cmp_attr" =>
-'
- return (attr_a->pn_code != attr_b->pn_code);
-'
-},
-
"StackParam" => {
"arity" => 1,
+ "remat" => 1,
"comment" => "constructs a Stack Parameter to retrieve a parameter from Stack",
"reg_req" => { "in" => [ "none" ], "out" => [ "general_purpose" ] },
"cmp_attr" =>
"fStackParam" => {
"arity" => 1,
+ "remat" => 1,
"comment" => "constructs a Stack Parameter to retrieve a SSE parameter from Stack",
"reg_req" => { "in" => [ "none" ], "out" => [ "floating_point" ] },
"cmp_attr" =>
"op_flags" => "L|F",
"state" => "mem_pinned",
"arity" => "variable",
- "spill" => 0,
"comment" => "construct Call: Call(...)",
"args" => [
{ "type" => "int", "name" => "n" },
" if (!op_ia32_Call) assert(0);
return new_ir_node(db, irg, block, op_ia32_Call, mode_T, n, in);
"
+},
+
+# Return
+
+"Return" => {
+ "op_flags" => "L|X",
+ "state" => "pinned",
+ "arity" => "variable",
+ "comment" => "construct Return: Return(...)",
+ "args" => [
+ { "type" => "int", "name" => "n" },
+ { "type" => "ir_node **", "name" => "in" }
+ ],
+ "rd_constructor" =>
+" if (!op_ia32_Return) assert(0);
+ return new_ir_node(db, irg, block, op_ia32_Return, mode_X, n, in);
+"
+},
+
+# M/Alloc
+
+"Alloca" => {
+ "op_flags" => "L|F",
+ "state" => "pinned",
+ "arity" => "2",
+ "comment" => "construct Alloca: allocate memory on Stack",
+ "reg_req" => { "in" => [ "general_purpose" ], "out" => [ "general_purpose" ] }
+},
+
+"Alloca_i" => {
+ "op_flags" => "L|F",
+ "state" => "pinned",
+ "arity" => "1",
+ "comment" => "construct Alloca: allocate memory on Stack",
+ "reg_req" => { "out" => [ "general_purpose" ] }
}
); # end of %nodes