From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6641 invoked by alias); 28 Feb 2011 23:37:55 -0000 Received: (qmail 6630 invoked by uid 22791); 28 Feb 2011 23:37:54 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Feb 2011 23:37:48 +0000 Received: from kpbe14.cbf.corp.google.com (kpbe14.cbf.corp.google.com [172.25.105.78]) by smtp-out.google.com with ESMTP id p1SNbkDm021578 for ; Mon, 28 Feb 2011 15:37:46 -0800 Received: from iwn33 (iwn33.prod.google.com [10.241.68.97]) by kpbe14.cbf.corp.google.com with ESMTP id p1SNasTZ018087 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 28 Feb 2011 15:37:45 -0800 Received: by iwn33 with SMTP id 33so5501968iwn.27 for ; Mon, 28 Feb 2011 15:37:45 -0800 (PST) Received: by 10.42.154.136 with SMTP id q8mr5693990icw.334.1298936265264; Mon, 28 Feb 2011 15:37:45 -0800 (PST) Received: from coign.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id d10sm3253453ibb.18.2011.02.28.15.37.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Feb 2011 15:37:44 -0800 (PST) From: Ian Lance Taylor To: Hari Sandanagobalane Cc: gcc-help@gcc.gnu.org Subject: Re: Gcc vector extensions References: <4D6BBD15.2010507@picochip.com> Date: Mon, 28 Feb 2011 23:55:00 -0000 In-Reply-To: <4D6BBD15.2010507@picochip.com> (Hari Sandanagobalane's message of "Mon, 28 Feb 2011 15:19:49 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-02/txt/msg00427.txt.bz2 Hari Sandanagobalane writes: > Picochip processor has a vector unit that supports operations such as > > ADD imm,vsrc,vdest. > > where you can add a scalar value to a vector register. This is > equivalent to adding every element of the vector register with the > scalar value. > > GCC vector extensions allow for a scalar to be used for shift > operations. This example from documentation says > > typedef int v4si __attribute__ ((vector_size (16))); > > v4si a, b; > > b = a >> 1; /* b = a >> {1,1,1,1}; */ > > Is it possible to support > > b = a + 1 /* b = a + {1,1,1,1} */ > > Or, is there any other way to represent this operation? That is not currently supported as you wrote it. It would have to be done using a builtin function. Ian