public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Initial debug support for comparing builtins
@ 2020-11-02 22:08 William Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: William Schmidt @ 2020-11-02 22:08 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:2c9d870a3e38544ee33cef99f20dd188970da835

commit 2c9d870a3e38544ee33cef99f20dd188970da835
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Mon Nov 2 11:33:42 2020 -0500

    rs6000: Initial debug support for comparing builtins
    
    2020-11-02  Bill Schmidt  <wschmidt@linux.ibm.com>
    
            * config/rs6000/rs6000-call.c (rs6000_debug_type): New function.
            (def_builtin): Change format of debug output.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 122 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 118 insertions(+), 4 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 12ff8a4bb92..16f209dcd95 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -8950,6 +8950,102 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
 
 /* Builtins.  */
 
+/* Debug utility to translate a type node to a single token.  */
+static
+const char *rs6000_debug_type (tree type)
+{
+  if (type == void_type_node)
+    return "void";
+  else if (type == long_integer_type_node)
+    return "long";
+  else if (type == long_unsigned_type_node)
+    return "ulong";
+  else if (type == bool_V16QI_type_node)
+    return "vbc";
+  else if (type == bool_V2DI_type_node)
+    return "vbll";
+  else if (type == bool_V4SI_type_node)
+    return "vbi";
+  else if (type == bool_V8HI_type_node)
+    return "vbs";
+  else if (type == bool_int_type_node)
+    return "bool";
+  else if (type == dfloat64_type_node)
+    return "_Decimal64";
+  else if (type == double_type_node)
+    return "double";
+  else if (type == intDI_type_node)
+    return "sll";
+  else if (type == intHI_type_node)
+    return "ss";
+  else if (type == ibm128_float_type_node)
+    return "__ibm128";
+  else if (type == opaque_V4SI_type_node)
+    return "opaque";
+  else if (POINTER_TYPE_P (type))
+    return "void*";
+  else if (type == intQI_type_node || type == char_type_node)
+    return "sc";
+  else if (type == dfloat32_type_node)
+    return "_Decimal32";
+  else if (type == float_type_node)
+    return "float";
+  else if (type == intSI_type_node || type == integer_type_node)
+    return "si";
+  else if (type == dfloat128_type_node)
+    return "_Decimal128";
+  else if (type == long_double_type_node)
+    return "longdouble";
+  else if (type == intTI_type_node)
+    return "sq";
+  else if (type == unsigned_intDI_type_node)
+    return "ull";
+  else if (type == unsigned_intHI_type_node)
+    return "us";
+  else if (type == unsigned_intQI_type_node)
+    return "uc";
+  else if (type == unsigned_intSI_type_node)
+    return "ui";
+  else if (type == unsigned_intTI_type_node)
+    return "uq";
+  else if (type == unsigned_V16QI_type_node)
+    return "vuc";
+  else if (type == unsigned_V1TI_type_node)
+    return "vuq";
+  else if (type == unsigned_V2DI_type_node)
+    return "vull";
+  else if (type == unsigned_V4SI_type_node)
+    return "vui";
+  else if (type == unsigned_V8HI_type_node)
+    return "vus";
+  else if (type == V16QI_type_node)
+    return "vsc";
+  else if (type == V1TI_type_node)
+    return "vsq";
+  else if (type == V2DF_type_node)
+    return "vd";
+  else if (type == V2DI_type_node)
+    return "vsll";
+  else if (type == V4SF_type_node)
+    return "vf";
+  else if (type == V4SI_type_node)
+    return "vsi";
+  else if (type == V8HI_type_node)
+    return "vss";
+  else if (type == pixel_V8HI_type_node)
+    return "vp";
+  else if (type == pcvoid_type_node)
+    return "voidc*";
+  else if (type == float128_type_node)
+    return "_Float128";
+  else if (type == vector_pair_type_node)
+    return "__vector_pair";
+  else if (type == vector_quad_type_node)
+    return "__vector_quad";
+  else
+    return "unknown";
+}
+
 static void
 def_builtin (const char *name, tree type, enum rs6000_builtins code)
 {
@@ -8978,7 +9074,7 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
       /* const function, function only depends on the inputs.  */
       TREE_READONLY (t) = 1;
       TREE_NOTHROW (t) = 1;
-      attr_string = ", const";
+      attr_string = "= const";
     }
   else if ((classify & RS6000_BTC_PURE) != 0)
     {
@@ -8986,7 +9082,7 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
 	 external state.  */
       DECL_PURE_P (t) = 1;
       TREE_NOTHROW (t) = 1;
-      attr_string = ", pure";
+      attr_string = "= pure";
     }
   else if ((classify & RS6000_BTC_FP) != 0)
     {
@@ -9000,12 +9096,12 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
 	{
 	  DECL_PURE_P (t) = 1;
 	  DECL_IS_NOVOPS (t) = 1;
-	  attr_string = ", fp, pure";
+	  attr_string = "= fp, pure";
 	}
       else
 	{
 	  TREE_READONLY (t) = 1;
-	  attr_string = ", fp, const";
+	  attr_string = "= fp, const";
 	}
     }
   else if ((classify & (RS6000_BTC_QUAD | RS6000_BTC_PAIR)) != 0)
