From owner-freebsd-numerics@FreeBSD.ORG Thu Jun 27 16:12:25 2013 Return-Path: Delivered-To: freebsd-numerics@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C8B18EF9 for ; Thu, 27 Jun 2013 16:12:25 +0000 (UTC) (envelope-from enh@google.com) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8441013 for ; Thu, 27 Jun 2013 16:12:25 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id k10so800514wiv.17 for ; Thu, 27 Jun 2013 09:12:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=C9hMPcUMo8lel3UZ7+wlZUABE/w8ogauq2SU8e02aqs=; b=VOYC+Evsbf5YJUI9dz7e8kqmv3z7txzuuWyRV7j90QXxIWYhpkTDowahUP8ObOucPy sfDX/3INz9jswi3Nqm4hIlcG+rRtTznMPwHpr2a9FJahHr+opVZZLNc0mJWPlPLT+uHA USqGMGRsdCi4JhegNsYVDqp2btZz59bzZj6eFtsz49+y4vjWnsO9T649WDeXEASzXz1X bV1f3FiNkRORnEf+4VFguM7KEHpB4lvvIeuD32wnBa4L1laKDcusuExHHy5WSDloG3k0 +YIPhzEPp9V0vIdplj5lll0qQvhRwn3xpFxmFmyWZ28xgbXLciwZmU24a6wY27CARgHR Mm2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=C9hMPcUMo8lel3UZ7+wlZUABE/w8ogauq2SU8e02aqs=; b=BaWDxyKocY4wbT1NsvdDi1jwZVLj1uhHXXwx2tjYeolTVqhNQeHEFOcg4EDkqnO83G 3EKBGd4/hTB8vAL6TZes4hmRd1Vp7cEyQhZkvwfFuSdLW+qL7MStH3F40M6hICHYR+ln wBk57H/fdC6oOMRXQoRK5+3j3Qn8KmMcrE83BYUITZNVa1UUQb3+t8zDy0WIFEzIz9km 3pukIH8EWleJa4f/MGDEGz21X/ut0TYZ4YtJhX0lD2BeblKCyG1xQAtHObQVaJiOIZy3 EEbdVH+CV9frFtf2yBiglQmHlHxUTi+fZGIZeHobUmQe1Ldao2gOTYIn5zb3X16M7FiA LQ2g== X-Received: by 10.180.81.169 with SMTP id b9mr16236369wiy.40.1372349544511; Thu, 27 Jun 2013 09:12:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.137.244 with HTTP; Thu, 27 Jun 2013 09:12:04 -0700 (PDT) In-Reply-To: <20130627013502.GA37295@troutmask.apl.washington.edu> References: <20130627013502.GA37295@troutmask.apl.washington.edu> From: enh Date: Thu, 27 Jun 2013 09:12:04 -0700 Message-ID: Subject: Re: sincos? To: Steve Kargl X-Gm-Message-State: ALoCoQkrw/7OlskkY3QTfAfgWMVMFYmggltAMEg/csESopNliNKLI4lxYtCwQYe6NcqcWqoSc1lVBQUvylp9Qii/QxykTNucPccEQEKfa/HNnOwRB2n7keRbTijN1rzFD1d8mQh9ZN/SFuQxcFcW0zueTGF5lsFOsKs/4Tui2VXHKA3Qv5liNwcdHGZc75JguB0Bb8eyPF7agJ/wrEr8XCTomMZCxHWWHw== Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-numerics@freebsd.org X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of high quality implementation of libm functions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jun 2013 16:12:25 -0000 well, that was Intel and the code's not been accepted, but yes --- that's another reason for me not to accept their patch! Intel claimed "The reason for this fix [beside workaround for O0 switch] - it helps to remove some sin[f]+cos[f] code duplication (which is the whole reason for introduction of such function at all), which results in 1.58-1.81x performance gain on intervals |x|<100." i've not seen their benchmark code, so i don't know what their distribution of values was, and i don't understand why they covered a range as large as +/- 100. when looking at i7 performance though, remember that x86 Android will usually be running on Atom (and most Android devices are actually ARM, not x86). On Wed, Jun 26, 2013 at 6:35 PM, Steve Kargl < sgk@troutmask.apl.washington.edu> wrote: > On Wed, Jun 26, 2013 at 04:45:34PM -0700, enh wrote: > > i'm a recent lurker on this list; i've inherited Android's C library, and > > among other things i'm trying to track FreeBSD's lib/msun much more > closely > > than we have traditionally. > > > > i was just reminded of the existence of a change submitted to us > (Android) > > a while back that adds a sincos/sincosf implementation cobbled together > > from your s_sin.c/s_sinf.c and s_cos.c/s_cosf.c implementations: > > https://android-review.googlesource.com/#/c/47585/< > https://android-review.googlesource.com/#/c/47585/1> > > > > A quick glance at the code shows that the android project has > slapped its Copyright on fdlibm code. I suspect that you'll > want to restore proper attribution to Sun Microsystems. > > > the submitter (Intel) rightly points out that at the moment GCC carefully > > optimizes paired sin/cos calls into a sincos call which we deoptimize > back > > into separate sin/cos calls. i personally don't want to take on > maintenance > > of this, but i would be happy to include you guys' sincos implementation > if > > you had one. is there a reason you don't have one? > > I haven't submitted the versions of sincos[fl], which I've > developed over the last year or so, yet. First, I need to > redo some testing. Second, I need to convince Bruce that > the implementation would be a nice addition to libm. > > -- > Steve >