[all-commits] [llvm/llvm-project] 0ed5d9: [LoongArch][BF16] Add support for the __bf16 type ...

Ami-zhang via All-commits all-commits at lists.llvm.org
Sun Jun 8 20:16:02 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ed5d9aff6e72bdaf3f12bc71dbf83a5c116e8fd
      https://github.com/llvm/llvm-project/commit/0ed5d9aff6e72bdaf3f12bc71dbf83a5c116e8fd
  Author: Ami-zhang <zhanglimin at loongson.cn>
  Date:   2025-06-09 (Mon, 09 Jun 2025)

  Changed paths:
    M clang/docs/LanguageExtensions.rst
    M clang/lib/Basic/Targets/LoongArch.h
    A clang/test/CodeGen/LoongArch/bfloat-abi.c
    A clang/test/CodeGen/LoongArch/bfloat-mangle.cpp
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
    M llvm/lib/Target/LoongArch/LoongArchISelLowering.h
    A llvm/test/CodeGen/LoongArch/bf16-promote.ll
    A llvm/test/CodeGen/LoongArch/bf16.ll

  Log Message:
  -----------
  [LoongArch][BF16] Add support for the __bf16 type (#142548)

The LoongArch psABI recently added __bf16 type support. Now we can
enable this new type in clang.

Currently, bf16 operations are automatically supported by promoting to
float. This patch adds bf16 support by ensuring that load extension /
truncate store operations are properly expanded.

And this commit implements support for bf16 truncate/extend on hard FP
targets. The extend operation is implemented by a shift just as in the
standard legalization. This requires custom lowering of the truncate
libcall on hard float ABIs (the normal libcall code path is used on soft
ABIs).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list