@@ -9014,9 +9110,27 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
   else if ((classify & RS6000_BTC_ATTR_MASK) != 0)
     gcc_unreachable ();
 
+  if (TARGET_DEBUG_BUILTIN)
+    {
+      tree t = TREE_TYPE (type);
+      fprintf (stderr, "%s %s (", rs6000_debug_type (t), name);
+      t = TYPE_ARG_TYPES (type);
+      while (t && TREE_VALUE (t) != void_type_node)
+	{
+	  fprintf (stderr, "%s",
+		   rs6000_debug_type (TREE_VALUE (t)));
+	  t = TREE_CHAIN (t);
+	  if (t && TREE_VALUE (t) != void_type_node)
+	    fprintf (stderr, ", ");
+	}
+      fprintf (stderr, "); %s [%4d]\n", attr_string, (int)code);
+    }
+
+  /*
   if (TARGET_DEBUG_BUILTIN)
     fprintf (stderr, "rs6000_builtin, code = %4d, %s%s\n",
 	     (int)code, name, attr_string);
+  */
 }
 
 /* Simple ternary operations: VECd = foo (VECa, VECb, VECc).  */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Initial debug support for comparing builtins
@ 2021-02-07 18:14 William Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: William Schmidt @ 2021-02-07 18:14 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:dc859c246ee6635eaf7f30e7ec39a02ab751e9c2

commit dc859c246ee6635eaf7f30e7ec39a02ab751e9c2
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Mon Nov 2 11:33:42 2020 -0500

    rs6000: Initial debug support for comparing builtins
    
    2020-11-02  Bill Schmidt  <wschmidt@linux.ibm.com>
    
            * config/rs6000/rs6000-call.c (rs6000_debug_type): New function.
            (def_builtin): Change format of debug output.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 122 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 118 insertions(+), 4 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 5921c674439..7a922289d57 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -9065,6 +9065,102 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
 
 /* Builtins.  */
 
