microsoft / microsoft/DirectXShaderCompiler

[HLK] Add missing tests for `firstbitShi`, `firstbitHi`, `firstbitLo`

Open
#7,502 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

hlk-gap
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Currently we have defined tests for the 16 & 32-bit versions of firstbitShi, firstbitHi, and firstbitLo, however, there is a gap for the 64-bit versions.

https://github.com/microsoft/DirectXShaderCompiler/blob/66287b27442d0af17a152d024a6deaadb075cd30/tools/clang/unittests/HLSLExec/ShaderOpArithTable.xml#L2533

This issue tracks the addition of these HLK tests to ensure that behaviour.

For additional context see here: https://github.com/llvm/offload-test-suite/pull/210

AC:

  • Add HLK test for 64-bit

Note:
For DirectX-WARP, firstbitShi(s64 -1) = 32 when it should return -1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced ShaderOpArithTable.xml entry around line 2533 and compare the existing 16- and 32-bit tests for firstbitShi, firstbitHi, and firstbitLo. Add the corresponding 64-bit HLK test and verify the DirectX-WARP behavior described in the issue, including the expected result for firstbitShi(s64 -1).

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.