Commit a92ffb3e by Richard Earnshaw Committed by Richard Earnshaw

[arm] Replace command-line option .def files with single definition file

The files arm-cores.def, arm-fpus.def and arm-arches.def are parsed and
used in several places and the format is slightly awkward to maintain
as they must be parsable in C and by certain scripts.  Furthermore,
changes to the content that affects every entry is particularly awkward for
dealing with merges.

This patch replaces all three files with a single file that specifies all
the command-line related definitions in a new format that allows for better
checking for consistency as well as (hopefully) easier to merge changes.

The awk script used to parse it is relatively complicated, but should be
pretty portable.  It works by parsing in all the data and then operating
one of a number of possible sub-commands to generate the desired output.

The new method picked up one error.  The CPU descriptions referred to an
architecture ARMv5tej which was not supported by -march.  This has been
fixed by adding the relevant entry to the architecture list.

gcc:
	* config.gcc: Use new awk script to check CPU, FPU and architecture
	parameters for --with-... options.
	* config/arm/parsecpu.awk: New file
	* config/arm/arm-cpus.in: New file.
	* config/arm/arm-opts.h: Include arm-cpu.h instead of processing .def
	files.
	* config/arm/arm.c: Include arm-cpu-data.h instead of processing .def
	files.
	* config/arm/t-arm: Update dependency rules.
	* common/config/arm/arm-common.c: Include arm-cpu-cdata.h instead
	of processing .def files.
	* config/arm/genopt.sh: Deleted.
	* config/arm/gentune.sh: Deleted.
	* config/arm/arm-cores.def: Deleted.
	* config/arm/arm-arches.def: Deleted.
	* config/arm/arm-fpus.def: Deleted.
	* config/arm/arm-tune.md: Regenerated.
	* config/arm/arm-tables.opt: Regenerated.
	* config/arm/arm-cpu.h: New generated file.
	* config/arm/arm-cpu-data.h: New generated file.
	* config/arm/arm-cpu-cdata.h: New generated file.

Contrib:
	* gcc_update: Adjust touch list.