+/* Debug utility to translate a type node to a single token.  */
+static
+const char *rs6000_debug_type (tree type)
+{
+  if (type == void_type_node)
+    return "void";
+  else if (type == long_integer_type_node)
+    return "long";
+  else if (type == long_unsigned_type_node)
+    return "ulong";
+  else if (type == bool_V16QI_type_node)
+    return "vbc";
+  else if (type == bool_V2DI_type_node)
+    return "vbll";
+  else if (type == bool_V4SI_type_node)
+    return "vbi";
+  else if (type == bool_V8HI_type_node)
+    return "vbs";
+  else if (type == bool_int_type_node)
+    return "bool";
+  else if (type == dfloat64_type_node)
+    return "_Decimal64";
+  else if (type == double_type_node)
+    return "double";
+  else if (type == intDI_type_node)
+    return "sll";
+  else if (type == intHI_type_node)
+    return "ss";
+  else if (type == ibm128_float_type_node)
+    return "__ibm128";
+  else if (type == opaque_V4SI_type_node)
+    return "opaque";
+  else if (POINTER_TYPE_P (type))
+    return "void*";
+  else if (type == intQI_type_node || type == char_type_node)
+    return "sc";
+  else if (type == dfloat32_type_node)
+    return "_Decimal32";
+  else if (type == float_type_node)
+    return "float";
+  else if (type == intSI_type_node || type == integer_type_node)
+    return "si";
+  else if (type == dfloat128_type_node)
+    return "_Decimal128";
+  else if (type == long_double_type_node)
+    return "longdouble";
+  else if (type == intTI_type_node)
+    return "sq";
+  else if (type == unsigned_intDI_type_node)
+    return "ull";
+  else if (type == unsigned_intHI_type_node)
+    return "us";
+  else if (type == unsigned_intQI_type_node)
+    return "uc";
+  else if (type == unsigned_intSI_type_node)
+    return "ui";
+  else if (type == unsigned_intTI_type_node)
+    return "uq";
+  else if (type == unsigned_V16QI_type_node)
+    return "vuc";
+  else if (type == unsigned_V1TI_type_node)
+    return "vuq";
+  else if (type == unsigned_V2DI_type_node)
+    return "vull";
+  else if (type == unsigned_V4SI_type_node)
+    return "vui";
+  else if (type == unsigned_V8HI_type_node)
+    return "vus";
+  else if (type == V16QI_type_node)
+    return "vsc";
+  else if (type == V1TI_type_node)
+    return "vsq";
+  else if (type == V2DF_type_node)
+    return "vd";
+  else if (type == V2DI_type_node)
+    return "vsll";
+  else if (type == V4SF_type_node)
+    return "vf";
+  else if (type == V4SI_type_node)
+    return "vsi";
+  else if (type == V8HI_type_node)
+    return "vss";
+  else if (type == pixel_V8HI_type_node)
+    return "vp";
+  else if (type == pcvoid_type_node)
+    return "voidc*";
+  else if (type == float128_type_node)
+    return "_Float128";
+  else if (type == vector_pair_type_node)
+    return "__vector_pair";
+  else if (type == vector_quad_type_node)
+    return "__vector_quad";
+  else
+    return "unknown";
+}
+
 static void
 def_builtin (const char *name, tree type, enum rs6000_builtins code)
 {
@@ -9093,7 +9189,7 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
       /* const function, function only depends on the inputs.  */
       TREE_READONLY (t) = 1;
       TREE_NOTHROW (t) = 1;
-      attr_string = ", const";
+      attr_string = "= const";
     }
   else if ((classify & RS6000_BTC_PURE) != 0)
     {
@@ -9101,7 +9197,7 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
 	 external state.  */
       DECL_PURE_P (t) = 1;
       TREE_NOTHROW (t) = 1;
-      attr_string = ", pure";
+      attr_string = "= pure";
     }
   else if ((classify & RS6000_BTC_FP) != 0)
     {
@@ -9115,12 +9211,12 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
 	{
 	  DECL_PURE_P (t) = 1;
 	  DECL_IS_NOVOPS (t) = 1;
-	  attr_string = ", fp, pure";
+	  attr_string = "= fp, pure";
 	}
       else
 	{
 	  TREE_READONLY (t) = 1;
-	  attr_string = ", fp, const";
+	  attr_string = "= fp, const";
 	}
     }
   else if ((classify & (RS6000_BTC_QUAD | RS6000_BTC_PAIR)) != 0)
@@ -9129,9 +9225,27 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
   else if ((classify & RS6000_BTC_ATTR_MASK) != 0)
     gcc_unreachable ();
 
+  if (TARGET_DEBUG_BUILTIN)
+    {
+      tree t = TREE_TYPE (type);
+      fprintf (stderr, "%s %s (", rs6000_debug_type (t), name);
+      t = TYPE_ARG_TYPES (type);
+      while (t && TREE_VALUE (t) != void_type_node)
+	{
+	  fprintf (stderr, "%s",
+		   rs6000_debug_type (TREE_VALUE (t)));
+	  t = TREE_CHAIN (t);
+	  if (t && TREE_VALUE (t) != void_type_node)
+	    fprintf (stderr, ", ");
+	}
+      fprintf (stderr, "); %s [%4d]\n", attr_string, (int)code);
+    }
+
+  /*
   if (TARGET_DEBUG_BUILTIN)
     fprintf (stderr, "rs6000_builtin, code = %4d, %s%s\n",
 	     (int)code, name, attr_string);
+  */
 }
 
 /* Simple ternary operations: VECd = foo (VECa, VECb, VECc).  */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Initial debug support for comparing builtins
