[HLSL] add sqrt library function
authorJoshua Batista <jbatista@microsoft.com>
Tue, 20 Sep 2022 19:46:06 +0000 (14:46 -0500)
committerChris Bieneman <chris.bieneman@me.com>
Tue, 20 Sep 2022 20:42:08 +0000 (15:42 -0500)
commitb95c57444a8ac3f81bc33a3d52d0f88b7a592a2f
tree81eb22693f16a197b0c31a673846184950009e26
parentd4514b155337f013022c6e989d3e6b7183a8b80e
[HLSL] add sqrt library function

This change exposes the sqrt library function for HLSL scalar types,
excluding long and long long doubles. Sqrt is supported for all scalar, vector,
and matrix types. This patch only adds a subset of scalar type support.

Long and long long double support is missing in this patch because that type
doesn't exist in HLSL.

The full documentation of the HLSL asin function is available here:
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-sqrt

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D132711
clang/lib/Headers/hlsl/hlsl_intrinsics.h
clang/test/CodeGenHLSL/builtins/sqrt.hlsl [new file with mode: 0644]