lkml.org 
[lkml]   [2024]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/2] crypto: x86/sha256-ni - convert to use rounds macros
Date
"Eric Biggers" <ebiggers@kernel.org> wrote:

> +.macro do_4rounds i, m0, m1, m2, m3
> +.if \i < 16
> + movdqu \i*4(DATA_PTR), MSG
> + pshufb SHUF_MASK, MSG
> + movdqa MSG, \m0
> +.else
> + movdqa \m0, MSG
> +.endif
> + paddd \i*4(SHA256CONSTANTS), MSG

To load the round constant independent from and parallel to the previous
instructions which use \m0 I recommend to change the first lines of the
do_4rounds macro as follows (this might save 1+ cycle per macro invocation,
and most obviously 2 lines):

macro do_4rounds i, m0, m1, m2, m3
if \i < 16
movdqu \i*4(DATA_PTR), \m0
pshufb SHUF_MASK, \m0
endif
movdqa \i*4(SHA256CONSTANTS), MSG
paddd \m0, MSG
..

regards
Stefan

\
 
 \ /
  Last update: 2024-05-27 16:31    [W:0.053 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site