@ 2020-12-16 18:07 William Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: William Schmidt @ 2020-12-16 18:07 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f18ff07bc2cd84be0fcc5feaacdee021f2685bad

commit f18ff07bc2cd84be0fcc5feaacdee021f2685bad
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Mon Nov 2 11:33:42 2020 -0500

    rs6000: Initial debug support for comparing builtins
    
    2020-11-02  Bill Schmidt  <wschmidt@linux.ibm.com>
    
            * config/rs6000/rs6000-call.c (rs6000_debug_type): New function.
            (def_builtin): Change format of debug output.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 122 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 118 insertions(+), 4 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 3ad544dcd7e..d3d5d7c4d5e 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -9020,6 +9020,102 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
 
 /* Builtins.  */
 
+/* Debug utility to translate a type node to a single token.  */
+static
+const char *rs6000_debug_type (tree type)
+{
+  if (type == void_type_node)
+    return "void";
+  else if (type == long_integer_type_node)
+    return "long";
+  else if (type == long_unsigned_type_node)
+    return "ulong";
+  else if (type == bool_V16QI_type_node)
+    return "vbc";
+  else if (type == bool_V2DI_type_node)
+    return "vbll";
+  else if (type == bool_V4SI_type_node)
+    return "vbi";
+  else if (type == bool_V8HI_type_node)
+    return "vbs";
+  else if (type == bool_int_type_node)
+    return "bool";
+  else if (type == dfloat64_type_node)
+    return "_Decimal64";
+  else if (type == double_type_node)
+    return "double";
+  else if (type == intDI_type_node)
+    return "sll";
+  else if (type == intHI_type_node)
+    return "ss";
+  else if (type == ibm128_float_type_node)
+    return "__ibm128";
+  else if (type == opaque_V4SI_type_node)
+    return "opaque";
+  else if (POINTER_TYPE_P (type))
+    return "void*";
+  else if (type == intQI_type_node || type == char_type_node)
+    return "sc";
+  else if (type == dfloat32_type_node)
+    return "_Decimal32";
+  else if (type == float_type_node)
+    return "float";
+  else if (type == intSI_type_node || type == integer_type_node)
+    return "si";
+  else if (type == dfloat128_type_node)
+    return "_Decimal128";
+  else if (type == long_double_type_node)
+    return "longdouble";
+  else if (type == intTI_type_node)
+    return "sq";
+  else if (type == unsigned_intDI_type_node)
+    return "ull";
+  else if (type == unsigned_intHI_type_node)
+    return "us";
+  else if (type == unsigned_intQI_type_node)
+    return "uc";
+  else if (type == unsigned_intSI_type_node)
+    return "ui";
+  else if (type == unsigned_intTI_type_node)
+    return "uq";
+  else if (type == unsigned_V16QI_type_node)
+    return "vuc";
+  else if (type == unsigned_V1TI_type_node)
+    return "vuq";
+  else if (type == unsigned_V2DI_type_node)
+    return "vull";
+  else if (type == unsigned_V4SI_type_node)
+    return "vui";
+  else if (type == unsigned_V8HI_type_node)
+    return "vus";
+  else if (type == V16QI_type_node)
+    return "vsc";
+  else if (type == V1TI_type_node)
+    return "vsq";
+  else if (type == V2DF_type_node)
+    return "vd";
+  else if (type == V2DI_type_node)
+    return "vsll";
+  else if (type == V4SF_type_node)
+    return "vf";
+  else if (type == V4SI_type_node)
+    return "vsi";
+  else if (type == V8HI_type_node)
+    return "vss";
+  else if (type == pixel_V8HI_type_node)
+    return "vp";
+  else if (type == pcvoid_type_node)
+    return "voidc*";
+  else if (type == float128_type_node)
+    return "_Float128";
+  else if (type == vector_pair_type_node)
+    return "__vector_pair";
+  else if (type == vector_quad_type_node)
+    return "__vector_quad";
+  else
+    return "unknown";
+}
+
 static void
 def_builtin (const char *name, tree type, enum rs6000_builtins code)
 {
@@ -9048,7 +9144,7 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
       /* const function, function only depends on the inputs.  */
       TREE_READONLY (t) = 1;
       TREE_NOTHROW (t) = 1;
-      attr_string = ", const";
+      attr_string = "= const";
     }
   else if ((classify & RS6000_BTC_PURE) != 0)
     {
@@ -9056,7 +9152,7 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
 	 external state.  */
       DECL_PURE_P (t) = 1;
       TREE_NOTHROW (t) = 1;
-      attr_string = ", pure";
+      attr_string = "= pure";
     }
   else if ((classify & RS6000_BTC_FP) != 0)
     {
@@ -9070,12 +9166,12 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
 	{
 	  DECL_PURE_P (t) = 1;
 	  DECL_IS_NOVOPS (t) = 1;
-	  attr_string = ", fp, pure";
+	  attr_string = "= fp, pure";
 	}
       else
 	{
 	  TREE_READONLY (t) = 1;
-	  attr_string = ", fp, const";
+	  attr_string = "= fp, const";
 	}
     }
   else if ((classify & (RS6000_BTC_QUAD | RS6000_BTC_PAIR)) != 0)
