public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Target-specific Front-Ends? (Was: front end changes for  altivec)
@ 2001-11-20  4:44 mike stump
  2001-11-20 10:10 ` Aldy Hernandez
  2001-11-27 18:12 ` mike stump
  0 siblings, 2 replies; 111+ messages in thread
From: mike stump @ 2001-11-20  4:44 UTC (permalink / raw)
  To: geoffk, ira; +Cc: gcc

> To: Ira Ruben <ira@apple.com>
> CC: gcc@gcc.gnu.org
> From: Geoff Keating <geoffk@geoffk.org>
> Date: 27 Nov 2001 12:10:15 -0800

> It won't work.  There's little or nothing that can be done about that;
> it wouldn't work even if 'vector' was a keyword.

#include <vector>
#include <gosh_what_name_here.h>

using gnu::gcc::vector;

vector<int[4]> a, b;
std::vector<int> cxx_vec;

void foo() {
     a += b;
     cxx_vec.begin();
}

or

#include <vector>
#include <gosh_what_name_here.h>

using std;

gnu::gcc::vector<int[4]> a, b;
vector<int> cxx_vec;

void foo() {
     a += b;
     cxx_vec.begin();
}

A completely trivial problem.  :-)

^ permalink raw reply	[flat|nested] 111+ messages in thread
* Re: Target-specific Front-Ends? (Was: front end changes for altivec)
@ 2001-11-18  8:02 mike stump
  2001-11-26 19:52 ` mike stump
  0 siblings, 1 reply; 111+ messages in thread
From: mike stump @ 2001-11-18  8:02 UTC (permalink / raw)
  To: gcc, zlaski; +Cc: aldyh, jsm28

> Date: Mon, 26 Nov 2001 18:26:45 -0800
> From: Ziemowit Laski <zlaski@apple.com>

> But this brings up a more general question, one that I've been
> meaning to ask of the wider community for quite some time: Should we
> come up with a generalized architecture in GCC (for all front-ends)
> to enable front-end extensions:

For the purposes you want it for, I propose we put this off into the
future as far as we can, with a little luck, we never do it.

> AltiVec is merely one example of an idiosyncratic extension that
> exists on only a small fraction of targets that GCC supports.  It
> would be nice to only enable the extension for the targets that need
> it

What would be nice, is to come up with language independent, machine
independent semantics that are nice, and provide them to the
frontends, and encourage the front ends to allow/expose them to the
user, in a MI way, since they are after all, MI.  We then use the
existing standard practice, if well designed, and we like it, to form
the basis of some future addition to the C/C++ language standard.  I
mean, they have MUL-ADD defined in the C99 standard (see fma in the
library), they certainly can add vector stuff.

Imagine a valarray of floats specialization in the C++ library that
uses vector float[8] internally, and feeds the += member functions to
the vector float[8] += gcc backend support code.  Just use valarray in
the natural way, and presto, the code uses a dual pipelined float[4]
hardware vector unit.  All the transformations to accomplish this
would be trivial enough (certainly easier than trying to intuit vector
usage in normal code.

Compile on a platform that doesn't have such hardware, the compiler
generates 8 calls to float +, as normal.  Maybe we want to expose the
maximal useful vec size, MATH_VEC_MAX_SIZE...  We might need to expose
the existence of particular operations.  Maybe...

By offering a MI way to do this, users can write their code in a
fairly portable way, and gain the benefits of such a standard.

The failings of the backend now, are, if the insn isn't supported by
the CPU, it doesn't work and the backend doesn't actually have any
operations, just a few types.  The failings of C/C++ languages are, we
need a standardized header to get at the operations, with standardized
names (not __builtin_addv4si), we might need a better syntax.  We need
to document all of the operations, and all operations always have to
work.  And we need to use these features in valarray.  We need to push
the standard out to the real folks that use these types of units, and
refine what we have to match what they need.

^ permalink raw reply	[flat|nested] 111+ messages in thread
* Re: front end changes for altivec
@ 2001-11-18  3:56 Joseph S. Myers
  2001-11-18  6:40 ` Target-specific Front-Ends? (Was: front end changes for altivec) Ziemowit Laski
  0 siblings, 1 reply; 111+ messages in thread
From: Joseph S. Myers @ 2001-11-18  3:56 UTC (permalink / raw)
  To: Aldy Hernandez; +Cc: gcc

