S3 => "${arch}_emit_source_register(env, node, 3);",
S4 => "${arch}_emit_source_register(env, node, 4);",
S5 => "${arch}_emit_source_register(env, node, 5);",
+ SB0 => "${arch}_emit_8bit_source_register(env, node, 0);",
+ SW0 => "${arch}_emit_16bit_source_register(env, node, 0);",
D0 => "${arch}_emit_dest_register(env, node, 0);",
D1 => "${arch}_emit_dest_register(env, node, 1);",
D2 => "${arch}_emit_dest_register(env, node, 2);",
reg_req => { out => [ "gp_NOREG" ] },
attr => "ir_entity *symconst, int symconst_sign, long offset",
attr_type => "ia32_immediate_attr_t",
+ latency => 0,
mode => $mode_gp,
},
arity => "variable",
out_arity => "variable",
attr_type => "ia32_asm_attr_t",
+ latency => 100,
+},
+
+ProduceVal => {
+ op_flags => "c",
+ irn_flags => "R",
+ reg_req => { out => [ "gp" ] },
+ emit => "",
+ units => [ ],
+ latency => 0,
+ mode => $mode_gp,
+ cmp_attr => "return 1;",
},
#-----------------------------------------------------------------#
modified_flags => $status_flags
},
-l_Shl => {
+l_ShlDep => {
cmp_attr => "return 1;",
- arity => 2
+ # value, cnt, dependency
+ arity => 3
},
ShlD => {
- irn_flags => "R",
+ # FIXME: WHY? the right requirement is in_r3 !in_r5, especially this is the same as in Shl
+ #
# Out requirements is: different from all in
# This is because, out must be different from LowPart and ShiftCount.
# We could say "!ecx !in_r4" but it can occur, that all values live through
- # this Shift and the only value dying is the ShiftCount. Then there would be
- # a register missing, as result must not be ecx and all other registers are
- # occupied. What we should write is "!in_r4 !in_r5", but this is not
- # supported (and probably never will). So we create artificial interferences
- # of the result with all inputs, so the spiller can always assure a free
- # register.
- reg_req => { in => [ "gp", "gp", "gp", "gp", "ecx", "none" ], out => [ "!in" ] },
+ # this Shift and the only value dying is the ShiftCount. Then there would be a
+ # register missing, as result must not be ecx and all other registers are
+ # occupied. What we should write is "!in_r4 !in_r5", but this is not supported
+ # (and probably never will). So we create artificial interferences of the result
+ # with all inputs, so the spiller can always assure a free register.
+ # reg_req => { in => [ "gp", "gp", "gp", "gp", "ecx", "none" ], out => [ "!in" ] },
+
+ irn_flags => "R",
+ reg_req => { in => [ "gp", "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r5" ] },
emit =>
'
if (get_ia32_immop_type(node) == ia32_ImmNone) {
modified_flags => $status_flags
},
-l_Shr => {
+l_ShrDep => {
cmp_attr => "return 1;",
- arity => 2
+ # value, cnt, dependency
+ arity => 3
},
ShrD => {
- irn_flags => "R",
+ # FIXME: WHY? the right requirement is in_r3 !in_r5, especially this is the same as in Shr
+ #
# Out requirements is: different from all in
# This is because, out must be different from LowPart and ShiftCount.
# We could say "!ecx !in_r4" but it can occur, that all values live through
# occupied. What we should write is "!in_r4 !in_r5", but this is not supported
# (and probably never will). So we create artificial interferences of the result
# with all inputs, so the spiller can always assure a free register.
- reg_req => { in => [ "gp", "gp", "gp", "gp", "ecx", "none" ], out => [ "!in" ] },
+ # reg_req => { in => [ "gp", "gp", "gp", "gp", "ecx", "none" ], out => [ "!in" ] },
+
+ irn_flags => "R",
+ reg_req => { in => [ "gp", "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r5" ] },
emit => '
if (get_ia32_immop_type(node) == ia32_ImmNone) {
if (get_ia32_op_type(node) == ia32_AddrModeD) {
l_Sar => {
cmp_attr => "return 1;",
+ # value, cnt
arity => 2
},
+l_SarDep => {
+ cmp_attr => "return 1;",
+ # value, cnt, dependency
+ arity => 3
+},
+
Ror => {
irn_flags => "R",
reg_req => { in => [ "gp", "gp", "gp", "ecx", "none" ], out => [ "in_r3 !in_r4" ] },
mode => "mode_T",
},
+IJmp => {
+ state => "pinned",
+ op_flags => "X",
+ reg_req => { in => [ "gp", "gp", "gp", "none" ] },
+ ins => [ "base", "index", "val", "mem" ],
+ emit => '. jmp *%unop2',
+ units => [ "BRANCH" ],
+ mode => "mode_X",
+ modified_flags => []
+},
+
Const => {
op_flags => "c",
irn_flags => "R",
Cltd => {
# we should not rematrialize this node. It produces 2 results and has
# very strict constrains
- reg_req => { in => [ "eax" ], out => [ "edx" ] },
- ins => [ "val" ],
+ reg_req => { in => [ "eax", "edx" ], out => [ "edx" ] },
+ ins => [ "val", "globbered" ],
emit => '. cltd',
mode => $mode_gp,
units => [ "GP" ],
op_flags => "L|F",
state => "exc_pinned",
reg_req => { in => [ "gp", "gp", "none" ], out => [ "gp", "none" ] },
+ ins => [ "base", "index", "mem" ],
+ outs => [ "res", "M" ],
latency => 0,
emit => ". mov%SE%ME%.l %AM, %D0",
- outs => [ "res", "M" ],
units => [ "GP" ],
},
op_flags => "L|F",
state => "exc_pinned",
reg_req => { in => [ "gp", "gp", "gp", "none" ], out => [ "none" ] },
+ ins => [ "base", "index", "val", "mem" ],
emit => '. mov%M %binop',
latency => 2,
units => [ "GP" ],
Lea => {
irn_flags => "R",
- reg_req => { in => [ "gp", "gp" ], out => [ "in_r1" ] },
+ reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
emit => '. leal %AM, %D0',
latency => 2,
units => [ "GP" ],
AddSP => {
irn_flags => "I",
+ state => "pinned",
reg_req => { in => [ "gp", "gp", "esp", "gp", "none" ], out => [ "in_r3", "none" ] },
emit => '. addl %binop',
outs => [ "stack:S", "M" ],
},
SubSP => {
- irn_flags => "I",
- reg_req => { in => [ "gp", "gp", "esp", "gp", "none" ], out => [ "in_r3", "none" ] },
- emit => '. subl %binop',
- outs => [ "stack:S", "M" ],
+#irn_flags => "I",
+ state => "pinned",
+ reg_req => { in => [ "gp", "gp", "esp", "gp", "none" ], out => [ "in_r3", "gp", "none" ] },
+ emit => ". subl %binop\n".
+ ". movl %%esp, %D1",
+ outs => [ "stack:I|S", "addr", "M" ],
units => [ "GP" ],
modified_flags => $status_flags
},
arity => 3,
},
-GetST0 => {
- op_flags => "L|F",
- irn_flags => "I",
- state => "pinned",
- reg_req => { in => [ "gp", "gp", "none" ] },
- emit => '. fstp%XM %AM',
- latency => 4,
- units => [ "SSE" ],
- mode => "mode_M",
-},
-
-SetST0 => {
- op_flags => "L|F",
- irn_flags => "I",
- state => "pinned",
- reg_req => { in => [ "gp", "gp", "none" ], out => [ "vf0", "none" ] },
- ins => [ "base", "index", "mem" ],
- emit => '. fld%XM %AM',
- outs => [ "res", "M" ],
- latency => 2,
- units => [ "SSE" ],
-},
-
# CopyB
CopyB => {
# Conversions
Conv_I2I => {
- reg_req => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3", "none" ] },
- units => [ "GP" ],
- ins => [ "base", "index", "val", "mem" ],
- mode => $mode_gp,
+ state => "exc_pinned",
+ reg_req => { in => [ "gp", "gp", "gp", "none" ], out => [ "in_r3", "none" ] },
+ units => [ "GP" ],
+ ins => [ "base", "index", "val", "mem" ],
+ attr => "ir_mode *smaller_mode",
+ init_attr => "attr->ls_mode = smaller_mode;",
+ mode => $mode_gp,
modified_flags => $status_flags
},
Conv_I2I8Bit => {
- reg_req => { in => [ "gp", "gp", "eax ebx ecx edx", "none" ], out => [ "in_r3", "none" ] },
- ins => [ "base", "index", "val", "mem" ],
- units => [ "GP" ],
- mode => $mode_gp,
+ state => "exc_pinned",
+ reg_req => { in => [ "gp", "gp", "eax ebx ecx edx", "none" ], out => [ "in_r3", "none" ] },
+ ins => [ "base", "index", "val", "mem" ],
+ units => [ "GP" ],
+ attr => "ir_mode *smaller_mode",
+ init_attr => "attr->ls_mode = smaller_mode;",
+ mode => $mode_gp,
modified_flags => $status_flags
},
CmpCMov => {
irn_flags => "R",
- reg_req => { in => [ "gp", "gp", "gp", "gp" ], out => [ "in_r4" ] },
- ins => [ "cmp_left", "cmp_right", "val_true", "val_false" ],
+ reg_req => { in => [ "gp", "gp", "gp", "gp", "none", "gp", "gp" ], out => [ "in_r7" ] },
+ ins => [ "base", "index", "cmp_left", "cmp_right", "mem", "val_true", "val_false" ],
+ attr => "pn_Cmp pn_code",
+ init_attr => "attr->pn_code = pn_code;",
+ latency => 2,
+ units => [ "GP" ],
+ mode => $mode_gp,
+},
+
+TestCMov => {
+ irn_flags => "R",
+ reg_req => { in => [ "gp", "gp", "gp", "gp", "none", "gp", "gp" ],
+ out => [ "in_r7" ] },
+ ins => [ "base", "index", "cmp_left", "cmp_right", "mem", "val_true",
+ "val_false" ],
attr => "pn_Cmp pn_code",
init_attr => "attr->pn_code = pn_code;",
latency => 2,
vfCmpCMov => {
irn_flags => "R",
- reg_req => { in => [ "vfp", "vfp", "gp", "gp" ], out => [ "in_r4" ] },
+ reg_req => { in => [ "gp", "gp", "vfp", "vfp", "none", "gp", "gp" ],
+ out => [ "in_r7" ] },
+ ins => [ "base", "index", "cmp_left", "cmp_right", "mem", "val_true",
+ "val_false" ],
latency => 10,
- units => [ "VFP" ],
+ units => [ "VFP", "GP" ],
mode => $mode_gp,
attr_type => "ia32_x87_attr_t",
},
CmpSet => {
irn_flags => "R",
- reg_req => { in => [ "gp", "gp", "gp", "gp", "none" ], out => [ "eax ebx ecx edx" ] },
+ reg_req => { in => [ "gp", "gp", "gp", "gp", "none" ],
+ out => [ "eax ebx ecx edx" ] },
+ ins => [ "base", "index", "cmp_left", "cmp_right", "mem" ],
+ attr => "pn_Cmp pn_code",
+ init_attr => "attr->pn_code = pn_code;",
+ latency => 2,
+ units => [ "GP" ],
+ mode => $mode_gp,
+},
+
+TestSet => {
+ irn_flags => "R",
+ reg_req => { in => [ "gp", "gp", "gp", "gp", "none" ],
+ out => [ "eax ebx ecx edx" ] },
ins => [ "base", "index", "cmp_left", "cmp_right", "mem" ],
attr => "pn_Cmp pn_code",
init_attr => "attr->pn_code = pn_code;",
op_flags => "R",
rd_constructor => "NONE",
reg_req => { },
- emit => '. faddp %x87_binop',
+ emit => '. faddp%XM %x87_binop',
attr_type => "ia32_x87_attr_t",
},
op_flags => "R",
rd_constructor => "NONE",
reg_req => { },
- emit => '. fmulp %x87_binop',,
+ emit => '. fmulp%XM %x87_binop',,
attr_type => "ia32_x87_attr_t",
},
rd_constructor => "NONE",
reg_req => { },
# see note about gas bugs
- emit => '. fsubrp %x87_binop',
+ emit => '. fsubrp%XM %x87_binop',
attr_type => "ia32_x87_attr_t",
},
irn_flags => "R",
reg_req => { },
# see note about gas bugs
- emit => '. fsubp %x87_binop',
+ emit => '. fsubp%XM %x87_binop',
attr_type => "ia32_x87_attr_t",
},
rd_constructor => "NONE",
reg_req => { },
# see note about gas bugs
- emit => '. fdivrp %x87_binop',
+ emit => '. fdivrp%XM %x87_binop',
attr_type => "ia32_x87_attr_t",
},
rd_constructor => "NONE",
reg_req => { },
# see note about gas bugs
- emit => '. fdivp %x87_binop',
+ emit => '. fdivp%XM %x87_binop',
attr_type => "ia32_x87_attr_t",
},
op_flags => "R",
rd_constructor => "NONE",
reg_req => { },
- emit => '. fild%XM %AM',
+ emit => '. fild%M %AM',
attr_type => "ia32_x87_attr_t",
},
state => "exc_pinned",
rd_constructor => "NONE",
reg_req => { },
- emit => '. fist%XM %AM',
+ emit => '. fist%M %AM',
mode => "mode_M",
attr_type => "ia32_x87_attr_t",
},
state => "exc_pinned",
rd_constructor => "NONE",
reg_req => { },
- emit => '. fistp%XM %AM',
+ emit => '. fistp%M %AM',
mode => "mode_M",
attr_type => "ia32_x87_attr_t",
},