Skip to content

Implement the QuadAny HLSL Function #99214

Open
Listed in
Open
@farzonl

Description

@farzonl
  • Implement QuadAny clang builtin,
    Link QuadAny clang builtin with hlsl_intrinsics.h
    Add sema checks for QuadAny to CheckHLSLBuiltinFunctionCall in SemaChecking.cpp
    Add codegen for QuadAny to EmitHLSLBuiltinExpr in CGBuiltin.cpp
    Add codegen tests to clang/test/CodeGenHLSL/builtins/QuadAny.hlsl
    Add sema tests to clang/test/SemaHLSL/BuiltIns/QuadAny-errors.hlsl
    Create the int_dx_QuadAny intrinsic in IntrinsicsDirectX.td
    Create the DXILOpMapping of int_dx_QuadAny to 222 in DXIL.td
    Create the QuadAny.ll and QuadAny_errors.ll tests in llvm/test/CodeGen/DirectX/

DirectX

DXIL Opcode DXIL OpName Shader Model Shader Stages
222 QuadVote 6.7 ('library', 'compute', 'amplification', 'mesh', 'pixel', 'node')

SPIR-V

There is no support for QuadAny when targeting SPIR-V.

NOTE: it is possible that this is incorrect. When working on this, the first thing to do is to determine if there really is no SPIR-V operation for this.

Test Case(s)

Example 1

//dxc QuadAny_test.hlsl -T lib_6_8 -enable-16bit-types -O0

export bool fn(bool p1) {
    return QuadAny(p1);
}

HLSL:

Syntax

bool QuadAny(bool cond);

Type Description

Name Template Type Component Type Size
ret scalar bool 1
cond scalar bool 1

Minimum Shader Model

This function is supported in the following shader models.

Shader Model Supported
Shader Model 6.7 and higher shader models yes

Shader Stages

See also

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    HLSLHLSL Language Supportbackend:DirectXbot:HLSLmetabugIssue to collect references to a group of similar or related issues.

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @farzonl

        Issue actions

          Implement the `QuadAny` HLSL Function · Issue #99214 · llvm/llvm-project