remove old+unused code
[libfirm] / ir / be / ia32 / ia32_spec.pl
index 0b1381e..ebffcad 100644 (file)
@@ -74,7 +74,7 @@ $state       = 32; # register represents a state
        ],
        fp_cw => [      # the floating point control word
                { name => "fpcw", type => $ignore | $state },
-               { mode => "mode_fpcw", flags => "manual_ra|state" }
+               { mode => "ia32_mode_fpcw", flags => "manual_ra|state" }
        ],
        flags => [
                { name => "eflags", type => 0 },
@@ -177,7 +177,10 @@ $custom_init_attr_func = \&ia32_custom_init_attr;
                "\tinit_ia32_call_attributes(res, pop, call_tp);",
        ia32_condcode_attr_t =>
                "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
-               "\tinit_ia32_condcode_attributes(res, pnc);",
+               "\tinit_ia32_condcode_attributes(res, condition_code);",
+       ia32_switch_attr_t =>
+               "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
+               "\tinit_ia32_switch_attributes(res, default_pn);",
        ia32_copyb_attr_t =>
                "\tinit_ia32_attributes(res, flags, in_reqs, exec_units, n_res);\n".
                "\tinit_ia32_copyb_attributes(res, size);",
@@ -193,10 +196,11 @@ $custom_init_attr_func = \&ia32_custom_init_attr;
 );
 
 %compare_attr = (
-       ia32_asm_attr_t       => "ia32_compare_asm_attr",
+       ia32_asm_attr_t        => "ia32_compare_asm_attr",
        ia32_attr_t            => "ia32_compare_nodes_attr",
        ia32_call_attr_t       => "ia32_compare_call_attr",
        ia32_condcode_attr_t   => "ia32_compare_condcode_attr",
+       ia32_switch_attr_t     => "ia32_compare_switch_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",
@@ -209,7 +213,7 @@ $custom_init_attr_func = \&ia32_custom_init_attr;
 $mode_xmm           = "mode_E";
 $mode_gp            = "mode_Iu";
 $mode_flags         = "mode_Iu";
-$mode_fpcw          = "mode_fpcw";
+$mode_fpcw          = "ia32_mode_fpcw";
 $status_flags       = [ "CF", "PF", "AF", "ZF", "SF", "OF" ];
 $status_flags_wo_cf = [       "PF", "AF", "ZF", "SF", "OF" ];
 $fpcw_flags         = [ "FP_IM", "FP_DM", "FP_ZM", "FP_OM", "FP_UM", "FP_PM",
@@ -220,6 +224,7 @@ $fpcw_flags         = [ "FP_IM", "FP_DM", "FP_ZM", "FP_OM", "FP_UM", "FP_PM",
 Immediate => {
        state     => "pinned",
        op_flags  => [ "constlike" ],
+       irn_flags => [ "not_scheduled" ],
        reg_req   => { out => [ "gp_NOREG:I" ] },
        attr      => "ir_entity *symconst, int symconst_sign, int no_pic_adjust, long offset",
        attr_type => "ia32_immediate_attr_t",
@@ -931,9 +936,8 @@ Cmp => {
        outs      => [ "eflags", "unused", "M" ],
        am        => "source,binary",
        emit      => '. cmp%M %binop',
-       attr      => "int ins_permuted, int cmp_unsigned",
-       init_attr => "attr->data.ins_permuted   = ins_permuted;\n".
-                    "\tattr->data.cmp_unsigned = cmp_unsigned;\n",
+       attr      => "bool ins_permuted",
+       init_attr => "attr->data.ins_permuted   = ins_permuted;",
        latency   => 1,
        units     => [ "GP" ],
        mode      => $mode_flags,
@@ -949,15 +953,28 @@ Cmp8Bit => {
        outs      => [ "eflags", "unused", "M" ],
        am        => "source,binary",
        emit      => '. cmpb %binop',
-       attr      => "int ins_permuted, int cmp_unsigned",
-       init_attr => "attr->data.ins_permuted   = ins_permuted;\n".
-                    "\tattr->data.cmp_unsigned = cmp_unsigned;\n",
+       attr      => "bool ins_permuted",
+       init_attr => "attr->data.ins_permuted   = ins_permuted;",
        latency   => 1,
        units     => [ "GP" ],
        mode      => $mode_flags,
        modified_flags => $status_flags
 },
 
+XorHighLow => {
+       irn_flags => [ "rematerializable" ],
+       state     => "exc_pinned",
+       reg_req   => { in => [ "eax ebx ecx edx" ],
+                      out => [ "in_r1", "flags" ] },
+       emit      => '. xorb %SH0, %SB0',
+       ins       => [ "value" ],
+       outs      => [ "res", "flags" ],
+       units     => [ "GP" ],
+       latency   => 1,
+       mode      => $mode_gp,
+       modified_flags => $status_flags,
+},
+
 Test => {
        irn_flags => [ "rematerializable" ],
        state     => "exc_pinned",
@@ -967,9 +984,8 @@ Test => {
        outs      => [ "eflags", "unused", "M" ],
        am        => "source,binary",
        emit      => '. test%M %binop',
-       attr      => "int ins_permuted, int cmp_unsigned",
-       init_attr => "attr->data.ins_permuted = ins_permuted;\n".
-                    "\tattr->data.cmp_unsigned = cmp_unsigned;\n",
+       attr      => "bool ins_permuted",
+       init_attr => "attr->data.ins_permuted = ins_permuted;",
        latency   => 1,
        units     => [ "GP" ],
        mode      => $mode_flags,
@@ -985,9 +1001,8 @@ Test8Bit => {
        outs      => [ "eflags", "unused", "M" ],
        am        => "source,binary",
        emit      => '. testb %binop',
-       attr      => "int ins_permuted, int cmp_unsigned",
-       init_attr => "attr->data.ins_permuted = ins_permuted;\n".
-                    "\tattr->data.cmp_unsigned = cmp_unsigned;\n",
+       attr      => "bool ins_permuted",
+       init_attr => "attr->data.ins_permuted = ins_permuted;",
        latency   => 1,
        units     => [ "GP" ],
        mode      => $mode_flags,
@@ -1000,11 +1015,11 @@ Setcc => {
        ins       => [ "eflags" ],
        outs      => [ "res" ],
        attr_type => "ia32_condcode_attr_t",
-       attr      => "pn_Cmp pnc",
+       attr      => "ia32_condition_code_t condition_code",
        # 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"
+               . "\tif (condition_code & ia32_cc_additional_float_cases) {\n"
                . "\t\tarch_irn_add_flags(res, arch_irn_flags_modify_flags);\n"
                . "\t\t/* attr->latency = 3; */\n"
                . "\t}\n",
@@ -1019,7 +1034,7 @@ SetccMem => {
        reg_req   => { in => [ "gp", "gp", "none", "eflags" ], out => [ "none" ] },
        ins       => [ "base", "index", "mem","eflags" ],
        attr_type => "ia32_condcode_attr_t",
-       attr      => "pn_Cmp pnc",
+       attr      => "ia32_condition_code_t condition_code",
        init_attr => "set_ia32_ls_mode(res, mode_Bu);\n",
        emit      => '. set%CMP3 %AM',
        latency   => 1,
@@ -1038,7 +1053,7 @@ CMovcc => {
        outs      => [ "res", "flags", "M" ],
        am        => "source,binary",
        attr_type => "ia32_condcode_attr_t",
-       attr      => "pn_Cmp pnc",
+       attr      => "ia32_condition_code_t condition_code",
        latency   => 1,
        units     => [ "GP" ],
        mode      => $mode_gp,
@@ -1051,7 +1066,7 @@ Jcc => {
        ins       => [ "eflags" ],
        outs      => [ "false", "true" ],
        attr_type => "ia32_condcode_attr_t",
-       attr      => "pn_Cmp pnc",
+       attr      => "ia32_condition_code_t condition_code",
        latency   => 2,
        units     => [ "BRANCH" ],
 },
@@ -1061,8 +1076,8 @@ SwitchJmp => {
        op_flags  => [ "labeled", "cfopcode", "forking" ],
        reg_req   => { in => [ "gp" ] },
        mode      => "mode_T",
-       attr_type => "ia32_condcode_attr_t",
-       attr      => "long pnc",
+       attr_type => "ia32_switch_attr_t",
+       attr      => "long default_pn",
        latency   => 3,
        units     => [ "BRANCH" ],
        modified_flags => $status_flags,
@@ -1124,6 +1139,7 @@ GetEIP => {
 NoReg_GP => {
        state     => "pinned",
        op_flags  => [ "constlike", "dump_noblock", "dump_noinput" ],
+       irn_flags => [ "not_scheduled" ],
        reg_req   => { out => [ "gp_NOREG:I" ] },
        units     => [],
        emit      => "",
@@ -1134,6 +1150,7 @@ NoReg_GP => {
 NoReg_VFP => {
        state     => "pinned",
        op_flags  => [ "constlike", "dump_noblock", "dump_noinput" ],
+       irn_flags => [ "not_scheduled" ],
        reg_req   => { out => [ "vfp_NOREG:I" ] },
        units     => [],
        emit      => "",
@@ -1145,6 +1162,7 @@ NoReg_VFP => {
 NoReg_XMM => {
        state     => "pinned",
        op_flags  => [ "constlike", "dump_noblock", "dump_noinput" ],
+       irn_flags => [ "not_scheduled" ],
        reg_req   => { out => [ "xmm_NOREG:I" ] },
        units     => [],
        emit      => "",
@@ -1155,6 +1173,7 @@ NoReg_XMM => {
 ChangeCW => {
        state     => "pinned",
        op_flags  => [ "constlike" ],
+       irn_flags => [ "not_scheduled" ],
        reg_req   => { out => [ "fpcw:I" ] },
        mode      => $mode_fpcw,
        latency   => 3,
@@ -1301,6 +1320,17 @@ PopEbp => {
        units     => [ "GP" ],
 },
 
+CopyEbpEsp => {
+       state     => "exc_pinned",
+       reg_req   => { in => [ "ebp" ], out => [ "esp:I|S" ] },
+       ins       => [ "ebp" ],
+       outs      => [ "esp" ],
+       emit      => '. movl %S0, %D0',
+       latency   => 1,
+       units     => [ "GP" ],
+       mode      => $mode_gp,
+},
+
 PopMem => {
        state     => "exc_pinned",
        reg_req   => { in => [ "gp", "gp", "none", "esp" ], out => [ "none", "none", "none", "esp:I|S" ] },
@@ -1325,6 +1355,7 @@ Leave => {
        outs      => [ "frame", "stack" ],
        latency   => 3,
        units     => [ "GP" ],
+       state     => "exc_pinned",
 },
 
 AddSP => {
@@ -1364,6 +1395,8 @@ LdTls => {
        irn_flags => [ "rematerializable" ],
        reg_req   => { out => [ "gp" ] },
        units     => [ "GP" ],
+       emit      => ". movl %%gs:0, %D0",
+       mode      => $mode_gp,
        latency   => 1,
 },
 
@@ -1844,7 +1877,7 @@ Ucomi => {
        ins       => [ "base", "index", "mem", "left", "right" ],
        outs      => [ "flags" ],
        am        => "source,binary",
-       attr      => "int ins_permuted",
+       attr      => "bool ins_permuted",
        init_attr => "attr->data.ins_permuted = ins_permuted;",
        emit      => ' .ucomi%XXM %binop',
        latency   => 3,
@@ -2253,7 +2286,7 @@ vFucomFnstsw => {
        reg_req   => { in => [ "vfp", "vfp" ], out => [ "eax" ] },
        ins       => [ "left", "right" ],
        outs      => [ "flags" ],
-       attr      => "int ins_permuted",
+       attr      => "bool ins_permuted",
        init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
        latency   => 3,
        units     => [ "VFP" ],
@@ -2266,7 +2299,7 @@ vFucomi => {
        reg_req   => { in => [ "vfp", "vfp" ], out => [ "eflags" ] },
        ins       => [ "left", "right" ],
        outs      => [ "flags" ],
-       attr      => "int ins_permuted",
+       attr      => "bool ins_permuted",
        init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
        latency   => 3,
        units     => [ "VFP" ],
@@ -2279,7 +2312,7 @@ vFtstFnstsw => {
        reg_req   => { in => [ "vfp" ], out => [ "eax" ] },
        ins       => [ "left" ],
        outs      => [ "flags" ],
-       attr      => "int ins_permuted",
+       attr      => "bool ins_permuted",
        init_attr => "attr->attr.data.ins_permuted = ins_permuted;",
        latency   => 3,
        units     => [ "VFP" ],