On 26 Nov 2001, Aldy Hernandez wrote:

> the altivec specs require changes to the gcc front end.  this has been
> brought up before but no one has really commented.  now before everyone
> start raising shields and going "yuck, no way", hear me out.

You have of course read the previous thread on "Vector Extensions in GCC"  
from July.

>     __vector keyword:
>     
>     	__vector int	=> mode(V4SI)
>     	__vector char	=> mode(V16QI)
>     	etc etc

Precise rules?  Is __vector a type specifier that can be added to the
various lists of keyword type specifiers that can be used?  Which of the
type specifiers listed in C99 6.7.2#2 can it be used with?  I take it it
can't be used with typedefs, structs or unions.  Can it be used with
enums?  Why those particular sizes of vectors rather than others?  Will
__vector on its own imply __vector int?

Given proper answers, thorough documentation and testcases and a design of
an architecture-independent __vector keyword that allows for the variety
of vector types on different architectures, this is comparatively harmless
- as long as there are no implicit conversions between these types and any
other type in either direction and no operations can be applied to these
types other than passing to and returning from functions, and any explicit
conversions available are properly documented and justified.

>     vector constant initializers:
>     
>     	__vector int foo = (5, 8, 3, 2);
>     
>     (yes, those are parentheses, not curlys :-()

Obviously a bad idea - (5, 8, 3, 2) has a defined meaning that does not
depend on the context here.  This is worse than was suggested in July
(which was (vector float) (1.0, 2.0, 3.0, 4.0)) though that still ought to
be a compound literal instead.

-- 
Joseph S. Myers
jsm28@cam.ac.uk

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

end of thread, other threads:[~2001-11-29  0:15 UTC | newest]

Thread overview: 111+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CB35D7B2-E374-11D5-AE62-0030658361CA@apple.com.suse.lists.egcs>
     [not found] ` <m3r8qjvqd1.fsf@litecycle.cc.andrews.edu.suse.lists.egcs>
     [not found]   ` <p73bshnss5x.fsf@amdsim2.suse.de>
2001-11-19 17:20     ` Target-specific Front-Ends? (Was: front end changes for altivec) Aldy Hernandez
2001-11-27 16:58       ` Aldy Hernandez
2001-11-20  4:44 mike stump
2001-11-20 10:10 ` Aldy Hernandez
2001-11-27 18:28   ` Aldy Hernandez
2001-11-27 18:12 ` mike stump
  -- strict thread matches above, loose matches on Subject: below --
2001-11-18  8:02 mike stump
2001-11-26 19:52 ` mike stump
2001-11-18  3:56 front end changes for altivec Joseph S. Myers
2001-11-18  6:40 ` Target-specific Front-Ends? (Was: front end changes for altivec) Ziemowit Laski
2001-11-18  6:33   ` Aldy Hernandez
2001-11-26 18:46     ` Aldy Hernandez
2001-11-18  8:19   ` Stan Shebs
2001-11-18  9:13     ` Ira Ruben
2001-11-18 12:26       ` Aldy Hernandez
2001-11-19  4:45         ` Ira Ruben
2001-11-19  6:04           ` Geoff Keating
2001-11-19  7:28             ` Ira Ruben
2001-11-19 12:04               ` Phil Edwards
2001-11-27 14:58                 ` Phil Edwards
2001-11-27 12:47               ` Ira Ruben
2001-11-27 12:10             ` Geoff Keating
2001-11-19  7:50           ` Aldy Hernandez
2001-11-27 13:12             ` Aldy Hernandez
2001-11-19  6:26         ` Ziemowit Laski
2001-11-19  7:53           ` Aldy Hernandez
2001-11-19  7:56             ` Ziemowit Laski
2001-11-27 13:21               ` Ziemowit Laski
2001-11-27 13:13             ` Aldy Hernandez
2001-11-27 12:41           ` Ziemowit Laski
2001-11-27  6:46         ` Aldy Hernandez
2001-11-18 18:51       ` Per Bothner
2001-11-27  9:20         ` Per Bothner
2001-11-18 23:55       ` Stan Shebs
2001-11-19  4:18         ` Ira Ruben
2001-11-19  4:48           ` Per Bothner
2001-11-19  5:28             ` Daniel Berlin
2001-11-27 11:35               ` Daniel Berlin
2001-11-19  6:26             ` Ziemowit Laski
2001-11-20  0:33               ` Per Bothner
2001-11-20  3:16                 ` Ziemowit Laski
2001-11-20  6:33                   ` Per Bothner
2001-11-27 18:27                     ` Per Bothner
2001-11-20 11:05                   ` Stan Shebs
2001-11-27 18:35                     ` Stan Shebs
2001-11-27 18:06                   ` Ziemowit Laski
2001-11-20  3:19                 ` Stan Shebs
2001-11-20  5:25                   ` Joseph S. Myers
2001-11-27 18:24                     ` Joseph S. Myers
2001-11-20 11:27                   ` Per Bothner
2001-11-27 19:59                     ` Per Bothner
2001-11-20 11:37                   ` Mark Mitchell
2001-11-20 17:03                     ` Aldy Hernandez
2001-11-20 18:25                       ` Mark Mitchell
2001-11-28  7:11                       ` Aldy Hernandez
2001-11-20 19:20                     ` Stan Shebs
2001-11-20 20:24                       ` Mark Mitchell
2001-11-20 20:27                       ` Dale Johannesen
2001-11-20 20:38                         ` Stan Shebs
2001-11-21  4:47                           ` Syd Polk
2001-11-21 12:31                             ` Tim Hollebeek
2001-11-28 16:15                               ` Tim Hollebeek
2001-11-28 14:12                             ` Syd Polk
2001-11-28 11:55                           ` Stan Shebs
2001-11-28 11:44                         ` Dale Johannesen
2001-11-28 11:19                       ` Stan Shebs
2001-11-27 18:09                   ` Stan Shebs
2001-11-27 17:35                 ` Per Bothner
2001-11-27 12:34               ` Ziemowit Laski
2001-11-27 11:16             ` Per Bothner
2001-11-19  6:19         ` Ziemowit Laski
2001-11-19  7:13           ` Joseph S. Myers
2001-11-19  7:34             ` Stan Shebs
2001-11-19  8:01               ` Joseph S. Myers
2001-11-19  9:18                 ` Aldy Hernandez
2001-11-19 11:23                   ` Dale Johannesen
2001-11-27 14:46                     ` Dale Johannesen
2001-11-27 13:56                   ` Aldy Hernandez
2001-11-27 13:27                 ` Joseph S. Myers
2001-11-27 12:57               ` Stan Shebs
2001-11-19  7:56             ` Ziemowit Laski
2001-11-19  8:31               ` Richard Henderson
2001-11-27 13:44                 ` Richard Henderson
2001-11-19 10:23               ` Mark Mitchell
2001-11-27 13:19               ` Ziemowit Laski
2001-11-27 12:44             ` Joseph S. Myers
2001-11-19  8:34           ` Aldy Hernandez
2001-11-19 12:54             ` Stan Shebs
2001-11-19 15:41               ` Aldy Hernandez
2001-11-19 19:08                 ` Dale Johannesen
2001-11-19 19:15                   ` Aldy Hernandez
2001-11-27 17:10                     ` Aldy Hernandez
2001-11-27 17:06                   ` Dale Johannesen
2001-11-27 16:56                 ` Aldy Hernandez
2001-11-27 15:06               ` Stan Shebs
2001-11-27 13:44             ` Aldy Hernandez
2001-11-19  9:26           ` Bernd Schmidt
2001-11-19  9:53             ` Ziemowit Laski
2001-11-19 10:59               ` Bernd Schmidt
2001-11-19 14:12                 ` Ziemowit Laski
2001-11-27 15:37                   ` Ziemowit Laski
2001-11-27 14:41                 ` Bernd Schmidt
2001-11-27 14:30               ` Ziemowit Laski
2001-11-27 14:13             ` Bernd Schmidt
2001-11-19  9:40           ` Stan Shebs
2001-11-19 11:27             ` Ziemowit Laski
2001-11-27 14:50               ` Ziemowit Laski
2001-11-27 14:20             ` Stan Shebs
2001-11-27 12:24           ` Ziemowit Laski
2001-11-27  9:48         ` Stan Shebs
2001-11-26 22:22     ` Stan Shebs
2001-11-26 18:47   ` Ziemowit Laski

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).