@@ -9084,9 +9180,27 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
   else if ((classify & RS6000_BTC_ATTR_MASK) != 0)
     gcc_unreachable ();
 
+  if (TARGET_DEBUG_BUILTIN)
+    {
+      tree t = TREE_TYPE (type);
+      fprintf (stderr, "%s %s (", rs6000_debug_type (t), name);
+      t = TYPE_ARG_TYPES (type);
+      while (t && TREE_VALUE (t) != void_type_node)
+	{
+	  fprintf (stderr, "%s",
+		   rs6000_debug_type (TREE_VALUE (t)));
+	  t = TREE_CHAIN (t);
+	  if (t && TREE_VALUE (t) != void_type_node)
+	    fprintf (stderr, ", ");
+	}
+      fprintf (stderr, "); %s [%4d]\n", attr_string, (int)code);
+    }
+
+  /*
   if (TARGET_DEBUG_BUILTIN)
     fprintf (stderr, "rs6000_builtin, code = %4d, %s%s\n",
 	     (int)code, name, attr_string);
+  */
 }
 
 /* Simple ternary operations: VECd = foo (VECa, VECb, VECc).  */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Initial debug support for comparing builtins
@ 2020-11-24 16:45 William Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: William Schmidt @ 2020-11-24 16:45 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d825be093d8b8d476b76ebf0f36383ed4f46e32b

commit d825be093d8b8d476b76ebf0f36383ed4f46e32b
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Mon Nov 2 11:33:42 2020 -0500

    rs6000: Initial debug support for comparing builtins
    
    2020-11-02  Bill Schmidt  <wschmidt@linux.ibm.com>
    
            * config/rs6000/rs6000-call.c (rs6000_debug_type): New function.
            (def_builtin): Change format of debug output.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 122 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 118 insertions(+), 4 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 562f80e191b..5ad2db88d6b 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -9020,6 +9020,102 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
 
 /* Builtins.  */
 
