This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Darwin FP constant peephole (again)
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Dale Johannesen <dalej at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 18 Dec 2001 17:55:07 -0800
- Subject: Re: PATCH: Darwin FP constant peephole (again)
- References: <383658A2-F406-11D5-B9B4-0030654D3B66@apple.com>
>>>>> "Dale" == Dale Johannesen <dalej@apple.com> writes:
it looks much better as a function :)
> +/* The convention appears to be to define this wherever it is used.
> + With legitimize_reload_address now defined here, REG_MODE_OK_FOR_BASE_P
> + is now used here. */
> +#ifndef REG_MODE_OK_FOR_BASE_P
> +#define REG_MODE_OK_FOR_BASE_P(REGNO, MODE) REG_OK_FOR_BASE_P (REGNO)
> +#endif
perhaps this should go either in reload.h or in rs6000.h. IMO we
shouldn't be defining target macros in the .c file.
> +#if TARGET_MACHO
> + if (DEFAULT_ABI == ABI_DARWIN && flag_pic
> + && GET_CODE (x) == LO_SUM
> + && GET_CODE (XEXP (x, 0)) == PLUS
> + && XEXP (XEXP (x, 0), 0) == pic_offset_table_rtx
> + && GET_CODE (XEXP (XEXP (x, 0), 1)) == HIGH
> + && GET_CODE (XEXP (XEXP (XEXP (x, 0), 1), 0)) == CONST
> + && XEXP (XEXP (XEXP (x, 0), 1), 0) == XEXP (x, 1)
> + && GET_CODE (XEXP (XEXP (x, 1), 0)) == MINUS
> + && GET_CODE (XEXP (XEXP (XEXP (x, 1), 0), 0)) == SYMBOL_REF
> + && GET_CODE (XEXP (XEXP (XEXP (x, 1), 0), 1)) == SYMBOL_REF)
> + {
> + /* Result of previous invocation of this function on Darwin
> + floating point constant. */
> + push_reload (XEXP (x, 0), NULL_RTX, &XEXP (x, 0), NULL,
> + BASE_REG_CLASS, Pmode, VOIDmode, 0, 0,
> + opnum, (enum reload_type)type);
> + *win = 1;
> + return x;
> + }
> +#endif
do these have to be conditionally compiled? We're trying to cut down
on conditionally compiled code when possible.
Otherwise, i like this version much better. Thanks.
Aldy