Assert Reactor Float constants are finite
Assert Reactor Float constants are finite

C++11 does not have a way to write an infinite or NaN literal, nor does
it allow division by zero as a constant expression. Thus we should not
accept inf or NaN as a Reactor Float constant, as this would typically
indicate a bug, and avoids undefined behavior.

This also prevents the issue of the LLVM JIT only taking double values
for constructing floating-point constants. During the conversion from
single-precision to double, a signaling NaN can become a quiet NaN, thus
altering its bit pattern. Hence this assert is also helpful for
detecting cases where integers are being reinterpreted as float and then
bitcast to integer again, which does not guarantee preserving the
integer value.

Should infinity and NaN constants be required, methods like infinity(),
quiet_NaN(), and signaling_NaN() should be added to the Float class.

For cases where binary float data must be preserved exactly, one can
construct a Reactor Int value and bitcast as Float.

Bug: b/140302841
Change-Id: I72cf7e6fe82913cffcb1e0de282bc6839f65226d
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/35868
Presubmit-Ready: Nicolas Capens <51edc787c30f24c4904e8ffbb5523c3a9f7a451d@google.com>
Kokoro-Presubmit: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>
Tested-by: Nicolas Capens <51edc787c30f24c4904e8ffbb5523c3a9f7a451d@google.com>
Reviewed-by: Chris Forbes <c3279c50043e18e9442c1ae071cafa0e7a4ca967@google.com>

google/swiftshader,bkaradzic/SwiftShader,google/swiftshader,google/swiftshader,bkaradzic/SwiftShader,bkaradzic/SwiftShader,bkaradzic/SwiftShader,bkaradzic/SwiftShader