On Wed, Jan 10, 2024 at 04:55:00PM +0000, Tamar Christina wrote:
>       PR tree-optimization/113287
>       * gcc.dg/vect/vect-early-break_100-pr113287.c: Support non-bitint.

This part is ok.

> --- a/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
> +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_99-pr113287.c
> @@ -1,9 +1,18 @@
>  /* { dg-add-options vect_early_break } */
>  /* { dg-require-effective-target vect_early_break } */
> -/* { dg-require-effective-target vect_int } */
> -/* { dg-require-effective-target bitint } */
> +/* { dg-require-effective-target vect_long_long } */
>  
> -_BitInt(998) b;
> +/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */
> +
> +#if __BITINT_MAXWIDTH__ >= 9020
> +typedef _BitInt(9020) B9020;
> +typedef _BitInt(998) B998;
> +#else
> +typedef long long B998;
> +typedef long long B9020;
> +#endif
> +
> +B998 b;
>  char c;
>  char d;
>  char e;
> @@ -14,7 +23,7 @@ char i;
>  char j;
>  
>  void
> -foo(char y, _BitInt(9020) a, char *r)
> +foo(char y, B9020 a, char *r)
>  {
>    char x = __builtin_mul_overflow_p(a << sizeof(a), y, 0);

But I'm afraid I have no idea how is this supposed to work on
non-bitint targets or where __BITINT_MAXWIDTH__ is smaller than 9020.
There is no loop at all there, so what should be vectorized?

I'd say introduce 
# Return 1 if the target supports _BitInt(65535), 0 otherwise.

proc check_effective_target_bitint65535 { } {
    return [check_no_compiler_messages bitint65535 object {
        _BitInt (2) a = 1wb;
        unsigned _BitInt (65535) b = 0uwb;
    } "-std=c23"]
}

after bitint575 effective target and use it in the test.

        Jakub

Reply via email to