Subzero: fix Call on bool-returning functions
On some ABIs, C++ functions that return bool only set the least
significant bits of the return register (e.g. AL on x64). The Call
implementation in SubzeroReactor would use uninitialized i32 target
to hold the result of a bool-returning function, but this would return
erroneous results when the called function would return false by setting
the LSB to 0, but with a non-zero MSB, thus returning true.
This change makes sure to truncate the i32 result to i8 (bool),
returning true only if the lsb is non-zero.
Bug: b/151158858
Change-Id: I41055a94d7f8045da503f27881ed887c1926f77b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/42068Tested-by:
Antonio Maiorano <amaiorano@google.com>
Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
Showing
Please
register
or
sign in
to comment