Skip to content

Commit

Permalink
crypto: x86/poly1305 - Use TEST %reg,%reg instead of CMP $0,%reg
Browse files Browse the repository at this point in the history
CMP $0,%reg can't set overflow flag, so we can use shorter TEST %reg,%reg
instruction when only zero and sign flags are checked (E,L,LE,G,GE conditions).

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Uros Bizjak authored and Herbert Xu committed Dec 4, 2020
1 parent 0b837f1 commit be169fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/crypto/poly1305-x86_64-cryptogams.pl
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ sub poly1305_iteration {
mov %rax,8($ctx)
mov %rax,16($ctx)
cmp \$0,$inp
test $inp,$inp
je .Lno_key
___
$code.=<<___ if (!$kernel);
Expand Down

0 comments on commit be169fe

Please sign in to comment.