From 22f2a04ab555ccb5257adbd529af18075263d1bf Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Fri, 6 Oct 2023 09:58:48 +0200 Subject: [PATCH] Restrict use of codegen to x86 only. --- src/bfloat16.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bfloat16.jl b/src/bfloat16.jl index 308ed59..03ac981 100644 --- a/src/bfloat16.jl +++ b/src/bfloat16.jl @@ -16,12 +16,13 @@ import Base: isfinite, isnan, precision, iszero, eps, bitstring, isinteger # Julia 1.11 provides codegen support for BFloat16 -if isdefined(Core, :BFloat16) +const codegen_support = if isdefined(Core, :BFloat16) && + Sys.ARCH in [:x86_64, :i686] using Core: BFloat16 - const codegen_support = true + true else primitive type BFloat16 <: AbstractFloat 16 end - const codegen_support = false + false end Base.reinterpret(::Type{Unsigned}, x::BFloat16) = reinterpret(UInt16, x)