[SYCL] Add external arbitrary floating point functions #2114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support of functions that operate on arbitrary precision floating
point numbers. This datatype and its corresponding operations can be
useful on targets that can take advantage of narrower representation
such as FPGAs.
Arbitrary precision floating point numbers are represented using
arbitrary precision integers (_ExtInt(N)). Additional parameters are:
The total width of the type is
E+M+1
where the last bit is used torepresent the sign. The data layout is shown below:
[ S (sign bit) ][ E (Exponent) ][ M (Mantissa) ]
The width of the data
(E+M+1)
is encoded with the width of thearbitrary precision integer variable. Mantissa (namely
M
) is encodedwithin each of the signature of the operations. Exponent values
(namely
E
) are inferred from the width of corresponding variable.Usage example:
_ExtInt(Wa) a;
_ExtInt(Wb) b;
_ExtInt(Wout) res = __spirv_ArbitraryFloatAddINTEL<Wa, Wb, Wout>(a, Ma, b, Mb, Mout);
Signed-off-by: Mikhail Lychkov [email protected]