microsoft / microsoft/DirectXShaderCompiler
[Feature Request] Separate compiler flags to disable/enable associative expression rewriting and other FP optimizations
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Is your feature request related to a problem? Please describe.
Currently, users have the following options to disable fast-math optimizations:
- The
precisequalifier can decorate any expression/variable to inhibit all fast-math operations - The
-Gisflag can be used to implicitly declare that all expressions areprecise
Unfortunately, there is no "in between," meaning that you either have all of fast-math or none of it. In particular, being able to decouple the compiler setting for math associativity from math contraction optimizations would be a useful lever to pull in many shader programs.
Describe the solution you'd like
I would like the various fast-math optimizations to be enabled or disabled independently of each other.
Describe alternatives you've considered
Here, I describe the possibility of an intrinsic that suggests a contracted operation, even if precise or -Gis is requested.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing how the precise qualifier and -Gis flag currently disable fast-math optimizations, then read the linked hlsl-specs issue 883 for the related intrinsic proposal. Done should provide independent controls for associative expression rewriting, contraction, and other fast-math optimizations without requiring all or none of them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100