[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Denormal input handling
From: |
Michael Morrell |
Subject: |
Denormal input handling |
Date: |
Wed, 26 May 2021 19:02:55 +0000 (UTC) |
I see support in QEMU for architectures which have a denormal input flag bit
and those that have a "flush inputs to zero" control bit, but the
implementation is not specializable and seems wrong for x86 at least.
For example, in sf_canonicalize, if the input is denormal and
"flush_inputs_to_zero" is true, the "input denormal" flag is set and then the
value is set to a zero value, and if the input is denormal and
"flush_inputs_to_zero" is false, then the input is simply normalized.
I think the behavior should be for denormal inputs that if
"flush_inputs_to_zero" is true, then set the value to zero (without setting the
"input denormal" flag); and if "flush_inputs_to_zero" is false, set the "input
denormal" flag and normalize the input.
This matches what x86 does (I'm not sure about other architectures).
Am I missing something? If not, I can work on a patch (there are several
places which check "flush_inputs_to_zero" which will need to be changed).
Michael