Skip to content

Commit

Permalink
Restrict use of codegen to x86 only.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Oct 6, 2023
1 parent 80a1280 commit 22f2a04
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/bfloat16.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 22f2a04

Please sign in to comment.