From a9308c8f0af3cf272aaab88659ebcbcf23568db9 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Mon, 1 Dec 2008 12:43:11 +0000 Subject: [PATCH] Perform dark rituals and resurrect ProduceVal. We are not ready to dispose it, yet, because the Spiller is too clever for the Keep-trick. [r24182] --- ir/be/ia32/ia32_spec.pl | 16 ++++++++++++++-- ir/be/ia32/ia32_transform.c | 10 +++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ir/be/ia32/ia32_spec.pl b/ir/be/ia32/ia32_spec.pl index 6f5fff40a..8307d4533 100644 --- a/ir/be/ia32/ia32_spec.pl +++ b/ir/be/ia32/ia32_spec.pl @@ -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, diff --git a/ir/be/ia32/ia32_transform.c b/ir/be/ia32/ia32_transform.c index f4c976667..baf414f67 100644 --- a/ir/be/ia32/ia32_transform.c +++ b/ir/be/ia32/ia32_transform.c @@ -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); -- 2.20.1