From owner-freebsd-toolchain@FreeBSD.ORG Sat Sep 15 16:03:26 2012 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0F0A106564A for ; Sat, 15 Sep 2012 16:03:26 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id 51E238FC0A for ; Sat, 15 Sep 2012 16:03:26 +0000 (UTC) Received: by iea17 with SMTP id 17so4700342iea.13 for ; Sat, 15 Sep 2012 09:03:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=hB43GeEg7m72IIQL0vJ/kfsud7K7kKRQD1qHltBw8K4=; b=LbpDmk3pljRjmMw5yQC+nbpbyd2rlYPVxvLBbNT18J82bvZ2/5BdrTWBRdqTdAb5zl 6JmHNZdXx4v9YYZ9obU1NTlARge154ZtV6OAgFT2jImKRpY4KlaA95i894gkYyxkjFmA zEPubs1mqTYPjbwAm/x496yXvlx3fN5FaztNpnDAVLjplOzi5rf9CuSz+Qe9YNPUEvv3 /7I5XXL+aTBET6r8mypENGTts56X7aTg6ZSpfqhCeAgOJ4Cy61Tov0ngZOpepQC3gmAB G3juqDlFcQRJfoSKPHSt5FTamGIlkX8VLIzOcBEsSG5Bpg5GqWVLrmKQ03uICPiiZQws V2Mg== Received: by 10.42.43.1 with SMTP id v1mr5189013ice.23.1347725005662; Sat, 15 Sep 2012 09:03:25 -0700 (PDT) Received: from 63.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPS id ce10sm3764831igb.1.2012.09.15.09.03.23 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Sep 2012 09:03:25 -0700 (PDT) Sender: Warner Losh Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20120915091455.GA93876@freebsd.org> Date: Sat, 15 Sep 2012 10:03:22 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <504F4645.4070900@FreeBSD.org> <504F4A6B.4010001@coosemans.org> <504F5101.8090906@FreeBSD.org> <505101C3.70203@freebsd.org> <20120913020833.GA8255@troutmask.apl.washington.edu> <1347550332.1110.108.camel@revolution.hippie.lan> <20120913161024.GA13846@troutmask.apl.washington.edu> <20120914202319.GB5244@lor.one-eyed-alien.net> <20120915001808.GA70215@troutmask.apl.washington.edu> <20120915010600.GA70426@troutmask.apl.washington.edu> <20120915091455.GA93876@freebsd.org> To: Roman Divacky X-Mailer: Apple Mail (2.1084) X-Gm-Message-State: ALoCoQnA6tCfLeEauIdVcOHoYCf4S7UjCaUSjNVZDjDqTmJkitU513zJGaRhfp9bQu3ULdTrEhEU Cc: Ian Lepore , Tijl Coosemans , current@freebsd.org, Dimitry Andric , toolchain@freebsd.org, Steve Kargl Subject: Re: Clang as default compiler November 4th X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 16:03:26 -0000 On Sep 15, 2012, at 3:14 AM, Roman Divacky wrote: > LLVM by default turns these: >=20 > case LibFunc::copysign: case LibFunc::copysignf: case = LibFunc::copysignl: > case LibFunc::fabs: case LibFunc::fabsf: case = LibFunc::fabsl: > case LibFunc::sin: case LibFunc::sinf: case = LibFunc::sinl: > case LibFunc::cos: case LibFunc::cosf: case = LibFunc::cosl: > case LibFunc::sqrt: case LibFunc::sqrtf: case = LibFunc::sqrtl: > case LibFunc::floor: case LibFunc::floorf: case = LibFunc::floorl: > case LibFunc::nearbyint: case LibFunc::nearbyintf: case = LibFunc::nearbyintl: > case LibFunc::ceil: case LibFunc::ceilf: case = LibFunc::ceill: > case LibFunc::rint: case LibFunc::rintf: case = LibFunc::rintl: > case LibFunc::trunc: case LibFunc::truncf: case = LibFunc::truncl: > case LibFunc::log2: case LibFunc::log2f: case = LibFunc::log2l: > case LibFunc::exp2: case LibFunc::exp2f: case = LibFunc::exp2l: >=20 > from lib calls to direct code (ie. instruction or sequence of). This = is not a "bug" > but feature ;) >=20 > I am not sure what the rules for the transformation should be. Allow = it only with > -ffast-math ? Disallow it on i386? Really, no idea. In the past, gcc has only done this with -ffast-math, but my 'in the = past' is a long time ago... > Steve, you tested on i386? Can you test on amd64? >=20 > Do you guys have any opinion what to do here? >=20 > On Fri, Sep 14, 2012 at 06:06:00PM -0700, Steve Kargl wrote: >> On Fri, Sep 14, 2012 at 05:18:08PM -0700, Steve Kargl wrote: >>>=20 >>> A third class of failure appears to be that clang emits >>> i387 fpu instructions for at least sinf and cosf instead=20 >>> of calls to the library routines. AFAIK, the library >>> routines are faster and more accurate. >>>=20 >>=20 >> Yep. Clang has problems with at least sinf on i386 FreeBSD. >>=20 >> % pwd >> /usr/home/kargl/trunk/math/sine >>=20 >> % make clean && make CC=3Dcc testf >> cc -o testf -O2 -pipe -static -I/usr/local/include -I../mp testf.c \ >> -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -lm >>=20 >> % ./testf -m 0 -M 1e20 -r >> ULP Range | >> -----------+------------------------- >> [0.0:0.6] | 1006424 (100.00%) >> (0.6:0.7] | 0 ( 0.00%) >> (0.7:0.8] | 0 ( 0.00%) >> (0.8:0.9] | 0 ( 0.00%) >> (0.9:1.0] | 0 ( 0.00%) >> (1.0:2.0] | 0 ( 0.00%) >> (2.0:3.0] | 0 ( 0.00%) >> 3.0 < ULP | 0 ( 0.00%) >> -----------+------------------------- >> Count | 1006424 >> Max ULP | 0.50084 >> Max ULP x | 53462490661259313152.000000 0x1.72f876p+65 >>=20 >> % make clean && make CC=3Dclang testf >> clang -o testf -O2 -pipe -static -I/usr/local/include -I../mp testf.c = \ >> -L/usr/local/lib -L../mp -lsgk -lmpfr -lgmp -lm >>=20 >> % ./testf -m 0 -M 1e20 -r >> ULP Range | >> -----------+------------------------- >> [0.0:0.6] | 1 ( 0.00%) >> (0.6:0.7] | 0 ( 0.00%) >> (0.7:0.8] | 0 ( 0.00%) >> (0.8:0.9] | 0 ( 0.00%) >> (0.9:1.0] | 0 ( 0.00%) >> (1.0:2.0] | 0 ( 0.00%) >> (2.0:3.0] | 0 ( 0.00%) >> 3.0 < ULP | 999998 (100.00%) >> -----------+------------------------- >> Count | 999999 >> Max ULP | 1328505256679420125050194353979392.00000 >> Max ULP x | 75516780764213542912.000000 0x1.06006p+66 >>=20 >> --=20 >> Steve >> _______________________________________________ >> 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" > _______________________________________________ > freebsd-toolchain@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain > To unsubscribe, send any mail to = "freebsd-toolchain-unsubscribe@freebsd.org"