[vector] tighten spec around FP ops

Paul Sandoz paul.sandoz at oracle.com
Fri Nov 1 18:20:21 UTC 2019


Hi,

Some tightening and consolidation of the floating point operations, especially associative ones:

  http://cr.openjdk.java.net/~psandoz/panama/vector-fp-spec/webrev/ <http://cr.openjdk.java.net/~psandoz/panama/vector-fp-spec/webrev/>

--

There is still one issue dangling.  By default the order applied for the associative operations ADD and MUL is deliberately undefined, allowing for optimizations.

1) This affects reproducibility, since the results may differ over versions or implementations of the platform.

2) This may also differ from a sequential application to the lane values from beginning to end.  However, since vector operations will be commonly applied over arrays, the result from a sequential loop will also differ from that of a vectorized loop (grouping by the lane width).

I am not concerned about the latter case.  I have some concern about the former case.  Given the Vector API is about performance I don’t wanna change the default behavior of ADD and MUL.

One solution is to provide two further associative operations for floating point, ORDERED_ADD and ORDERED_MUL say.  John’s extensible operator design make this easy to define, which also makes it easier to punt on this decision until later.

I am leaning towards punting give the performance focus of this API but could be persuaded otherwise..

Thoughts?

Paul.


More information about the panama-dev mailing list