Topics

FP instructions that depend on rounding mode


Paul Donahue
 

The F extension says: "The behavior of floating-point instructions that depend on rounding mode when executed with a reserved rounding mode is reserved, including both static reserved rounding modes (101–110) and dynamic reserved rounding modes (101–111)."  How does the specification specify which FP instructions "depend on rounding mode"?


For example: The F extension says: "Note FCVT.D.W[U] always produces an exact result and is unaffected by rounding mode" and "FCVT.D.S will never round."  In a casual sense, that means that those two instructions do not depend on rounding mode.  In a more formal sense, the table in section 14.3 does not list frm as a source register for either of those instructions which also hints that these instructions do not depend on rounding mode (or at least are allowed to not depend on rounding mode).


If an implementation executes one of these instructions either with a reserved value in the rm field or with rm=111 and a reserved value in the frm CSR, is an implementation allowed to raise an illegal instruction exception or must implementations ignore the rm field and the frm CSR on those instructions?



Thanks,


-Paul


Allen Baum
 

Good catch. Previously, those encodings we marked as invalid, reserved, and trapped in FRM - but had reserved behavior in the RM field.
that was loosened so that now both have the same reserved behavior.
But the statement that 
"Some instructions, ...have the rm field but are nevertheless unaffected by the rounding mode; 
implies that it is ignored, but the following statement
SW should set their rm field to RNE (000). 
Implies that something may care if it isn't. 
So the two statements are in conflict, which one takes priority?

On Fri, Oct 2, 2020 at 3:03 PM Paul Donahue <pdonahue@...> wrote:

The F extension says: "The behavior of floating-point instructions that depend on rounding mode when executed with a reserved rounding mode is reserved, including both static reserved rounding modes (101–110) and dynamic reserved rounding modes (101–111)."  How does the specification specify which FP instructions "depend on rounding mode"?


For example: The F extension says: "Note FCVT.D.W[U] always produces an exact result and is unaffected by rounding mode" and "FCVT.D.S will never round."  In a casual sense, that means that those two instructions do not depend on rounding mode.  In a more formal sense, the table in section 14.3 does not list frm as a source register for either of those instructions which also hints that these instructions do not depend on rounding mode (or at least are allowed to not depend on rounding mode).


If an implementation executes one of these instructions either with a reserved value in the rm field or with rm=111 and a reserved value in the frm CSR, is an implementation allowed to raise an illegal instruction exception or must implementations ignore the rm field and the frm CSR on those instructions?



Thanks,


-Paul