Skip to content

fix: denormal flush of inputs - #1350

Merged
nunoplopes merged 2 commits into
AliveToolkit:masterfrom
regehr:regehr/denorm-flush
Sep 29, 2026
Merged

nunoplopes merged 2 commits into
AliveToolkit:masterfrom
regehr:regehr/denorm-flush

Conversation

@regehr

@regehr regehr commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

this fixes more false alarms seen while running riscv-tv on the LLVM test suite -- no fuzzer involved, so far!

the change here is from LangRef: input flushing is mandatory, not optional

@regehr regehr closed this Sep 28, 2026
@regehr
regehr deleted the regehr/denorm-flush branch September 28, 2026 00:08
@nunoplopes

Copy link
Copy Markdown
Member

Uhm, I forgot about this one. Wasn't this correct?

@regehr

regehr commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

Re-opening this, please take a look at the reasoning below Nuno.

Here's an example that I believe alive should reject-- our master branch accepts it.

define i1 @src() denormal_fpenv(ieee|positivezero) {
  %r = fcmp oeq float 0x380FFFFFC0000000, 0.0
  ret i1 %r
}

define i1 @tgt() denormal_fpenv(ieee|positivezero) {
  ret i1 false
}

Here's the chain of reasoning:

0x380FFFFFC0000000 comes out to be the largest float denormal.

LangRef says:

"If the input mode is preservesign, or positivezero, a floating-point operation must treat any input denormal value as zero."

The fcmp clearly has an input denormal value, so the interpretation of this seems completely clear-- this can be folded to true, but not to false.

@regehr regehr reopened this Sep 28, 2026
@nunoplopes

Copy link
Copy Markdown
Member

Ok, I traced down the issue. There was a change in LangRef when the input/output flushing modes were split.

@nunoplopes
nunoplopes merged commit bcdd17f into AliveToolkit:master Sep 29, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants