[all-commits] [llvm/llvm-project] dce503: [clang][HLSL] Add sign intrinsic part 3 (#101989)

Tim Gymnich via All-commits all-commits at lists.llvm.org
Mon Sep 9 20:36:07 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dce50397b52e33e927ffb1d1c40765109abf40f0
      https://github.com/llvm/llvm-project/commit/dce50397b52e33e927ffb1d1c40765109abf40f0
  Author: Tim Gymnich <tgymnich at icloud.com>
  Date:   2024-09-09 (Mon, 09 Sep 2024)

  Changed paths:
    M clang/include/clang/Basic/Builtins.td
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/lib/CodeGen/CGHLSLRuntime.h
    M clang/lib/Headers/hlsl/hlsl_intrinsics.h
    M clang/lib/Sema/SemaHLSL.cpp
    A clang/test/CodeGenHLSL/builtins/sign.hlsl
    A clang/test/SemaHLSL/BuiltIns/sign-errors.hlsl

  Log Message:
  -----------
  [clang][HLSL] Add sign intrinsic part 3 (#101989)

partially fixes #70078

### Changes
- Implemented `sign` clang builtin
- Linked `sign` clang builtin with `hlsl_intrinsics.h`
- Added sema checks for `sign` to `CheckHLSLBuiltinFunctionCall` in
`SemaChecking.cpp`
- Add codegen for `sign` to `EmitHLSLBuiltinExpr` in `CGBuiltin.cpp`
- Add codegen tests to `clang/test/CodeGenHLSL/builtins/sign.hlsl`
- Add sema tests to `clang/test/SemaHLSL/BuiltIns/sign-errors.hlsl`

### Related PRs
- https://github.com/llvm/llvm-project/pull/101987
- https://github.com/llvm/llvm-project/pull/101988

### Discussion
- Should there be a `usign` intrinsic that handles the unsigned cases?



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