+/* Debug utility to translate a type node to a single token.  */
+static
+const char *rs6000_debug_type (tree type)
+{
+  if (type == void_type_node)
+    return "void";
+  else if (type == long_integer_type_node)
+    return "long";
+  else if (type == long_unsigned_type_node)
+    return "ulong";
+  else if (type == bool_V16QI_type_node)
+    return "vbc";
+  else if (type == bool_V2DI_type_node)
+    return "vbll";
+  else if (type == bool_V4SI_type_node)
+    return "vbi";
+  else if (type == bool_V8HI_type_node)
+    return "vbs";
+  else if (type == bool_int_type_node)
+    return "bool";
+  else if (type == dfloat64_type_node)
+    return "_Decimal64";
+  else if (type == double_type_node)
+    return "double";
+  else if (type == intDI_type_node)
+    return "sll";
+  else if (type == intHI_type_node)
+    return "ss";
+  else if (type == ibm128_float_type_node)
+    return "__ibm128";
+  else if (type == opaque_V4SI_type_node)
+    return "opaque";
+  else if (POINTER_TYPE_P (type))
+    return "void*";
+  else if (type == intQI_type_node || type == char_type_node)
+    return "sc";
+  else if (type == dfloat32_type_node)
+    return "_Decimal32";
+  else if (type == float_type_node)
+    return "float";
+  else if (type == intSI_type_node || type == integer_type_node)
+    return "si";
+  else if (type == dfloat128_type_node)
+    return "_Decimal128";
+  else if (type == long_double_type_node)
+    return "longdouble";
+  else if (type == intTI_type_node)
+    return "sq";
+  else if (type == unsigned_intDI_type_node)
+    return "ull";
+  else if (type == unsigned_intHI_type_node)
+    return "us";
+  else if (type == unsigned_intQI_type_node)
+    return "uc";
+  else if (type == unsigned_intSI_type_node)
+    return "ui";
+  else if (type == unsigned_intTI_type_node)
+    return "uq";
+  else if (type == unsigned_V16QI_type_node)
+    return "vuc";
+  else if (type == unsigned_V1TI_type_node)
+    return "vuq";
+  else if (type == unsigned_V2DI_type_node)
+    return "vull";
+  else if (type == unsigned_V4SI_type_node)
+    return "vui";
+  else if (type == unsigned_V8HI_type_node)
+    return "vus";
+  else if (type == V16QI_type_node)
+    return "vsc";
+  else if (type == V1TI_type_node)
+    return "vsq";
+  else if (type == V2DF_type_node)
+    return "vd";
+  else if (type == V2DI_type_node)
+    return "vsll";
+  else if (type == V4SF_type_node)
+    return "vf";
+  else if (type == V4SI_type_node)
+    return "vsi";
+  else if (type == V8HI_type_node)
+    return "vss";
+  else if (type == pixel_V8HI_type_node)
+    return "vp";
+  else if (type == pcvoid_type_node)
+    return "voidc*";
+  else if (type == float128_type_node)
+    return "_Float128";
+  else if (type == vector_pair_type_node)
+    return "__vector_pair";
+  else if (type == vector_quad_type_node)
+    return "__vector_quad";
+  else
+    return "unknown";
+}
+
 static void
 def_builtin (const char *name, tree type, enum rs6000_builtins code)
 {
@@ -9048,7 +9144,7 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
       /* const function, function only depends on the inputs.  */
       TREE_READONLY (t) = 1;
       TREE_NOTHROW (t) = 1;
-      attr_string = ", const";
+      attr_string = "= const";
     }
   else if ((classify & RS6000_BTC_PURE) != 0)
     {
@@ -9056,7 +9152,7 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
 	 external state.  */
       DECL_PURE_P (t) = 1;
       TREE_NOTHROW (t) = 1;
-      attr_string = ", pure";
+      attr_string = "= pure";
     }
   else if ((classify & RS6000_BTC_FP) != 0)
     {
@@ -9070,12 +9166,12 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
 	{
 	  DECL_PURE_P (t) = 1;
 	  DECL_IS_NOVOPS (t) = 1;
-	  attr_string = ", fp, pure";
+	  attr_string = "= fp, pure";
 	}
       else
 	{
 	  TREE_READONLY (t) = 1;
-	  attr_string = ", fp, const";
+	  attr_string = "= fp, const";
 	}
     }
   else if ((classify & (RS6000_BTC_QUAD | RS6000_BTC_PAIR)) != 0)
@@ -9084,9 +9180,27 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
   else if ((classify & RS6000_BTC_ATTR_MASK) != 0)
     gcc_unreachable ();
 
