Skip to content

Implement the IsHelperLane HLSL Function #99233

Open
@farzonl

Description

@farzonl
  • Implement IsHelperLane clang builtin,
  • Link IsHelperLane clang builtin with hlsl_intrinsics.h
  • Add sema checks for IsHelperLane to CheckHLSLBuiltinFunctionCall in SemaChecking.cpp
  • Add codegen for IsHelperLane to EmitHLSLBuiltinExpr in CGBuiltin.cpp
  • Add codegen tests to clang/test/CodeGenHLSL/builtins/IsHelperLane.hlsl
  • Add sema tests to clang/test/SemaHLSL/BuiltIns/IsHelperLane-errors.hlsl
  • Create the int_dx_IsHelperLane intrinsic in IntrinsicsDirectX.td
  • Create the DXILOpMapping of int_dx_IsHelperLane to 221 in DXIL.td
  • Create the IsHelperLane.ll and IsHelperLane_errors.ll tests in llvm/test/CodeGen/DirectX/
  • Create the int_spv_IsHelperLane intrinsic in IntrinsicsSPIRV.td
  • In SPIRVInstructionSelector.cpp create the IsHelperLane lowering and map it to int_spv_IsHelperLane in SPIRVInstructionSelector::selectIntrinsic.
  • Create SPIR-V backend test case in llvm/test/CodeGen/SPIRV/hlsl-intrinsics/IsHelperLane.ll

DirectX

DXIL Opcode DXIL OpName Shader Model Shader Stages
221 IsHelperLane 6.6 ()

SPIR-V

OpIsHelperInvocationEXT:

Description:

Reserved.

Capability:
DemoteToHelperInvocationEXT

Reserved.

Word Count Opcode Results Operands

3

5381

<id>
Result Type

Result <id>

Test Case(s)

Example 1

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

export bool fn() {
    return IsHelperLane();
}

HLSL:

Syntax

bool IsHelperLane();

Type Description

Name Template Type Component Type Size
ret scalar bool 1

Minimum Shader Model

This function is supported in the following shader models.

Shader Model Supported
Shader Model 6.6 and higher shader models yes

Shader Stages

See also

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions