public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: e500 API compatability patch [ignore]
Date: Sat, 27 Jul 2002 15:04:00 -0000	[thread overview]
Message-ID: <20020727014355.A8972@redhat.com> (raw)

The e500 API specifies that the magic opaque types defined in <spe.h>
can be copied to and from other simd types of the same size without
casting.  They can also be passed to functions without casting.  And a
function accepting an opaque type, can accept any other same sized
simd type without a cast.  Also, opaque types cannot be initialized.

Yes, puke and complain all you want.... But I'm only including this
(a) for archival purposes (b) in case anyone needs full API
compatability in writing e500 code.

We really should come up with a place to put all these "never to be
included but mildly useful patches".  For instance, Jason had some
front end patches for AltiVec as well we colud put there.

Not ok in install?

2002-07-27  Aldy Hernandez  <aldyh@redhat.com>

	* c-typeck.c (convert_for_assignment): Allow interconversion of
	__ev64_opaque__ types.
	(really_start_incremental_init): Disallow initialization of opaque
	types.


Index: c-typeck.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/c-typeck.c,v
retrieving revision 1.237.2.1
diff -c -p -r1.237.2.1 c-typeck.c
*** c-typeck.c	2002/06/10 22:29:05	1.237.2.1
--- c-typeck.c	2002/07/27 08:18:12
*************** convert_for_assignment (type, rhs, errty
*** 4076,4081 ****
--- 4076,4098 ----
        rhs = build1 (NOP_EXPR, type, rhs);
        return rhs;
      }
+   /* branch-local */
+   /* __ev64_opaque__ types can interconvert without explicit casts.
+      Sick, disgusting, and you better like it.  */
+   else if (codel == VECTOR_TYPE && coder == VECTOR_TYPE
+ 	   && ((TYPE_NAME (type)
+ 		&& TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
+ 		&& DECL_NAME (TYPE_NAME (type))
+ 		&& !strcmp (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))),
+ 			    "__ev64_opaque__"))
+ 	       || (TYPE_NAME (TREE_TYPE (rhs))
+ 		   && TREE_CODE (TYPE_NAME (TREE_TYPE (rhs))) == TYPE_DECL
+ 		   && DECL_NAME (TYPE_NAME (TREE_TYPE (rhs)))
+ 		   && !strcmp (IDENTIFIER_POINTER
+ 			       (DECL_NAME (TYPE_NAME (TREE_TYPE (rhs)))),
+ 			       "__ev64_opaque__"))))
+     return convert (type, rhs);
+   /* end-branch-local */
    /* Arithmetic types all interconvert, and enum is treated like int.  */
    else if ((codel == INTEGER_TYPE || codel == REAL_TYPE 
  	    || codel == ENUMERAL_TYPE || codel == COMPLEX_TYPE
*************** really_start_incremental_init (type)
*** 5148,5153 ****
--- 5165,5179 ----
  
    if (type == 0)
      type = TREE_TYPE (constructor_decl);
+ 
+   /* branch-local */
+   if (TYPE_NAME (type)
+       && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
+       && DECL_NAME (TYPE_NAME (type))
+       && !strcmp (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))),
+ 		  "__ev64_opaque__"))
+     error ("__ev64_opaque__ types cannot be initialized");
+   /* end-branch-local */
  
    p->type = constructor_type;
    p->fields = constructor_fields;

                 reply	other threads:[~2002-07-27  8:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020727014355.A8972@redhat.com \
    --to=aldyh@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).