aboutsummaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2021-06-14 15:33:17 +0300
committerClaudiu Zissulescu <claziss@synopsys.com>2021-06-14 15:33:25 +0300
commitc4c47a84a16a29d7077f537051d90de1f3475957 (patch)
treeb1e3500f478976c7374252f932a371273eea1067 /gcc/config.gcc
parent831589c227cf1a53cb08490edbafb612d0a9db7c (diff)
downloadgcc-c4c47a84a16a29d7077f537051d90de1f3475957.zip
gcc-c4c47a84a16a29d7077f537051d90de1f3475957.tar.gz
gcc-c4c47a84a16a29d7077f537051d90de1f3475957.tar.bz2
arc: Add --with-fpu support for ARCv2 cpus
Support for a compile-time default FPU. The --with-fpu configuration option is ignored if -mfpu compiler option is specified. The FPU options are only available for ARCv2 cpus. gcc/ 2021-06-14 Claudiu Zissulescu <claziss@synopsys.com> * config.gcc (arc): Add support for with_cpu option. * config/arc/arc.h (OPTION_DEFAULT_SPECS): Add fpu. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r--gcc/config.gcc44
1 files changed, 39 insertions, 5 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 4dc4fe0..1be8d96 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4260,18 +4260,52 @@ case "${target}" in
;;
arc*-*-*)
- supported_defaults="cpu"
+ supported_defaults="cpu fpu"
+ new_cpu=hs38_linux
if [ x"$with_cpu" = x ] \
- || grep "^ARC_CPU ($with_cpu," \
- ${srcdir}/config/arc/arc-cpus.def \
- > /dev/null; then
+ || grep -q -E "^ARC_CPU[[:blank:]]*\($with_cpu," \
+ ${srcdir}/config/arc/arc-cpus.def
+ then
# Ok
- true
+ new_cpu=$with_cpu
else
echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
exit 1
fi
+
+ # see if --with-fpu matches any of the supported FPUs
+ case "$with_fpu" in
+ "")
+ # OK
+ ;;
+ fpus | fpus_div | fpus_fma | fpus_all)
+ # OK if em or hs
+ flags_ok="[emhs]+"
+ ;;
+ fpuda | fpuda_div | fpuda_fma | fpuda_all)
+ # OK only em
+ flags_ok="em"
+ ;;
+ fpud | fpud_div | fpud_fma | fpud_all)
+ # OK only hs
+ flags_ok="hs"
+ ;;
+ *)
+ echo "Unknown floating point type used in "\
+ "--with-fpu=$with_fpu" 1>&2
+ exit 1
+ ;;
+ esac
+
+ if [ -n "$flags_ok" ] \
+ && ! grep -q -E "^ARC_CPU[[:blank:]]*\($new_cpu,[[:blank:]]*$flags_ok," \
+ ${srcdir}/config/arc/arc-cpus.def
+ then
+ echo "Unknown floating point type used in "\
+ "--with-fpu=$with_fpu for cpu $new_cpu" 1>&2
+ exit 1
+ fi
;;
csky-*-*)