Feature Request P3
Status Update
Comments
ni...@google.com <ni...@google.com> #2
ni...@google.com <ni...@google.com> #3
ap...@google.com <ap...@google.com> #4
Project: SwiftShader
Branch: master
commit e6504a2a091c45772724b2f38e48131a53751fce
Author: Bruno Pitrus <brunopitrus@hotmail.com>
Date: Thu Oct 20 21:05:59 2022
Use sw::bit_cast<> for type punning
Type punning through pointer or reference type cast breaks strict
aliasing rules which can lead to undefined behavior.
Note that sw::bit_cast<> makes use of a union to perform type punning,
which is also in violation of strict C++ rules, but is supported by
extension in at least the Visual Studio, Clang, and GCC compilers. It
will also be trivial to replace with std::bit_cast<> once we can upgrade
to C++20.
Bug: b/227975743
Change-Id: I4b94764aa6445d7c8d6463ba3a4b23a09ac975ef
Reviewed-on:https://swiftshader-review.googlesource.com/c/SwiftShader/+/69169
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Commit-Queue: Alexis Hétu <sugoi@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
M src/Pipeline/Constants.cpp
M src/System/Half.cpp
M src/System/Half.hpp
https://swiftshader-review.googlesource.com/69169
Branch: master
commit e6504a2a091c45772724b2f38e48131a53751fce
Author: Bruno Pitrus <brunopitrus@hotmail.com>
Date: Thu Oct 20 21:05:59 2022
Use sw::bit_cast<> for type punning
Type punning through pointer or reference type cast breaks strict
aliasing rules which can lead to undefined behavior.
Note that sw::bit_cast<> makes use of a union to perform type punning,
which is also in violation of strict C++ rules, but is supported by
extension in at least the Visual Studio, Clang, and GCC compilers. It
will also be trivial to replace with std::bit_cast<> once we can upgrade
to C++20.
Bug:
Change-Id: I4b94764aa6445d7c8d6463ba3a4b23a09ac975ef
Reviewed-on:
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Commit-Queue: Alexis Hétu <sugoi@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
M src/Pipeline/Constants.cpp
M src/System/Half.cpp
M src/System/Half.hpp
vi...@gmail.com <vi...@gmail.com> #5
KG5k-F062-11.0-GL-V195-20221224
Description
C++20 supports a number of features useful to SwiftShader. For example:
constexpr
vector<>
: Enables creating static vectorsmemset
.contains()
method for sets ands maps.