This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: mips march/mtune support


echristo@redhat.com ("Eric Christopher") writes:
> -#define GENERATE_BRANCHLIKELY  (!TARGET_MIPS16 && (TARGET_MIPS3900 || ISA_HAS_BRANCHLIKELY))
> +#define GENERATE_BRANCHLIKELY  (!TARGET_MIPS16 && ISA_HAS_BRANCHLIKELY)
>  #define GENERATE_MULT3         (TARGET_MIPS3900				\
> @@ -597,7 +614,10 @@ extern void		sbss_section PARAMS ((void)
>                                  )
>  
>  /* ISA has branch likely instructions (eg. mips2). */ 
> -#define ISA_HAS_BRANCHLIKELY	(mips_isa != 1)
> +/* Disable branchlikely for tx39 until compare rewrite.  They haven't
> +   been generated up to this point.  */
> +#define ISA_HAS_BRANCHLIKELY	(mips_isa != 1                          \
> +				 /* || TARGET_MIPS3900 */)

i didn't have time to look at this patch in great detail, but i did
notice the chunk quoted above.

use of Branch Likely instructions is strongly discouraged in the
MIPS32 and MIPS64 architectures.  See, for instance, page 57 of the
MIPS32 Instruction set manual at
http://www.mips.com/declassified/Declassified_2001/MD00086-2B-MIPS32BIS-AFP-00.95.pdf
(page 65 of the PDF document, it seems -- *sigh*).

This is a case of "the instruction is there if you need it, but you
shouldn't use it unless you really really know that you need it."  not
sure how to handle that.  maybe "avoid if cpu_tune is mips32
architecture or mips64 architecture."

that makes me wonder if there's need for macros that basically say is
this processor a mips32 / is this processor a mips64 cpu.

that may be overkill though...



cgd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]