[all-commits] [llvm/llvm-project] 7a6d69: [NVPTX] Expose float tys min, max, abs, neg as bui...

Nicolas Miller via All-commits all-commits at lists.llvm.org
Tue Mar 1 11:08:09 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7a6d692b3b11e80fd19e7c9b65e1e6f70035c676
      https://github.com/llvm/llvm-project/commit/7a6d692b3b11e80fd19e7c9b65e1e6f70035c676
  Author: Jakub Chlanda <j.chlanda at gmail.com>
  Date:   2022-03-01 (Tue, 01 Mar 2022)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsNVPTX.def
    A clang/test/CodeGen/builtins-nvptx-native-half-type.c
    M clang/test/CodeGen/builtins-nvptx.c

  Log Message:
  -----------
  [NVPTX] Expose float tys min, max, abs, neg as builtins

Adds support for the following builtins:

abs, neg:
- .bf16,
- .bf16x2
min, max
- {.ftz}{.NaN}{.xorsign.abs}.f16
- {.ftz}{.NaN}{.xorsign.abs}.f16x2
- {.NaN}{.xorsign.abs}.bf16
- {.NaN}{.xorsign.abs}.bf16x2
- {.ftz}{.NaN}{.xorsign.abs}.f32

Differential Revision: https://reviews.llvm.org/D117887


  Commit: a8951823024b38c455e839d40656ad533b4aa8ff
      https://github.com/llvm/llvm-project/commit/a8951823024b38c455e839d40656ad533b4aa8ff
  Author: Jakub Chlanda <j.chlanda at gmail.com>
  Date:   2022-03-01 (Tue, 01 Mar 2022)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsNVPTX.def
    M clang/test/CodeGen/builtins-nvptx-native-half-type.c
    M clang/test/CodeGen/builtins-nvptx.c

  Log Message:
  -----------
  [NVPTX] Add more FMA intriniscs/builtins

This patch adds builtins/intrinsics for the following variants of FMA:

NOTE: follow-up commit with the missing clang-side changes.

- f16, f16x2
  - rn
  - rn_ftz
  - rn_sat
  - rn_ftz_sat
  - rn_relu
  - rn_ftz_relu
- bf16, bf16x2
  - rn
  - rn_relu

ptxas (Cuda compilation tools, release 11.0, V11.0.194) is happy with the generated assembly.

Differential Revision: https://reviews.llvm.org/D118977


  Commit: 510fd283fda2d7c5118ae1b451a1f2365cfc3f27
      https://github.com/llvm/llvm-project/commit/510fd283fda2d7c5118ae1b451a1f2365cfc3f27
  Author: Nicolas Miller <nicolas.miller at codeplay.com>
  Date:   2022-03-01 (Tue, 01 Mar 2022)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsNVPTX.def
    M clang/test/CodeGen/builtins-nvptx-native-half-type.c

  Log Message:
  -----------
  [NVPTX] Add ex2.approx.f16/f16x2 support

NOTE: this is a follow-up commit with the missing clang-side changes.

This patch adds builtins and intrinsics for the f16 and f16x2 variants of the ex2
instruction.

These two variants were added in PTX7.0, and are supported by sm_75 and above.

Note that this isn't wired with the exp2 llvm intrinsic because the ex2
instruction is only available in its approx variant.

Running ptxas on the assembly generated by the test f16-ex2.ll works as
expected.

Differential Revision: https://reviews.llvm.org/D119157


Compare: https://github.com/llvm/llvm-project/compare/e527986a9c72...510fd283fda2


More information about the All-commits mailing list