lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4F2BF4A7.2070603@linux.intel.com>
Date:	Fri, 03 Feb 2012 06:52:23 -0800
From:	Arjan van de Ven <arjan@...ux.intel.com>
To:	Chinmay V S <chinmay.v.s@...hpartnertech.com>
CC:	Sebastian Andrzej Siewior <sebastian@...akpoint.cc>,
	linux-kernel@...r.kernel.org, cvs268@...il.com, tglx@...utronix.de,
	jeff.chua.linux@...il.com
Subject: Re: [RFC] [PATCH] [timer] Optimise apply_slack() for size and speed.

On 2/2/2012 10:31 PM, Chinmay V S wrote:
> Here is the dis-assembly (build for x86) :
> 
> Original code snippet :
> mov    %eax,%ecx
> mov    $0x1,%edx
> shl    %cl,%edx
> sub    $0x1,%edx
> mov    %edx,-0x10(%ebp)
> not    %edx
> and    %esi,%edx
> mov    %edx,-0x14(%ebp)
> 
> Patched code snippet :
> mov    %eax,%ecx
> shrl   %cl,-0x14(%ebp)
> shll   %cl,-0x14(%ebp)
> 
> As is evident, we are able to reduce 5 instructions by using a bit-shift
> logic (compared to a masking logic).
> 

this code is so not performance critical to this level, that we should
optimize for readability, not for the output of a compiler.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