From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6978 Path: news.gmane.org!not-for-mail From: Denys Vlasenko Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 1/2] x86_64/memset: simple optimizations Date: Wed, 11 Feb 2015 02:07:23 +0100 Message-ID: References: <1423589457-8407-1-git-send-email-vda.linux@googlemail.com> <20150210205047.GK23507@brightrain.aerifal.cx> <20150210213756.GM23507@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1423616879 6121 80.91.229.3 (11 Feb 2015 01:07:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Feb 2015 01:07:59 +0000 (UTC) To: musl Original-X-From: musl-return-6991-gllmg-musl=m.gmane.org@lists.openwall.com Wed Feb 11 02:07:59 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YLLmX-0002Dt-Ad for gllmg-musl@m.gmane.org; Wed, 11 Feb 2015 02:07:57 +0100 Original-Received: (qmail 30116 invoked by uid 550); 11 Feb 2015 01:07:55 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 30105 invoked from network); 11 Feb 2015 01:07:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=emQW+R6ZNOWNDTo2Go1I1MvOY8EkW5D76x8xfJxslEw=; b=oYnDdrA2ALhsa+30mzv0irFNb7vbYNpkA4oOOaEVi19phr3h7yOFt/4piu4TNS9Mkz lficA8IrP8+CIBZaN4bd2RCYiDLanYpzJDCX+LVoNo8NAp7oKrTLoJdWlxSzS3jGEMYa cnLTV1+wvVb4LjL/ABVXoGAqGMLnhfcnLePTWXjsZQRbqzvlfKS2Vfu1cKKIuEKP23w9 ldBnRwQI6rLYAgOVsyFuBxJ2p/xKgCwndfANxFMnXPUdRj63YKFBfHYR+yKozrsxc5kL XyrcrCZ1xVcIajqUL+K750PmFQ+OSKqC/69aRzFkfLasfZZwdcqHpZ9HCpiY4oLyLc8l Lijw== X-Received: by 10.140.33.201 with SMTP id j67mr22946448qgj.10.1423616863209; Tue, 10 Feb 2015 17:07:43 -0800 (PST) In-Reply-To: <20150210213756.GM23507@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:6978 Archived-At: On Tue, Feb 10, 2015 at 10:37 PM, Rich Felker wrote: > OK. Based on some casual testing on my Celeron 847: > > - For small sizes, your patches make significant improvement, 20-30%. > > - For rep stosq path, the improvement is minimal (roughly 1-2 cycles). > > - Using 32-bit imul instead of 64-bit makes no difference at all. That's because Celeron 847 is a Sandy Bridge CPU. Only Intel's "big" CPUs starting from Nehalem have fast (and large in transistor count) integer multiplier capable of 3-cycle 64-bit multiply. Many other CPUs are worse, even Intel ones: Atoms are 13-cycle (!), Silvermont: 5 cycles. AMD's Bulldozers: 6 cycles, Bobcat: 6-7, Jaguar: 6, K10: 4 cycles. 32-bit imul is 3 or 4 cycles on all these CPUs (well, Atom has 5).