@@ -30,19 +30,23 @@ include("philox.jl")
3030export R123_USE_AESNI
3131
3232" True when AES-NI has been enabled."
33- const R123_USE_AESNI = try
34- cmd = Base. julia_cmd ()
35- push! (
36- cmd. exec, " -e" ,
37- " const __m128i = NTuple{2, VecElement{UInt64}};" *
38- " @assert ccall(\" llvm.x86.aesni.aeskeygenassist\" , " *
39- " llvmcall, __m128i, (__m128i, UInt8), " *
40- " __m128i((0x0123456789123450, 0x9876543210987654)), 0x1) ≡ " *
41- " __m128i((0x857c266f7c266e85, 0x2346382146382023))"
42- )
43- success (cmd)
44- catch e
33+ const R123_USE_AESNI = @static if Sys. isapple () && Sys. ARCH ≡ :aarch64
4534 false
35+ else
36+ try
37+ cmd = Base. julia_cmd ()
38+ push! (
39+ cmd. exec, " -e" ,
40+ " const __m128i = NTuple{2, VecElement{UInt64}};" *
41+ " @assert ccall(\" llvm.x86.aesni.aeskeygenassist\" , " *
42+ " llvmcall, __m128i, (__m128i, UInt8), " *
43+ " __m128i((0x0123456789123450, 0x9876543210987654)), 0x1) ≡ " *
44+ " __m128i((0x857c266f7c266e85, 0x2346382146382023))"
45+ )
46+ success (cmd)
47+ catch e
48+ false
49+ end
4650end
4751
4852@static if R123_USE_AESNI
5256 include (" ./aesni.jl" )
5357 include (" ./ars.jl" )
5458else
55- @warn " AES-NI is not enabled, so AESNI and ARS are not available."
59+ @warn " AES-NI instruction set is not enabled, so the related RNGs ( AESNI and ARS) are not available."
5660end
5761
5862end
0 commit comments