Re: Fixed Point (Chapter 13): Clarification Request


Andrew Waterman
 



On Fri, Aug 7, 2020 at 8:49 AM CDS <cohen.steed@...> wrote:
The definition  of the numeric range (at the beginning of section 13) matches the definition of an integer, not of a fixed-point number. For example, the range specified is the range of an integer, not a number of 1.X or 2.X format. This doesn't seem to be a fixed-point specification in a manner consistent with other fixed-point operations commercially available. As INTEGER-ONLY operations go, these are likely useful instructions. As a fixed-point specification, this section seems to raise a lot of concerns.
Fixed Point math, itself, is somewhat niche. It mostly sees use in legacy audio and mixed signal applications. If it needs to be a part of RISC-V:
  • Could it be a sub-spec, or an optional consideration? The implementation requirements to support these are non-trivial and seem to target a small use-case demand.
Having implemented these instructions recently, I can say they weren’t unduly onerous to provide, and the HW cost increase wasn’t that great (the rounding and clipping logic are new; the rest reuses the integer datapath). But it’s nonzero cost, so your point holds.

I agree that fixed-point could be broken out into a separate extension so that embedded vector units can exclude it for applications where integer-only or integer-and-float-only would suffice.

  • Specify a 1.X format (or some fixed, deterministic point position). The current specification has no definition of a fixed point number format. The number format is implied, as a side effect in some instructions.
  • There is a need for a fixed<->float conversion instruction (as used in signal processing applications on mixed fixed/float processing systems, or for conversion of data from e.g. ADCs/DACs).

I think this can be done in two instructions without additional loss of precision: convert from int to float, then multiply by a floating-point scalar to move the binary point (or vice-versa).

Join tech-vector-ext@lists.riscv.org to automatically receive all group messages.