Skip to content

Commit

Permalink
Enable AArch64 arithmetic on LLVM 19. (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt authored Aug 14, 2024
1 parent 2266cc5 commit b5312dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bfloat16.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Printf
# However, not all LLVM targets support `bfloat`. If the target can store/load BFloat16s
# (and supports synthesizing constants) we can use the `bfloat` IR type, otherwise we fall
# back to defining a primitive type that will be represented as an `i16`. If, in addition,
# the target supports BFloat16 arithmetic, we can use LLVM intrinsics.
# the target supports BFloat16 arithmetic, we can use LLVM instructions.
# - x86: storage and arithmetic support in LLVM 15
# - aarch64: storage support in LLVM 17
const llvm_storage = if isdefined(Core, :BFloat16)
Expand All @@ -40,6 +40,8 @@ const llvm_arithmetic = if llvm_storage
using Core: BFloat16
if Sys.ARCH in [:x86_64, :i686] && Base.libllvm_version >= v"15"
true
elseif Sys.ARCH == :aarch64 && Base.libllvm_version >= v"19"
true
else
false
end
Expand Down

0 comments on commit b5312dd

Please sign in to comment.