From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11585 Path: news.gmane.org!.POSTED!not-for-mail From: David Edelsohn Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] powerpc64le: Add single instruction math functions Date: Fri, 23 Jun 2017 23:05:08 -0400 Message-ID: References: <20170623193533.GO1627@brightrain.aerifal.cx> <594DB66E.7030009@adelielinux.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1498273529 14992 195.159.176.226 (24 Jun 2017 03:05:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 24 Jun 2017 03:05:29 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-11598-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jun 24 05:05:20 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dObNu-0003NH-Py for gllmg-musl@m.gmane.org; Sat, 24 Jun 2017 05:05:18 +0200 Original-Received: (qmail 24228 invoked by uid 550); 24 Jun 2017 03:05:21 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 24207 invoked from network); 24 Jun 2017 03:05:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=vW9btWNQnB5R3fDXsP2LgFkzo8aWqmfMq7i+0g691oE=; b=pwWStnBGaYEI/g9XFkgHlceXge42M4U3pWZjS0f2iuDwGsdsaSStOckWFXGreBtR9d eV0DDy7GsLqZQ84QTzFygYpp4JdoGinnoSf3QBM8IjsT/IqxgiTUcjgWeoZ2ENLNoedn u4WRFzajR/UoLSwIf/QqDJNKdwYAd1w9utMKBChtLCnOq9peo88R9AFbrNcUvCBFBKiA p+sNrmUwOuNTFpls1fX11CkL3vqi/zzHlAkXO3F6q+Dnl4ywsaEJ5P4eli/99aGFlLNy 6R/HbRzXqs6V694djiekkqi51v/ZnAtTv6r4DFD/fAGUfqusIP2/gvasP6LFj97uxo9w 2IzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=vW9btWNQnB5R3fDXsP2LgFkzo8aWqmfMq7i+0g691oE=; b=jGIGyL4O0uYjIMeNTEkiU1Q6WaVb8UD+Fq3Gu3EI0V1jE/QuMJLu1b0uBBHrLPS+yM 9cA/KQtgFAdNvodQ6jzixyAazsQUWiU8805EG3IXTtaaYoEqL/XojfEC+FkO0je89R0p kC50dE5qYsir2Mry+mqwcLxe9qtbL7GpZXvuFdI2crpcPxc0OqhNJ69egJBxALEeJ19b pjwlsyeXgplFBGCvsIo9Tk0XuPx+H3j0xbTxDPEUP3i6eAB1fsr52hXA3QKWBORboPZu q5F3Msq5ze6LQS93qgPFF9WXb1wYFDw4QeLSKXqxQ89I+l2iRjK9u6x+m7yc/TwDCQpQ arww== X-Gm-Message-State: AKS2vOxintInW2eG9c+ObEb+wdqPOB+mP6R34UeK1iQ3mxUDbgWzljid c90r4HUR0GYQzrVZwUIXTYy09GbbCA== X-Received: by 10.233.216.1 with SMTP id u1mr7908134qkf.10.1498273508941; Fri, 23 Jun 2017 20:05:08 -0700 (PDT) In-Reply-To: <594DB66E.7030009@adelielinux.org> Xref: news.gmane.org gmane.linux.lib.musl.general:11585 Archived-At: Note that I only added the optimizations to the "powerpc64" port, not the "powerpc" port. The powerpc64 port only support PPC64LE Linux, which does not include PPC970. The comments about emulation are not relevant to the "powerpc64" port. If someone wants to copy the support to "powerpc" and add the additional tests, that's fine. Thanks, David On Fri, Jun 23, 2017 at 8:46 PM, A. Wilcox wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 23/06/17 14:53, David Edelsohn wrote: >> On Fri, Jun 23, 2017 at 3:35 PM, Rich Felker >> wrote: >>> On Wed, Jun 21, 2017 at 10:53:13AM -0400, David Edelsohn wrote: >>>> The following two patches are a start at single instruction >>>> math functions for PowerPC64 architecture. Although PPC64LE >>>> Linux and ELFv2 ABI require Power8 as the minimum >>>> architecture, I have added guards that fallback to C code for >>>> earlier architectures. >>> >>> Indeed, musl uses the ELFv2 ABI (minus its gratuitous mandate of >>> minimum ISA level) for both little and big endian powerpc64, >>> and I think we have users of both (people running it on old >>> powerbooks, etc.). >>> >>> Am I reading correctly that sqrt, fma, and fabs are available >>> even in the lowest powerpc64 ISA, and don't need preprocessor >>> conditionals? >> >> fabs and fma are part of the base ISA for Power processors that >> include floating point support. fsqrt originally was optional >> feature in the distant past (General Purpose group of optional >> instructions), but is required in the ISA for Power processors. >> >> Thanks, David >> > > Chiming in as one of the heavy users/developers involved with musl/ppc. > > I can confirm FSQRT exists on the oldest PPC64 chip I have - a 970FX > from 2003 - but it is indeed optional. (I didn't bother checking the > actual IBM chips because they're all on the higher end.) The Linux > kernel actually has support for emulating the instruction on PowerPC > chips where it wasn't implemented. See arch/powerpc/math-emu/fsqrt.c > in the kernel tree. > > It depends on CONFIG_MATH_EMULATION_HW_UNIMPLEMENTED (or > CONFIG_MATH_EMULATION_FULL), but most (all?) distros that ship PPC > kernels have that knob turned on, as far as I can tell. > > So this should be safe. The worst case scenario is that distros would > need to twiddle a config knob in the kernel. > > All the best, > - --arw > > - -- > A. Wilcox (awilfox) > Project Lead, Ad=C3=A9lie Linux > http://adelielinux.org > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQIcBAEBCAAGBQJZTbZrAAoJEMspy1GSK50UPQIQAJS//JXGNUSjHtlOsK2ngxTz > 0lOFPDSMTJHmTTXVGJIfoM/Rw0NtAKO6I9+eBbi08eN+Bmh6swRDK+/WQeIft8xx > Ayyi0fCNFhrEFLCc/M+SE5cwSym2gD7o0XyjNGhi5OM4rqOCybHUzTk5KW2Yxoyr > MUG7tqFgXCX8LOkWauGDkAmr9A6NjCN6GZazR7ubrsqId7KRxPGUtZRNZhfl+/cQ > sR5TcTF1yy1Ify6D0wyHIJlIdQPE65i+L+lAr9FGQSNl/NdOQA56hRiijCLwhMNJ > GNSGS6xPMWX0I7bV/gas15CRmJZyNC5sc+5Gm61/wToHgsclYVWJNJ52NXfSEWCA > LzEBfZ+6xoZgKQqBDumGEPSRoaRp8sYTTv5mgmlMBs76mOvjyd8j1p9gYrfzFoPx > Th1EX/CAlgUq84f2Nx1MyDq47ukeJKjWEGfsJe3+yUHYYpENYIKYgvKfx01UGkqR > vx7Cshtz6zjhadruxWAkQ3oqEJwJOfbBXKCITUMuUxFLHK47Ij4yJ/VZaAwiasLn > 9zcTEtsq+Iu4xj/drNNPzVm2KbHTDfcKaQynowvuOx9KgyOpv+UprDXr2Koi5SCD > 5+jS26QzcflGOF6WLvY+pKbDO3l1GPRHc57MhPcjJVVdYWE2NoVbcq+BhYw9ljTq > KIiCkOVyagFRViWyrzvO > =3Deogy > -----END PGP SIGNATURE-----