Re: [PATCH] crypto: blake2b - Fix clang optimization for ARMv7-M

From: Arnd Bergmann
Date: Fri May 08 2020 - 17:31:29 EST


On Wed, May 6, 2020 at 7:12 AM Nathan Chancellor
<natechancellor@xxxxxxxxx> wrote:
> > -
> > +#ifdef CONFIG_CC_IS_CLANG
>
> Given your comment in the bug:
>
> "The code is written to assume no loops are unrolled"
>
> Does it make sense to make this unconditional and take compiler
> heuristics out of it?
>
> > +#pragma nounroll /* https://bugs.llvm.org/show_bug.cgi?id=45803 */
> > +#endif
> > for (i = 0; i < 8; ++i)
> > S->h[i] = S->h[i] ^ v[i] ^ v[i + 8];

No, that would not work, as gcc does not support this pragma.

Arnd