Perform dark rituals and resurrect ProduceVal. We are not ready to dispose it, yet...
authorChristoph Mallon <christoph.mallon@gmx.de>
Mon, 1 Dec 2008 12:43:11 +0000 (12:43 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Mon, 1 Dec 2008 12:43:11 +0000 (12:43 +0000)
[r24182]

ir/be/ia32/ia32_spec.pl
ir/be/ia32/ia32_transform.c

index 6f5fff4..8307d45 100644 (file)
@@ -339,6 +339,18 @@ Asm => {
        modified_flags => $status_flags,
 },
 
+# "allocates" a free register
+ProduceVal => {
+       op_flags  => "c",
+       irn_flags => "R",
+       reg_req   => { out => [ "gp" ] },
+       emit      => "",
+       units     => [ ],
+       latency   => 0,
+       mode      => $mode_gp,
+       cmp_attr  => "return 1;",
+},
+
 #-----------------------------------------------------------------#
 #  _       _                                         _            #
 # (_)     | |                                       | |           #
@@ -1301,8 +1313,8 @@ FnstCWNOP => {
 
 Cltd => {
        # we should not rematrialize this node. It has very strict constraints.
-       reg_req   => { in => [ "eax" ], out => [ "edx" ] },
-       ins       => [ "val" ],
+       reg_req   => { in => [ "eax", "edx" ], out => [ "edx" ] },
+       ins       => [ "val", "clobbered" ],
        emit      => '. cltd',
        latency   => 1,
        mode      => $mode_gp,
index f4c9766..baf414f 100644 (file)
@@ -1339,13 +1339,9 @@ static ir_node *create_sex_32_64(dbg_info *dbgi, ir_node *block,
 
        (void)orig;
        if (ia32_cg_config.use_short_sex_eax) {
-               const arch_register_class_t *reg_class = &ia32_reg_classes[CLASS_ia32_gp];
-               ir_node                     *in[2];
-
-               res = new_bd_ia32_Cltd(dbgi, block, val);
-               in[0] = res;
-               in[1] = val;
-               be_new_Keep(reg_class, current_ir_graph, block, 2, in);
+               ir_node *pval = new_bd_ia32_ProduceVal(dbgi, block);
+               be_dep_on_frame(pval);
+               res = new_bd_ia32_Cltd(dbgi, block, val, pval);
        } else {
                ir_node *imm31 = create_Immediate(NULL, 0, 31);
                res = new_bd_ia32_Sar(dbgi, block, val, imm31);