[openssl-dev] Making assembly language optimizations working on Cortex-M3

Andy Polyakov appro at openssl.org
Mon Aug 10 09:49:44 UTC 2015


>     > and recognize two new settings,
>     > OPENSSL_NO_ARM_NEON and OPENSSL_ARM_THUMB_ONLY, to accommodate this.
> 
>     While NO_NEON might make sense, I really see no reason to introduce
>     THUMB_ONLY. Because pre-defines set by the compiler driver are
>     sufficient. 
> 
> 
> You mean, using __thumb__ (predefined for both thumb1 and thumb2)
> and __thumb2__ (predefined for thumb2 only)?

Yes.

>     Actually, one can argue that even decision to omit NEON code
>     can be made based on pre-defines, e.g. __ARM_ARCH_7M__. Well, this
>     doesn't exclude possibility to define NO_NEON based on pre-define and
>     using NO_NEON in code.
> 
> 
> Right. If you are building for Cortex-A (armv7-a) then you may or may
> not want the NEON detection, depending on how much you know about the
> users' hardware in advance. Consequently, I think having an
> OPENSSL_ARM_NO_NEON option is useful.

Well, there is kind of conflict of approaches. Distribution vendors and
generic Linux application developers appreciate if NEON is always
included, because they want to target as many configurations as they
can. On the other hand we have tailored system designers [like yourself]
who prefer "perfect fit" for their target. But probability that tailored
system is armv7-a is rather low. This is rationale behind suggestion to
use pre-defines. But once again, these are not mutually exclusive. In
sense that NO_NEON can be set automatically on __ARM_ARCH_7M__ [in case
user forgets to pass it].

> So, basically, we just need to (a) understand which modules are
> thumb2-only and which aren't,

We already know that. I mean I'm confident that those that are not in
already mentioned list can't be compiled for Thumb-2.

> and (b) adjust more modules to work for thumb2.

That's the idea.

> I am mostly interested in getting the AES-GCM and sha1 assembly
> language optimizations working for this configuration. You mentioned in
> your message that you already have ghash working for thumb2. Is that right?

Yes. Well, even if it's lost, as far as I recall it wasn't really really
complicated...



More information about the openssl-dev mailing list