To whom it may concern:

As some of you may be aware, Paul Dennis (whirlicote on Github) and I
(KloudKoder) are trying to enable floating-point (FP) instructions with
explicit rounding modes (RMs) in WebAssembly. The motivation is to
trivialize analog security via interval arithmetic (which provides
guarantees about where a given real number resides). As part of our work
with the WebAssembly Community Group, we were tasked with producing a
prototype implementation in V8. The required changes are conceptually
simple and at this point we're just looking for implementation guidance.
For that matter, if you feel strongly one way or the other about this, then
we invite your feedback.

Several months ago, Paul submitted a prototype design for their reference
interpreter for some new FP instructions which include an explicit rounding
mode. For example, instead of FP division, one could now have:

divide_floor
divide_ceil
divide_chop
divide_nearest_even (already existing as simply "divide")

in the usual 32-bit and 64-bit widths.

There are also new rounding instructions which convert between floats and
ints, and promote or demote between precisions, all with an explicit RM.
We've also added support for the extraction of arithmetic (trinary) or
logical (binary) signs.

For my part, I provided him with thousands of corner cases for testing
against actual Intel FPU (IEEE754) hardware. There's full coverage of all
unique instruction behavior, with some esoteric exceptions involving NaNs
that are already the subject of relevant canonicalization efforts, absent
any of this.

While there are tens of new instructions, the implementation is actually
quite repetitive, basically consisting of hardware RM switches before and
after an FP operation.

But if that's still too overwhelming, then we could start with sqrt_floor
and/or divide. These are unary and binary instructions, respectively, the
code for which would serve as templates for implementing the other FP
instructions in the proposal.

If you want to get into the weeds on all this, you can check out the
relevant Github issue below:

https://github.com/WebAssembly/rounding-mode-control/issues/2

We haven't signed the CLA yet but we're willing to do so if there's
interest here. Ask us anything!

Kloud Koder

-- 
-- 
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/CAB_Hu_YZ-B%3DQ7pP7B%3DP6Xf992jCZPQj%3DrCucggHEHo0GJTiP1w%40mail.gmail.com.

Reply via email to