diff --git a/dev/aarch64_clean/meta.h b/dev/aarch64_clean/meta.h index 89f3e27787..731b7ffc12 100644 --- a/dev/aarch64_clean/meta.h +++ b/dev/aarch64_clean/meta.h @@ -28,7 +28,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -40,7 +40,7 @@ static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -52,7 +52,7 @@ static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -63,7 +63,7 @@ static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_tomont_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -75,7 +75,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_mulcache_compute_native(int16_t x[MLKEM_N / 2], const int16_t y[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -91,7 +91,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k2_native( int16_t r[MLKEM_N], const int16_t a[2 * MLKEM_N], const int16_t b[2 * MLKEM_N], const int16_t b_cache[2 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -106,7 +106,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k3_native( int16_t r[MLKEM_N], const int16_t a[3 * MLKEM_N], const int16_t b[3 * MLKEM_N], const int16_t b_cache[3 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -121,7 +121,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k4_native( int16_t r[MLKEM_N], const int16_t a[4 * MLKEM_N], const int16_t b[4 * MLKEM_N], const int16_t b_cache[4 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -134,7 +134,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_tobytes_native(uint8_t r[MLKEM_POLYBYTES], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -147,7 +147,7 @@ static MLK_INLINE int mlk_rej_uniform_native(int16_t *r, unsigned len, const uint8_t *buf, unsigned buflen) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON) || len != MLKEM_N || + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON) || len != MLKEM_N || buflen % 24 != 0) { return MLK_NATIVE_FUNC_FALLBACK; diff --git a/dev/aarch64_opt/meta.h b/dev/aarch64_opt/meta.h index 6bd1653e28..324427d6f8 100644 --- a/dev/aarch64_opt/meta.h +++ b/dev/aarch64_opt/meta.h @@ -28,7 +28,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -40,7 +40,7 @@ static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -52,7 +52,7 @@ static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -63,7 +63,7 @@ static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_tomont_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -75,7 +75,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_mulcache_compute_native(int16_t x[MLKEM_N / 2], const int16_t y[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -91,7 +91,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k2_native( int16_t r[MLKEM_N], const int16_t a[2 * MLKEM_N], const int16_t b[2 * MLKEM_N], const int16_t b_cache[2 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -106,7 +106,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k3_native( int16_t r[MLKEM_N], const int16_t a[3 * MLKEM_N], const int16_t b[3 * MLKEM_N], const int16_t b_cache[3 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -121,7 +121,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k4_native( int16_t r[MLKEM_N], const int16_t a[4 * MLKEM_N], const int16_t b[4 * MLKEM_N], const int16_t b_cache[4 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -134,7 +134,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_tobytes_native(uint8_t r[MLKEM_POLYBYTES], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -147,7 +147,7 @@ static MLK_INLINE int mlk_rej_uniform_native(int16_t *r, unsigned len, const uint8_t *buf, unsigned buflen) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON) || len != MLKEM_N || + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON) || len != MLKEM_N || buflen % 24 != 0) { return MLK_NATIVE_FUNC_FALLBACK; diff --git a/dev/fips202/aarch64/x1_v84a.h b/dev/fips202/aarch64/x1_v84a.h index 393c64b720..8513a6d926 100644 --- a/dev/fips202/aarch64/x1_v84a.h +++ b/dev/fips202/aarch64/x1_v84a.h @@ -21,8 +21,8 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_keccak_f1600_x1_native(uint64_t *state) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON) || - !mlk_sys_check_capability(MLK_SYS_CAP_SHA3)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON) || + !mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_SHA3)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/dev/fips202/aarch64/x2_v84a.h b/dev/fips202/aarch64/x2_v84a.h index e09a6dc583..6bfeee96c6 100644 --- a/dev/fips202/aarch64/x2_v84a.h +++ b/dev/fips202/aarch64/x2_v84a.h @@ -21,8 +21,8 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON) || - !mlk_sys_check_capability(MLK_SYS_CAP_SHA3)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON) || + !mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_SHA3)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/dev/fips202/aarch64/x4_v8a_scalar.h b/dev/fips202/aarch64/x4_v8a_scalar.h index d5ccd9fa06..7a9cfc4154 100644 --- a/dev/fips202/aarch64/x4_v8a_scalar.h +++ b/dev/fips202/aarch64/x4_v8a_scalar.h @@ -17,7 +17,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/dev/fips202/aarch64/x4_v8a_v84a_scalar.h b/dev/fips202/aarch64/x4_v8a_v84a_scalar.h index 10e93808e1..0d624bdb2f 100644 --- a/dev/fips202/aarch64/x4_v8a_v84a_scalar.h +++ b/dev/fips202/aarch64/x4_v8a_v84a_scalar.h @@ -21,8 +21,8 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON) || - !mlk_sys_check_capability(MLK_SYS_CAP_SHA3)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON) || + !mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_SHA3)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/dev/fips202/x86_64/keccak_f1600_x4_avx2.h b/dev/fips202/x86_64/keccak_f1600_x4_avx2.h index 30a63e31cb..4601629284 100644 --- a/dev/fips202/x86_64/keccak_f1600_x4_avx2.h +++ b/dev/fips202/x86_64/keccak_f1600_x4_avx2.h @@ -19,7 +19,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/dev/x86_64/meta.h b/dev/x86_64/meta.h index fdbbfcea28..c750f10809 100644 --- a/dev/x86_64/meta.h +++ b/dev/x86_64/meta.h @@ -37,7 +37,7 @@ static MLK_INLINE void mlk_poly_permute_bitrev_to_custom(int16_t data[MLKEM_N]) { - if (mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { mlk_nttunpack_avx2_asm(data); } @@ -48,7 +48,7 @@ static MLK_INLINE int mlk_rej_uniform_native(int16_t *r, unsigned len, const uint8_t *buf, unsigned buflen) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2) || len != MLKEM_N || + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2) || len != MLKEM_N || buflen % 12 != 0) { return MLK_NATIVE_FUNC_FALLBACK; @@ -59,7 +59,7 @@ static MLK_INLINE int mlk_rej_uniform_native(int16_t *r, unsigned len, MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -71,7 +71,7 @@ static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -83,7 +83,7 @@ static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -95,7 +95,7 @@ static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_tomont_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -108,7 +108,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_mulcache_compute_native(int16_t x[MLKEM_N / 2], const int16_t y[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -123,7 +123,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k2_native( int16_t r[MLKEM_N], const int16_t a[2 * MLKEM_N], const int16_t b[2 * MLKEM_N], const int16_t b_cache[2 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -139,7 +139,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k3_native( int16_t r[MLKEM_N], const int16_t a[3 * MLKEM_N], const int16_t b[3 * MLKEM_N], const int16_t b_cache[3 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -155,7 +155,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k4_native( int16_t r[MLKEM_N], const int16_t a[4 * MLKEM_N], const int16_t b[4 * MLKEM_N], const int16_t b_cache[4 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -169,7 +169,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_tobytes_native(uint8_t r[MLKEM_POLYBYTES], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -182,7 +182,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_frombytes_native( int16_t r[MLKEM_N], const uint8_t a[MLKEM_POLYBYTES]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -196,7 +196,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_compress_d4_native( uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D4], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -209,7 +209,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_compress_d10_native( uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D10], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -222,7 +222,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_decompress_d4_native( int16_t r[MLKEM_N], const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D4]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -235,7 +235,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_decompress_d10_native( int16_t r[MLKEM_N], const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D10]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -250,7 +250,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_compress_d5_native( uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D5], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -263,7 +263,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_compress_d11_native( uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D11], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -276,7 +276,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_decompress_d5_native( int16_t r[MLKEM_N], const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D5]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -289,7 +289,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_decompress_d11_native( int16_t r[MLKEM_N], const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D11]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/integration/aws-lc/post_import.patch b/integration/aws-lc/post_import.patch index 1a265e7276..2662646082 100644 --- a/integration/aws-lc/post_import.patch +++ b/integration/aws-lc/post_import.patch @@ -11,12 +11,13 @@ diff --git a/crypto/fipsmodule/ml_kem/mlkem_native_config.h b/crypto/fipsmodule/ static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap) { #if defined(MLK_SYS_X86_64) - if (cap == MLK_SYS_CAP_AVX2) +- if (cap == MLK_SYS_CAP_AVX2) ++ if (cap == MLK_SYS_CAP_X86_64_AVX2) { return CRYPTO_is_AVX2_capable(); } +#elif defined(MLK_SYS_AARCH64) -+ if (cap == MLK_SYS_CAP_NEON) ++ if (cap == MLK_SYS_CAP_AARCH64_NEON) + { + return CRYPTO_is_NEON_capable(); + } diff --git a/mlkem/src/fips202/native/aarch64/x1_v84a.h b/mlkem/src/fips202/native/aarch64/x1_v84a.h index d380f86731..0d0c8b6ad4 100644 --- a/mlkem/src/fips202/native/aarch64/x1_v84a.h +++ b/mlkem/src/fips202/native/aarch64/x1_v84a.h @@ -21,8 +21,8 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_keccak_f1600_x1_native(uint64_t *state) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON) || - !mlk_sys_check_capability(MLK_SYS_CAP_SHA3)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON) || + !mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_SHA3)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/mlkem/src/fips202/native/aarch64/x2_v84a.h b/mlkem/src/fips202/native/aarch64/x2_v84a.h index 26582b78a1..22d05d3292 100644 --- a/mlkem/src/fips202/native/aarch64/x2_v84a.h +++ b/mlkem/src/fips202/native/aarch64/x2_v84a.h @@ -21,8 +21,8 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON) || - !mlk_sys_check_capability(MLK_SYS_CAP_SHA3)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON) || + !mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_SHA3)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h b/mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h index fdce7b3a59..87f82e7e0f 100644 --- a/mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h +++ b/mlkem/src/fips202/native/aarch64/x4_v8a_scalar.h @@ -17,7 +17,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h b/mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h index ea8be1a86e..e4609f4c1d 100644 --- a/mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h +++ b/mlkem/src/fips202/native/aarch64/x4_v8a_v84a_scalar.h @@ -21,8 +21,8 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON) || - !mlk_sys_check_capability(MLK_SYS_CAP_SHA3)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON) || + !mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_SHA3)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h b/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h index 1c37f31ac3..aa975b0f35 100644 --- a/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h +++ b/mlkem/src/fips202/native/x86_64/keccak_f1600_x4_avx2.h @@ -19,7 +19,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_keccak_f1600_x4_native(uint64_t *state) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/mlkem/src/native/aarch64/meta.h b/mlkem/src/native/aarch64/meta.h index fb4a7c164b..d82ebdeb92 100644 --- a/mlkem/src/native/aarch64/meta.h +++ b/mlkem/src/native/aarch64/meta.h @@ -28,7 +28,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -40,7 +40,7 @@ static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -52,7 +52,7 @@ static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -63,7 +63,7 @@ static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_tomont_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -75,7 +75,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_mulcache_compute_native(int16_t x[MLKEM_N / 2], const int16_t y[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -91,7 +91,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k2_native( int16_t r[MLKEM_N], const int16_t a[2 * MLKEM_N], const int16_t b[2 * MLKEM_N], const int16_t b_cache[2 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -106,7 +106,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k3_native( int16_t r[MLKEM_N], const int16_t a[3 * MLKEM_N], const int16_t b[3 * MLKEM_N], const int16_t b_cache[3 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -121,7 +121,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k4_native( int16_t r[MLKEM_N], const int16_t a[4 * MLKEM_N], const int16_t b[4 * MLKEM_N], const int16_t b_cache[4 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -134,7 +134,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_tobytes_native(uint8_t r[MLKEM_POLYBYTES], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -147,7 +147,7 @@ static MLK_INLINE int mlk_rej_uniform_native(int16_t *r, unsigned len, const uint8_t *buf, unsigned buflen) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON) || len != MLKEM_N || + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON) || len != MLKEM_N || buflen % 24 != 0) { return MLK_NATIVE_FUNC_FALLBACK; diff --git a/mlkem/src/native/x86_64/meta.h b/mlkem/src/native/x86_64/meta.h index e59849ef76..e6573261ee 100644 --- a/mlkem/src/native/x86_64/meta.h +++ b/mlkem/src/native/x86_64/meta.h @@ -37,7 +37,7 @@ static MLK_INLINE void mlk_poly_permute_bitrev_to_custom(int16_t data[MLKEM_N]) { - if (mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { mlk_nttunpack_avx2_asm(data); } @@ -48,7 +48,7 @@ static MLK_INLINE int mlk_rej_uniform_native(int16_t *r, unsigned len, const uint8_t *buf, unsigned buflen) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2) || len != MLKEM_N || + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2) || len != MLKEM_N || buflen % 12 != 0) { return MLK_NATIVE_FUNC_FALLBACK; @@ -59,7 +59,7 @@ static MLK_INLINE int mlk_rej_uniform_native(int16_t *r, unsigned len, MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -71,7 +71,7 @@ static MLK_INLINE int mlk_ntt_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -83,7 +83,7 @@ static MLK_INLINE int mlk_intt_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -95,7 +95,7 @@ static MLK_INLINE int mlk_poly_reduce_native(int16_t data[MLKEM_N]) MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_tomont_native(int16_t data[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -108,7 +108,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_mulcache_compute_native(int16_t x[MLKEM_N / 2], const int16_t y[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -123,7 +123,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k2_native( int16_t r[MLKEM_N], const int16_t a[2 * MLKEM_N], const int16_t b[2 * MLKEM_N], const int16_t b_cache[2 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -139,7 +139,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k3_native( int16_t r[MLKEM_N], const int16_t a[3 * MLKEM_N], const int16_t b[3 * MLKEM_N], const int16_t b_cache[3 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -155,7 +155,7 @@ static MLK_INLINE int mlk_polyvec_basemul_acc_montgomery_cached_k4_native( int16_t r[MLKEM_N], const int16_t a[4 * MLKEM_N], const int16_t b[4 * MLKEM_N], const int16_t b_cache[4 * (MLKEM_N / 2)]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -169,7 +169,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_tobytes_native(uint8_t r[MLKEM_POLYBYTES], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -182,7 +182,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_frombytes_native( int16_t r[MLKEM_N], const uint8_t a[MLKEM_POLYBYTES]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -196,7 +196,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_compress_d4_native( uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D4], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -209,7 +209,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_compress_d10_native( uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D10], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -222,7 +222,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_decompress_d4_native( int16_t r[MLKEM_N], const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D4]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -235,7 +235,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_decompress_d10_native( int16_t r[MLKEM_N], const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D10]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -250,7 +250,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_compress_d5_native( uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D5], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -263,7 +263,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_compress_d11_native( uint8_t r[MLKEM_POLYCOMPRESSEDBYTES_D11], const int16_t a[MLKEM_N]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -276,7 +276,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_decompress_d5_native( int16_t r[MLKEM_N], const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D5]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } @@ -289,7 +289,7 @@ MLK_MUST_CHECK_RETURN_VALUE static MLK_INLINE int mlk_poly_decompress_d11_native( int16_t r[MLKEM_N], const uint8_t a[MLKEM_POLYCOMPRESSEDBYTES_D11]) { - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { return MLK_NATIVE_FUNC_FALLBACK; } diff --git a/mlkem/src/sys.h b/mlkem/src/sys.h index 227b50bd17..2d153ad5a1 100644 --- a/mlkem/src/sys.h +++ b/mlkem/src/sys.h @@ -273,12 +273,12 @@ typedef enum { /* x86_64 */ - MLK_SYS_CAP_AVX2, + MLK_SYS_CAP_X86_64_AVX2, /* AArch64 */ - MLK_SYS_CAP_NEON, - MLK_SYS_CAP_SHA3, + MLK_SYS_CAP_AARCH64_NEON, + MLK_SYS_CAP_AARCH64_SHA3, /* Armv8.1-M */ - MLK_SYS_CAP_MVE + MLK_SYS_CAP_ARMV81M_MVE } mlk_sys_cap; #if !defined(MLK_CONFIG_CUSTOM_CAPABILITY_FUNC) diff --git a/scripts/autogen b/scripts/autogen index eb96db8fc4..0367078b1f 100755 --- a/scripts/autogen +++ b/scripts/autogen @@ -2916,11 +2916,10 @@ def check_macro_typos_in_file(filename, macro_check): def get_syscaps(): return [ - "MLK_SYS_CAP_AVX2", - "MLK_SYS_CAP_NEON", - "MLK_SYS_CAP_SHA3", - "MLK_SYS_CAP_MVE", - "MLK_SYS_CAP_DUMMY", + "MLK_SYS_CAP_X86_64_AVX2", + "MLK_SYS_CAP_AARCH64_NEON", + "MLK_SYS_CAP_AARCH64_SHA3", + "MLK_SYS_CAP_ARMV81M_MVE", ] @@ -2971,8 +2970,8 @@ def check_macro_typos(): if rest.startswith("\\") or m in ["MLK_XXX", "MLK_SOURCE_XXX"]: return True - # AWS-LC importer patch - if is_autogen or filename == "integration/awslc/awslc.patch": + # AWS-LC post-import patch + if is_autogen or filename == "integration/aws-lc/post_import.patch": return True if ( @@ -4613,7 +4612,7 @@ ABI_CAPS = { "AVX2": { "asm_subdir": "x86_64", "guard": "__AVX2__", - "syscap": "MLK_SYS_CAP_AVX2", + "syscap": "MLK_SYS_CAP_X86_64_AVX2", "description": "AVX2", "cflags": ["-mavx2", "-mbmi2"], "aux_files": [], @@ -4621,7 +4620,7 @@ ABI_CAPS = { "NEON": { "asm_subdir": "aarch64", "guard": None, - "syscap": "MLK_SYS_CAP_NEON", + "syscap": "MLK_SYS_CAP_AARCH64_NEON", "description": "AArch64 NEON", "cflags": [], "aux_files": [], @@ -4629,7 +4628,7 @@ ABI_CAPS = { "SHA3": { "asm_subdir": "aarch64", "guard": "__ARM_FEATURE_SHA3", - "syscap": "MLK_SYS_CAP_SHA3", + "syscap": "MLK_SYS_CAP_AARCH64_SHA3", "description": "Armv8.4-A SHA3 (eor3, rax1, xar, bcax)", "cflags": ["-march=armv8.4-a+sha3"], "aux_files": [], @@ -4637,7 +4636,7 @@ ABI_CAPS = { "MVE": { "asm_subdir": "armv81m", "guard": "__ARM_FEATURE_MVE", - "syscap": "MLK_SYS_CAP_MVE", + "syscap": "MLK_SYS_CAP_ARMV81M_MVE", "description": "Armv8.1-M MVE", "cflags": ["-march=armv8.1-m.main+mve", "-mthumb"], "aux_files": [ @@ -5369,8 +5368,8 @@ def _main(): ("Generate monolithic source files", gen_monolithic), ("Generate undefs", gen_undefs), ("Generate test configs", gen_test_configs), - ("Check macro typos", check_macro_typos), ("Generate ABI checker tests", gen_abicheck), + ("Check macro typos", check_macro_typos), ("Generate preprocessor comments", gen_preprocessor_comments), # Formatting should be the last step ("Format files", lambda: format_files(args.dry_run)), diff --git a/test/abicheck/aarch64/abicheck_aarch64.c b/test/abicheck/aarch64/abicheck_aarch64.c index dadb11acff..56d3ffa5f5 100644 --- a/test/abicheck/aarch64/abicheck_aarch64.c +++ b/test/abicheck/aarch64/abicheck_aarch64.c @@ -45,7 +45,7 @@ int check_aarch64_aapcs_compliance(struct aarch64_register_state *before, } /* The call stub leaves vector output untouched when NEON is unavailable. */ - if (mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { /* Check callee-saved NEON registers (d8-d15, lower 64 bits only). */ for (i = 8; i <= 15; i++) diff --git a/test/abicheck/aarch64/abicheck_aarch64.h b/test/abicheck/aarch64/abicheck_aarch64.h index f086f3e747..06613b53e6 100644 --- a/test/abicheck/aarch64/abicheck_aarch64.h +++ b/test/abicheck/aarch64/abicheck_aarch64.h @@ -32,7 +32,7 @@ static MLK_INLINE void call_stub_aarch64(struct aarch64_register_state *input, struct aarch64_register_state *output, void (*function_ptr)(void)) { - int use_neon = mlk_sys_check_capability(MLK_SYS_CAP_NEON) != 0; + int use_neon = mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON) != 0; asm_call_stub_aarch64(input, output, function_ptr, use_neon); } diff --git a/test/abicheck/aarch64/checks/check_intt_aarch64_asm.c b/test/abicheck/aarch64/checks/check_intt_aarch64_asm.c index a37d49bfe8..973dd58b1f 100644 --- a/test/abicheck/aarch64/checks/check_intt_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_intt_aarch64_asm.c @@ -32,7 +32,7 @@ int check_intt_aarch64_asm(void) MLK_ALIGN uint8_t buf_x1[160]; /* Twiddle factors for layers 1-5 */ MLK_ALIGN uint8_t buf_x2[768]; /* Twiddle factors for layers 6-7 */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check intt_aarch64_asm: host lacks AArch64 NEON, skipping\n"); diff --git a/test/abicheck/aarch64/checks/check_keccak_f1600_x1_v84a_aarch64_asm.c b/test/abicheck/aarch64/checks/check_keccak_f1600_x1_v84a_aarch64_asm.c index ce07d2e415..53fd833b29 100644 --- a/test/abicheck/aarch64/checks/check_keccak_f1600_x1_v84a_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_keccak_f1600_x1_v84a_aarch64_asm.c @@ -31,7 +31,7 @@ int check_keccak_f1600_x1_v84a_aarch64_asm(void) MLK_ALIGN uint8_t buf_x0[200]; /* Keccak state (25 x uint64_t) */ MLK_ALIGN uint8_t buf_x1[192]; /* Round constants (24 x uint64_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check keccak_f1600_x1_v84a_aarch64_asm: host lacks AArch64 " @@ -39,7 +39,7 @@ int check_keccak_f1600_x1_v84a_aarch64_asm(void) return MLK_ABICHECK_SKIPPED; } - if (!mlk_sys_check_capability(MLK_SYS_CAP_SHA3)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_SHA3)) { fprintf(stderr, "ABI check keccak_f1600_x1_v84a_aarch64_asm: host lacks Armv8.4-A " diff --git a/test/abicheck/aarch64/checks/check_keccak_f1600_x2_v84a_aarch64_asm.c b/test/abicheck/aarch64/checks/check_keccak_f1600_x2_v84a_aarch64_asm.c index 376da33880..a992d4b559 100644 --- a/test/abicheck/aarch64/checks/check_keccak_f1600_x2_v84a_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_keccak_f1600_x2_v84a_aarch64_asm.c @@ -32,7 +32,7 @@ int check_keccak_f1600_x2_v84a_aarch64_asm(void) buf_x0[400]; /* Two sequential Keccak states (state0[25], state1[25]) */ MLK_ALIGN uint8_t buf_x1[192]; /* Round constants (24 x uint64_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check keccak_f1600_x2_v84a_aarch64_asm: host lacks AArch64 " @@ -40,7 +40,7 @@ int check_keccak_f1600_x2_v84a_aarch64_asm(void) return MLK_ABICHECK_SKIPPED; } - if (!mlk_sys_check_capability(MLK_SYS_CAP_SHA3)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_SHA3)) { fprintf(stderr, "ABI check keccak_f1600_x2_v84a_aarch64_asm: host lacks Armv8.4-A " diff --git a/test/abicheck/aarch64/checks/check_keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.c b/test/abicheck/aarch64/checks/check_keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.c index 1e504cbae7..0ac2c6ca3b 100644 --- a/test/abicheck/aarch64/checks/check_keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm.c @@ -32,7 +32,7 @@ int check_keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm(void) state1[25], state2[25], state3[25]) */ MLK_ALIGN uint8_t buf_x1[192]; /* Round constants (24 x uint64_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check keccak_f1600_x4_v8a_scalar_hybrid_aarch64_asm: host " diff --git a/test/abicheck/aarch64/checks/check_keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.c b/test/abicheck/aarch64/checks/check_keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.c index f577d95bd7..a22399b4e6 100644 --- a/test/abicheck/aarch64/checks/check_keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm.c @@ -32,7 +32,7 @@ int check_keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm(void) state1[25], state2[25], state3[25]) */ MLK_ALIGN uint8_t buf_x1[192]; /* Round constants (24 x uint64_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm: " @@ -40,7 +40,7 @@ int check_keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm(void) return MLK_ABICHECK_SKIPPED; } - if (!mlk_sys_check_capability(MLK_SYS_CAP_SHA3)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_SHA3)) { fprintf(stderr, "ABI check keccak_f1600_x4_v8a_v84a_scalar_hybrid_aarch64_asm: " diff --git a/test/abicheck/aarch64/checks/check_ntt_aarch64_asm.c b/test/abicheck/aarch64/checks/check_ntt_aarch64_asm.c index 30b2608d84..e81bf1c76e 100644 --- a/test/abicheck/aarch64/checks/check_ntt_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_ntt_aarch64_asm.c @@ -32,7 +32,7 @@ int check_ntt_aarch64_asm(void) MLK_ALIGN uint8_t buf_x1[160]; /* Twiddle factors for layers 1-5 */ MLK_ALIGN uint8_t buf_x2[768]; /* Twiddle factors for layers 6-7 */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check ntt_aarch64_asm: host lacks AArch64 NEON, skipping\n"); diff --git a/test/abicheck/aarch64/checks/check_poly_mulcache_compute_aarch64_asm.c b/test/abicheck/aarch64/checks/check_poly_mulcache_compute_aarch64_asm.c index d592db4c78..8ef4e72c03 100644 --- a/test/abicheck/aarch64/checks/check_poly_mulcache_compute_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_poly_mulcache_compute_aarch64_asm.c @@ -35,7 +35,7 @@ int check_poly_mulcache_compute_aarch64_asm(void) MLK_ALIGN uint8_t buf_x2[256]; /* Zeta values */ MLK_ALIGN uint8_t buf_x3[256]; /* Twisted zeta values */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check poly_mulcache_compute_aarch64_asm: host lacks AArch64 " diff --git a/test/abicheck/aarch64/checks/check_poly_reduce_aarch64_asm.c b/test/abicheck/aarch64/checks/check_poly_reduce_aarch64_asm.c index 880df9cf7b..901677997c 100644 --- a/test/abicheck/aarch64/checks/check_poly_reduce_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_poly_reduce_aarch64_asm.c @@ -29,7 +29,7 @@ int check_poly_reduce_aarch64_asm(void) int violations; MLK_ALIGN uint8_t buf_x0[512]; /* Input/output polynomial */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check poly_reduce_aarch64_asm: host lacks AArch64 NEON, " diff --git a/test/abicheck/aarch64/checks/check_poly_tobytes_aarch64_asm.c b/test/abicheck/aarch64/checks/check_poly_tobytes_aarch64_asm.c index d3bb8c5169..23281bfdac 100644 --- a/test/abicheck/aarch64/checks/check_poly_tobytes_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_poly_tobytes_aarch64_asm.c @@ -30,7 +30,7 @@ int check_poly_tobytes_aarch64_asm(void) MLK_ALIGN uint8_t buf_x0[384]; /* Output byte array */ MLK_ALIGN uint8_t buf_x1[512]; /* Input polynomial */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check poly_tobytes_aarch64_asm: host lacks AArch64 NEON, " diff --git a/test/abicheck/aarch64/checks/check_poly_tomont_aarch64_asm.c b/test/abicheck/aarch64/checks/check_poly_tomont_aarch64_asm.c index 079b94d2e5..63d57832fd 100644 --- a/test/abicheck/aarch64/checks/check_poly_tomont_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_poly_tomont_aarch64_asm.c @@ -29,7 +29,7 @@ int check_poly_tomont_aarch64_asm(void) int violations; MLK_ALIGN uint8_t buf_x0[512]; /* Input/output polynomial */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check poly_tomont_aarch64_asm: host lacks AArch64 NEON, " diff --git a/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.c b/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.c index 1cda91102a..7616bd4531 100644 --- a/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm.c @@ -34,7 +34,7 @@ int check_polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm(void) MLK_ALIGN uint8_t buf_x2[1024]; /* Input polynomial vector b */ MLK_ALIGN uint8_t buf_x3[512]; /* Cached values for b */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check polyvec_basemul_acc_montgomery_cached_k2_aarch64_asm: " diff --git a/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.c b/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.c index d51079a6ac..7ec40fc829 100644 --- a/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm.c @@ -34,7 +34,7 @@ int check_polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm(void) MLK_ALIGN uint8_t buf_x2[1536]; /* Input polynomial vector b */ MLK_ALIGN uint8_t buf_x3[768]; /* Cached values for b */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check polyvec_basemul_acc_montgomery_cached_k3_aarch64_asm: " diff --git a/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.c b/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.c index 6d4cafb793..6ca679e613 100644 --- a/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm.c @@ -34,7 +34,7 @@ int check_polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm(void) MLK_ALIGN uint8_t buf_x2[2048]; /* Input polynomial vector b */ MLK_ALIGN uint8_t buf_x3[1024]; /* Cached values for b */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check polyvec_basemul_acc_montgomery_cached_k4_aarch64_asm: " diff --git a/test/abicheck/aarch64/checks/check_rej_uniform_aarch64_asm.c b/test/abicheck/aarch64/checks/check_rej_uniform_aarch64_asm.c index d796122287..fc6f07c6ca 100644 --- a/test/abicheck/aarch64/checks/check_rej_uniform_aarch64_asm.c +++ b/test/abicheck/aarch64/checks/check_rej_uniform_aarch64_asm.c @@ -33,7 +33,7 @@ int check_rej_uniform_aarch64_asm(void) MLK_ALIGN uint8_t buf_x1[504]; /* Input buffer */ MLK_ALIGN uint8_t buf_x3[4096]; /* Lookup table */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { fprintf(stderr, "ABI check rej_uniform_aarch64_asm: host lacks AArch64 NEON, " diff --git a/test/abicheck/armv81m/checks/check_keccak_f1600_x4_mve_asm.c b/test/abicheck/armv81m/checks/check_keccak_f1600_x4_mve_asm.c index ccc6a9f9e6..3f84d6186a 100644 --- a/test/abicheck/armv81m/checks/check_keccak_f1600_x4_mve_asm.c +++ b/test/abicheck/armv81m/checks/check_keccak_f1600_x4_mve_asm.c @@ -34,7 +34,7 @@ int check_keccak_f1600_x4_mve_asm(void) MLK_ALIGN uint8_t buf_r2[192]; /* Keccak round constants in bit-interleaved form (24 pairs of 32-bit words) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_MVE)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_ARMV81M_MVE)) { fprintf(stderr, "ABI check keccak_f1600_x4_mve_asm: host lacks Armv8.1-M MVE, " diff --git a/test/abicheck/selftest.c b/test/abicheck/selftest.c index 30fd23dc53..1fec29000a 100644 --- a/test/abicheck/selftest.c +++ b/test/abicheck/selftest.c @@ -335,7 +335,7 @@ int abicheck_selftest(void) /* The NEON corrupters execute vector instructions, so running them on a * host without NEON would fault instead of testing the ABI checker. */ - if (mlk_sys_check_capability(MLK_SYS_CAP_NEON)) + if (mlk_sys_check_capability(MLK_SYS_CAP_AARCH64_NEON)) { SELFTEST_RUN_ARCH("aarch64", struct aarch64_register_state, init_aarch64_register_state, call_stub_aarch64, diff --git a/test/abicheck/x86_64/checks/check_invntt_avx2_asm.c b/test/abicheck/x86_64/checks/check_invntt_avx2_asm.c index 3a7a52f80b..a7c6a0ffbf 100644 --- a/test/abicheck/x86_64/checks/check_invntt_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_invntt_avx2_asm.c @@ -32,7 +32,7 @@ int check_invntt_avx2_asm(void) MLK_ALIGN uint8_t buf_rdi[512]; /* Input/output polynomial (256 x int16_t) */ MLK_ALIGN uint8_t buf_rsi[1248]; /* Precomputed constants (624 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check invntt_avx2_asm: host lacks AVX2, skipping\n"); return MLK_ABICHECK_SKIPPED; diff --git a/test/abicheck/x86_64/checks/check_keccak_f1600_x4_avx2_asm.c b/test/abicheck/x86_64/checks/check_keccak_f1600_x4_avx2_asm.c index b529d951cc..33aa051e6d 100644 --- a/test/abicheck/x86_64/checks/check_keccak_f1600_x4_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_keccak_f1600_x4_avx2_asm.c @@ -37,7 +37,7 @@ int check_keccak_f1600_x4_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[32]; /* Rotation constant rho8 (4 x uint64_t) */ MLK_ALIGN uint8_t buf_rsi[192]; /* Round constants (24 x uint64_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check keccak_f1600_x4_avx2_asm: host lacks AVX2, skipping\n"); diff --git a/test/abicheck/x86_64/checks/check_ntt_avx2_asm.c b/test/abicheck/x86_64/checks/check_ntt_avx2_asm.c index 7c0e1ec819..b2185c6019 100644 --- a/test/abicheck/x86_64/checks/check_ntt_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_ntt_avx2_asm.c @@ -32,7 +32,7 @@ int check_ntt_avx2_asm(void) MLK_ALIGN uint8_t buf_rdi[512]; /* Input/output polynomial (256 x int16_t) */ MLK_ALIGN uint8_t buf_rsi[1248]; /* Precomputed constants (624 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check ntt_avx2_asm: host lacks AVX2, skipping\n"); return MLK_ABICHECK_SKIPPED; diff --git a/test/abicheck/x86_64/checks/check_nttfrombytes_avx2_asm.c b/test/abicheck/x86_64/checks/check_nttfrombytes_avx2_asm.c index 8adfa96815..90b9c29563 100644 --- a/test/abicheck/x86_64/checks/check_nttfrombytes_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_nttfrombytes_avx2_asm.c @@ -32,7 +32,7 @@ int check_nttfrombytes_avx2_asm(void) MLK_ALIGN uint8_t buf_rdi[512]; /* Output polynomial (256 x int16_t) */ MLK_ALIGN uint8_t buf_rsi[384]; /* Input byte array (MLKEM_POLYBYTES = 384) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check nttfrombytes_avx2_asm: host lacks AVX2, skipping\n"); diff --git a/test/abicheck/x86_64/checks/check_ntttobytes_avx2_asm.c b/test/abicheck/x86_64/checks/check_ntttobytes_avx2_asm.c index 3d3de38115..36ad2af817 100644 --- a/test/abicheck/x86_64/checks/check_ntttobytes_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_ntttobytes_avx2_asm.c @@ -33,7 +33,7 @@ int check_ntttobytes_avx2_asm(void) buf_rdi[384]; /* Output byte array (MLKEM_POLYBYTES = 384) */ MLK_ALIGN uint8_t buf_rsi[512]; /* Input polynomial (256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check ntttobytes_avx2_asm: host lacks AVX2, skipping\n"); diff --git a/test/abicheck/x86_64/checks/check_nttunpack_avx2_asm.c b/test/abicheck/x86_64/checks/check_nttunpack_avx2_asm.c index 96d7a62fd6..eaee811376 100644 --- a/test/abicheck/x86_64/checks/check_nttunpack_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_nttunpack_avx2_asm.c @@ -31,7 +31,7 @@ int check_nttunpack_avx2_asm(void) int violations; MLK_ALIGN uint8_t buf_rdi[512]; /* Input/output polynomial (256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check nttunpack_avx2_asm: host lacks AVX2, skipping\n"); diff --git a/test/abicheck/x86_64/checks/check_poly_compress_d10_avx2_asm.c b/test/abicheck/x86_64/checks/check_poly_compress_d10_avx2_asm.c index 455b7a2b68..a30c040d04 100644 --- a/test/abicheck/x86_64/checks/check_poly_compress_d10_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_poly_compress_d10_avx2_asm.c @@ -34,7 +34,7 @@ int check_poly_compress_d10_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[32]; /* Precomputed compression constants */ MLK_ALIGN uint8_t buf_rsi[512]; /* Input polynomial (256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf( stderr, diff --git a/test/abicheck/x86_64/checks/check_poly_compress_d11_avx2_asm.c b/test/abicheck/x86_64/checks/check_poly_compress_d11_avx2_asm.c index 702d204dde..8fc598be22 100644 --- a/test/abicheck/x86_64/checks/check_poly_compress_d11_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_poly_compress_d11_avx2_asm.c @@ -34,7 +34,7 @@ int check_poly_compress_d11_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[64]; /* Precomputed compression constants */ MLK_ALIGN uint8_t buf_rsi[512]; /* Input polynomial (256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf( stderr, diff --git a/test/abicheck/x86_64/checks/check_poly_compress_d4_avx2_asm.c b/test/abicheck/x86_64/checks/check_poly_compress_d4_avx2_asm.c index a5e71ffa07..5d819961be 100644 --- a/test/abicheck/x86_64/checks/check_poly_compress_d4_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_poly_compress_d4_avx2_asm.c @@ -34,7 +34,7 @@ int check_poly_compress_d4_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[32]; /* Precomputed compression constants */ MLK_ALIGN uint8_t buf_rsi[512]; /* Input polynomial (256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check poly_compress_d4_avx2_asm: host lacks AVX2, skipping\n"); diff --git a/test/abicheck/x86_64/checks/check_poly_compress_d5_avx2_asm.c b/test/abicheck/x86_64/checks/check_poly_compress_d5_avx2_asm.c index db3117c6cc..e64c7966c2 100644 --- a/test/abicheck/x86_64/checks/check_poly_compress_d5_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_poly_compress_d5_avx2_asm.c @@ -34,7 +34,7 @@ int check_poly_compress_d5_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[32]; /* Precomputed compression constants */ MLK_ALIGN uint8_t buf_rsi[512]; /* Input polynomial (256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check poly_compress_d5_avx2_asm: host lacks AVX2, skipping\n"); diff --git a/test/abicheck/x86_64/checks/check_poly_decompress_d10_avx2_asm.c b/test/abicheck/x86_64/checks/check_poly_decompress_d10_avx2_asm.c index a1ee4d9652..c878ae7319 100644 --- a/test/abicheck/x86_64/checks/check_poly_decompress_d10_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_poly_decompress_d10_avx2_asm.c @@ -34,7 +34,7 @@ int check_poly_decompress_d10_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[32]; /* Precomputed decompression constants */ MLK_ALIGN uint8_t buf_rsi[320]; /* Input compressed polynomial */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf( stderr, diff --git a/test/abicheck/x86_64/checks/check_poly_decompress_d11_avx2_asm.c b/test/abicheck/x86_64/checks/check_poly_decompress_d11_avx2_asm.c index 89fab6768c..573a11b47e 100644 --- a/test/abicheck/x86_64/checks/check_poly_decompress_d11_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_poly_decompress_d11_avx2_asm.c @@ -34,7 +34,7 @@ int check_poly_decompress_d11_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[128]; /* Precomputed decompression constants */ MLK_ALIGN uint8_t buf_rsi[352]; /* Input compressed polynomial */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf( stderr, diff --git a/test/abicheck/x86_64/checks/check_poly_decompress_d4_avx2_asm.c b/test/abicheck/x86_64/checks/check_poly_decompress_d4_avx2_asm.c index d414efd90e..a27768ccf5 100644 --- a/test/abicheck/x86_64/checks/check_poly_decompress_d4_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_poly_decompress_d4_avx2_asm.c @@ -34,7 +34,7 @@ int check_poly_decompress_d4_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[32]; /* Precomputed decompression constants */ MLK_ALIGN uint8_t buf_rsi[128]; /* Input compressed polynomial */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf( stderr, diff --git a/test/abicheck/x86_64/checks/check_poly_decompress_d5_avx2_asm.c b/test/abicheck/x86_64/checks/check_poly_decompress_d5_avx2_asm.c index 2ce87bdd04..bdc2d6e806 100644 --- a/test/abicheck/x86_64/checks/check_poly_decompress_d5_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_poly_decompress_d5_avx2_asm.c @@ -34,7 +34,7 @@ int check_poly_decompress_d5_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[96]; /* Precomputed decompression constants */ MLK_ALIGN uint8_t buf_rsi[160]; /* Input compressed polynomial */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf( stderr, diff --git a/test/abicheck/x86_64/checks/check_poly_mulcache_compute_avx2_asm.c b/test/abicheck/x86_64/checks/check_poly_mulcache_compute_avx2_asm.c index db9539c521..1bacb3b763 100644 --- a/test/abicheck/x86_64/checks/check_poly_mulcache_compute_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_poly_mulcache_compute_avx2_asm.c @@ -34,7 +34,7 @@ int check_poly_mulcache_compute_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[1248]; /* Precomputed constants (624 x int16_t) */ MLK_ALIGN uint8_t buf_rsi[512]; /* Input polynomial (256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check poly_mulcache_compute_avx2_asm: host lacks AVX2, " diff --git a/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.c b/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.c index a61cc18edc..9e31b942c7 100644 --- a/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm.c @@ -35,7 +35,7 @@ int check_polyvec_basemul_acc_montgomery_cached_k2_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[1024]; /* Input polyvec b (2 x 256 x int16_t) */ MLK_ALIGN uint8_t buf_rsi[1024]; /* Input polyvec a (2 x 256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check polyvec_basemul_acc_montgomery_cached_k2_avx2_asm: host " diff --git a/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.c b/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.c index 958df27d90..e1add85cbb 100644 --- a/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm.c @@ -35,7 +35,7 @@ int check_polyvec_basemul_acc_montgomery_cached_k3_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[1536]; /* Input polyvec b (3 x 256 x int16_t) */ MLK_ALIGN uint8_t buf_rsi[1536]; /* Input polyvec a (3 x 256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check polyvec_basemul_acc_montgomery_cached_k3_avx2_asm: host " diff --git a/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.c b/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.c index 43ad32d4af..7cdabca54c 100644 --- a/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm.c @@ -35,7 +35,7 @@ int check_polyvec_basemul_acc_montgomery_cached_k4_avx2_asm(void) MLK_ALIGN uint8_t buf_rdx[2048]; /* Input polyvec b (4 x 256 x int16_t) */ MLK_ALIGN uint8_t buf_rsi[2048]; /* Input polyvec a (4 x 256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check polyvec_basemul_acc_montgomery_cached_k4_avx2_asm: host " diff --git a/test/abicheck/x86_64/checks/check_reduce_avx2_asm.c b/test/abicheck/x86_64/checks/check_reduce_avx2_asm.c index ecc4e0b481..9e1ed6bb67 100644 --- a/test/abicheck/x86_64/checks/check_reduce_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_reduce_avx2_asm.c @@ -31,7 +31,7 @@ int check_reduce_avx2_asm(void) int violations; MLK_ALIGN uint8_t buf_rdi[512]; /* Input/output polynomial (256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check reduce_avx2_asm: host lacks AVX2, skipping\n"); return MLK_ABICHECK_SKIPPED; diff --git a/test/abicheck/x86_64/checks/check_rej_uniform_avx2_asm.c b/test/abicheck/x86_64/checks/check_rej_uniform_avx2_asm.c index c740b7e21f..8f2089c212 100644 --- a/test/abicheck/x86_64/checks/check_rej_uniform_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_rej_uniform_avx2_asm.c @@ -34,7 +34,7 @@ int check_rej_uniform_avx2_asm(void) MLK_ALIGN uint8_t buf_rdi[512]; /* Output buffer (256 x int16_t) */ MLK_ALIGN uint8_t buf_rsi[504]; /* Input buffer */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check rej_uniform_avx2_asm: host lacks AVX2, skipping\n"); diff --git a/test/abicheck/x86_64/checks/check_tomont_avx2_asm.c b/test/abicheck/x86_64/checks/check_tomont_avx2_asm.c index 8803c982c6..38db3122a2 100644 --- a/test/abicheck/x86_64/checks/check_tomont_avx2_asm.c +++ b/test/abicheck/x86_64/checks/check_tomont_avx2_asm.c @@ -31,7 +31,7 @@ int check_tomont_avx2_asm(void) int violations; MLK_ALIGN uint8_t buf_rdi[512]; /* Input/output polynomial (256 x int16_t) */ - if (!mlk_sys_check_capability(MLK_SYS_CAP_AVX2)) + if (!mlk_sys_check_capability(MLK_SYS_CAP_X86_64_AVX2)) { fprintf(stderr, "ABI check tomont_avx2_asm: host lacks AVX2, skipping\n"); return MLK_ABICHECK_SKIPPED; diff --git a/test/configs/configs.yml b/test/configs/configs.yml index 01b06d2ac4..b58a1f9b65 100644 --- a/test/configs/configs.yml +++ b/test/configs/configs.yml @@ -214,7 +214,7 @@ configs: static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap) { - if (cap == MLK_SYS_CAP_AVX2) + if (cap == MLK_SYS_CAP_X86_64_AVX2) { uint32_t eax, ebx, ecx, edx; @@ -261,7 +261,7 @@ configs: static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap) { - if (cap == MLK_SYS_CAP_NEON) + if (cap == MLK_SYS_CAP_AARCH64_NEON) { uint64_t id_aa64pfr0_el1; @@ -274,7 +274,7 @@ configs: return (advsimd_field != 0xF) ? 1 : 0; } - if (cap == MLK_SYS_CAP_SHA3) + if (cap == MLK_SYS_CAP_AARCH64_SHA3) { uint64_t id_aa64pfr1_el1; diff --git a/test/configs/custom_native_capability_config_CPUID_AVX2.h b/test/configs/custom_native_capability_config_CPUID_AVX2.h index afde1e7d81..e42bf78e70 100644 --- a/test/configs/custom_native_capability_config_CPUID_AVX2.h +++ b/test/configs/custom_native_capability_config_CPUID_AVX2.h @@ -419,7 +419,7 @@ static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap) { - if (cap == MLK_SYS_CAP_AVX2) + if (cap == MLK_SYS_CAP_X86_64_AVX2) { uint32_t eax, ebx, ecx, edx; diff --git a/test/configs/custom_native_capability_config_ID_AA64PFR1_EL1.h b/test/configs/custom_native_capability_config_ID_AA64PFR1_EL1.h index dd8eb7f2d6..c707198caf 100644 --- a/test/configs/custom_native_capability_config_ID_AA64PFR1_EL1.h +++ b/test/configs/custom_native_capability_config_ID_AA64PFR1_EL1.h @@ -418,7 +418,7 @@ static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap) { - if (cap == MLK_SYS_CAP_NEON) + if (cap == MLK_SYS_CAP_AARCH64_NEON) { uint64_t id_aa64pfr0_el1; @@ -431,7 +431,7 @@ static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap) return (advsimd_field != 0xF) ? 1 : 0; } - if (cap == MLK_SYS_CAP_SHA3) + if (cap == MLK_SYS_CAP_AARCH64_SHA3) { uint64_t id_aa64pfr1_el1;