Skip to content
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

[simd] simd.mask for long double fail #50

Closed
fepicture opened this issue Aug 4, 2022 · 4 comments
Closed

[simd] simd.mask for long double fail #50

fepicture opened this issue Aug 4, 2022 · 4 comments
Assignees

Comments

@fepicture
Copy link

fepicture commented Aug 4, 2022

reproduce method

sorry for my silly way to reproduce: modify the test file to following script and run test-suite build

  1. modify llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp to the following code
#include <experimental/simd>
#include<iostream>
namespace ex = std::experimental::parallelism_v2;
int main() {
    bool v = ex::is_abi_tag_v<ex::simd<long double >>;   
    std::cout<<v<<'\n';
   bool v2 = ex::is_abi_tag_v<ex::simd_mask<long double >>;//  note this line will throw error
}
  1. run following command
cd ~/llvm-project && mkdir -p llvm-project/build 

cd ~/llvm-project/build && cmake ../runtimes -G Ninja -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" -DCMAKE_C_COMPILER="$(which clang)" -DCMAKE_CXX_COMPILER="$(which clang++)"

cd ~/llvm-project/build && ninja cxx-test-depends

cd to llvm-project/build  && bin/llvm-lit -av libcxx/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp &> err.log

check the llvm-project/build/err.log

error log

error log
In file included from /root/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp:19:
In file included from /root/llvm-project/build/include/c++/v1/experimental/simd:693:
In file included from /root/llvm-project/build/include/c++/v1/__simd/abi/builtin.h:19:
/root/llvm-project/build/include/c++/v1/__simd/abi/simd_storage.h:64:41: error: invalid application of 'sizeof' to an incomplete type 'void'
  _Tp __data __attribute__((vector_size(sizeof(_Tp) * _Np)));
                                        ^~~~~~~~~~~
/root/llvm-project/build/include/c++/v1/__simd/abi/simd_storage.h:75:57: note: in instantiation of template class 'std::experimental::__simd_storage<void, std::experimental::simd_abi::__vec_ext<1>>' requested here
struct __mask_storage <_Tp, simd_abi::__vec_ext<_Np>> : __simd_storage<decltype(__choose_mask_type<_Tp>()), simd_abi::__vec_ext<_Np>> {};
                                                        ^
/root/llvm-project/build/include/c++/v1/experimental/simd:1942:12: note: in instantiation of template class 'std::experimental::__mask_storage<long double, std::experimental::simd_abi::__vec_ext<1>>' requested here
  _Storage __s_;
           ^
/root/llvm-project/build/include/c++/v1/experimental/simd:979:48: note: in instantiation of template class 'std::experimental::simd_mask<long double, std::experimental::simd_abi::__vec_ext<1>>' requested here
struct __is_abi_tag_impl<_Tp, std::enable_if_t<_Tp::__is_abi_tag>> : std::bool_constant<_Tp::__is_abi_tag> {};
                                               ^
/root/llvm-project/build/include/c++/v1/experimental/simd:982:21: note: during template argument deduction for class template partial specialization '__is_abi_tag_impl<_Tp, std::enable_if_t<_Tp::__is_abi_tag>>' [with _Tp = std::experimental::simd_mask<long double, std::experimental::simd_abi::__vec_ext<1>>]
struct is_abi_tag : __is_abi_tag_impl<_Tp> {};
                    ^
/root/llvm-project/build/include/c++/v1/experimental/simd:982:21: note: in instantiation of template class 'std::experimental::__is_abi_tag_impl<std::experimental::simd_mask<long double, std::experimental::simd_abi::__vec_ext<1>>>' requested here
/root/llvm-project/build/include/c++/v1/experimental/simd:985:38: note: in instantiation of template class 'std::experimental::is_abi_tag<std::experimental::simd_mask<long double, std::experimental::simd_abi::__vec_ext<1>>>' requested here
inline constexpr bool is_abi_tag_v = is_abi_tag<_Tp>::value;
                                     ^
/root/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp:119:15: note: in instantiation of variable template specialization 'std::experimental::is_abi_tag_v<std::experimental::simd_mask<long double, std::experimental::simd_abi::__vec_ext<1>>>' requested here
 bool v = ex::is_abi_tag_v<ex::simd_mask<long double >>;
              ^
In file included from /root/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp:19:
In file included from /root/llvm-project/build/include/c++/v1/experimental/simd:693:
In file included from /root/llvm-project/build/include/c++/v1/__simd/abi/builtin.h:19:
/root/llvm-project/build/include/c++/v1/__simd/abi/simd_storage.h:71:32: error: argument may not have 'void' type
  void __set(size_t __idx, _Tp __v) noexcept { __data[__idx] = __v; }
                               ^
2 errors generated.

error: command failed with exit status: 1

--

********************
********************
Failed Tests (1):
  libc++ :: std/experimental/simd/simd.traits/is_abi_tag.pass.cpp


Testing Time: 0.82s
  Failed: 1

edit 1:

clang 14.0.0 and c++2b

compile config:
 "/usr/lib/llvm-14/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name is_abi_tag.pass.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -v -fcoverage-compilation-dir=/root/llvm-project/build/libcxx/test/std/experimental/simd/simd.traits -nostdinc++ -resource-dir /usr/lib/llvm-14/lib/clang/14.0.0 -include /root/llvm-project/libcxx/test/support/nasty_macros.h -I /root/llvm-project/build/include/c++/v1 -I /root/llvm-project/build/libcxx/include/c++build -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -D __STDC_CONSTANT_MACROS -I /root/llvm-project/libcxx/test/support -D _LIBCPP_DISABLE_AVAILABILITY -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D _LIBCPP_HAS_THREAD_API_PTHREAD -D _LIBCPP_ABI_VERSION=1 -internal-isystem /usr/lib/llvm-14/lib/clang/14.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Werror -Wall -Wextra -Wshadow -Wundef -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type -Wno-atomic-alignment -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Werror=thread-safety -Wuser-defined-warnings -Wno-macro-redefined -Wno-macro-redefined -std=c++2b -fdeprecated-macro -fdebug-compilation-dir=/root/llvm-project/build/libcxx/test/std/experimental/simd/simd.traits -ferror-limit 19 -fcoroutines-ts -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/is_abi_tag-20e072.o -x c++ /root/llvm-project/libcxx/test/std/experimental/simd/simd.traits/is_abi_tag.pass.cpp
clang -cc1 version 14.0.0 based upon LLVM 14.0.0 default target x86_64-pc-linux-gnu
@fepicture
Copy link
Author

@joy2myself please take a look if you have time.

@joy2myself joy2myself self-assigned this Aug 4, 2022
@joy2myself
Copy link
Collaborator

Thanks for the report!

I'm not sure if it is fixed by commit d2b8a36. Please try it again.

And I think you can submit the implemented test cases to PR #46 as soon as possible, whether they can pass or not. Then I can use them to debug such problems.

@fepicture
Copy link
Author

Thanks for the report!

I'm not sure if it is fixed by commit d2b8a36. Please try it again.

And I think you can submit the implemented test cases to PR #46 as soon as possible, whether they can pass or not. Then I can use them to debug such problems.

I got your point, sure, I will squash to one commit.
Also, you can directly bind my repo to test(git add upstream related things).

@fepicture
Copy link
Author

thank you! it indeed fixed by d2b8a36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants