Fix undefined behavior in minifloat conversion
Fix undefined behavior in minifloat conversion

Shifting a 32-bit value by 32 or more is undefined behavior in C++. This
previously happened in this code when converting a 32-bit float value to
an 11- or 10-bit minifloat which is too small to be represented as a
denormal, and should produce 0 instead.

Instead of going through this arithmetic for denormals, just test
whether the input value is too small to produce a valid denormal, and
return 0 instead.

Bug: chromium:1117433
Change-Id: I8149996fb6d66d328db45725c4cdb81dc7826a10
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48069
Presubmit-Ready: Nicolas Capens <51edc787c30f24c4904e8ffbb5523c3a9f7a451d@google.com>
Tested-by: Nicolas Capens <51edc787c30f24c4904e8ffbb5523c3a9f7a451d@google.com>
Kokoro-Result: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>
Reviewed-by: Alexis Hétu <1c7141772178a7e80858c3db5052b328076f08f4@google.com>

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