[all-commits] [llvm/llvm-project] 77f72a: [HLSL] Enable half type for hlsl.

Xiang Li via All-commits all-commits at lists.llvm.org
Thu Jun 23 12:56:42 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 77f72ac15bcac8923c6bd104f303feaa1e964692
  Author: Xiang Li <python3kgae at outlook.com>
  Date:   2022-06-23 (Thu, 23 Jun 2022)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/MicrosoftMangle.cpp
    M clang/lib/Basic/LangOptions.cpp
    M clang/lib/Basic/Targets/DirectX.h
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/HLSL.cpp
    M clang/test/CodeGenHLSL/basic_types.hlsl
    A clang/test/CodeGenHLSL/half.hlsl

  Log Message:
  [HLSL] Enable half type for hlsl.

HLSL supports half type.
When enable-16bit-types is not set, half will be treated as float.
When enable-16bit-types is set, half will be treated like real 16bit float type and map to llvm half type.
Also change CXXABI to Microsoft to match dxc behavior.
The mangle name for half is "$f16@" when half is treat as native half type and "$halff@" when treat as float.

In AST, half is still half.
The special thing is done at clang codeGen, when NativeHalfType is false, half will translated into float.

Reviewed By: aaron.ballman

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

More information about the All-commits mailing list