+  if (TARGET_DEBUG_BUILTIN)
+    {
+      tree t = TREE_TYPE (type);
+      fprintf (stderr, "%s %s (", rs6000_debug_type (t), name);
+      t = TYPE_ARG_TYPES (type);
+      while (t && TREE_VALUE (t) != void_type_node)
+	{
+	  fprintf (stderr, "%s",
+		   rs6000_debug_type (TREE_VALUE (t)));
+	  t = TREE_CHAIN (t);
+	  if (t && TREE_VALUE (t) != void_type_node)
+	    fprintf (stderr, ", ");
+	}
+      fprintf (stderr, "); %s [%4d]\n", attr_string, (int)code);
+    }
+
+  /*
   if (TARGET_DEBUG_BUILTIN)
     fprintf (stderr, "rs6000_builtin, code = %4d, %s%s\n",
 	     (int)code, name, attr_string);
+  */
 }
 
 /* Simple ternary operations: VECd = foo (VECa, VECb, VECc).  */


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Initial debug support for comparing builtins
@ 2020-11-02 16:34 William Schmidt
  0 siblings, 0 replies; 5+ messages in thread
From: William Schmidt @ 2020-11-02 16:34 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6c5fc0f971bb4bb1b294019c8b5cbd2f3f011dcf

commit 6c5fc0f971bb4bb1b294019c8b5cbd2f3f011dcf
Author: Bill Schmidt <wschmidt@linux.ibm.com>
Date:   Mon Nov 2 11:33:42 2020 -0500

    rs6000: Initial debug support for comparing builtins
    
    2020-11-02  Bill Schmidt  <wschmidt@linux.ibm.com>
    
            * config/rs6000/rs6000-call.c (rs6000_debug_type): New function.
            (def_builtin): Change format of debug output.

Diff:
---
 gcc/config/rs6000/rs6000-call.c | 122 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 118 insertions(+), 4 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
index 1001cc1e1e7..67fa7a42422 100644
--- a/gcc/config/rs6000/rs6000-call.c
+++ b/gcc/config/rs6000/rs6000-call.c
@@ -8822,6 +8822,102 @@ rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
 
 /* Builtins.  */
 
