llvm / llvm/llvm-project

[KnownFPClass] `fpext` does not properly handle `DAZ` or `DAPZ` input denormal modes.

Open
#219,300 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

floating-point llvm:support
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Discovered by https://github.com/llvm/llvm-project/pull/219091

Currently, fpext incorrectly rules out positive/negative zero when the input is subnormal that gets flushed to zero:

  • Under DAPZ, a negative subnormal input could become positive zero.
  • Under DAZ, a negative subnormal input could become negative zero.
  • Under Dynamic, a negative subnormal input could become either positive or negative zero.

The output denormal mode would matter for cases such as f128 = fpext(f80) where the exponent range is the same. But I will create another issue for that once I confirm it.

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 by tracing the KnownFPClass handling for fpext and reviewing the behavior described for DAZ, DAPZ, and Dynamic input denormal modes. Verify the sign possibilities for flushed subnormal inputs, including the f128 = fpext(f80) case noted as a separate concern. Done means fpext no longer rules out valid zero signs under the stated input modes.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.