-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang++] operator==(vector of long, vector of long) -> vector of long long #132604
Comments
@llvm/issue-subscribers-backend-x86 Author: Imple Lee (ImpleLee)
When comparing two variables of vector of long, clang++ returns a vector of long long, inconsistent with g++.
https://godbolt.org/z/db9zT6f4r
#include <type_traits>
using T [[gnu::vector_size(sizeof(long))]] = long;
static_assert(std::is_same_v<std::remove_reference_t<decltype((T{} == T{})[0])>, long>); This makes the following code fails to compile with clang++ with the compilation options #include <experimental/simd>
#include <cstdint>
using deduce_t_element = std::experimental::simd<
std::uint64_t,
std::experimental::simd_abi::deduce_t<std::uint64_t, 4>
>;
auto f(deduce_t_element e) {
return e == 0;
} |
@llvm/issue-subscribers-clang-frontend Author: Imple Lee (ImpleLee)
When comparing two variables of vector of long, clang++ returns a vector of long long, inconsistent with g++.
https://godbolt.org/z/db9zT6f4r
#include <type_traits>
using T [[gnu::vector_size(sizeof(long))]] = long;
static_assert(std::is_same_v<std::remove_reference_t<decltype((T{} == T{})[0])>, long>); This makes the following code fails to compile with clang++ with the compilation options #include <experimental/simd>
#include <cstdint>
using deduce_t_element = std::experimental::simd<
std::uint64_t,
std::experimental::simd_abi::deduce_t<std::uint64_t, 4>
>;
auto f(deduce_t_element e) {
return e == 0;
} |
CC @mizvekov |
The resulting type of the comparison is the signed equivalent of the original vector type. But the way clang computes this is strange, it gets the size of the element type, and returns a signed vector of the same size, On triples where |
Can we make it a type-to-type mapping, so that |
When comparing two variables of vector of long, clang++ returns a vector of long long, inconsistent with g++.
https://godbolt.org/z/db9zT6f4r
This makes the following code fails to compile with clang++ with the compilation options
-march=x86-64-v4 -std=c++20
(previously reported as gcc bugzilla 118546).Online link: https://godbolt.org/z/sxqsKrv9e .
The text was updated successfully, but these errors were encountered: