Stam Markianos-Wright <stam.markianos-wri...@arm.com> writes:
> Hi all,
>
> This small patch adds support for the ARM v8.6 extensions +bf16 and 
> +i8mm to the testsuite. This will be tested through other upcoming 
> patches, which is why we are not providing any explicit tests here.
>
> Ok for trunk?
>
> Also I don't have commit rights, so if someone could commit on my 
> behalf, that would be great :)
>
> The functionality here depends on CLI patches:
> https://gcc.gnu.org/ml/gcc-patches/2019-11/msg02415.html
> https://gcc.gnu.org/ml/gcc-patches/2019-11/msg02195.html
>
> but this patch applies cleanly without them, too.
>
> Cheers,
> Stam
>
>
> gcc/testsuite/ChangeLog:
>
> 2019-12-11  Stam Markianos-Wright  <stam.markianos-wri...@arm.com>
>
>       * lib/target-supports.exp
>       (check_effective_target_arm_v8_2a_i8mm_ok_nocache): New.
>       (check_effective_target_arm_v8_2a_i8mm_ok): New.
>       (add_options_for_arm_v8_2a_i8mm): New.
>       (check_effective_target_arm_v8_2a_bf16_neon_ok_nocache): New.
>       (check_effective_target_arm_v8_2a_bf16_neon_ok): New.
>       (add_options_for_arm_v8_2a_bf16_neon): New.

The new effective-target keywords need to be documented in
doc/sourcebuild.texi.

LGTM otherwise.  For:

> diff --git a/gcc/testsuite/lib/target-supports.exp 
> b/gcc/testsuite/lib/target-supports.exp
> index 5b4cc02f921..36fb63e9929 100644
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -4781,6 +4781,49 @@ proc add_options_for_arm_v8_2a_dotprod_neon { flags } {
>      return "$flags $et_arm_v8_2a_dotprod_neon_flags"
>  }
>  
> +# Return 1 if the target supports ARMv8.2+i8mm Adv.SIMD Dot Product
> +# instructions, 0 otherwise.  The test is valid for ARM and for AArch64.
> +# Record the command line options needed.
> +
> +proc check_effective_target_arm_v8_2a_i8mm_ok_nocache { } {
> +    global et_arm_v8_2a_i8mm_flags
> +    set et_arm_v8_2a_i8mm_flags ""
> +
> +    if { ![istarget arm*-*-*] && ![istarget aarch64*-*-*] } {
> +        return 0;
> +    }
> +
> +    # Iterate through sets of options to find the compiler flags that
> +    # need to be added to the -march option.
> +    foreach flags {"" "-mfloat-abi=hard -mfpu=neon-fp-armv8" 
> "-mfloat-abi=softfp -mfpu=neon-fp-armv8" } {
> +        if { [check_no_compiler_messages_nocache \
> +                  arm_v8_2a_i8mm_ok object {
> +            #include <arm_neon.h>
> +            #if !defined (__ARM_FEATURE_MATMUL_INT8)
> +            #error "__ARM_FEATURE_MATMUL_INT8 not defined"
> +            #endif
> +        } "$flags -march=armv8.2-a+i8mm"] } {
> +            set et_arm_v8_2a_i8mm_flags "$flags -march=armv8.2-a+i8mm"
> +            return 1
> +        }
> +    }

I wondered whether it would be better to add no options if testing
with something that already supports i8mm (e.g. -march=armv8.6).
That would mean trying:

  "" "-march=armv8.2-a+i8mm" "-march=armv8.2-a+i8mm -mfloat-abi..." ...

instead.  But there are arguments both ways, and the above follows
existing style, so OK.

Thanks,
Richard

Reply via email to