Discussion:
Configuration question
Bill Fischofer
2015-11-17 22:08:29 UTC
Permalink
Hi,

This question has arisen in the ODP project and the thought is that a 'best
practices' answer would be more likely to be found on this list.

We have a component that wants to make use of specialized instructions for
performing CRC and/or AES computations and was wondering what is the
recommended way for an application to determine whether such instructions
are available in the toolchain and whether the user has overruled their use?

Thanks for any insight you can provide.

Bill
Pinski, Andrew
2015-11-17 22:10:25 UTC
Permalink
Sounds like HWCAP should be checked at runtime for these features and then have a fallback to software one.
This might mean using function pointers and initializing the correct ones. Or better yet use ifunc directly to check on them.

Thanks,
Andrew

From: linaro-toolchain [mailto:linaro-toolchain-***@lists.linaro.org] On Behalf Of Bill Fischofer
Sent: Tuesday, November 17, 2015 2:08 PM
To: Linaro Toolchain Mailman List <linaro-***@lists.linaro.org>
Cc: Barry Spinney <***@ezchip.com>
Subject: Configuration question

Hi,

This question has arisen in the ODP project and the thought is that a 'best practices' answer would be more likely to be found on this list.

We have a component that wants to make use of specialized instructions for performing CRC and/or AES computations and was wondering what is the recommended way for an application to determine whether such instructions are available in the toolchain and whether the user has overruled their use?

Thanks for any insight you can provide.

Bill
Bill Fischofer
2015-11-17 22:14:08 UTC
Permalink
Thanks, however we were hoping that this is something that might be
determined at configure/compile time via standard configuration options (we
use autotools).

On Tue, Nov 17, 2015 at 4:10 PM, Pinski, Andrew <
Post by Pinski, Andrew
Sounds like HWCAP should be checked at runtime for these features and then
have a fallback to software one.
This might mean using function pointers and initializing the correct
ones. Or better yet use ifunc directly to check on them.
Thanks,
Andrew
*On Behalf Of *Bill Fischofer
*Sent:* Tuesday, November 17, 2015 2:08 PM
*Subject:* Configuration question
Hi,
This question has arisen in the ODP project and the thought is that a
'best practices' answer would be more likely to be found on this list.
We have a component that wants to make use of specialized instructions for
performing CRC and/or AES computations and was wondering what is the
recommended way for an application to determine whether such instructions
are available in the toolchain and whether the user has overruled their use?
Thanks for any insight you can provide.
Bill
Pinski, Andrew
2015-11-17 22:18:48 UTC
Permalink
Why not runtime instead of compile time?

From: Bill Fischofer [mailto:***@linaro.org]
Sent: Tuesday, November 17, 2015 2:14 PM
To: Pinski, Andrew <***@caviumnetworks.com>
Cc: Linaro Toolchain Mailman List <linaro-***@lists.linaro.org>; Barry Spinney <***@ezchip.com>
Subject: Re: Configuration question

Thanks, however we were hoping that this is something that might be determined at configure/compile time via standard configuration options (we use autotools).

On Tue, Nov 17, 2015 at 4:10 PM, Pinski, Andrew <***@caviumnetworks.com<mailto:***@caviumnetworks.com>> wrote:
Sounds like HWCAP should be checked at runtime for these features and then have a fallback to software one.
This might mean using function pointers and initializing the correct ones. Or better yet use ifunc directly to check on them.

Thanks,
Andrew

From: linaro-toolchain [mailto:linaro-toolchain-***@lists.linaro.org<mailto:linaro-toolchain-***@lists.linaro.org>] On Behalf Of Bill Fischofer
Sent: Tuesday, November 17, 2015 2:08 PM
To: Linaro Toolchain Mailman List <linaro-***@lists.linaro.org<mailto:linaro-***@lists.linaro.org>>
Cc: Barry Spinney <***@ezchip.com<mailto:***@ezchip.com>>
Subject: Configuration question

Hi,

This question has arisen in the ODP project and the thought is that a 'best practices' answer would be more likely to be found on this list.

We have a component that wants to make use of specialized instructions for performing CRC and/or AES computations and was wondering what is the recommended way for an application to determine whether such instructions are available in the toolchain and whether the user has overruled their use?

Thanks for any insight you can provide.

Bill
Renato Golin
2015-11-17 22:21:48 UTC
Permalink
On 17 November 2015 at 22:10, Pinski, Andrew
Post by Pinski, Andrew
Or better yet use ifunc directly to check on them.
I was going to say, this looks like the kind of thing IFUNC was designed for. :)

--renato
Bill Fischofer
2015-11-17 22:24:40 UTC
Permalink
Thanks. We'll look into ifunc.
Post by Renato Golin
On 17 November 2015 at 22:10, Pinski, Andrew
Post by Pinski, Andrew
Or better yet use ifunc directly to check on them.
I was going to say, this looks like the kind of thing IFUNC was designed for. :)
--renato
Loading...