-
Notifications
You must be signed in to change notification settings - Fork 15k
Closed
Labels
HLSLHLSL Language SupportHLSL Language Supportbackend:DirectXbackend:SPIR-Vbot:HLSLclang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"metaissueIssue to collect references to a group of similar or related issues.Issue to collect references to a group of similar or related issues.
Description
- Implement
degreesclang builtin, - Link
degreesclang builtin withhlsl_intrinsics.h - Add sema checks for
degreestoCheckHLSLBuiltinFunctionCallinSemaChecking.cpp - Add codegen for
degreestoEmitHLSLBuiltinExprinCGBuiltin.cpp - Add codegen tests to
clang/test/CodeGenHLSL/builtins/degrees.hlsl - Add sema tests to
clang/test/SemaHLSL/BuiltIns/degrees-errors.hlsl - Create the
int_spv_degreesintrinsic inIntrinsicsSPIRV.td - In SPIRVInstructionSelector.cpp create the
degreeslowering and map it toint_spv_degreesinSPIRVInstructionSelector::selectIntrinsic. - Create SPIR-V backend test case in
llvm/test/CodeGen/SPIRV/hlsl-intrinsics/degrees.ll
DirectX
There were no DXIL opcodes found for degrees.
SPIR-V
Degrees:
Description:
Degrees
Converts radians to degrees, i.e., radians * 180 / π.
The operand radians must be a scalar or vector whose component type is
16-bit or 32-bit floating-point.
Result Type and the type of radians must be the same type. Results
are computed per component.
| Number | Operand 1 | Operand 2 | Operand 3 | Operand 4 |
|---|---|---|---|---|
12 |
<id> |
Test Case(s)
Example 1
//dxc degrees_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export float4 fn(float4 p1) {
return degrees(p1);
}HLSL:
Converts the specified value from radians to degrees.
| ret degrees(x) |
|---|
Parameters
| Item | Description |
|---|---|
| x |
[in] The specified value. |
Return Value
The result of converting the x parameter from radians to degrees.
Type Description
| Name | Template Type | Component Type | Size |
|---|---|---|---|
| x | scalar, vector, or matrix | float | any |
| ret | same as input x | float | 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 |
See also
Metadata
Metadata
Assignees
Labels
HLSLHLSL Language SupportHLSL Language Supportbackend:DirectXbackend:SPIR-Vbot:HLSLclang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"metaissueIssue to collect references to a group of similar or related issues.Issue to collect references to a group of similar or related issues.
Type
Projects
Status
No status