[Matrix] Implement matrix support for the `abs` HLSL Function
Matrix requirements:
- [ ] https://github.com/llvm/wg-hlsl/issues/387
HLSL:
Returns the absolute value of the specified value.
Parameters
| Item | Description |
|---|---|
| x |
[in] The specified value. |
Return Value
The absolute value of the x parameter.
Type Description
| Name | Template Type | Component Type | Size |
|---|---|---|---|
| x | scalar, vector, or matrix | float, int | any |
| ret | same as input x | same as input x | same dimension(s) as input x |
Minimum Shader Model
This function is supported in the following shader models.
| Shader Model | Supported |
|---|---|
| Shader Model 2 (DirectX HLSL) and higher shader models | yes |
| Shader Model 1 (DirectX HLSL) | vs_1_1 and ps_1_4 |
See also
Im interested in working on this issue.
Could someone suggest a good reference patch or completed matrix intrinsic implementation to follow? I'd like to understand the typical changes needed across the frontend, Sema, codegen, and tests before getting started.
Also, if there are any specific code paths related to matrix intrinsic support that I should look at first, I'd appreciate the guidance.
@AjaySingh8923 There are a few completed matrix issues listed under here that would be good references to follow!
@llvm/issue-subscribers-clang-codegen
Author: Kaitlin Peng (kmpeng)
HLSL:
Returns the absolute value of the specified value.
Parameters
| Item | Description |
|---|---|
| <span id="x"></span><span id="X"></span>x<br/> | [in] The specified value.<br/> |
Return Value
The absolute value of the x parameter.
Type Description
| Name | Template Type | Component Type | Size |
|---|---|---|---|
| x | scalar, vector, or matrix | float, int | any |
| ret | same as input x | same as input x | same dimension(s) as input x |
Minimum Shader Model
This function is supported in the following shader models.
| Shader Model | Supported |
|---|---|
| Shader Model 2 (DirectX HLSL) and higher shader models | yes |
| Shader Model 1 (DirectX HLSL) | vs_1_1 and ps_1_4 |
See also
<dl> <dt>
Intrinsic Functions (DirectX HLSL) </dt> </dl>