From 1c43ee69f4f6148fff4b5ace80d709d7f8b250d7 Mon Sep 17 00:00:00 2001 From: Delia Burduv Date: Wed, 11 Mar 2020 18:01:26 +0000 Subject: [PATCH] Bug fix: cannot convert 'const short int*' to 'const __bf16*' This patch fixes a bug introduced by my earlier patch ( https://gcc.gnu.org/pipermail/gcc-patches/2020-March/541680.html ). It introduces a new scalar builtin type that was missing in the original patch. Bootstrapped cleanly on arm-none-linux-gnueabihf. Tested for regression on arm-none-linux-gnueabihf. No regression from before the original patch. Tests that failed or became unsupported because of the original tests now work as they did before it. * config/arm/arm-builtins.c (arm_init_simd_builtin_scalar_types): New. * config/arm/arm_neon.h (vld2_bf16): Used new builtin type. (vld2q_bf16): Used new builtin type. (vld3_bf16): Used new builtin type. (vld3q_bf16): Used new builtin type. (vld4_bf16): Used new builtin type. (vld4q_bf16): Used new builtin type. (vld2_dup_bf16): Used new builtin type. (vld2q_dup_bf16): Used new builtin type. (vld3_dup_bf16): Used new builtin type. (vld3q_dup_bf16): Used new builtin type. (vld4_dup_bf16): Used new builtin type. (vld4q_dup_bf16): Used new builtin type. --- gcc/ChangeLog | 17 +++++++++++++++++ gcc/config/arm/arm-builtins.c | 4 +++- gcc/config/arm/arm_neon.h | 24 ++++++++++++------------ 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 818cf19..dfc9b8e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2020-03-11 Delia Burduv + + * config/arm/arm-builtins.c + (arm_init_simd_builtin_scalar_types): New. + * config/arm/arm_neon.h (vld2_bf16): Used new builtin type. + (vld2q_bf16): Used new builtin type. + (vld3_bf16): Used new builtin type. + (vld3q_bf16): Used new builtin type. + (vld4_bf16): Used new builtin type. + (vld4q_bf16): Used new builtin type. + (vld2_dup_bf16): Used new builtin type. + (vld2q_dup_bf16): Used new builtin type. + (vld3_dup_bf16): Used new builtin type. + (vld3q_dup_bf16): Used new builtin type. + (vld4_dup_bf16): Used new builtin type. + (vld4q_dup_bf16): Used new builtin type. + 2020-03-11 Jakub Jelinek PR target/94134 diff --git a/gcc/config/arm/arm-builtins.c b/gcc/config/arm/arm-builtins.c index e0561c5..1f55898 100644 --- a/gcc/config/arm/arm-builtins.c +++ b/gcc/config/arm/arm-builtins.c @@ -784,6 +784,7 @@ const char *arm_scalar_builtin_types[] = { "__builtin_neon_oi", "__builtin_neon_ci", "__builtin_neon_xi", + "__builtin_neon_bf", NULL }; @@ -1101,7 +1102,8 @@ arm_init_simd_builtin_scalar_types (void) "__builtin_neon_df"); (*lang_hooks.types.register_builtin_type) (intTI_type_node, "__builtin_neon_ti"); - + (*lang_hooks.types.register_builtin_type) (arm_bf16_type_node, + "__builtin_neon_bf"); /* Unsigned integer types for various mode sizes. */ (*lang_hooks.types.register_builtin_type) (unsigned_intQI_type_node, "__builtin_neon_uqi"); diff --git a/gcc/config/arm/arm_neon.h b/gcc/config/arm/arm_neon.h index f5ccf18..aa21730 100644 --- a/gcc/config/arm/arm_neon.h +++ b/gcc/config/arm/arm_neon.h @@ -19562,7 +19562,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld2_bf16 (bfloat16_t const * __ptr) { union { bfloat16x4x2_t __i; __builtin_neon_ti __o; } __rv; - __rv.__o = __builtin_neon_vld2v4bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld2v4bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } @@ -19571,7 +19571,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld2q_bf16 (const bfloat16_t * __ptr) { union { bfloat16x8x2_t __i; __builtin_neon_oi __o; } __rv; - __rv.__o = __builtin_neon_vld2v8bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld2v8bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } @@ -19580,7 +19580,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld3_bf16 (const bfloat16_t * __ptr) { union { bfloat16x4x3_t __i; __builtin_neon_ei __o; } __rv; - __rv.__o = __builtin_neon_vld3v4bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld3v4bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } @@ -19589,7 +19589,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld3q_bf16 (const bfloat16_t * __ptr) { union { bfloat16x8x3_t __i; __builtin_neon_ci __o; } __rv; - __rv.__o = __builtin_neon_vld3v8bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld3v8bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } @@ -19598,7 +19598,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld4_bf16 (const bfloat16_t * __ptr) { union { bfloat16x4x4_t __i; __builtin_neon_oi __o; } __rv; - __rv.__o = __builtin_neon_vld4v4bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld4v4bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } @@ -19607,7 +19607,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld4q_bf16 (const bfloat16_t * __ptr) { union { bfloat16x8x4_t __i; __builtin_neon_xi __o; } __rv; - __rv.__o = __builtin_neon_vld4v8bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld4v8bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } @@ -19616,7 +19616,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld2_dup_bf16 (const bfloat16_t * __ptr) { union { bfloat16x4x2_t __i; __builtin_neon_ti __o; } __rv; - __rv.__o = __builtin_neon_vld2_dupv4bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld2_dupv4bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } @@ -19625,7 +19625,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld2q_dup_bf16 (const bfloat16_t * __ptr) { union { bfloat16x8x2_t __i; __builtin_neon_oi __o; } __rv; - __rv.__o = __builtin_neon_vld2_dupv8bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld2_dupv8bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } @@ -19634,7 +19634,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld3_dup_bf16 (const bfloat16_t * __ptr) { union { bfloat16x4x3_t __i; __builtin_neon_ei __o; } __rv; - __rv.__o = __builtin_neon_vld3_dupv4bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld3_dupv4bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } @@ -19643,7 +19643,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld3q_dup_bf16 (const bfloat16_t * __ptr) { union { bfloat16x8x3_t __i; __builtin_neon_ci __o; } __rv; - __rv.__o = __builtin_neon_vld3_dupv8bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld3_dupv8bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } @@ -19652,7 +19652,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld4_dup_bf16 (const bfloat16_t * __ptr) { union { bfloat16x4x4_t __i; __builtin_neon_oi __o; } __rv; - __rv.__o = __builtin_neon_vld4_dupv4bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld4_dupv4bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } @@ -19661,7 +19661,7 @@ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) vld4q_dup_bf16 (const bfloat16_t * __ptr) { union { bfloat16x8x4_t __i; __builtin_neon_xi __o; } __rv; - __rv.__o = __builtin_neon_vld4_dupv8bf ((const __builtin_neon_hi *) __ptr); + __rv.__o = __builtin_neon_vld4_dupv8bf ((const __builtin_neon_bf *) __ptr); return __rv.__i; } -- 2.7.4