From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2808 invoked by alias); 27 Nov 2001 01:04:32 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 2773 invoked from network); 27 Nov 2001 01:04:29 -0000 Received: from unknown (HELO puce.csi.cam.ac.uk) (131.111.8.40) by hostedprojects.ges.redhat.com with SMTP; 27 Nov 2001 01:04:29 -0000 Received: from student.cusu.cam.ac.uk ([131.111.179.82] helo=kern.srcf.societies.cam.ac.uk ident=mail) by puce.csi.cam.ac.uk with esmtp (Exim 3.22 #1) id 168WfR-00065K-00; Tue, 27 Nov 2001 01:04:09 +0000 Received: from jsm28 (helo=localhost) by kern.srcf.societies.cam.ac.uk with local-esmtp (Exim 3.12 #1 (Debian)) id 168WfQ-0001Z5-00; Tue, 27 Nov 2001 01:04:08 +0000 Date: Sun, 18 Nov 2001 05:09:00 -0000 From: "Joseph S. Myers" X-X-Sender: To: Aldy Hernandez cc: Aldy Hernandez , Subject: Re: front end changes for altivec In-Reply-To: <20011126163925.55335@taarna.cygnus.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2001-11/txt/msg00804.txt.bz2 On Mon, 26 Nov 2001, Aldy Hernandez wrote: > __vector must be first among type specifiers. the specs are rather skekchy, That's not consistent with how other type specifiers work. It would make more sense for the list of possible type specifier combinations to include such things as "__vector signed int" and any permutation thereof. > ok, but how would we differentiate between the diff vector sizes. > altivec has "vector int" being V4SI, but vector int could mean V2SI in > mmx. suggestion welcome while i think through this. The answer from some quarters might be "vector int<4>" or "vector<4> int", but this adds complications to the C grammar I don't really want there since > can be part of a constant expression (so if going that way then do as many as possible of defining disambiguating rules by reference to existing practice, proving the existence or nonexistence of ambiguous cases, describing how the parsing should be implemented). Or use "vector(4)". Or add some other way of specifying a non-default vector size. > correct. you can't convert between any of the vector types. the following > just does a straight copy, no conversion (nop): > > vector short b; > vector int a = (vector int) b; What about other operations, e.g. arithmetic? > vector int foo = ((vector int)(1,2,3,4)); > > this kinda sucks all together because i don't think gcc has vector constants > at all, do we? we could pass it as a BLKmode or as a struct right? I think you should just use the C99 compound literal syntax here (with braces, not parentheses). Presumably the ABI says how such arguments are passed. -- Joseph S. Myers jsm28@cam.ac.uk From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Joseph S. Myers" To: Aldy Hernandez Cc: Aldy Hernandez , Subject: Re: front end changes for altivec Date: Mon, 26 Nov 2001 17:04:00 -0000 Message-ID: References: <20011126163925.55335@taarna.cygnus.com> X-SW-Source: 2001-11/msg01308.html Message-ID: <20011126170400.xQQ_b6pXlWIH1SZouFch8PNmxDOqLDE4xtLj2TyPnEU@z> On Mon, 26 Nov 2001, Aldy Hernandez wrote: > __vector must be first among type specifiers. the specs are rather skekchy, That's not consistent with how other type specifiers work. It would make more sense for the list of possible type specifier combinations to include such things as "__vector signed int" and any permutation thereof. > ok, but how would we differentiate between the diff vector sizes. > altivec has "vector int" being V4SI, but vector int could mean V2SI in > mmx. suggestion welcome while i think through this. The answer from some quarters might be "vector int<4>" or "vector<4> int", but this adds complications to the C grammar I don't really want there since > can be part of a constant expression (so if going that way then do as many as possible of defining disambiguating rules by reference to existing practice, proving the existence or nonexistence of ambiguous cases, describing how the parsing should be implemented). Or use "vector(4)". Or add some other way of specifying a non-default vector size. > correct. you can't convert between any of the vector types. the following > just does a straight copy, no conversion (nop): > > vector short b; > vector int a = (vector int) b; What about other operations, e.g. arithmetic? > vector int foo = ((vector int)(1,2,3,4)); > > this kinda sucks all together because i don't think gcc has vector constants > at all, do we? we could pass it as a BLKmode or as a struct right? I think you should just use the C99 compound literal syntax here (with braces, not parentheses). Presumably the ABI says how such arguments are passed. -- Joseph S. Myers jsm28@cam.ac.uk