From owner-freebsd-performance@FreeBSD.ORG Thu Jun 16 07:04:15 2011 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43395106568C; Thu, 16 Jun 2011 07:04:15 +0000 (UTC) (envelope-from ohartman@zedat.fu-berlin.de) Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by mx1.freebsd.org (Postfix) with ESMTP id F41E58FC13; Thu, 16 Jun 2011 07:04:14 +0000 (UTC) Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost1.zedat.fu-berlin.de (Exim 4.69) with esmtp (envelope-from ) id <1QX6cf-00076b-Jx>; Thu, 16 Jun 2011 09:04:13 +0200 Received: from telesto.geoinf.fu-berlin.de ([130.133.86.198]) by inpost2.zedat.fu-berlin.de (Exim 4.69) with esmtpsa (envelope-from ) id <1QX6cf-00043a-Hq>; Thu, 16 Jun 2011 09:04:13 +0200 Message-ID: <4DF9AAEB.5090801@zedat.fu-berlin.de> Date: Thu, 16 Jun 2011 09:04:11 +0200 From: "O. Hartmann" Organization: Freie =?ISO-8859-1?Q?Universit=E4t_Berlin?= User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: Doug Rabson References: <4DF4EC9F.9020604@zedat.fu-berlin.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: 130.133.86.198 Cc: "freebsd-performance@freebsd.org" , FreeBSD Current Subject: Re: FreeBSD 9.0-CUR/amd64 CLANG: howto use gcc __builtin_ia32? X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 07:04:15 -0000 On 06/15/11 20:36, Doug Rabson wrote: > You could try using the standard header - that has inline > functions which should cover all the SSE instructions. > > On 12 June 2011 17:43, Hartmann, O. wrote: > >> I use some numerical code utilizing the SIMD units of modern X86 >> architectures. Code compiles well using gcc/gcc46, >> but clang does not know about the __builtin_ia32_xxxxx() statements. How to >> treat those in clang and how to make >> C code compiling with clang utilizing those __builtin_ia32 statements? >> >> Thanks, >> Oliver Thanks for this hint. I tried, and its a negative. I'm quite new to the usage of builtins and I oriented myself using gcc style __builtins. Especially __builtin_ia32_mulpd(()), __builtin_ia32_addpd(()). The aim is to add, mul, div and sub two 64 Bit doubles residing in a 128 Bit xmm register; by doing this, a struct contains two unions, each 128 bit, to simulate a 4d vector, so I' capable of adding, multiplying etc. vectors using the SIMD units. It seems that there is a more 'sophisticated' way than simply apllying the __builtin assembly equivalences. Oliver