Maamoun TK <[email protected]> writes:

> +dnl NETTLE_CHECK_POWER_CRYPTO_EXT
> +dnl ---------------------
> +dnl Check if POWER crypto extensions should be used.
> +dnl Obeys enable_power_crypto_ext, which should be set earlier.
> +AC_DEFUN([NETTLE_CHECK_POWER_CRYPTO_EXT],
> +[if test "$enable_power_crypto_ext" = auto ; then
> +  if test "$cross_compiling" = yes ; then
> +    dnl Check if compiler/assembler accepts it.
> +    AC_CACHE_CHECK([if assembler accepts crypto instructions],
> +      nettle_cv_asm_power_vcrypto,
> +      [GMP_TRY_ASSEMBLE([
> +.text
> +foo:
> + vcipher 0, 0, 1
> +],
> +      [nettle_cv_asm_power_vcrypto=yes],
> +      [nettle_cv_asm_power_vcrypto=no])])
> +    enable_power_crypto_ext="$nettle_cv_asm_power_vcrypto"
> +  else
> +    AC_CACHE_CHECK([if crypto extensions supported],
> +      nettle_cv_asm_power_vcrypto,
> +      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
> +#if defined(__FreeBSD__) && __FreeBSD__ < 12
> +#include <sys/sysctl.h>
> +#else
> +#include <sys/auxv.h>
> +#endif

Do you expect that this "auto" logic does what that user wants? I'm
thinking, maybe it's simpler to stick with just yes/no (no being the
default), and then add support for --enable-fat later, to select code at
run-time?

> --- /dev/null
> +++ b/powerpc64/machine.m4
> @@ -0,0 +1,24 @@
> +define(<PROLOGUE>,
> +<ifelse(WORDS_BIGENDIAN,no,
> +<.align 5
> +.globl C_NAME($1)
> +DECLARE_FUNC(C_NAME($1))
> +C_NAME($1):
> +addis 2,12,(.TOC.-C_NAME($1))@ha
> +addi 2,2,(.TOC.-C_NAME($1))@l
> +.localentry C_NAME($1), .-C_NAME($1)>,
> +<.globl C_NAME($1)
> +DECLARE_FUNC(C_NAME($1))
> +.section ".opd","aw"
> +.align 3
> +C_NAME($1):
> +.quad .C_NAME($1),.TOC.@tocbase,0
> +.previous
> +.align 5
> +.C_NAME($1):>)>)

Overriding PROLOGUE here looks fine, but it would be nice with a comment
explaining what's needed, and/or linking the some appropriate ABI
specification.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Reply via email to