From ffb1eabf4525d5e5c9e6d62894f63c775f876eab Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 19 Oct 2016 23:27:53 +0200 Subject: [PATCH] Floating point promotion is less buggy. --- mach/proto/mcg/pass_promotefloatops.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mach/proto/mcg/pass_promotefloatops.c b/mach/proto/mcg/pass_promotefloatops.c index ffea3f0dc..87db1e47d 100644 --- a/mach/proto/mcg/pass_promotefloatops.c +++ b/mach/proto/mcg/pass_promotefloatops.c @@ -86,8 +86,21 @@ static void modify_promotable_irs(void) { struct ir* ir = promotable.item[i]; - if (ir->opcode != IR_PHI) - ir->opcode++; + switch (ir->opcode) + { + case IR_ADDF: + case IR_SUBF: + case IR_MULF: + case IR_DIVF: + case IR_NEGF: + case IR_PHI: + case IR_NOP: + break; + + default: + ir->opcode++; + break; + } } }