From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1725) id 410043877013; Fri, 25 Jun 2021 16:17:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 410043877013 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: William Schmidt To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/wschmidt/heads/builtins10)] rs6000: Add more type nodes to support builtin processing X-Act-Checkin: gcc X-Git-Author: Bill Schmidt X-Git-Refname: refs/users/wschmidt/heads/builtins10 X-Git-Oldrev: 59d68fe44b9261e130daf93efe1310fe86c59838 X-Git-Newrev: 61b2f91d71d0404cbf41b361f50f1cd836285d85 Message-Id: <20210625161721.410043877013@sourceware.org> Date: Fri, 25 Jun 2021 16:17:21 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2021 16:17:21 -0000 https://gcc.gnu.org/g:61b2f91d71d0404cbf41b361f50f1cd836285d85 commit 61b2f91d71d0404cbf41b361f50f1cd836285d85 Author: Bill Schmidt Date: Thu Jun 10 11:44:52 2021 -0500 rs6000: Add more type nodes to support builtin processing 2021-06-10 Bill Schmidt gcc/ * config/rs6000/rs6000-call.c (rs6000_init_builtins): Initialize various pointer type nodes. * config/rs6000/rs6000.h (rs6000_builtin_type_index): Add enum values for various pointer types. (ptr_V16QI_type_node): New macro. (ptr_V1TI_type_node): New macro. (ptr_V2DI_type_node): New macro. (ptr_V2DF_type_node): New macro. (ptr_V4SI_type_node): New macro. (ptr_V4SF_type_node): New macro. (ptr_V8HI_type_node): New macro. (ptr_unsigned_V16QI_type_node): New macro. (ptr_unsigned_V1TI_type_node): New macro. (ptr_unsigned_V8HI_type_node): New macro. (ptr_unsigned_V4SI_type_node): New macro. (ptr_unsigned_V2DI_type_node): New macro. (ptr_bool_V16QI_type_node): New macro. (ptr_bool_V8HI_type_node): New macro. (ptr_bool_V4SI_type_node): New macro. (ptr_bool_V2DI_type_node): New macro. (ptr_bool_V1TI_type_node): New macro. (ptr_pixel_type_node): New macro. (ptr_intQI_type_node): New macro. (ptr_uintQI_type_node): New macro. (ptr_intHI_type_node): New macro. (ptr_uintHI_type_node): New macro. (ptr_intSI_type_node): New macro. (ptr_uintSI_type_node): New macro. (ptr_intDI_type_node): New macro. (ptr_uintDI_type_node): New macro. (ptr_intTI_type_node): New macro. (ptr_uintTI_type_node): New macro. (ptr_long_integer_type_node): New macro. (ptr_long_unsigned_type_node): New macro. (ptr_float_type_node): New macro. (ptr_double_type_node): New macro. (ptr_long_double_type_node): New macro. (ptr_dfloat64_type_node): New macro. (ptr_dfloat128_type_node): New macro. (ptr_ieee128_type_node): New macro. (ptr_ibm128_type_node): New macro. (ptr_vector_pair_type_node): New macro. (ptr_vector_quad_type_node): New macro. (ptr_long_long_integer_type_node): New macro. (ptr_long_long_unsigned_type_node): New macro. Diff: --- gcc/config/rs6000/rs6000-call.c | 151 ++++++++++++++++++++++++++++++++++++++++ gcc/config/rs6000/rs6000.h | 82 ++++++++++++++++++++++ 2 files changed, 233 insertions(+) diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c index 4651345adde..d9be017ee61 100644 --- a/gcc/config/rs6000/rs6000-call.c +++ b/gcc/config/rs6000/rs6000-call.c @@ -13272,25 +13272,63 @@ rs6000_init_builtins (void) V2DI_type_node = rs6000_vector_type (TARGET_POWERPC64 ? "__vector long" : "__vector long long", long_long_integer_type_node, 2); + ptr_V2DI_type_node + = build_pointer_type (build_qualified_type (V2DI_type_node, + TYPE_QUAL_CONST)); + V2DF_type_node = rs6000_vector_type ("__vector double", double_type_node, 2); + ptr_V2DF_type_node + = build_pointer_type (build_qualified_type (V2DF_type_node, + TYPE_QUAL_CONST)); + V4SI_type_node = rs6000_vector_type ("__vector signed int", intSI_type_node, 4); + ptr_V4SI_type_node + = build_pointer_type (build_qualified_type (V4SI_type_node, + TYPE_QUAL_CONST)); + V4SF_type_node = rs6000_vector_type ("__vector float", float_type_node, 4); + ptr_V4SF_type_node + = build_pointer_type (build_qualified_type (V4SF_type_node, + TYPE_QUAL_CONST)); + V8HI_type_node = rs6000_vector_type ("__vector signed short", intHI_type_node, 8); + ptr_V8HI_type_node + = build_pointer_type (build_qualified_type (V8HI_type_node, + TYPE_QUAL_CONST)); + V16QI_type_node = rs6000_vector_type ("__vector signed char", intQI_type_node, 16); + ptr_V16QI_type_node + = build_pointer_type (build_qualified_type (V16QI_type_node, + TYPE_QUAL_CONST)); unsigned_V16QI_type_node = rs6000_vector_type ("__vector unsigned char", unsigned_intQI_type_node, 16); + ptr_unsigned_V16QI_type_node + = build_pointer_type (build_qualified_type (unsigned_V16QI_type_node, + TYPE_QUAL_CONST)); + unsigned_V8HI_type_node = rs6000_vector_type ("__vector unsigned short", unsigned_intHI_type_node, 8); + ptr_unsigned_V8HI_type_node + = build_pointer_type (build_qualified_type (unsigned_V8HI_type_node, + TYPE_QUAL_CONST)); + unsigned_V4SI_type_node = rs6000_vector_type ("__vector unsigned int", unsigned_intSI_type_node, 4); + ptr_unsigned_V4SI_type_node + = build_pointer_type (build_qualified_type (unsigned_V4SI_type_node, + TYPE_QUAL_CONST)); + unsigned_V2DI_type_node = rs6000_vector_type (TARGET_POWERPC64 ? "__vector unsigned long" : "__vector unsigned long long", long_long_unsigned_type_node, 2); + ptr_unsigned_V2DI_type_node + = build_pointer_type (build_qualified_type (unsigned_V2DI_type_node, + TYPE_QUAL_CONST)); opaque_V4SI_type_node = build_opaque_vector_type (intSI_type_node, 4); @@ -13304,9 +13342,15 @@ rs6000_init_builtins (void) { V1TI_type_node = rs6000_vector_type ("__vector __int128", intTI_type_node, 1); + ptr_V1TI_type_node + = build_pointer_type (build_qualified_type (V1TI_type_node, + TYPE_QUAL_CONST)); unsigned_V1TI_type_node = rs6000_vector_type ("__vector unsigned __int128", unsigned_intTI_type_node, 1); + ptr_unsigned_V1TI_type_node + = build_pointer_type (build_qualified_type (unsigned_V1TI_type_node, + TYPE_QUAL_CONST)); } /* The 'vector bool ...' types must be kept distinct from 'vector unsigned ...' @@ -13340,6 +13384,78 @@ rs6000_init_builtins (void) dfloat128_type_internal_node = dfloat128_type_node; void_type_internal_node = void_type_node; + ptr_intQI_type_node + = build_pointer_type (build_qualified_type (intQI_type_internal_node, + TYPE_QUAL_CONST)); + ptr_uintQI_type_node + = build_pointer_type (build_qualified_type (uintQI_type_internal_node, + TYPE_QUAL_CONST)); + ptr_intHI_type_node + = build_pointer_type (build_qualified_type (intHI_type_internal_node, + TYPE_QUAL_CONST)); + ptr_uintHI_type_node + = build_pointer_type (build_qualified_type (uintHI_type_internal_node, + TYPE_QUAL_CONST)); + ptr_intSI_type_node + = build_pointer_type (build_qualified_type (intSI_type_internal_node, + TYPE_QUAL_CONST)); + ptr_uintSI_type_node + = build_pointer_type (build_qualified_type (uintSI_type_internal_node, + TYPE_QUAL_CONST)); + ptr_intDI_type_node + = build_pointer_type (build_qualified_type (intDI_type_internal_node, + TYPE_QUAL_CONST)); + ptr_uintDI_type_node + = build_pointer_type (build_qualified_type (uintDI_type_internal_node, + TYPE_QUAL_CONST)); + ptr_intTI_type_node + = build_pointer_type (build_qualified_type (intTI_type_internal_node, + TYPE_QUAL_CONST)); + ptr_uintTI_type_node + = build_pointer_type (build_qualified_type (uintTI_type_internal_node, + TYPE_QUAL_CONST)); + ptr_long_integer_type_node + = build_pointer_type + (build_qualified_type (long_integer_type_internal_node, + TYPE_QUAL_CONST)); + + ptr_long_unsigned_type_node + = build_pointer_type + (build_qualified_type (long_unsigned_type_internal_node, + TYPE_QUAL_CONST)); + + ptr_float_type_node + = build_pointer_type (build_qualified_type (float_type_internal_node, + TYPE_QUAL_CONST)); + ptr_double_type_node + = build_pointer_type (build_qualified_type (double_type_internal_node, + TYPE_QUAL_CONST)); + ptr_long_double_type_node + = build_pointer_type (build_qualified_type (long_double_type_internal_node, + TYPE_QUAL_CONST)); + if (dfloat64_type_node) + ptr_dfloat64_type_node + = build_pointer_type (build_qualified_type (dfloat64_type_internal_node, + TYPE_QUAL_CONST)); + else + ptr_dfloat64_type_node = NULL; + + if (dfloat128_type_node) + ptr_dfloat128_type_node + = build_pointer_type (build_qualified_type (dfloat128_type_internal_node, + TYPE_QUAL_CONST)); + else + ptr_dfloat128_type_node = NULL; + + ptr_long_long_integer_type_node + = build_pointer_type + (build_qualified_type (long_long_integer_type_internal_node, + TYPE_QUAL_CONST)); + ptr_long_long_unsigned_type_node + = build_pointer_type + (build_qualified_type (long_long_unsigned_type_internal_node, + TYPE_QUAL_CONST)); + /* 128-bit floating point support. KFmode is IEEE 128-bit floating point. IFmode is the IBM extended 128-bit format that is a pair of doubles. TFmode will be either IEEE 128-bit floating point or the IBM double-double @@ -13367,6 +13483,9 @@ rs6000_init_builtins (void) SET_TYPE_MODE (ibm128_float_type_node, IFmode); layout_type (ibm128_float_type_node); } + ptr_ibm128_float_type_node + = build_pointer_type (build_qualified_type (ibm128_float_type_node, + TYPE_QUAL_CONST)); lang_hooks.types.register_builtin_type (ibm128_float_type_node, "__ibm128"); @@ -13375,6 +13494,9 @@ rs6000_init_builtins (void) ieee128_float_type_node = long_double_type_node; else ieee128_float_type_node = float128_type_node; + ptr_ieee128_float_type_node + = build_pointer_type (build_qualified_type (ieee128_float_type_node, + TYPE_QUAL_CONST)); lang_hooks.types.register_builtin_type (ieee128_float_type_node, "__ieee128"); @@ -13395,6 +13517,9 @@ rs6000_init_builtins (void) TYPE_USER_ALIGN (vector_pair_type_node) = 0; lang_hooks.types.register_builtin_type (vector_pair_type_node, "__vector_pair"); + ptr_vector_pair_type_node + = build_pointer_type (build_qualified_type (vector_pair_type_node, + TYPE_QUAL_CONST)); vector_quad_type_node = make_node (OPAQUE_TYPE); SET_TYPE_MODE (vector_quad_type_node, XOmode); @@ -13405,6 +13530,9 @@ rs6000_init_builtins (void) TYPE_USER_ALIGN (vector_quad_type_node) = 0; lang_hooks.types.register_builtin_type (vector_quad_type_node, "__vector_quad"); + ptr_vector_quad_type_node + = build_pointer_type (build_qualified_type (vector_quad_type_node, + TYPE_QUAL_CONST)); } /* Initialize the modes for builtin_function_type, mapping a machine mode to @@ -13455,18 +13583,41 @@ rs6000_init_builtins (void) bool_V16QI_type_node = rs6000_vector_type ("__vector __bool char", bool_char_type_node, 16); + ptr_bool_V16QI_type_node + = build_pointer_type (build_qualified_type (bool_V16QI_type_node, + TYPE_QUAL_CONST)); + bool_V8HI_type_node = rs6000_vector_type ("__vector __bool short", bool_short_type_node, 8); + ptr_bool_V8HI_type_node + = build_pointer_type (build_qualified_type (bool_V8HI_type_node, + TYPE_QUAL_CONST)); + bool_V4SI_type_node = rs6000_vector_type ("__vector __bool int", bool_int_type_node, 4); + ptr_bool_V4SI_type_node + = build_pointer_type (build_qualified_type (bool_V4SI_type_node, + TYPE_QUAL_CONST)); + bool_V2DI_type_node = rs6000_vector_type (TARGET_POWERPC64 ? "__vector __bool long" : "__vector __bool long long", bool_long_long_type_node, 2); + ptr_bool_V2DI_type_node + = build_pointer_type (build_qualified_type (bool_V2DI_type_node, + TYPE_QUAL_CONST)); + bool_V1TI_type_node = rs6000_vector_type ("__vector __bool __int128", intTI_type_node, 1); + ptr_bool_V1TI_type_node + = build_pointer_type (build_qualified_type (bool_V1TI_type_node, + TYPE_QUAL_CONST)); + pixel_V8HI_type_node = rs6000_vector_type ("__vector __pixel", pixel_type_node, 8); + ptr_pixel_V8HI_type_node + = build_pointer_type (build_qualified_type (pixel_V8HI_type_node, + TYPE_QUAL_CONST)); pcvoid_type_node = build_pointer_type (build_qualified_type (void_type_node, TYPE_QUAL_CONST)); diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index c5d20d240f2..3eba1c072cf 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -2461,6 +2461,47 @@ enum rs6000_builtin_type_index RS6000_BTI_vector_pair, /* unsigned 256-bit types (vector pair). */ RS6000_BTI_vector_quad, /* unsigned 512-bit types (vector quad). */ RS6000_BTI_const_ptr_void, /* const pointer to void */ + RS6000_BTI_ptr_V16QI, + RS6000_BTI_ptr_V1TI, + RS6000_BTI_ptr_V2DI, + RS6000_BTI_ptr_V2DF, + RS6000_BTI_ptr_V4SI, + RS6000_BTI_ptr_V4SF, + RS6000_BTI_ptr_V8HI, + RS6000_BTI_ptr_unsigned_V16QI, + RS6000_BTI_ptr_unsigned_V1TI, + RS6000_BTI_ptr_unsigned_V8HI, + RS6000_BTI_ptr_unsigned_V4SI, + RS6000_BTI_ptr_unsigned_V2DI, + RS6000_BTI_ptr_bool_V16QI, + RS6000_BTI_ptr_bool_V8HI, + RS6000_BTI_ptr_bool_V4SI, + RS6000_BTI_ptr_bool_V2DI, + RS6000_BTI_ptr_bool_V1TI, + RS6000_BTI_ptr_pixel_V8HI, + RS6000_BTI_ptr_INTQI, + RS6000_BTI_ptr_UINTQI, + RS6000_BTI_ptr_INTHI, + RS6000_BTI_ptr_UINTHI, + RS6000_BTI_ptr_INTSI, + RS6000_BTI_ptr_UINTSI, + RS6000_BTI_ptr_INTDI, + RS6000_BTI_ptr_UINTDI, + RS6000_BTI_ptr_INTTI, + RS6000_BTI_ptr_UINTTI, + RS6000_BTI_ptr_long_integer, + RS6000_BTI_ptr_long_unsigned, + RS6000_BTI_ptr_float, + RS6000_BTI_ptr_double, + RS6000_BTI_ptr_long_double, + RS6000_BTI_ptr_dfloat64, + RS6000_BTI_ptr_dfloat128, + RS6000_BTI_ptr_ieee128_float, + RS6000_BTI_ptr_ibm128_float, + RS6000_BTI_ptr_vector_pair, + RS6000_BTI_ptr_vector_quad, + RS6000_BTI_ptr_long_long, + RS6000_BTI_ptr_long_long_unsigned, RS6000_BTI_MAX }; @@ -2517,6 +2558,47 @@ enum rs6000_builtin_type_index #define vector_pair_type_node (rs6000_builtin_types[RS6000_BTI_vector_pair]) #define vector_quad_type_node (rs6000_builtin_types[RS6000_BTI_vector_quad]) #define pcvoid_type_node (rs6000_builtin_types[RS6000_BTI_const_ptr_void]) +#define ptr_V16QI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_V16QI]) +#define ptr_V1TI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_V1TI]) +#define ptr_V2DI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_V2DI]) +#define ptr_V2DF_type_node (rs6000_builtin_types[RS6000_BTI_ptr_V2DF]) +#define ptr_V4SI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_V4SI]) +#define ptr_V4SF_type_node (rs6000_builtin_types[RS6000_BTI_ptr_V4SF]) +#define ptr_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_V8HI]) +#define ptr_unsigned_V16QI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_unsigned_V16QI]) +#define ptr_unsigned_V1TI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_unsigned_V1TI]) +#define ptr_unsigned_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_unsigned_V8HI]) +#define ptr_unsigned_V4SI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_unsigned_V4SI]) +#define ptr_unsigned_V2DI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_unsigned_V2DI]) +#define ptr_bool_V16QI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_bool_V16QI]) +#define ptr_bool_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_bool_V8HI]) +#define ptr_bool_V4SI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_bool_V4SI]) +#define ptr_bool_V2DI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_bool_V2DI]) +#define ptr_bool_V1TI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_bool_V1TI]) +#define ptr_pixel_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_pixel_V8HI]) +#define ptr_intQI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_INTQI]) +#define ptr_uintQI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_UINTQI]) +#define ptr_intHI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_INTHI]) +#define ptr_uintHI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_UINTHI]) +#define ptr_intSI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_INTSI]) +#define ptr_uintSI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_UINTSI]) +#define ptr_intDI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_INTDI]) +#define ptr_uintDI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_UINTDI]) +#define ptr_intTI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_INTTI]) +#define ptr_uintTI_type_node (rs6000_builtin_types[RS6000_BTI_ptr_UINTTI]) +#define ptr_long_integer_type_node (rs6000_builtin_types[RS6000_BTI_ptr_long_integer]) +#define ptr_long_unsigned_type_node (rs6000_builtin_types[RS6000_BTI_ptr_long_unsigned]) +#define ptr_float_type_node (rs6000_builtin_types[RS6000_BTI_ptr_float]) +#define ptr_double_type_node (rs6000_builtin_types[RS6000_BTI_ptr_double]) +#define ptr_long_double_type_node (rs6000_builtin_types[RS6000_BTI_ptr_long_double]) +#define ptr_dfloat64_type_node (rs6000_builtin_types[RS6000_BTI_ptr_dfloat64]) +#define ptr_dfloat128_type_node (rs6000_builtin_types[RS6000_BTI_ptr_dfloat128]) +#define ptr_ieee128_float_type_node (rs6000_builtin_types[RS6000_BTI_ptr_ieee128_float]) +#define ptr_ibm128_float_type_node (rs6000_builtin_types[RS6000_BTI_ptr_ibm128_float]) +#define ptr_vector_pair_type_node (rs6000_builtin_types[RS6000_BTI_ptr_vector_pair]) +#define ptr_vector_quad_type_node (rs6000_builtin_types[RS6000_BTI_ptr_vector_quad]) +#define ptr_long_long_integer_type_node (rs6000_builtin_types[RS6000_BTI_ptr_long_long]) +#define ptr_long_long_unsigned_type_node (rs6000_builtin_types[RS6000_BTI_ptr_long_long_unsigned]) extern GTY(()) tree rs6000_builtin_types[RS6000_BTI_MAX]; extern GTY(()) tree rs6000_builtin_decls[RS6000_BUILTIN_COUNT];