From owner-freebsd-current@FreeBSD.ORG Thu Jun 16 07:29:00 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 113C21065672; Thu, 16 Jun 2011 07:29:00 +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 B7ADF8FC13; Thu, 16 Jun 2011 07:28:59 +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 <1QX70c-0002td-NZ>; Thu, 16 Jun 2011 09:28:58 +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 <1QX70c-0005t5-LS>; Thu, 16 Jun 2011 09:28:58 +0200 Message-ID: <4DF9B0B9.5060601@zedat.fu-berlin.de> Date: Thu, 16 Jun 2011 09:28:57 +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> <4DF9AAEB.5090801@zedat.fu-berlin.de> In-Reply-To: <4DF9AAEB.5090801@zedat.fu-berlin.de> 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-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 07:29:00 -0000 On 06/16/11 09:04, O. Hartmann wrote: > 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 > _______________________________________________ Sorry for the noise, got it. Using _mm_add_pd() etc. Oliver