From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32029 invoked by alias); 30 Mar 2010 18:03:40 -0000 Received: (qmail 31858 invoked by uid 22791); 30 Mar 2010 18:03:39 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e35.co.us.ibm.com (HELO e35.co.us.ibm.com) (32.97.110.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Mar 2010 18:03:34 +0000 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e35.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o2UHwiHq007946 for ; Tue, 30 Mar 2010 11:58:44 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id o2UI3V8A239746 for ; Tue, 30 Mar 2010 12:03:32 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o2UB3SOQ028261 for ; Tue, 30 Mar 2010 05:03:28 -0600 Received: from hungry-tiger.westford.ibm.com (dyn9033020061.westford.ibm.com [9.33.20.61]) by d03av03.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id o2UB3SlV028248; Tue, 30 Mar 2010 05:03:28 -0600 Received: from hungry-tiger.westford.ibm.com (hungry-tiger.westford.ibm.com [127.0.0.1]) by hungry-tiger.westford.ibm.com (Postfix) with ESMTP id 2318B2D0C; Tue, 30 Mar 2010 14:03:28 -0400 (EDT) Received: (from meissner@localhost) by hungry-tiger.westford.ibm.com (8.14.3/8.14.3/Submit) id o2UI3Rnu008419; Tue, 30 Mar 2010 14:03:27 -0400 Date: Tue, 30 Mar 2010 18:13:00 -0000 From: Michael Meissner To: =?utf-8?B?0JDRgNGC0LXQvCDQqNC40L3QutCw0YDQvtCy?= Cc: gcc Subject: Re: GSoC 2010 Project Idea Message-ID: <20100330180327.GA8039@hungry-tiger.westford.ibm.com> Mail-Followup-To: Michael Meissner , =?utf-8?B?0JDRgNGC0LXQvCDQqNC40L3QutCw0YDQvtCy?= , gcc References: <979659581003280414o8a88c0fy29016c15674834df@mail.gmail.com> <979659581003281437k3eab3771sdbafe2574a374e0d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <979659581003281437k3eab3771sdbafe2574a374e0d@mail.gmail.com> User-Agent: Mutt/1.5.20 (2009-08-17) X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-03/txt/msg00453.txt.bz2 On Sun, Mar 28, 2010 at 10:37:07PM +0100, Артем Шинкаров wrote: > Hi, > > I have a project in mind which I'm going to propose to the GCC in terms of > Google Summer of Code. My project is not on the list of project ideas > (http://gcc.gnu.org/wiki/SummerOfCode) that is why it would be very interesting > for me to hear any opinions and maybe even to find a mentor. > > > 1. Project idea > > A brief project idea is to create an abstract layer for vectorized > computations. This would allow to write a portable vectorized code. > > > 2. State of the art > > Nowadays most of processors have a support for SIMD computations. However, the > problem is that each hardware has a different set of SIMD instructions: Intel > MMX+SSE+AVX, PowerPC Altivec, ARM iWMMXt, and so on. GCC supports most of > architecture-specific instructions providing built-in functions. It is > considerably convenient to use these functions when you want to optimize some > piece of code. The problem starts when you want to make this code portable. > It is not a very common task, and of course GCC has a vectorizer. > Unfortunately, there are many examples which show that it is relatively simple > for a human to find a right place in the code and vectorize it, but it is > extremely hard for the compiler to do the same. As a result we end up with the > code which is not using the capabilities of the architecture. > It would be much easier for the programmer to use an abstract layer to > implement a vectorized code. A compiler should deal with the portability issues > dispatching the code from the abstract layer to the particular architecture. My > experience shows that there are no such a library for C/C++ that could solve > the problem. There are some attempts like: http://libsimd.sourceforge.net/ but > it is only a small part of the idea, and unfortunately the development is > suspended. Or maybe I am wrong and everything is already written? Note, the powerpc and cell compilers have the notion of a vector keyword that is followed by a type (powerpc needs -maltivec and/or -mvsx to enable it). So you can write: vector float sum (vector float a, vector float b) { return a+b; } Now, ideally, it would be useful to have sytax so you could change the vector size, and the compiler would do the conversion to/from hw types to abstract types. -- Michael Meissner, IBM 4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA meissner@linux.vnet.ibm.com