public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: gcc@gcc.gnu.org
Cc: DJ Delorie <dj@redhat.com>
Subject: Re: opaque vector types?
Date: Wed, 10 Jun 2009 13:00:00 -0000	[thread overview]
Message-ID: <200906101359.59878.paul@codesourcery.com> (raw)
In-Reply-To: <200905060604.n4664Skm024765@greed.delorie.com>

On Wednesday 06 May 2009, DJ Delorie wrote:
> Is there an opaque vector type?  Something that can be assigned
> to/from other vector types of the same size, without warning?
>
> I'm working on a coprocessor which has separate SIMD arithmetic
> operations for each data size, but only one SIMD logical operation for
> all sizes.  I.e. there's four ADD insns (V8QI, V4HI, etc) , but only
> one AND insn.  I'd like to use an opaque vector type for the AND
> builtin, to avoid warnings.

FWIW ARM/NEON solve this by defining the full set of builtins for all types, 
and some of them (e.g. AND) happen to expand to the same machine instructions.

In practice I'd expect this actually makes writing vector code easier/safer 
because you don't loose type safety every time you use the AND builtin.

Having some of your intrinsics be type specific, and some type agnostic seems 
a somewhat strange programming model. I'd expect everything to be types, or 
everything to use opaque vectors (and select the opcode based on the actual 
argument types). The latter is problematic because C doesn't really have 
polymorphism.

Paul

      parent reply	other threads:[~2009-06-10 13:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-06  6:04 DJ Delorie
2009-05-06  6:11 ` Andrew Pinski
2009-05-06  6:29   ` DJ Delorie
2009-05-06  9:08     ` Paolo Bonzini
2009-05-08 21:05     ` Michael Meissner
2009-06-10 13:00 ` Paul Brook [this message]

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=200906101359.59878.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=dj@redhat.com \
    --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).