Thread (11 messages) 11 messages, 8 authors, 2017-12-28

Re: [PATCH] crypto: x86/twofish-3way - Fix %rbp usage

flat view

From: Juergen Gross <jgross@suse.com>
Date: 2017-12-19 08:05:01
Also in: lkml

On 19/12/17 08:54, Ingo Molnar wrote:
* Eric Biggers [off-list ref] wrote:
quoted
There may be a small overhead caused by replacing 'xchg REG, REG' with
the needed sequence 'mov MEM, REG; mov REG, MEM; mov REG, REG' once per
round.  But, counterintuitively, when I tested "ctr-twofish-3way" on a
Haswell processor, the new version was actually about 2% faster.
(Perhaps 'xchg' is not as well optimized as plain moves.)
XCHG has implicit LOCK semantics on all x86 CPUs, so that's not a surprising 
result I think.
Exchanging 2 registers can be done without memory access via:

xor reg1, reg2
xor reg2, reg1
xor reg1, reg2


Juergen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help