Skip to content

[SM6.9] Generate native vectors operations for elementwise intrinsics #7120

Open
0 of 1 issue completed
@pow2clk

Description

@pow2clk

NOTE: we're now using this as an umbrella issue - look at sub-issues for actual work.

In SM6.9, long vectors should be usable on the following HLSL intrinsics:

  • Trigonometry : acos, asin, atan, atan2, cos, cosh, degrees, radians, sin, sinh, tan, tanh
  • Math: abs, ceil, clamp, exp, exp2, floor, fma, fmod, frac, frexp, ldexp, lerp, log, log10, log2, mad, max, min, pow, rcp, round, rsqrt, sign, smoothstep, sqrt, step, trunc
  • Float Ops: f16tof32, f32tof16, isfinite, isinf, isnan, modf, saturate
  • Bitwise Ops: reversebits, countbits, firstbithigh, firstbitlow
  • Logic Ops: and, or, select
  • Reductions: all, any, clamp, dot
  • Quad Ops: ddx, ddx_coarse, ddx_fine, ddy, ddy_coarse, ddy_fine, fwidth, QuadReadLaneAt, QuadReadLaneAcrossX, QuadReadLaneAcrossY, QuadReadLaneAcrossDiagonal
  • Wave Ops: WaveActiveBitAnd, WaveActiveBitOr, WaveActiveBitXor, WaveActiveProduct, WaveActiveSum, WaveActiveMin, WaveActiveMax, WaveMultiPrefixBitAnd, WaveMultiPrefixBitOr, WaveMultiPrefixBitXor, WaveMultiPrefixProduct, WaveMultiPrefixSum, WavePrefixSum, WavePrefixProduct, WaveReadLaneAt, WaveReadLaneFirst
  • Wave Reductions: WaveActiveAllEqual, WaveMatch
  • Type Conversions: asdouble, asfloat, asfloat16, asint, asint16, asuint, asuint16

In addition to this, any vector used for these intrinsics should produce DXIL that uses native vectors as parameters.

Some of these are trivially convertable into corresponding DXIL intrinsics that will form vector variants with similar if not identical arguments. Some others expand into a few operations that may involve multiple DXIL intrinsics or intrinsics paired with native operators. In either case, the generated DXIL should use vector variants of the operations to implement the intent.

Implementation will mostly differ little from that done for operators in #7123. The exception might be intrinsics that scalarize themselves as part of their lowering, which will need to change to preserve the vectors until the scalarization pass runs or doesn't depending on compile-time flags. This is a separate issue in spite of that since many intrinsic lowering involves native operators and testing will be involved and can be separated. This does depend on #7123.

Sub-issues

Metadata

Metadata

Assignees

Labels

enhancementFeature suggestionsm6.9Shader Model 6.9

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions