This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: i386.md: fp_jcc_3 and TARGET_CMOVE
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: i386.md: fp_jcc_3 and TARGET_CMOVE
- From: Clinton Popetz <cpopetz at cygnus dot com>
- Date: Thu, 1 Jun 2000 09:42:49 -0500
- Cc: gcc-patches at gcc dot gnu dot org
- References: <20000531121827.A32566@cpopetz.com> <20000601030331.B4262@cygnus.com>
On Thu, Jun 01, 2000 at 03:03:31AM -0700, Richard Henderson wrote:
> On Wed, May 31, 2000 at 12:18:27PM -0500, Clinton Popetz wrote:
> > * config/i386/i386.c (ix86_use_fcomi_compare): Make global.
> > * config/i386/i386-protos.h (ix86_use_fcomi_compare): Declare.
> > * config/i386/i386.md (*fp_jcc_3): Require the second operand
> > to be a REG if we can use FCOMI.
>
> I'm guessing we moved from matching fp_jcc_1 to fp_jcc_3
> during combine, because it thought merging with the memory
> load would be a good idea.
Yes.
> This won't work, I don't believe. Mostly because
>
> > ! && (GET_CODE (operands[2]) == REG ||
> > ! !ix86_use_fcomi_compare (GET_CODE (operands[0])))"
>
> this doesn't get rid of the "m" alternative during reload.
I hadn't considered that.
> Instead, just add the later half of the clause to disable
> fp_jcc_[34] if we're planning on using fcomi.
Thanks. I committed the appended patch.
-Clint
Thu Jun 1 09:37:35 2000 Clinton Popetz <cpopetz@cygnus.com>
* config/i386/i386.c (ix86_use_fcomi_compare): Make global.
* config/i386/i386-protos.h (ix86_use_fcomi_compare): Declare.
* config/i386/i386.md (*fp_jcc_3, *fp_jcc_4): Disable if we
will use FCOMI.
Index: i386-protos.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386-protos.h,v
retrieving revision 1.19
diff -c -2 -p -r1.19 i386-protos.h
*** i386-protos.h 2000/04/27 14:56:46 1.19
--- i386-protos.h 2000/06/01 14:35:18
*************** extern int ix86_unary_operator_ok PARAMS
*** 100,103 ****
--- 100,104 ----
extern int ix86_match_ccmode PARAMS ((rtx, enum machine_mode));
extern rtx ix86_expand_fp_compare PARAMS ((enum rtx_code, rtx, rtx, rtx));
+ extern int ix86_use_fcomi_compare PARAMS ((enum rtx_code));
extern void ix86_expand_branch PARAMS ((enum rtx_code, rtx));
extern int ix86_expand_setcc PARAMS ((enum rtx_code, rtx));
Index: i386.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.159
diff -c -2 -p -r1.159 i386.c
*** i386.c 2000/04/27 14:56:46 1.159
--- i386.c 2000/06/01 14:35:29
*************** static enum rtx_code unsigned_comparison
*** 393,397 ****
static rtx ix86_expand_int_compare PARAMS ((enum rtx_code, rtx, rtx));
static enum machine_mode ix86_fp_compare_mode PARAMS ((enum rtx_code));
- static int ix86_use_fcomi_compare PARAMS ((enum rtx_code));
static enum rtx_code ix86_prepare_fp_compare_args PARAMS ((enum rtx_code,
rtx *, rtx *));
--- 393,396 ----
*************** ix86_fp_compare_mode (code)
*** 4540,4544 ****
/* Return true if we should use an FCOMI instruction for this fp comparison. */
! static int
ix86_use_fcomi_compare (code)
enum rtx_code code;
--- 4539,4543 ----
/* Return true if we should use an FCOMI instruction for this fp comparison. */
! int
ix86_use_fcomi_compare (code)
enum rtx_code code;
Index: i386.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.md,v
retrieving revision 1.156
diff -c -2 -p -r1.156 i386.md
*** i386.md 2000/05/27 20:23:15 1.156
--- i386.md 2000/06/01 14:35:48
***************
*** 7154,7158 ****
"TARGET_80387
&& (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
! && GET_MODE (operands[1]) == GET_MODE (operands[2])"
"#")
--- 7154,7159 ----
"TARGET_80387
&& (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
! && GET_MODE (operands[1]) == GET_MODE (operands[2])
! && !ix86_use_fcomi_compare (GET_CODE (operands[0]))"
"#")
***************
*** 7169,7173 ****
"TARGET_80387
&& (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
! && GET_MODE (operands[1]) == GET_MODE (operands[2])"
"#")
--- 7170,7175 ----
"TARGET_80387
&& (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
! && GET_MODE (operands[1]) == GET_MODE (operands[2])
! && !ix86_use_fcomi_compare (GET_CODE (operands[0]))"
"#")