# %nodes = (
#
# <op-name> => {
-# op_flags => "N|L|C|X|I|F|Y|H|c|K",
+# op_flags => "N|L|C|X|I|F|Y|H|c|K|n",
# irn_flags => "R|N"
# arity => "0|1|2|3 ... |variable|dynamic|any",
# state => "floats|pinned|mem_pinned|exc_pinned",
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);",
CMP3 => "${arch}_emit_cmp_suffix_node(node, 3);",
);
# "allocates" a free register
ProduceVal => {
- op_flags => "c",
+ op_flags => "c|n",
irn_flags => "R",
reg_req => { out => [ "gp" ] },
emit => "",
},
Sbb0 => {
- irn_flags => "R",
+ # Spiller currently fails when rematerializing flag consumers
+ # irn_flags => "R",
reg_req => { in => [ "flags" ], out => [ "gp", "flags" ] },
outs => [ "res", "flags" ],
emit => ". sbb%M %D0, %D0",
modified_flags => $status_flags
},
-Set => {
+Setcc => {
#irn_flags => "R",
reg_req => { in => [ "eflags" ], out => [ "eax ebx ecx edx" ] },
ins => [ "eflags" ],
outs => [ "res" ],
attr_type => "ia32_condcode_attr_t",
- attr => "pn_Cmp pnc, int ins_permuted",
- init_attr => "attr->attr.data.ins_permuted = ins_permuted;\n".
- "\tset_ia32_ls_mode(res, mode_Bu);\n",
- emit => '. set%CMP0 %DB0',
+ attr => "pn_Cmp pnc",
+ # The way we handle Setcc with float nodes (potentially) destroys the flags
+ # (when we emit the setX; setp; orb and the setX;setnp;andb sequences)
+ init_attr => "set_ia32_ls_mode(res, mode_Bu);\n"
+ . "\tif ((pnc & ia32_pn_Cmp_float) && ((pnc & 0xf) != pn_Cmp_Uo) && ((pnc & 0xf) != pn_Cmp_Leg)) {\n"
+ . "\t\tarch_irn_add_flags(res, arch_irn_flags_modify_flags);\n"
+ . "\t\t/* attr->latency = 3; */\n"
+ . "\t}\n",
latency => 1,
units => [ "GP" ],
mode => $mode_gp,
},
-SetMem => {
+SetccMem => {
#irn_flags => "R",
state => "exc_pinned",
reg_req => { in => [ "gp", "gp", "none", "eflags" ], out => [ "none" ] },
ins => [ "base", "index", "mem","eflags" ],
attr_type => "ia32_condcode_attr_t",
- attr => "pn_Cmp pnc, int ins_permuted",
- init_attr => "attr->attr.data.ins_permuted = ins_permuted;\n".
- "\tset_ia32_ls_mode(res, mode_Bu);\n",
+ attr => "pn_Cmp pnc",
+ init_attr => "set_ia32_ls_mode(res, mode_Bu);\n",
emit => '. set%CMP3 %AM',
latency => 1,
units => [ "GP" ],
mode => 'mode_M',
},
-CMov => {
+CMovcc => {
#irn_flags => "R",
+ state => "exc_pinned",
# (note: leave the false,true order intact to make it compatible with other
# ia32_binary ops)
- state => "exc_pinned",
reg_req => { in => [ "gp", "gp", "none", "gp", "gp", "eflags" ],
out => [ "in_r4 in_r5", "flags", "none" ] },
ins => [ "base", "index", "mem", "val_false", "val_true", "eflags" ],
outs => [ "res", "flags", "M" ],
am => "source,binary",
attr_type => "ia32_condcode_attr_t",
- attr => "int ins_permuted, pn_Cmp pnc",
- init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
+ attr => "pn_Cmp pnc",
latency => 1,
units => [ "GP" ],
mode => $mode_gp,