-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
HLSLHLSL Language SupportHLSL Language Supportbot:HLSLclang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsicsmetaissueIssue to collect references to a group of similar or related issues.Issue to collect references to a group of similar or related issues.
Description
- Link bitcast clang builtin for int with
asinthlsl_intrinsics.h - Add checks for
asint - Add codegen tests to
clang/test/CodeGenHLSL/builtins/asint.hlsl - Add sema tests to
clang/test/SemaHLSL/BuiltIns/asint-errors.hlsl
DirectX
There were no DXIL opcodes found for asint.
SPIR-V
There were no SPIRV opcodes found for asint.
Test Case(s)
Example 1
//dxc asint_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export int4 fn(float p1) {
return asint(p1);
}Example 2
//dxc asint_1_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export int4 fn(uint p1) {
return asint(p1);
}Example 3
//dxc asint_2_test.hlsl -T lib_6_8 -enable-16bit-types -O0
export int4 fn(int p1) {
return asint(p1);
}HLSL:
Interprets the bit pattern of x as an integer.
| ret asint(x) |
|---|
Parameters
| Item | Description |
|---|---|
| x |
[in] The input value. |
Return Value
The input interpreted as an integer.
Type Description
| Name | Template Type | Component Type | Size |
|---|---|---|---|
| x | scalar, vector, or matrix | float, uint | any |
| ret | same as input x | int | same dimension(s) as input x |
Minimum Shader Model
This function is supported in the following shader models.
| Shader Model | Supported |
|---|---|
| Shader Model 4 and higher shader models | yes |
| Shader Model 3 (DirectX HLSL) | no |
| Shader Model 2 (DirectX HLSL) | no |
| Shader Model 1 (DirectX HLSL) | no |
See also
Metadata
Metadata
Assignees
Labels
HLSLHLSL Language SupportHLSL Language Supportbot:HLSLclang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsicsmetaissueIssue 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