From 97f51ac4afce58ff9db51095f4125ae6b80e6c2b Mon Sep 17 00:00:00 2001 From: Rodney Brown Date: Wed, 17 Jul 2002 18:09:56 +0000 Subject: [PATCH] i386.c (ix86_expand_int_movcc): In the general case suppress addition when either ct or cf are zero. * config/i386/i386.c (ix86_expand_int_movcc): In the general case suppress addition when either ct or cf are zero. From-SVN: r55540 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/i386.c | 22 ++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index da5ebc2ba2c..9e10f29d9a8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-07-17 Rodney Brown + + * config/i386/i386.c (ix86_expand_int_movcc): In the general case + suppress addition when either ct or cf are zero. + 2002-06-17 Eric Botcazou Glen Nakamura diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 6c2a2b5c77e..68b3d4a95f5 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -8866,8 +8866,8 @@ ix86_expand_int_movcc (operands) ix86_compare_op1, VOIDmode, 0, 1); nops = 0; - /* On x86_64 the lea instruction operates on Pmode, so we need to get arithmetics - done in proper mode to match. */ + /* On x86_64 the lea instruction operates on Pmode, so we need + to get arithmetics done in proper mode to match. */ if (diff == 1) tmp = out; else @@ -8931,10 +8931,10 @@ ix86_expand_int_movcc (operands) if (!optimize_size && !TARGET_CMOVE) { - if (ct == 0) + if (cf == 0) { - ct = cf; - cf = 0; + cf = ct; + ct = 0; if (FLOAT_MODE_P (GET_MODE (ix86_compare_op0))) /* We may be reversing unordered compare to normal compare, that is not valid in general (we may convert non-trapping @@ -8983,18 +8983,16 @@ ix86_expand_int_movcc (operands) out = emit_store_flag (out, code, ix86_compare_op0, ix86_compare_op1, VOIDmode, 0, 1); - out = expand_simple_binop (mode, PLUS, - out, constm1_rtx, + out = expand_simple_binop (mode, PLUS, out, constm1_rtx, out, 1, OPTAB_DIRECT); } - out = expand_simple_binop (mode, AND, - out, + out = expand_simple_binop (mode, AND, out, gen_int_mode (cf - ct, mode), out, 1, OPTAB_DIRECT); - out = expand_simple_binop (mode, PLUS, - out, GEN_INT (ct), - out, 1, OPTAB_DIRECT); + if (ct) + out = expand_simple_binop (mode, PLUS, out, GEN_INT (ct), + out, 1, OPTAB_DIRECT); if (out != operands[0]) emit_move_insn (operands[0], out); -- 2.30.2