mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Polyakov <appro@cryptogams.org>
To: Danny Tsen <dtsen@linux.ibm.com>, linux-crypto@vger.kernel.org
Cc: herbert@gondor.apana.org.au, leitao@debian.org,
	nayna@linux.ibm.com, linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au,
	ltcgcw@linux.vnet.ibm.com, dtsen@us.ibm.com
Subject: Re: [PATCH 1/3] crypto: X25519 low-level primitives for ppc64le.
Date: Wed, 15 May 2024 11:06:58 +0200	[thread overview]
Message-ID: <db513fd8-4723-4b4c-bc14-7da7222617b3@cryptogams.org> (raw)
In-Reply-To: <20240514173835.4814-2-dtsen@linux.ibm.com>

Hi,

> +SYM_FUNC_START(x25519_fe51_sqr_times)
> ...
> +
> +.Lsqr_times_loop:
> ...
> +
> +	std	9,16(3)
> +	std	10,24(3)
> +	std	11,32(3)
> +	std	7,0(3)
> +	std	8,8(3)
> +	bdnz	.Lsqr_times_loop

I see no reason for why the stores can't be moved outside the loop in 
question.

> +SYM_FUNC_START(x25519_fe51_frombytes)
> +.align	5
> +
> +	li	12, -1
> +	srdi	12, 12, 13	# 0x7ffffffffffff
> +
> +	ld	5, 0(4)
> +	ld	6, 8(4)
> +	ld	7, 16(4)
> +	ld	8, 24(4)

Is there actual guarantee that the byte input is 64-bit aligned? While 
it is true that processor is obliged to handle misaligned loads and 
stores by the ISA specification, them being inefficient doesn't go 
against it. Most notably inefficiency is likely to be noted at the page 
boundaries. What I'm trying to say is that it would be more appropriate 
to avoid the unaligned loads (and stores).

Cheers.


  parent reply	other threads:[~2024-05-15  9:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14 17:38 [PATCH 0/3] crypto: X25519 supports " Danny Tsen
2024-05-14 17:38 ` [PATCH 1/3] crypto: X25519 low-level primitives " Danny Tsen
2024-05-15  8:11   ` Andy Polyakov
2024-05-15 12:59     ` Danny Tsen
2024-05-15  9:06   ` Andy Polyakov [this message]
2024-05-15 13:04     ` Danny Tsen
2024-05-16  4:53   ` Michael Ellerman
2024-05-16  8:38     ` Andy Polyakov
2024-05-16 11:39       ` Danny Tsen
2024-05-16 12:06       ` Michael Ellerman
2024-05-16 13:42         ` Andy Polyakov
2024-05-16 19:48         ` Segher Boessenkool
2024-05-16 11:38     ` Danny Tsen
2024-05-14 17:38 ` [PATCH 2/3] crypto: X25519 core functions " Danny Tsen
2024-05-15  8:29   ` Andy Polyakov
2024-05-15 13:06     ` Danny Tsen
2024-05-15 13:33     ` Andy Polyakov
2024-05-15 13:58       ` Danny Tsen
2024-05-15 14:20         ` Andy Polyakov
2024-05-16 19:28     ` Segher Boessenkool
2024-05-14 17:38 ` [PATCH 3/3] crypto: Update Kconfig and Makefile for ppc64le x25519 Danny Tsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db513fd8-4723-4b4c-bc14-7da7222617b3@cryptogams.org \
    --to=appro@cryptogams.org \
    --cc=dtsen@linux.ibm.com \
    --cc=dtsen@us.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=leitao@debian.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ltcgcw@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=nayna@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®