microsoft / microsoft/DirectXShaderCompiler

Unspecified behavior from new-to-DXIL sdiv instruction

Open
#3,150 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

DXBC had a udiv instruction, with clearly-spec'd behavior for corner cases like divide by 0 (should produce maximum uint).

DXIL introduces an sdiv instruction, but doesn't specify what should happen with:

  • Positive value / 0
  • Negative value / 0
  • INT_MIN / -1, which would evaluate to INT_MAX+1, but that can't be represented

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

No implementation file or test is named. Start by reviewing the DXIL specification and the issue discussion around signed division; done means the behavior is explicitly defined for positive and negative values divided by zero, and for INT_MIN divided by -1.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.