[LLVMdev] [RFC] Add a simple soft-float class

Owen Anderson resistor at mac.com
Tue Jun 17 21:59:08 PDT 2014


Hi Duncan,

Some of these don’t make a lot of sense:

>  - Easy to use and reason about (unlike `APFloat`).
>      - Uses operators.
>      - No special numbers.

What semantics do you propose to use instead?  At some point, people will hit the boundaries of their range, and you need to do something sensible there.

>      - Every operation well-defined (even divide-by-zero).

Divide-by-zero is actually well-defined in IEEE 754:
	x / +0.0 == +Inf
	x / -0.0 == -Inf
	(-)0.0 / (-)0.0 ==  NaN

>      - No rounding modes.

You can’t implement a finite precision floating point representation without any rounding.  I assume what you mean here is only one rounding mode, i.e. round-nearest-ties-to-even.

>      - Digits represented simply as a 32-bit or 64-bit integer.


Isn’t this the same as the significand of an IEEE float?  If you go with 64-bit, it sounds like you’re defining something very close to Intel’s FP80.

—Owen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140617/3489d2a6/attachment.html>


More information about the llvm-dev mailing list