+/* Debug utility to translate a type node to a single token.  */
+static
+const char *rs6000_debug_type (tree type)
+{
+  if (type == void_type_node)
+    return "void";
+  else if (type == long_integer_type_node)
+    return "long";
+  else if (type == long_unsigned_type_node)
+    return "ulong";
+  else if (type == bool_V16QI_type_node)
+    return "vbc";
+  else if (type == bool_V2DI_type_node)
+    return "vbll";
+  else if (type == bool_V4SI_type_node)
+    return "vbi";
+  else if (type == bool_V8HI_type_node)
+    return "vbs";
+  else if (type == bool_int_type_node)
+    return "bool";
+  else if (type == dfloat64_type_node)
+    return "_Decimal64";
+  else if (type == double_type_node)
+    return "double";
+  else if (type == intDI_type_node)
+    return "sll";
+  else if (type == intHI_type_node)
+    return "ss";
+  else if (type == ibm128_float_type_node)
+    return "__ibm128";
+  else if (type == opaque_V4SI_type_node)
+    return "opaque";
+  else if (POINTER_TYPE_P (type))
+    return "void*";
+  else if (type == intQI_type_node || type == char_type_node)
+    return "sc";
+  else if (type == dfloat32_type_node)
+    return "_Decimal32";
+  else if (type == float_type_node)
+    return "float";
+  else if (type == intSI_type_node || type == integer_type_node)
+    return "si";
+  else if (type == dfloat128_type_node)
+    return "_Decimal128";
+  else if (type == long_double_type_node)
+    return "longdouble";
+  else if (type == intTI_type_node)
+    return "sq";
+  else if (type == unsigned_intDI_type_node)
+    return "ull";
+  else if (type == unsigned_intHI_type_node)
+    return "us";
+  else if (type == unsigned_intQI_type_node)
+    return "uc";
+  else if (type == unsigned_intSI_type_node)
+    return "ui";
+  else if (type == unsigned_intTI_type_node)
+    return "uq";
+  else if (type == unsigned_V16QI_type_node)
+    return "vuc";
+  else if (type == unsigned_V1TI_type_node)
+    return "vuq";
+  else if (type == unsigned_V2DI_type_node)
+    return "vull";
+  else if (type == unsigned_V4SI_type_node)
+    return "vui";
+  else if (type == unsigned_V8HI_type_node)
+    return "vus";
+  else if (type == V16QI_type_node)
+    return "vsc";
+  else if (type == V1TI_type_node)
+    return "vsq";
+  else if (type == V2DF_type_node)
+    return "vd";
+  else if (type == V2DI_type_node)
+    return "vsll";
+  else if (type == V4SF_type_node)
+    return "vf";
+  else if (type == V4SI_type_node)
+    return "vsi";
+  else if (type == V8HI_type_node)
+    return "vss";
+  else if (type == pixel_V8HI_type_node)
+    return "vp";
+  else if (type == pcvoid_type_node)
+    return "voidc*";
+  else if (type == float128_type_node)
+    return "_Float128";
+  else if (type == vector_pair_type_node)
+    return "__vector_pair";
+  else if (type == vector_quad_type_node)
+    return "__vector_quad";
+  else
+    return "unknown";
+}
+
 static void
 def_builtin (const char *name, tree type, enum rs6000_builtins code)
 {
@@ -8850,7 +8946,7 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
       /* const function, function only depends on the inputs.  */
       TREE_READONLY (t) = 1;
       TREE_NOTHROW (t) = 1;
-      attr_string = ", const";
+      attr_string = "= const";
     }
   else if ((classify & RS6000_BTC_PURE) != 0)
     {
@@ -8858,7 +8954,7 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
 	 external state.  */
       DECL_PURE_P (t) = 1;
       TREE_NOTHROW (t) = 1;
-      attr_string = ", pure";
+      attr_string = "= pure";
     }
   else if ((classify & RS6000_BTC_FP) != 0)
     {
@@ -8872,12 +8968,12 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
 	{
 	  DECL_PURE_P (t) = 1;
 	  DECL_IS_NOVOPS (t) = 1;
-	  attr_string = ", fp, pure";
+	  attr_string = "= fp, pure";
 	}
       else
 	{
 	  TREE_READONLY (t) = 1;
-	  attr_string = ", fp, const";
+	  attr_string = "= fp, const";
 	}
     }
   else if ((classify & (RS6000_BTC_QUAD | RS6000_BTC_PAIR)) != 0)
@@ -8886,9 +8982,27 @@ def_builtin (const char *name, tree type, enum rs6000_builtins code)
   else if ((classify & RS6000_BTC_ATTR_MASK) != 0)
     gcc_unreachable ();
 
+  if (TARGET_DEBUG_BUILTIN)
+    {
+      tree t = TREE_TYPE (type);
+      fprintf (stderr, "%s %s (", rs6000_debug_type (t), name);
+      t = TYPE_ARG_TYPES (type);
+      while (t && TREE_VALUE (t) != void_type_node)
+	{
+	  fprintf (stderr, "%s",
+		   rs6000_debug_type (TREE_VALUE (t)));
+	  t = TREE_CHAIN (t);
+	  if (t && TREE_VALUE (t) != void_type_node)
+	    fprintf (stderr, ", ");
+	}
+      fprintf (stderr, "); %s [%4d]\n", attr_string, (int)code);
+    }
+
+  /*
   if (TARGET_DEBUG_BUILTIN)
     fprintf (stderr, "rs6000_builtin, code = %4d, %s%s\n",
 	     (int)code, name, attr_string);
+  */
 }
 
 /* Simple ternary operations: VECd = foo (VECa, VECb, VECc).  */


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-07 18:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-02 22:08 [gcc(refs/users/wschmidt/heads/builtins4)] rs6000: Initial debug support for comparing builtins William Schmidt
  -- strict thread matches above, loose matches on Subject: below --
2021-02-07 18:14 William Schmidt
2020-12-16 18:07 William Schmidt
2020-11-24 16:45 William Schmidt
2020-11-02 16:34 William Schmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).