diff options
author | Dennis Zhang <dennis.zh@live.com> | 2020-04-08 15:06:31 +0100 |
---|---|---|
committer | Dennis Zhang <dennis.zh@live.com> | 2020-04-08 15:06:31 +0100 |
commit | 975e6670c428b032aa6ec600f57082d3cfb57393 (patch) | |
tree | ee079a210bfab455715fb97817d1010222f5c6ea /gcc/testsuite/lib/target-supports.exp | |
parent | 4cf6b06cb5b02c053738e2975e3b7a4b3c577401 (diff) |
arm: CLI for Custom Datapath Extension (CDE)
This patch is part of a series that adds support for the Arm Custom
Datapath Extension. It defines the options cdecp0-cdecp7 for CLI to
enable the CDE on corresponding coprocessor 0-7.
It also adds new target supports for CDE feature testsuite.
gcc/ChangeLog:
2020-04-08 Dennis Zhang <dennis.zhang@arm.com>
* config.gcc: Add arm_cde.h.
* config/arm/arm-c.c (arm_cpu_builtins): Define or undefine
__ARM_FEATURE_CDE and __ARM_FEATURE_CDE_COPROC.
* config/arm/arm-cpus.in (cdecp0, cdecp1, ..., cdecp7): New options.
* config/arm/arm.c (arm_option_reconfigure_globals): Configure
arm_arch_cde and arm_arch_cde_coproc to store the feature bits.
* config/arm/arm.h (TARGET_CDE): New macro.
* config/arm/arm_cde.h: New file.
* doc/invoke.texi: Document CDE options +cdecp[0-7].
* doc/sourcebuild.texi (arm_v8m_main_cde_ok): Document new target
supports option.
(arm_v8m_main_cde_fp, arm_v8_1m_main_cde_mve): Likewise.
gcc/testsuite/ChangeLog:
2020-04-08 Dennis Zhang <dennis.zhang@arm.com>
* gcc.target/arm/pragma_cde.c: New test.
* lib/target-supports.exp (arm_v8m_main_cde_ok): New target support
option.
(arm_v8m_main_cde_fp, arm_v8_1m_main_cde_mve): Likewise.
Diffstat (limited to 'gcc/testsuite/lib/target-supports.exp')
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 0dfe3ae0651..050b4ba452f 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5103,6 +5103,65 @@ proc add_options_for_arm_v8_2a_bf16_neon { flags } { return "$flags $et_arm_v8_2a_bf16_neon_flags" } +# A series of routines are created to 1) check if a given architecture is +# effective (check_effective_target_*_ok) and then 2) give the corresponding +# flags that enable the architecture (add_options_for_*). +# The series includes: +# arm_v8m_main_cde: Armv8-m CDE (Custom Datapath Extension). +# arm_v8m_main_cde_fp: Armv8-m CDE with FP registers. +# arm_v8_1m_main_cde_mve: Armv8.1-m CDE with MVE. +# Usage: +# /* { dg-require-effective-target arm_v8m_main_cde_ok } */ +# /* { dg-add-options arm_v8m_main_cde } */ +# The tests are valid for Arm. + +foreach { armfunc armflag armdef } { + arm_v8m_main_cde + "-march=armv8-m.main+cdecp0 -mthumb" + "defined (__ARM_FEATURE_CDE)" + arm_v8m_main_cde_fp + "-march=armv8-m.main+fp+cdecp0 -mthumb" + "defined (__ARM_FEATURE_CDE) && defined (__ARM_FP)" + arm_v8_1m_main_cde_mve + "-march=armv8.1-m.main+mve+cdecp0 -mthumb" + "defined (__ARM_FEATURE_CDE) && defined (__ARM_FEATURE_MVE)" + } { + eval [string map [list FUNC $armfunc FLAG $armflag DEF $armdef ] { + proc check_effective_target_FUNC_ok_nocache { } { + global et_FUNC_flags + set et_FUNC_flags "" + + if { ![istarget arm*-*-*] } { + return 0; + } + + if { [check_no_compiler_messages_nocache FUNC_ok assembly { + #if !(DEF) + #error "DEF failed" + #endif + } "FLAG"] } { + set et_FUNC_flags "FLAG" + return 1 + } + + return 0; + } + + proc check_effective_target_FUNC_ok { } { + return [check_cached_effective_target FUNC_ok \ + check_effective_target_FUNC_ok_nocache] + } + + proc add_options_for_FUNC { flags } { + if { ! [check_effective_target_FUNC_ok] } { + return "$flags" + } + global et_FUNC_flags + return "$flags $et_FUNC_flags" + } + }] +} + # Return 1 if the target supports executing ARMv8 NEON instructions, 0 # otherwise. |