From owner-freebsd-numerics@freebsd.org Fri Sep 6 14:15:22 2019 Return-Path: Delivered-To: freebsd-numerics@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CF42F4CEC for ; Fri, 6 Sep 2019 14:15:22 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Q02J64CVz4Ps7; Fri, 6 Sep 2019 14:15:20 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id x86EFInA091328 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 6 Sep 2019 07:15:18 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id x86EFHiC091327; Fri, 6 Sep 2019 07:15:17 -0700 (PDT) (envelope-from sgk) Date: Fri, 6 Sep 2019 07:15:17 -0700 From: Steve Kargl To: Stefan Kanthak Cc: freebsd-numerics@freebsd.org, das@freebsd.org Subject: Re: Superfluous instructions in crufty old releng/12.0/lib/msun/i387/s_remquo.S, releng/12.0/lib/msun/amd64/s_remquo.S, ... Message-ID: <20190906141517.GA91272@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <582553CAF6B647A09A15C24F50B9A75E@H270> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <582553CAF6B647A09A15C24F50B9A75E@H270> User-Agent: Mutt/1.12.1 (2019-06-15) X-Rspamd-Queue-Id: 46Q02J64CVz4Ps7 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of sgk@troutmask.apl.washington.edu has no SPF policy when checking 128.95.76.21) smtp.mailfrom=sgk@troutmask.apl.washington.edu X-Spamd-Result: default: False [-0.87 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[sgk@troutmask.apl.washington.edu]; NEURAL_HAM_MEDIUM(-0.64)[-0.637,0]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.03)[0.027,0]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[washington.edu]; REPLYTO_ADDR_EQ_FROM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-0.94)[-0.936,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-0.22)[ip: (0.06), ipnet: 128.95.0.0/16(-0.24), asn: 73(-0.88), country: US(-0.05)]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:73, ipnet:128.95.0.0/16, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-numerics@freebsd.org X-Mailman-Version: 2.1.29 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: Fri, 06 Sep 2019 14:15:22 -0000 On Fri, Sep 06, 2019 at 12:45:03PM +0200, Stefan Kanthak wrote: > > although I doubt that this FPU code might still be used, > here's a patch to shave 2 superfluous instructions from > http://sources.freebsd.org/releng/12.0/lib/msun/i387/s_remquo.S > http://sources.freebsd.org/releng/12.0/lib/msun/i387/s_remquof.S > http://sources.freebsd.org/releng/12.0/lib/msun/i387/s_remquol.S > http://sources.freebsd.org/releng/12.0/lib/msun/amd64/s_remquo.S > http://sources.freebsd.org/releng/12.0/lib/msun/amd64/s_remquof.S > http://sources.freebsd.org/releng/12.0/lib/msun/amd64/s_remquol.S > I don't know assembly, so cannot judge the correctness of your patch. Perhaps, bde will chime in here. The files are used. % make |& tee make.txt ... cc -O2 -pipe -I/usr/src/lib/msun/x86 -I/usr/src/lib/msun/ld80 -I/usr/src/lib/msun/i387 -I/usr/src/lib/msun/src -I/usr/src/lib/libc/include -I/usr/src/lib/libc/i386 -march=core2 -MD -MF.depend.s_remquo.o -MTs_remquo.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wno-pointer-sign -Wno-unknown-pragmas -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -Qunused-arguments -c /usr/src/lib/msun/i387/s_remquo.S -o s_remquo.o -- Steve