From-SVN: r244316
parent ca280d38
2017-01-11 Richard Earnshaw <rearnsha@arm.com>
* gcc_update: Adjust touch list for ARM.
2017-01-08 Gerald Pfeifer <gerald@pfeifer.com>
* download_ecj: Remove.
......
......@@ -80,8 +80,11 @@ gcc/cstamp-h.in: gcc/configure.ac
gcc/config.in: gcc/cstamp-h.in
gcc/fixinc/fixincl.x: gcc/fixinc/fixincl.tpl gcc/fixinc/inclhack.def
gcc/config/aarch64/aarch64-tune.md: gcc/config/aarch64/aarch64-cores.def gcc/config/aarch64/gentune.sh
gcc/config/arm/arm-tune.md: gcc/config/arm/arm-cores.def gcc/config/arm/gentune.sh
gcc/config/arm/arm-tables.opt: gcc/config/arm/arm-arches.def gcc/config/arm/arm-cores.def gcc/config/arm/arm-fpus.def gcc/config/arm/genopt.sh
gcc/config/arm/arm-tune.md: gcc/config/arm/arm-cpus.in gcc/config/arm/parsecpu.awk
gcc/config/arm/arm-tables.opt: gcc/config/arm/arm-cpus.in gcc/config/arm/parsecpu.awk
gcc/config/arm/arm-cpu.h: gcc/config/arm/arm-cpus.in gcc/config/arm/parsecpu.awk
gcc/config/arm/arm-cpu-data.h: gcc/config/arm/arm-cpus.in gcc/config/arm/parsecpu.awk
gcc/config/arm/arm-cpu-cdata.h: gcc/config/arm/arm-cpus.in gcc/config/arm/parsecpu.awk
gcc/config/avr/avr-tables.opt: gcc/config/avr/avr-mcus.def gcc/config/avr/genopt.sh
gcc/config/avr/t-multilib: gcc/config/avr/avr-mcus.def gcc/config/avr/genmultilib.awk
gcc/config/c6x/c6x-tables.opt: gcc/config/c6x/c6x-isas.def gcc/config/c6x/genopt.sh
......
2017-01-11 Richard Earnshaw <rearnsha@arm.com>
* config.gcc: Use new awk script to check CPU, FPU and architecture
parameters for --with-... options.
* config/arm/parsecpu.awk: New file
* config/arm/arm-cpus.in: New file.
* config/arm/arm-opts.h: Include arm-cpu.h instead of processing .def
files.
* config/arm/arm.c: Include arm-cpu-data.h instead of processing .def
files.
* config/arm/t-arm: Update dependency rules.
* common/config/arm/arm-common.c: Include arm-cpu-cdata.h instead
of processing .def files.
* config/arm/genopt.sh: Deleted.
* config/arm/gentune.sh: Deleted.
* config/arm/arm-cores.def: Deleted.
* config/arm/arm-arches.def: Deleted.
* config/arm/arm-fpus.def: Deleted.
* config/arm/arm-tune.md: Regenerated.
* config/arm/arm-tables.opt: Regenerated.
* config/arm/arm-cpu.h: New generated file.
* config/arm/arm-cpu-data.h: New generated file.
* config/arm/arm-cpu-cdata.h: New generated file.
2017-01-11 Maxim Ostapenko <m.ostapenko@samsung.com>
PR lto/79042
......
......@@ -104,19 +104,7 @@ struct arm_arch_core_flag
const enum isa_feature isa_bits[isa_num_bits];
};
static const struct arm_arch_core_flag arm_arch_core_flags[] =
{
#undef ARM_CORE
#define ARM_CORE(NAME, X, IDENT, TUNE_FLAGS, ARCH, ISA, COSTS) \
{NAME, {ISA isa_nobit}},
#include "config/arm/arm-cores.def"
#undef ARM_CORE
#undef ARM_ARCH
#define ARM_ARCH(NAME, CORE, TUNE_FLAGS, ARCH, ISA) \
{NAME, {ISA isa_nobit}},
#include "config/arm/arm-arches.def"
#undef ARM_ARCH
};
#include "config/arm/arm-cpu-cdata.h"
/* Scan over a raw feature array BITS checking for BIT being present.
This is slower than the normal bitmask checks, but we would spend longer
......
......@@ -3675,41 +3675,24 @@ case "${target}" in
arm*-*-*)
supported_defaults="arch cpu float tune fpu abi mode tls"
for which in cpu tune; do
# See if it matches any of the entries in arm-cores.def
for which in cpu tune arch; do
# See if it matches a supported value
eval "val=\$with_$which"
if [ x"$val" = x ] \
|| grep "^ARM_CORE(\"$val\"," \
${srcdir}/config/arm/arm-cores.def \
> /dev/null; then
# Ok
new_val=`grep "^ARM_CORE(\"$val\"," \
${srcdir}/config/arm/arm-cores.def | \
sed -e 's/^[^,]*,[ ]*//' | \
sed -e 's/,.*$//'`
if [ x"$val" != x ] ; then
eval "target_${which}_cname=$new_val"
echo "For $val real value is $new_val"
if [ x"$val" != x ]; then
cpu=`awk -f ${srcdir}/config/arm/parsecpu.awk \
-v cmd="chk$which $val" \
${srcdir}/config/arm/arm-cpus.in`
if [ "$cpu" = "error" ]; then
echo "Unknown target in --with-$which=$val" 1>&2
exit 1
else
new_val=$cpu
eval "target_${which}_cname=$new_val"
echo "For $val real value is $new_val"
fi
true
else
echo "Unknown CPU used in --with-$which=$val" 1>&2
exit 1
fi
done
# See if it matches any of the entries in arm-arches.def
if [ x"$with_arch" = x ] \
|| grep "^ARM_ARCH(\"$with_arch\"," \
${srcdir}/config/arm/arm-arches.def \
> /dev/null; then
# OK
true
else
echo "Unknown arch used in --with-arch=$with_arch" 1>&2
exit 1
fi
case "$with_float" in
"" \
| soft | hard | softfp)
......@@ -3721,16 +3704,16 @@ case "${target}" in
;;
esac
# see if it matches any of the entries in arm-fpus.def
if [ x"$with_fpu" = x ] \
|| grep "^ARM_FPU(\"$with_fpu\"," \
${srcdir}/config/arm/arm-fpus.def \
> /dev/null; then
# OK
true
else
echo "Unknown fpu used in --with-fpu=$with_fpu" 1>&2
exit 1
# see if --with-fpu matches any of the supported FPUs
if [ x"$with_fpu" != x ] ; then
fpu=`awk -f ${srcdir}/config/arm/parsecpu.awk \
-v cmd="chkfpu $with_fpu" \
${srcdir}/config/arm/arm-cpus.in`
if [ "$fpu" = "error"]
then
echo "Unknown target in --with-$which=$val" 1>&2
exit 1
fi
fi
case "$with_abi" in
......
/* ARM CPU architectures.
Copyright (C) 1991-2017 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* Before using #include to read this file, define a macro:
ARM_ARCH(NAME, CORE, TUNE_FLAGS, ARCH, ISA)
The NAME is the name of the architecture, represented as a string
constant. The CORE is the identifier for a core representative of
this architecture. ARCH is the architecture revision. ISA is the
detailed architectural capabilities of the core (see arm-isa.h).
genopt.sh assumes no whitespace up to the first "," in each entry. */
ARM_ARCH("armv2", arm2, (TF_CO_PROC | TF_NO_MODE32), 2, ISA_FEAT(ISA_ARMv2) ISA_FEAT(isa_bit_mode26))
ARM_ARCH("armv2a", arm2, (TF_CO_PROC | TF_NO_MODE32), 2, ISA_FEAT(ISA_ARMv2) ISA_FEAT(isa_bit_mode26))
ARM_ARCH("armv3", arm6, TF_CO_PROC, 3, ISA_FEAT(ISA_ARMv3) ISA_FEAT(isa_bit_mode26))
ARM_ARCH("armv3m", arm7m, TF_CO_PROC, 3M, ISA_FEAT(ISA_ARMv3m) ISA_FEAT(isa_bit_mode26))
ARM_ARCH("armv4", arm7tdmi, TF_CO_PROC, 4, ISA_FEAT(ISA_ARMv4) ISA_FEAT(isa_bit_mode26))
/* Strictly, isa_bit_mode26 is a permitted option for v4t, but there are no
implementations that support it, so we will leave it out for now. */
ARM_ARCH("armv4t", arm7tdmi, TF_CO_PROC, 4T, ISA_FEAT(ISA_ARMv4t))
ARM_ARCH("armv5", arm10tdmi, TF_CO_PROC, 5, ISA_FEAT(ISA_ARMv5))
ARM_ARCH("armv5t", arm10tdmi, TF_CO_PROC, 5T, ISA_FEAT(ISA_ARMv5t))
ARM_ARCH("armv5e", arm1026ejs, TF_CO_PROC, 5E, ISA_FEAT(ISA_ARMv5e))
ARM_ARCH("armv5te", arm1026ejs, TF_CO_PROC, 5TE, ISA_FEAT(ISA_ARMv5te))
ARM_ARCH("armv6", arm1136js, TF_CO_PROC, 6, ISA_FEAT(ISA_ARMv6))
ARM_ARCH("armv6j", arm1136js, TF_CO_PROC, 6J, ISA_FEAT(ISA_ARMv6j))
ARM_ARCH("armv6k", mpcore, TF_CO_PROC, 6K, ISA_FEAT(ISA_ARMv6k))
ARM_ARCH("armv6z", arm1176jzs, TF_CO_PROC, 6Z, ISA_FEAT(ISA_ARMv6z))
ARM_ARCH("armv6kz", arm1176jzs, TF_CO_PROC, 6KZ, ISA_FEAT(ISA_ARMv6kz))
ARM_ARCH("armv6zk", arm1176jzs, TF_CO_PROC, 6KZ, ISA_FEAT(ISA_ARMv6kz))
ARM_ARCH("armv6t2", arm1156t2s, TF_CO_PROC, 6T2, ISA_FEAT(ISA_ARMv6t2))
ARM_ARCH("armv6-m", cortexm1, 0, 6M, ISA_FEAT(ISA_ARMv6m))
ARM_ARCH("armv6s-m", cortexm1, 0, 6M, ISA_FEAT(ISA_ARMv6m))
ARM_ARCH("armv7", cortexa8, TF_CO_PROC, 7, ISA_FEAT(ISA_ARMv7))
ARM_ARCH("armv7-a", cortexa8, TF_CO_PROC, 7A, ISA_FEAT(ISA_ARMv7a))
ARM_ARCH("armv7ve", cortexa8, TF_CO_PROC, 7A, ISA_FEAT(ISA_ARMv7ve))
ARM_ARCH("armv7-r", cortexr4, TF_CO_PROC, 7R, ISA_FEAT(ISA_ARMv7r))
ARM_ARCH("armv7-m", cortexm3, TF_CO_PROC, 7M, ISA_FEAT(ISA_ARMv7m))
ARM_ARCH("armv7e-m", cortexm4, TF_CO_PROC, 7EM, ISA_FEAT(ISA_ARMv7em))
ARM_ARCH("armv8-a", cortexa53, TF_CO_PROC, 8A, ISA_FEAT(ISA_ARMv8a))
ARM_ARCH("armv8-a+crc",cortexa53, TF_CO_PROC, 8A, ISA_FEAT(ISA_ARMv8a) ISA_FEAT(isa_bit_crc32))
ARM_ARCH("armv8.1-a", cortexa53, TF_CO_PROC, 8A, ISA_FEAT(ISA_ARMv8_1a))
ARM_ARCH ("armv8.2-a", cortexa53, TF_CO_PROC, 8A, ISA_FEAT(ISA_ARMv8_2a))
ARM_ARCH ("armv8.2-a+fp16", cortexa53, TF_CO_PROC, 8A, ISA_FEAT(ISA_ARMv8_2a) ISA_FEAT(isa_bit_fp16))
ARM_ARCH("armv8-m.base", cortexm23, 0, 8M_BASE, ISA_FEAT(ISA_ARMv8m_base))
ARM_ARCH("armv8-m.main", cortexm7, TF_CO_PROC, 8M_MAIN, ISA_FEAT(ISA_ARMv8m_main))
ARM_ARCH("armv8-m.main+dsp", cortexm33, TF_CO_PROC, 8M_MAIN, ISA_FEAT(ISA_ARMv8m_main) ISA_FEAT(isa_bit_ARMv7em))
ARM_ARCH("iwmmxt", iwmmxt, (TF_LDSCHED | TF_STRONG | TF_XSCALE), 5TE, ISA_FEAT(ISA_ARMv5te) ISA_FEAT(isa_bit_xscale) ISA_FEAT(isa_bit_iwmmxt))
ARM_ARCH("iwmmxt2", iwmmxt2, (TF_LDSCHED | TF_STRONG | TF_XSCALE), 5TE, ISA_FEAT(ISA_ARMv5te) ISA_FEAT(isa_bit_xscale) ISA_FEAT(isa_bit_iwmmxt) ISA_FEAT(isa_bit_iwmmxt2))
/* -*- buffer-read-only: t -*-
Generated automatically by parsecpu.awk from arm-cpus.in.
Do not edit.
Copyright (C) 2011-2017 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 3,
or (at your option) any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
enum processor_type
{
TARGET_CPU_arm2,
TARGET_CPU_arm250,
TARGET_CPU_arm3,
TARGET_CPU_arm6,
TARGET_CPU_arm60,
TARGET_CPU_arm600,
TARGET_CPU_arm610,
TARGET_CPU_arm620,
TARGET_CPU_arm7,
TARGET_CPU_arm7d,
TARGET_CPU_arm7di,
TARGET_CPU_arm70,
TARGET_CPU_arm700,
TARGET_CPU_arm700i,
TARGET_CPU_arm710,
TARGET_CPU_arm720,
TARGET_CPU_arm710c,
TARGET_CPU_arm7100,
TARGET_CPU_arm7500,
TARGET_CPU_arm7500fe,
TARGET_CPU_arm7m,
TARGET_CPU_arm7dm,
TARGET_CPU_arm7dmi,
TARGET_CPU_arm8,
TARGET_CPU_arm810,
TARGET_CPU_strongarm,
TARGET_CPU_strongarm110,
TARGET_CPU_strongarm1100,
TARGET_CPU_strongarm1110,
TARGET_CPU_fa526,
TARGET_CPU_fa626,
TARGET_CPU_arm7tdmi,
TARGET_CPU_arm7tdmis,
TARGET_CPU_arm710t,
TARGET_CPU_arm720t,
TARGET_CPU_arm740t,
TARGET_CPU_arm9,
TARGET_CPU_arm9tdmi,
TARGET_CPU_arm920,
TARGET_CPU_arm920t,
TARGET_CPU_arm922t,
TARGET_CPU_arm940t,
TARGET_CPU_ep9312,
TARGET_CPU_arm10tdmi,
TARGET_CPU_arm1020t,
TARGET_CPU_arm9e,
TARGET_CPU_arm946es,
TARGET_CPU_arm966es,
TARGET_CPU_arm968es,
TARGET_CPU_arm10e,
TARGET_CPU_arm1020e,
TARGET_CPU_arm1022e,
TARGET_CPU_xscale,
TARGET_CPU_iwmmxt,
TARGET_CPU_iwmmxt2,
TARGET_CPU_fa606te,
TARGET_CPU_fa626te,
TARGET_CPU_fmp626,
TARGET_CPU_fa726te,
TARGET_CPU_arm926ejs,
TARGET_CPU_arm1026ejs,
TARGET_CPU_arm1136js,
TARGET_CPU_arm1136jfs,
TARGET_CPU_arm1176jzs,
TARGET_CPU_arm1176jzfs,
TARGET_CPU_mpcorenovfp,
TARGET_CPU_mpcore,
TARGET_CPU_arm1156t2s,
TARGET_CPU_arm1156t2fs,
TARGET_CPU_cortexm1,
TARGET_CPU_cortexm0,
TARGET_CPU_cortexm0plus,
TARGET_CPU_cortexm1smallmultiply,
TARGET_CPU_cortexm0smallmultiply,
TARGET_CPU_cortexm0plussmallmultiply,
TARGET_CPU_genericv7a,
TARGET_CPU_cortexa5,
TARGET_CPU_cortexa7,
TARGET_CPU_cortexa8,
TARGET_CPU_cortexa9,
TARGET_CPU_cortexa12,
TARGET_CPU_cortexa15,
TARGET_CPU_cortexa17,
TARGET_CPU_cortexr4,
TARGET_CPU_cortexr4f,
TARGET_CPU_cortexr5,
TARGET_CPU_cortexr7,
TARGET_CPU_cortexr8,
TARGET_CPU_cortexm7,
TARGET_CPU_cortexm4,
TARGET_CPU_cortexm3,
TARGET_CPU_marvell_pj4,
TARGET_CPU_cortexa15cortexa7,
TARGET_CPU_cortexa17cortexa7,
TARGET_CPU_cortexa32,
TARGET_CPU_cortexa35,
TARGET_CPU_cortexa53,
TARGET_CPU_cortexa57,
TARGET_CPU_cortexa72,
TARGET_CPU_cortexa73,
TARGET_CPU_exynosm1,
TARGET_CPU_falkor,
TARGET_CPU_qdf24xx,
TARGET_CPU_xgene1,
TARGET_CPU_cortexa57cortexa53,
TARGET_CPU_cortexa72cortexa53,
TARGET_CPU_cortexa73cortexa35,
TARGET_CPU_cortexa73cortexa53,
TARGET_CPU_cortexm23,
TARGET_CPU_cortexm33,
TARGET_CPU_arm_none
};
enum fpu_type
{
TARGET_FPU_vfp,
TARGET_FPU_vfpv2,
TARGET_FPU_vfpv3,
TARGET_FPU_vfpv3_fp16,
TARGET_FPU_vfpv3_d16,
TARGET_FPU_vfpv3_d16_fp16,
TARGET_FPU_vfpv3xd,
TARGET_FPU_vfpv3xd_fp16,
TARGET_FPU_neon,
TARGET_FPU_neon_vfpv3,
TARGET_FPU_neon_fp16,
TARGET_FPU_vfpv4,
TARGET_FPU_neon_vfpv4,
TARGET_FPU_vfpv4_d16,
TARGET_FPU_fpv4_sp_d16,
TARGET_FPU_fpv5_sp_d16,
TARGET_FPU_fpv5_d16,
TARGET_FPU_fp_armv8,
TARGET_FPU_neon_fp_armv8,
TARGET_FPU_crypto_neon_fp_armv8,
TARGET_FPU_vfp3,
TARGET_FPU_auto
};
/* ARM FPU variants.
Copyright (C) 1991-2017 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 3, or (at your
option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* Before using #include to read this file, define a macro:
ARM_FPU(NAME, CNAME, ISA)
NAME is the publicly visible option name.
CNAME is a C-compatible variable name substring.
ISA is the list of feature bits that this FPU provides.
genopt.sh assumes no whitespace up to the first "," in each entry. */
ARM_FPU("vfp", vfp, ISA_FEAT(ISA_VFPv2) ISA_FEAT(ISA_FP_DBL))
ARM_FPU("vfpv2", vfpv2, ISA_FEAT(ISA_VFPv2) ISA_FEAT(ISA_FP_DBL))
ARM_FPU("vfpv3", vfpv3, ISA_FEAT(ISA_VFPv3) ISA_FEAT(ISA_FP_D32))
ARM_FPU("vfpv3-fp16", vfpv3_fp16, ISA_FEAT(ISA_VFPv3) ISA_FEAT(ISA_FP_D32) ISA_FEAT(isa_bit_fp16conv))
ARM_FPU("vfpv3-d16", vfpv3_d16, ISA_FEAT(ISA_VFPv3) ISA_FEAT(ISA_FP_DBL))
ARM_FPU("vfpv3-d16-fp16", vfpv3_d16_fp16, ISA_FEAT(ISA_VFPv3) ISA_FEAT(ISA_FP_DBL) ISA_FEAT(isa_bit_fp16conv))
ARM_FPU("vfpv3xd", vfpv3xd, ISA_FEAT(ISA_VFPv3))
ARM_FPU("vfpv3xd-fp16", vfpv3xd_fp16, ISA_FEAT(ISA_VFPv3) ISA_FEAT(isa_bit_fp16conv))
ARM_FPU("neon", neon, ISA_FEAT(ISA_VFPv3) ISA_FEAT(ISA_NEON))
ARM_FPU("neon-vfpv3", neon_vfpv3, ISA_FEAT(ISA_VFPv3) ISA_FEAT(ISA_NEON))
ARM_FPU("neon-fp16", neon_fp16, ISA_FEAT(ISA_VFPv3) ISA_FEAT(ISA_NEON) ISA_FEAT(isa_bit_fp16conv))
ARM_FPU("vfpv4", vfpv4, ISA_FEAT(ISA_VFPv4) ISA_FEAT(ISA_FP_D32))
ARM_FPU("neon-vfpv4", neon_vfpv4, ISA_FEAT(ISA_VFPv4) ISA_FEAT(ISA_NEON))
ARM_FPU("vfpv4-d16", vfpv4_d16, ISA_FEAT(ISA_VFPv4) ISA_FEAT(ISA_FP_DBL))
ARM_FPU("fpv4-sp-d16", fpv4_sp_d16, ISA_FEAT(ISA_VFPv4))
ARM_FPU("fpv5-sp-d16", fpv5_sp_d16, ISA_FEAT(ISA_FPv5))
ARM_FPU("fpv5-d16", fpv5_d16, ISA_FEAT(ISA_FPv5) ISA_FEAT(ISA_FP_DBL))
ARM_FPU("fp-armv8", fp_armv8, ISA_FEAT(ISA_FP_ARMv8) ISA_FEAT(ISA_FP_D32))
ARM_FPU("neon-fp-armv8", neon_fp_armv8, ISA_FEAT(ISA_FP_ARMv8) ISA_FEAT(ISA_NEON))
ARM_FPU("crypto-neon-fp-armv8", crypto_neon_fp_armv8, ISA_FEAT(ISA_FP_ARMv8) ISA_FEAT(ISA_CRYPTO))
/* Compatibility aliases. */
ARM_FPU("vfp3", vfp3, ISA_FEAT(ISA_VFPv3) ISA_FEAT(ISA_FP_D32))
......@@ -27,28 +27,7 @@
#include "arm-flags.h"
#include "arm-isa.h"
/* The various ARM cores. */
enum processor_type
{
#undef ARM_CORE
#define ARM_CORE(NAME, INTERNAL_IDENT, IDENT, TUNE_FLAGS, ARCH, ISA, COSTS) \
TARGET_CPU_##INTERNAL_IDENT,
#include "arm-cores.def"
#undef ARM_CORE
/* Used to indicate that no processor has been specified. */
TARGET_CPU_arm_none
};
/* The various ARM FPUs. */
enum fpu_type
{
#undef ARM_FPU
#define ARM_FPU(NAME, CNAME, ISA) TARGET_FPU_##CNAME,
#include "arm-fpus.def"
TARGET_FPU_auto
#undef ARM_FPU
};
#include "arm-cpu.h"
/* Which __fp16 format to use.
The enumeration values correspond to the numbering for the
......
; -*- buffer-read-only: t -*-
; Generated automatically by genopt.sh from arm-cores.def, arm-arches.def
; and arm-fpus.def.
; Generated automatically by parsecpu.awk from arm-cpus.in.
; Do not edit.
; Copyright (C) 2011-2017 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
; GCC is free software; you can redistribute it and/or modify it under
; the terms of the GNU General Public License as published by the Free
; Software Foundation; either version 3, or (at your option) any later
; version.
;
; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
; WARRANTY; without even the implied warranty of MERCHANTABILITY or
; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
; for more details.
;
; You should have received a copy of the GNU General Public License
; along with GCC; see the file COPYING3. If not see
; GCC is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as
; published by the Free Software Foundation; either version 3,
; or (at your option) any later version.
; GCC is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
; You should have received a copy of the GNU General Public
; License along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
Enum
......@@ -389,79 +389,82 @@ EnumValue
Enum(arm_arch) String(armv5te) Value(9)
EnumValue
Enum(arm_arch) String(armv6) Value(10)
Enum(arm_arch) String(armv5tej) Value(10)
EnumValue
Enum(arm_arch) String(armv6) Value(11)
EnumValue
Enum(arm_arch) String(armv6j) Value(11)
Enum(arm_arch) String(armv6j) Value(12)
EnumValue
Enum(arm_arch) String(armv6k) Value(12)
Enum(arm_arch) String(armv6k) Value(13)
EnumValue
Enum(arm_arch) String(armv6z) Value(13)
Enum(arm_arch) String(armv6z) Value(14)
EnumValue
Enum(arm_arch) String(armv6kz) Value(14)
Enum(arm_arch) String(armv6kz) Value(15)
EnumValue
Enum(arm_arch) String(armv6zk) Value(15)
Enum(arm_arch) String(armv6zk) Value(16)
EnumValue
Enum(arm_arch) String(armv6t2) Value(16)
Enum(arm_arch) String(armv6t2) Value(17)
EnumValue
Enum(arm_arch) String(armv6-m) Value(17)
Enum(arm_arch) String(armv6-m) Value(18)
EnumValue
Enum(arm_arch) String(armv6s-m) Value(18)
Enum(arm_arch) String(armv6s-m) Value(19)
EnumValue
Enum(arm_arch) String(armv7) Value(19)
Enum(arm_arch) String(armv7) Value(20)
EnumValue
Enum(arm_arch) String(armv7-a) Value(20)
Enum(arm_arch) String(armv7-a) Value(21)
EnumValue
Enum(arm_arch) String(armv7ve) Value(21)
Enum(arm_arch) String(armv7ve) Value(22)
EnumValue
Enum(arm_arch) String(armv7-r) Value(22)
Enum(arm_arch) String(armv7-r) Value(23)
EnumValue
Enum(arm_arch) String(armv7-m) Value(23)
Enum(arm_arch) String(armv7-m) Value(24)
EnumValue
Enum(arm_arch) String(armv7e-m) Value(24)
Enum(arm_arch) String(armv7e-m) Value(25)
EnumValue
Enum(arm_arch) String(armv8-a) Value(25)
Enum(arm_arch) String(armv8-a) Value(26)
EnumValue
Enum(arm_arch) String(armv8-a+crc) Value(26)
Enum(arm_arch) String(armv8-a+crc) Value(27)
EnumValue
Enum(arm_arch) String(armv8.1-a) Value(27)
Enum(arm_arch) String(armv8.1-a) Value(28)
EnumValue
Enum(arm_arch) String(armv8.2-a) Value(28)
Enum(arm_arch) String(armv8.2-a) Value(29)
EnumValue
Enum(arm_arch) String(armv8.2-a+fp16) Value(29)
Enum(arm_arch) String(armv8.2-a+fp16) Value(30)
EnumValue
Enum(arm_arch) String(armv8-m.base) Value(30)
Enum(arm_arch) String(armv8-m.base) Value(31)
EnumValue
Enum(arm_arch) String(armv8-m.main) Value(31)
Enum(arm_arch) String(armv8-m.main) Value(32)
EnumValue
Enum(arm_arch) String(armv8-m.main+dsp) Value(32)
Enum(arm_arch) String(armv8-m.main+dsp) Value(33)
EnumValue
Enum(arm_arch) String(iwmmxt) Value(33)
Enum(arm_arch) String(iwmmxt) Value(34)
EnumValue
Enum(arm_arch) String(iwmmxt2) Value(34)
Enum(arm_arch) String(iwmmxt2) Value(35)
Enum
Name(arm_fpu) Type(enum fpu_type)
......
;; -*- buffer-read-only: t -*-
;; Generated automatically by gentune.sh from arm-cores.def
; -*- buffer-read-only: t -*-
; Generated automatically by parsecpu.awk from arm-cpus.in.
; Do not edit.
; Copyright (C) 2011-2017 Free Software Foundation, Inc.
; This file is part of GCC.
; GCC is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as
; published by the Free Software Foundation; either version 3,
; or (at your option) any later version.
; GCC is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
; You should have received a copy of the GNU General Public
; License along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
(define_attr "tune"
"arm2,arm250,arm3,
arm6,arm60,arm600,
......
......@@ -2293,33 +2293,8 @@ const struct tune_params arm_fa726te_tune =
tune_params::SCHED_AUTOPREF_OFF
};
/* Not all of these give usefully different compilation alternatives,
but there is no simple way of generalizing them. */
static const struct processors all_cores[] =
{
/* ARM Cores */
#define ARM_CORE(NAME, X, IDENT, TUNE_FLAGS, ARCH, ISA, COSTS) \
{NAME, TARGET_CPU_##IDENT, TUNE_FLAGS, #ARCH, BASE_ARCH_##ARCH, \
{ISA isa_nobit}, &arm_##COSTS##_tune},
#include "arm-cores.def"
#undef ARM_CORE
{NULL, TARGET_CPU_arm_none, 0, NULL, BASE_ARCH_0, {isa_nobit}, NULL}
};
static const struct processors all_architectures[] =
{
/* ARM Architectures */
/* We don't specify tuning costs here as it will be figured out
from the core. */
#define ARM_ARCH(NAME, CORE, TUNE_FLAGS, ARCH, ISA) \
{NAME, TARGET_CPU_##CORE, TUNE_FLAGS, #ARCH, BASE_ARCH_##ARCH, \
{ISA isa_nobit}, NULL},
#include "arm-arches.def"
#undef ARM_ARCH
{NULL, TARGET_CPU_arm_none, 0, NULL, BASE_ARCH_0, {isa_nobit}, NULL}
};
/* Auto-generated CPU, FPU and architecture tables. */
#include "arm-cpu-data.h"
/* The name of the preprocessor macro to define for this architecture. PROFILE
is replaced by the architecture name (eg. 8A) in arm_option_override () and
......@@ -2327,17 +2302,6 @@ static const struct processors all_architectures[] =
char arm_arch_name[] = "__ARM_ARCH_PROFILE__";
/* Available values for -mfpu=. */
const struct arm_fpu_desc all_fpus[] =
{
#undef ARM_FPU
#define ARM_FPU(NAME, CNAME, ISA) \
{ NAME, {ISA isa_nobit} },
#include "arm-fpus.def"
#undef ARM_FPU
};
/* Supported TLS relocations. */
enum tls_reloc {
......
#!/bin/sh
# Generate arm-tables.opt from the lists in *.def.
# Copyright (C) 2011-2017 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
cat <<EOF
; -*- buffer-read-only: t -*-
; Generated automatically by genopt.sh from arm-cores.def, arm-arches.def
; and arm-fpus.def.
; Copyright (C) 2011-2017 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
; GCC is free software; you can redistribute it and/or modify it under
; the terms of the GNU General Public License as published by the Free
; Software Foundation; either version 3, or (at your option) any later
; version.
;
; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
; WARRANTY; without even the implied warranty of MERCHANTABILITY or
; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
; for more details.
;
; You should have received a copy of the GNU General Public License
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
Enum
Name(processor_type) Type(enum processor_type)
Known ARM CPUs (for use with the -mcpu= and -mtune= options):
EOF
awk -F'[(, ]+' '/^ARM_CORE/ {
name = $2
enum = $3
gsub("\"", "", name)
print "EnumValue"
print "Enum(processor_type) String(" name ") Value( TARGET_CPU_" enum ")"
print ""
}' $1/arm-cores.def
cat <<EOF
Enum
Name(arm_arch) Type(int)
Known ARM architectures (for use with the -march= option):
EOF
awk -F'[(, ]+' 'BEGIN {
value = 0
}
/^ARM_ARCH/ {
name = $2
gsub("\"", "", name)
print "EnumValue"
print "Enum(arm_arch) String(" name ") Value(" value ")"
print ""
value++
}' $1/arm-arches.def
cat <<EOF
Enum
Name(arm_fpu) Type(enum fpu_type)
Known ARM FPUs (for use with the -mfpu= option):
EOF
awk -F'[(, ]+' '
/^ARM_FPU/ {
name = $2
enum = $3
gsub("\"", "", name)
print "EnumValue"
print "Enum(arm_fpu) String(" name ") Value(TARGET_FPU_" enum ")"
print ""
}
END {
print "EnumValue"
print "Enum(arm_fpu) String(auto) Value(TARGET_FPU_auto)"
}' $1/arm-fpus.def
#!/bin/sh
# Generate arm-tune.md, a file containing the tune attribute from the list of
# CPUs in arm-cores.def
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
echo ";; -*- buffer-read-only: t -*-"
echo ";; Generated automatically by gentune.sh from arm-cores.def"
allcores=`awk -F'[(, ]+' '/^ARM_CORE/ { cores = cores$3"," } END { print cores } ' $1`
echo "(define_attr \"tune\""
echo " \"$allcores\"" | sed -e 's/,"$/"/' | sed -e 's/\([a-z0-9_]\+,[a-z0-9_]\+,[a-z0-9_]\+,\)/\1\n\t/g'
echo " (const (symbol_ref \"((enum attr_tune) arm_tune)\")))"
......@@ -18,8 +18,7 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
TM_H += $(srcdir)/config/arm/arm-cores.def
OPTIONS_H_EXTRA += $(srcdir)/config/arm/arm-cores.def
TM_H += $(srcdir)/config/arm/arm-cpu.h
# All md files - except for arm.md.
# This list should be kept in alphabetical order and updated whenever an md
......@@ -67,18 +66,36 @@ MD_INCLUDES= $(srcdir)/config/arm/arm1020e.md \
s-config s-conditions s-flags s-codes s-constants s-emit s-recog s-preds \
s-opinit s-extract s-peep s-attr s-attrtab s-output: $(MD_INCLUDES)
$(srcdir)/config/arm/arm-tune.md: $(srcdir)/config/arm/gentune.sh \
$(srcdir)/config/arm/arm-cores.def
$(SHELL) $(srcdir)/config/arm/gentune.sh \
$(srcdir)/config/arm/arm-cores.def > \
$(srcdir)/config/arm/arm-tune.md
$(srcdir)/config/arm/arm-tune.md: $(srcdir)/config/arm/parsecpu.awk \
$(srcdir)/config/arm/arm-cpus.in
$(AWK) -f $(srcdir)/config/arm/parsecpu.awk -v cmd=md \
$(srcdir)/config/arm/arm-cpus.in > arm-tune.new
mv arm-tune.new $(srcdir)/config/arm/arm-tune.md
$(srcdir)/config/arm/arm-tables.opt: $(srcdir)/config/arm/genopt.sh \
$(srcdir)/config/arm/arm-cores.def $(srcdir)/config/arm/arm-arches.def \
$(srcdir)/config/arm/arm-fpus.def
$(SHELL) $(srcdir)/config/arm/genopt.sh $(srcdir)/config/arm > \
$(srcdir)/config/arm/arm-tables.opt: $(srcdir)/config/arm/parsecpu.awk \
$(srcdir)/config/arm/arm-cpus.in
$(AWK) -f $(srcdir)/config/arm/parsecpu.awk -v cmd=opt \
$(srcdir)/config/arm/arm-cpus.in > \
$(srcdir)/config/arm/arm-tables.opt
$(srcdir)/config/arm/arm-cpu.h: $(srcdir)/config/arm/parsecpu.awk \
$(srcdir)/config/arm/arm-cpus.in
$(AWK) -f $(srcdir)/config/arm/parsecpu.awk -v cmd=headers \
$(srcdir)/config/arm/arm-cpus.in > arm-cpu.new
mv arm-cpu.new $(srcdir)/config/arm/arm-cpu.h
$(srcdir)/config/arm/arm-cpu-data.h: $(srcdir)/config/arm/parsecpu.awk \
$(srcdir)/config/arm/arm-cpus.in
$(AWK) -f $(srcdir)/config/arm/parsecpu.awk -v cmd=data \
$(srcdir)/config/arm/arm-cpus.in > arm-cpu-data.new
mv arm-cpu-data.new $(srcdir)/config/arm/arm-cpu-data.h
$(srcdir)/config/arm/arm-cpu-cdata.h: $(srcdir)/config/arm/parsecpu.awk \
$(srcdir)/config/arm/arm-cpus.in
$(AWK) -f $(srcdir)/config/arm/parsecpu.awk -v cmd=common-data \
$(srcdir)/config/arm/arm-cpus.in > arm-cpu-cdata.new
mv arm-cpu-cdata.new $(srcdir)/config/arm/arm-cpu-cdata.h
aarch-common.o: $(srcdir)/config/arm/aarch-common.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TM_P_H) $(RTL_H) $(TREE_H) output.h $(C_COMMON_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
......@@ -92,8 +109,7 @@ arm.o: $(srcdir)/config/arm/arm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(GGC_H) except.h $(C_PRAGMA_H) $(TM_P_H) \
$(TARGET_H) $(TARGET_DEF_H) debug.h langhooks.h $(DF_H) \
intl.h libfuncs.h $(PARAMS_H) $(OPTS_H) sched-int.h \
$(srcdir)/config/arm/arm-cores.def \
$(srcdir)/config/arm/arm-arches.def $(srcdir)/config/arm/arm-fpus.def \
$(srcdir)/config/arm/arm-cpu-data.h \
$(srcdir)/config/arm/arm-protos.h \
$(srcdir)/config/arm/arm_neon_builtins.def \
$(srcdir)/config/arm/arm_vfp_builtins.def
......@@ -113,3 +129,5 @@ arm-c.o: $(srcdir)/config/arm/arm-c.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(srcdir)/config/arm/arm-c.c
arm-common.o: $(srcdir)/config/arm/arm-cpu-cdata.h
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment