From owner-freebsd-performance@FreeBSD.ORG Sun Jun 12 16:58:34 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 CDB10106566C for ; Sun, 12 Jun 2011 16:58:34 +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 8DBE28FC14 for ; Sun, 12 Jun 2011 16:58:34 +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 <1QVnkl-0003Oc-Ju>; Sun, 12 Jun 2011 18:43:11 +0200 Received: from e178021162.adsl.alicedsl.de ([85.178.21.162] helo=thor.walstatt.dyndns.org) by inpost2.zedat.fu-berlin.de (Exim 4.69) with esmtpsa (envelope-from ) id <1QVnkl-0002P8-Hb>; Sun, 12 Jun 2011 18:43:11 +0200 Message-ID: <4DF4EC9F.9020604@zedat.fu-berlin.de> Date: Sun, 12 Jun 2011 18:43:11 +0200 From: "Hartmann, O." User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110601 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: FreeBSD Current , "freebsd-performance@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: 85.178.21.162 Cc: Subject: 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: Sun, 12 Jun 2011 16:58:34 -0000 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 From owner-freebsd-performance@FreeBSD.ORG Wed Jun 15 10:34:08 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 5F5211065672 for ; Wed, 15 Jun 2011 10:34:08 +0000 (UTC) (envelope-from gofp-freebsd-performance@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id E5E038FC17 for ; Wed, 15 Jun 2011 10:34:07 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QWnQ9-0005yk-Ij for freebsd-performance@freebsd.org; Wed, 15 Jun 2011 12:34:01 +0200 Received: from nuclight.avtf.net ([82.117.70.99]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Jun 2011 12:34:01 +0200 Received: from vadim_nuclight by nuclight.avtf.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 Jun 2011 12:34:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-performance@freebsd.org From: Vadim Goncharov Date: Wed, 15 Jun 2011 10:33:49 +0000 (UTC) Organization: Nuclear Lightning @ Tomsk, TPU AVTF Hostel Lines: 67 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: nuclight.avtf.net X-Comment-To: All User-Agent: slrn/0.9.9p1 (FreeBSD) Subject: strange differencies: find -exec \+ vs find | xargs X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vadim_nuclight@mail.ru List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2011 10:34:08 -0000 Hi, There was a flamewar in a local maillist about the fastest way to do chmod 644 on files and chmod 755 on directories in a sbubtree. It suddenly revealed the strange thing: on the same subtree, find -type d -exec \+ on 76000 directories has the same as find | xargs, but on 246000 files it was 4 times slower - while there must be almost identical number of forks. I've repeated the tests on deliberately old machine, a Pentium I 233 MHz with 80 Mb RAM, 7.4R UFS2. Subtree for tests was copy of /usr/src with several categories from /usr/ports. The output is from ZSH's builtin 'time' (also set up to automatically output if cmd was run more than 30 secs). Below is the ooutput, first with 80K files, it doesn't differ, than added several more /usr/ports categories and got slow result on 100K. Why is the difference at all? This machine has maxvnodes about 4600 and too small RAM for caches, if that's buffers, I'd expect the difference to begin on mush slow number of files. But it runs the same 80K normally... kernblitz:/home/vadim# find /warehouse/garbage -type f | wc -l; find /warehouse/garbage -type d | wc -l 80208 find /warehouse/garbage -type f 5,01s user 53,12s system 53% cpu 1:48,52 total wc -l 0,54s user 0,31s system 0% cpu 1:48,49 total 13989 find /warehouse/garbage -type d 4,52s user 52,00s system 53% cpu 1:45,63 total wc -l 0,11s user 0,06s system 0% cpu 1:45,61 total kernblitz:/home/vadim# time chmod -R u+rwX,go+rX,go-w /warehouse/garbage chmod -R u+rwX,go+rX,go-w /warehouse/garbage 4,39s user 54,94s system 53% cpu 1:50,73 total kernblitz:/home/vadim# time find /warehouse/garbage -type f -exec chmod 644 {} \+ find /warehouse/garbage -type f -exec chmod 644 {} \+ 7,29s user 100,30s system 65% cpu 2:43,29 total kernblitz:/home/vadim# time find /warehouse/garbage -type d -exec chmod 755 {} \+ find /warehouse/garbage -type d -exec chmod 755 {} \+ 5,04s user 58,91s system 54% cpu 1:58,05 total kernblitz:/home/vadim# time find /warehouse/garbage -type f -print0 | xargs -0 chmod 644 find /warehouse/garbage -type f -print0 4,78s user 55,14s system 37% cpu 2:40,27 total xargs -0 chmod 644 3,26s user 46,70s system 30% cpu 2:41,26 total kernblitz:/home/vadim# cp -r /usr/ports/[e-k]* /warehouse/garbage cp -r /usr/ports/[e-k]* /warehouse/garbage 4,57s user 115,70s system 29% cpu 6:54,47 total kernblitz:/home/vadim# find /warehouse/garbage -type f | wc -l; find /warehouse/garbage -type d | wc -l 102014 find /warehouse/garbage -type f 6,46s user 69,75s system 48% cpu 2:38,31 total wc -l 0,78s user 0,27s system 0% cpu 2:38,29 total 19714 find /warehouse/garbage -type d 6,11s user 72,32s system 48% cpu 2:43,26 total wc -l 0,13s user 0,09s system 0% cpu 2:43,24 total kernblitz:/home/vadim# time chmod -R u+rwX,go+rX,go-w /warehouse/garbage chmod -R u+rwX,go+rX,go-w /warehouse/garbage 5,59s user 69,97s system 48% cpu 2:36,53 total kernblitz:/home/vadim# time find /warehouse/garbage -type d -exec chmod 755 {} \+ find /warehouse/garbage -type d -exec chmod 755 {} \+ 6,72s user 83,05s system 23% cpu 6:15,22 total kernblitz:/home/vadim# time find /warehouse/garbage -type f -exec chmod 644 {} \+ find /warehouse/garbage -type f -exec chmod 644 {} \+ 10,49s user 138,30s system 20% cpu 12:14,49 total kernblitz:/home/vadim# time find /warehouse/garbage -type f -print0 | xargs -0 chmod 644 find /warehouse/garbage -type f -print0 6,58s user 70,84s system 35% cpu 3:36,67 total xargs -0 chmod 644 3,93s user 59,30s system 28% cpu 3:39,50 total -- WBR, Vadim Goncharov. ICQ#166852181 mailto:vadim_nuclight@mail.ru [Moderator of RU.ANTI-ECOLOGY][FreeBSD][http://antigreen.org][LJ:/nuclight] From owner-freebsd-performance@FreeBSD.ORG Wed Jun 15 11:36:12 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 C3817106566C for ; Wed, 15 Jun 2011 11:36:12 +0000 (UTC) (envelope-from db@bsdsystems.de) Received: from fop.bsdsystems.de (mx.bsdsystems.de [88.198.57.43]) by mx1.freebsd.org (Postfix) with ESMTP id 48E598FC0C for ; Wed, 15 Jun 2011 11:36:12 +0000 (UTC) Received: from [IPv6:::1] (fop.bsdsystems.de [88.198.57.43]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by fop.bsdsystems.de (Postfix) with ESMTP id 5DC654FC38; Wed, 15 Jun 2011 13:13:22 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: dennis berger In-Reply-To: Date: Wed, 15 Jun 2011 13:14:32 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <4E648192-7D2C-4556-B001-FDD812E821F8@bsdsystems.de> References: To: vadim_nuclight@mail.ru X-Mailer: Apple Mail (2.1084) X-Mailman-Approved-At: Wed, 15 Jun 2011 13:02:19 +0000 Cc: freebsd-performance@freebsd.org Subject: Re: strange differencies: find -exec \+ vs find | xargs 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: Wed, 15 Jun 2011 11:36:12 -0000 Dear, I suspect that you're hitting a cache limit for that machine. I had similar behaviour when rsyncing huge directories. I usually raise = vfs.ufs.dirhash_maxmem sysctl variable, which solves the problem. best, -dennis Am 15.06.2011 um 12:33 schrieb Vadim Goncharov: > Hi, >=20 > There was a flamewar in a local maillist about the fastest way to do = chmod 644 > on files and chmod 755 on directories in a sbubtree. It suddenly = revealed the > strange thing: on the same subtree, find -type d -exec \+ on 76000 = directories > has the same as find | xargs, but on 246000 files it was 4 times = slower - while > there must be almost identical number of forks. >=20 > I've repeated the tests on deliberately old machine, a Pentium I 233 = MHz with > 80 Mb RAM, 7.4R UFS2. Subtree for tests was copy of /usr/src with = several > categories from /usr/ports. The output is from ZSH's builtin 'time' = (also > set up to automatically output if cmd was run more than 30 secs). >=20 > Below is the ooutput, first with 80K files, it doesn't differ, than = added > several more /usr/ports categories and got slow result on 100K. Why is > the difference at all? This machine has maxvnodes about 4600 and too = small > RAM for caches, if that's buffers, I'd expect the difference to begin = on > mush slow number of files. But it runs the same 80K normally... >=20 > kernblitz:/home/vadim# find /warehouse/garbage -type f | wc -l; find = /warehouse/garbage -type d | wc -l > 80208 > find /warehouse/garbage -type f 5,01s user 53,12s system 53% cpu = 1:48,52 total > wc -l 0,54s user 0,31s system 0% cpu 1:48,49 total > 13989 > find /warehouse/garbage -type d 4,52s user 52,00s system 53% cpu = 1:45,63 total > wc -l 0,11s user 0,06s system 0% cpu 1:45,61 total >=20 > kernblitz:/home/vadim# time chmod -R u+rwX,go+rX,go-w = /warehouse/garbage > chmod -R u+rwX,go+rX,go-w /warehouse/garbage 4,39s user 54,94s system = 53% cpu 1:50,73 total >=20 > kernblitz:/home/vadim# time find /warehouse/garbage -type f -exec = chmod 644 {} \+ > find /warehouse/garbage -type f -exec chmod 644 {} \+ 7,29s user = 100,30s system 65% cpu 2:43,29 total >=20 > kernblitz:/home/vadim# time find /warehouse/garbage -type d -exec = chmod 755 {} \+ > find /warehouse/garbage -type d -exec chmod 755 {} \+ 5,04s user = 58,91s system 54% cpu 1:58,05 total >=20 > kernblitz:/home/vadim# time find /warehouse/garbage -type f -print0 | = xargs -0 chmod 644 > find /warehouse/garbage -type f -print0 4,78s user 55,14s system 37% = cpu 2:40,27 total > xargs -0 chmod 644 3,26s user 46,70s system 30% cpu 2:41,26 total >=20 > kernblitz:/home/vadim# cp -r /usr/ports/[e-k]* /warehouse/garbage > cp -r /usr/ports/[e-k]* /warehouse/garbage 4,57s user 115,70s system = 29% cpu 6:54,47 total >=20 > kernblitz:/home/vadim# find /warehouse/garbage -type f | wc -l; find = /warehouse/garbage -type d | wc -l > 102014 > find /warehouse/garbage -type f 6,46s user 69,75s system 48% cpu = 2:38,31 total > wc -l 0,78s user 0,27s system 0% cpu 2:38,29 total > 19714 > find /warehouse/garbage -type d 6,11s user 72,32s system 48% cpu = 2:43,26 total > wc -l 0,13s user 0,09s system 0% cpu 2:43,24 total >=20 > kernblitz:/home/vadim# time chmod -R u+rwX,go+rX,go-w = /warehouse/garbage > chmod -R u+rwX,go+rX,go-w /warehouse/garbage 5,59s user 69,97s system = 48% cpu 2:36,53 total >=20 > kernblitz:/home/vadim# time find /warehouse/garbage -type d -exec = chmod 755 {} \+ > find /warehouse/garbage -type d -exec chmod 755 {} \+ 6,72s user = 83,05s system 23% cpu 6:15,22 total >=20 > kernblitz:/home/vadim# time find /warehouse/garbage -type f -exec = chmod 644 {} \+ > find /warehouse/garbage -type f -exec chmod 644 {} \+ 10,49s user = 138,30s system 20% cpu 12:14,49 total >=20 > kernblitz:/home/vadim# time find /warehouse/garbage -type f -print0 | = xargs -0 chmod 644 > find /warehouse/garbage -type f -print0 6,58s user 70,84s system 35% = cpu 3:36,67 total > xargs -0 chmod 644 3,93s user 59,30s system 28% cpu 3:39,50 total >=20 > --=20 > WBR, Vadim Goncharov. ICQ#166852181 = mailto:vadim_nuclight@mail.ru > [Moderator of = RU.ANTI-ECOLOGY][FreeBSD][http://antigreen.org][LJ:/nuclight] >=20 > _______________________________________________ > freebsd-performance@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-performance > To unsubscribe, send any mail to = "freebsd-performance-unsubscribe@freebsd.org" From owner-freebsd-performance@FreeBSD.ORG Wed Jun 15 19:08:30 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 2E71E1065673; Wed, 15 Jun 2011 19:08:30 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 070238FC1C; Wed, 15 Jun 2011 19:08:29 +0000 (UTC) Received: by pvg11 with SMTP id 11so761934pvg.13 for ; Wed, 15 Jun 2011 12:08:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.14.74 with SMTP id n10mr42169pbc.489.1308163014250; Wed, 15 Jun 2011 11:36:54 -0700 (PDT) Received: by 10.68.55.130 with HTTP; Wed, 15 Jun 2011 11:36:54 -0700 (PDT) In-Reply-To: <4DF4EC9F.9020604@zedat.fu-berlin.de> References: <4DF4EC9F.9020604@zedat.fu-berlin.de> Date: Wed, 15 Jun 2011 19:36:54 +0100 Message-ID: From: Doug Rabson To: "Hartmann, O." X-Mailman-Approved-At: Wed, 15 Jun 2011 19:13:10 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Wed, 15 Jun 2011 19:08:30 -0000 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 > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > 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 From owner-freebsd-performance@FreeBSD.ORG Thu Jun 16 07:29:00 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 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-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: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