Scalar SSE instructions only use the lowest scalar of an SSE vector register, but MemorySanitizer doesn't recognize some of them so it will check the entire 128-bit operand for uninitialized bits. This change makes sure the other elements of the vector gets zero- initialized instead of leaving it undefined. This affects Round, Trunc, Frac, Ceil, Floor, Sqrt, and RcpSqrt scalar operations. Note that this workaround results in MemorySanitizer marking the entire output vector to have a well-defined value, which isn't actually the case in non-MSan builds. Fortunately, a scalar can't be cast into a vector (unlike our 'emulated' small vectors), so we just have to make sure to immediately extract the scalar from the intrinsic's result. Bug: b/172238865 Change-Id: If68388e476ac9e27e2de33ddf2efab4124540c7a Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/54269 Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by:Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .vscode | Loading commit data... | |
| build | Loading commit data... | |
| build_overrides | Loading commit data... | |
| docs | Loading commit data... | |
| extensions | Loading commit data... | |
| include | Loading commit data... | |
| infra/config | Loading commit data... | |
| src | Loading commit data... | |
| tests | Loading commit data... | |
| third_party | Loading commit data... | |
| tools/cmake_generate_graphviz | Loading commit data... | |
| .clang-format | Loading commit data... | |
| .dir-locals.el | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .gitmodules | Loading commit data... | |
| AUTHORS.txt | Loading commit data... | |
| Android.bp | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CMakeSettings.json | Loading commit data... | |
| CONTRIBUTING.txt | Loading commit data... | |
| CONTRIBUTORS.txt | Loading commit data... | |
| DIR_METADATA | Loading commit data... | |
| LICENSE.txt | Loading commit data... | |
| OWNERS | Loading commit data... | |
| README.md | Loading commit data... | |
| codereview.settings | Loading commit data... |