[PATCH] D144309: add max/min lib fxns

Joshua Batista via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 17 17:22:21 PST 2023


bob80905 created this revision.
bob80905 added reviewers: python3kgae, beanz.
Herald added a subscriber: Anastasia.
Herald added a project: All.
bob80905 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

[HLSL] add max/min library functions

This change exposes the max and min library functions for HLSL, excluding long, int, and long long doubles.
The max / min functions are supported for all scalar, vector, and matrix types.
Long and long long double support is missing in this patch because those types
don't exist in HLSL. Int is missing because the max / min functions only work on floating type arguments.

The full documentation of the HLSL max / min functions are available here:
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-max
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-min


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144309

Files:
  clang/lib/Headers/hlsl/hlsl_intrinsics.h
  clang/test/CodeGenHLSL/builtins/max.hlsl
  clang/test/CodeGenHLSL/builtins/min.hlsl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144309.498531.patch
Type: text/x-patch
Size: 7743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230218/2ea5269b/attachment.bin>


More information about the cfe-commits mailing list