[all-commits] [llvm/llvm-project] b2ca23: [HLSL] implement exp intrinsic (#83832)

Farzon Lotfi via All-commits all-commits at lists.llvm.org
Tue Mar 5 09:42:44 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b2ca23aed802abc43ed216ce9bf4c80c056a04c0
      https://github.com/llvm/llvm-project/commit/b2ca23aed802abc43ed216ce9bf4c80c056a04c0
  Author: Farzon Lotfi <1802579+farzonl at users.noreply.github.com>
  Date:   2024-03-05 (Tue, 05 Mar 2024)

  Changed paths:
    M clang/lib/Headers/hlsl/hlsl_intrinsics.h
    A clang/test/CodeGenHLSL/builtins/exp.hlsl
    A clang/test/CodeGenHLSL/builtins/exp2.hlsl
    A clang/test/SemaHLSL/BuiltIns/exp-errors.hlsl
    M llvm/lib/Target/DirectX/DXIL.td
    A llvm/test/CodeGen/DirectX/exp2.ll

  Log Message:
  -----------
  [HLSL] implement exp intrinsic (#83832)

This change implements: #70072

- `hlsl_intrinsics.h` - add the `exp` api
- `DXIL.td` - add the llvm intrinsic to DXIL opcode lowering mapping.
- This change reuses llvm's existing intrinsic
`__builtin_elementwise_exp` \ `int_exp` & `__builtin_elementwise_exp2` \
`int_exp2`
- This PR is part 1 of 2.
- Part 2 requires an intrinsic to instructions lowering.
Part2 will expand `int_exp` to 
```
A = Builder.CreateFMul(log2eConst, val);
int_exp2(A)
```
just like we do in
[TranslateExp](https://github.com/microsoft/DirectXShaderCompiler/blob/main/lib/HLSL/HLOperationLower.cpp#L2220C1-L2236C2)



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