HomeFreeBSD

Use mips3 as the default MIPS ISA for 32-bit FreeBSD/mips.

Description

Use mips3 as the default MIPS ISA for 32-bit FreeBSD/mips.

The in-tree GCC 4.2.1 defaults to a MIPS ISA of MIPS3 (which includes ll
and sc instructions needed for SMP-aware atomics). However, out of the
box GCC defaults to MIPS1 for 32-bit MIPS (N32 and N64 both require a
minimum of MIPS3). Change both devel/mips-gcc and base/gcc to default to
MIPS3 for 32-bit MIPS on FreeBSD.

  • Fix the default target cpu to include MASK_ABICALLS in configure.tgt. The gcc/config/mips/freebsd.h header already overrides this anway, but it is more correct to fix this here. We could perhaps remove the hack from freebsd.h now but I haven't done that.
  • Fix the case that checks for 32-bit mips tuples to match on 'mips*' instead of 'mips32*' in configure.tgt. We don't use mips32* in our tuples for O32 MIPS.
  • Set MIPS_ISA_DEFAULT to 3 (MIPS3) rather than 33 (MIPS32R6 or some such) for O32.
  • Remove MIPS_ISA_DEFAULT for N32 to use the default of MIPS3.
  • Remove hackish driver specs and instead replace with more standard driver specs. Add MIPS_DEFAULT_ISA_LEVEL_SPEC to the default driver specs. This macro forces a suitable MIPS ISA parameter (such as -mips3) to always be added to the flags passed to subcommands. In particular, without this change the compiler would assume MIPS3 by default via MIPS_ISA_DEFAULT but would not pass any flags on to as(1) and as would still use MIPS1. The added macro ensures -mips3 is passed to as(1) if no explicit -march is specified.

The upshot of all this is that one no longer has to explicitly specify
TARGET_CPUTYPE=mips3 to build O32 MIPS. It should also make /usr/bin/cc
from base/gcc more compatible with GCC 4.2.1.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D15543