5 { name => "rax", dwarf => 0 },
6 { name => "rcx", dwarf => 2 },
7 { name => "rdx", dwarf => 1 },
8 { name => "rsi", dwarf => 4 },
9 { name => "rdi", dwarf => 5 },
10 { name => "rbx", dwarf => 3 },
11 { name => "rbp", dwarf => 6 },
12 { name => "rsp", dwarf => 7, type => "ignore" }, # stackpointer
13 { name => "r8", dwarf => 8 },
14 { name => "r9", dwarf => 9 },
15 { name => "r10", dwarf => 10 },
16 { name => "r11", dwarf => 11 },
17 { name => "r12", dwarf => 12 },
18 { name => "r13", dwarf => 13 },
19 { name => "r14", dwarf => 14 },
20 { name => "r15", dwarf => 15 },
21 # { name => "gp_NOREG", type => "ignore" }, # we need a dummy register for NoReg nodes
25 # { name => "xmm0", dwarf => 17 },
26 # { name => "xmm1", dwarf => 18 },
27 # { name => "xmm2", dwarf => 19 },
28 # { name => "xmm3", dwarf => 20 },
29 # { name => "xmm4", dwarf => 21 },
30 # { name => "xmm5", dwarf => 22 },
31 # { name => "xmm6", dwarf => 23 },
32 # { name => "xmm7", dwarf => 24 },
33 # { name => "xmm8", dwarf => 25 },
34 # { name => "xmm9", dwarf => 26 },
35 # { name => "xmm10", dwarf => 27 },
36 # { name => "xmm11", dwarf => 28 },
37 # { name => "xmm12", dwarf => 29 },
38 # { name => "xmm13", dwarf => 30 },
39 # { name => "xmm14", dwarf => 31 },
40 # { name => "xmm15", dwarf => 32 },
41 # { mode => "mode_D" }
44 { name => "eflags", dwarf => 49 },
45 { mode => "mode_Iu", flags => "manual_ra" }
50 $mode_flags = "mode_Iu";
52 sub amd64_custom_init_attr {
58 if(defined($node->{modified_flags})) {
59 $res .= "\tarch_add_irn_flags(res, arch_irn_flags_modify_flags);\n";
63 $custom_init_attr_func = \&amd64_custom_init_attr;
65 $default_copy_attr = "amd64_copy_attr";
69 "\tinit_amd64_attributes(res, irn_flags_, in_reqs, n_res);",
70 amd64_SymConst_attr_t =>
71 "\tinit_amd64_attributes(res, irn_flags_, in_reqs, n_res);"
72 . "\tinit_amd64_SymConst_attributes(res, entity);",
73 amd64_condcode_attr_t =>
74 "\tinit_amd64_attributes(res, irn_flags_, in_reqs, n_res);"
75 . "\tinit_amd64_condcode_attributes(res, pnc);",
79 amd64_attr_t => "cmp_amd64_attr",
80 amd64_SymConst_attr_t => "cmp_amd64_attr_SymConst",
81 amd64_condcode_attr_t => "cmp_amd64_attr_condcode",
86 op_flags => [ "uses_memory" ],
87 state => "exc_pinned",
88 reg_req => { in => [ "gp", "gp", "none", "gp", "rsp" ], out => [ "rsp:I|S", "none" ] },
89 ins => [ "base", "index", "mem", "val", "stack" ],
91 outs => [ "stack", "M" ],
98 op_flags => [ "commutative" ],
99 irn_flags => [ "rematerializable" ],
100 state => "exc_pinned",
101 reg_req => { in => [ "gp", "gp" ],
103 ins => [ "left", "right" ],
110 # we should not rematrialize this node. It produces 2 results and has
111 # very strict constraints
112 state => "exc_pinned",
113 reg_req => { in => [ "rax", "gp" ],
114 out => [ "rax rdx" ] },
115 ins => [ "left", "right" ],
119 am => "source,binary",
120 modified_flags => $status_flags
124 irn_flags => [ "rematerializable" ],
125 state => "exc_pinned",
126 reg_req => { in => [ "gp", "gp" ],
128 ins => [ "left", "right" ],
135 irn_flags => [ "rematerializable" ],
136 reg_req => { in => [ "gp" ],
137 out => [ "in_r1" ] },
142 modified_flags => $status_flags
146 op_flags => [ "constlike" ],
147 attr => "unsigned imm_value",
148 init_attr => "attr->ext.imm_value = imm_value;",
149 reg_req => { out => [ "gp" ] },
150 emit => 'mov %C, %D0',
155 op_flags => [ "constlike" ],
156 irn_flags => [ "rematerializable" ],
157 attr => "ir_entity *entity",
158 attr_type => "amd64_SymConst_attr_t",
159 reg_req => { out => [ "gp" ] },
165 state => "exc_pinned",
166 attr => "ir_mode *smaller_mode",
167 init_attr => "attr->ls_mode = smaller_mode;",
168 reg_req => { in => [ "gp" ], out => [ "gp" ] },
176 op_flags => [ "cfopcode" ],
177 reg_req => { out => [ "none" ] },
182 irn_flags => [ "rematerializable" ],
183 state => "exc_pinned",
184 reg_req => { in => [ "gp", "gp" ],
185 out => [ "flags" ] },
186 ins => [ "left", "right" ],
187 outs => [ "eflags" ],
188 emit => 'cmp %S0, %S1',
189 attr => "int ins_permuted, int cmp_unsigned",
190 init_attr => "attr->data.ins_permuted = ins_permuted;\n".
191 "\tattr->data.cmp_unsigned = cmp_unsigned;\n",
198 op_flags => [ "cfopcode", "forking" ],
199 reg_req => { in => [ "eflags" ], out => [ "none", "none" ] },
201 outs => [ "false", "true" ],
202 attr => "ir_relation relation",
203 init_attr => "attr->ext.relation = relation;",
208 op_flags => [ "uses_memory" ],
209 state => "exc_pinned",
210 reg_req => { in => [ "gp", "none" ],
211 out => [ "gp", "none" ] },
212 ins => [ "ptr", "mem" ],
213 outs => [ "res", "M" ],
214 attr => "ir_entity *entity",
215 attr_type => "amd64_SymConst_attr_t",
216 emit => "mov %O(%S0), %D0"
220 op_flags => [ "constlike" ],
221 irn_flags => [ "rematerializable" ],
222 reg_req => { in => [ "gp" ], out => [ "gp" ] },
224 attr => "ir_entity *entity",
225 attr_type => "amd64_SymConst_attr_t",
230 op_flags => [ "uses_memory" ],
231 state => "exc_pinned",
232 reg_req => { in => [ "gp", "gp", "none" ], out => [ "none" ] },
233 ins => [ "ptr", "val", "mem" ],
235 attr => "ir_entity *entity",
236 attr_type => "amd64_SymConst_attr_t",
238 emit => "mov %S1, %O(%S0)"
243 # op_flags => [ "constlike", "dump_noblcok" ],
244 # reg_req => { out => [ "gp_NOREG:I" ] },