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

<intrin0.h>: needs some stuff for _M_ARM64 #2129

Open
fsb4000 opened this issue Aug 16, 2021 · 3 comments · May be fixed by #4695
Open

<intrin0.h>: needs some stuff for _M_ARM64 #2129

fsb4000 opened this issue Aug 16, 2021 · 3 comments · May be fixed by #4695
Labels
ARM64 Related to the ARM64 architecture

Comments

@fsb4000
Copy link
Contributor

fsb4000 commented Aug 16, 2021

For #2127 I need

  1. __uint64ToN64_v
  2. neon_cnt
  3. neon_addv8
  4. __n64

from <arm64_neon.h>

https://godbolt.org/z/MbEqfshGG

@fsb4000
Copy link
Contributor Author

fsb4000 commented Aug 16, 2021

clang generates only 2 errors.

#include <intrin0.h>

_NODISCARD int _Arm64_popcount(const unsigned long long _Val) noexcept {
    const __n64 _Result = neon_cnt(__uint64ToN64_v(_Val));
    return neon_addv8(_Result).n8_u8[0];
}

int main() {
    return _Arm64_popcount(0xFFFF);
}

$ clang++ --target=aarch64-windows-msvc -O3 -S test.cpp
test.cpp:4:11: error: unknown type name '__n64'
    const __n64 _Result = neon_cnt(__uint64ToN64_v(_Val));
          ^
test.cpp:4:36: error: use of undeclared identifier '__uint64ToN64_v'
    const __n64 _Result = neon_cnt(__uint64ToN64_v(_Val));
                                   ^
2 errors generated.

So does clang use different <intrin0.h>?
If so should I create a bug report at LLVM bugzilla?

@AlexGuteniev
Copy link
Contributor

Want also neon_cntq, neon_addvq8, __n128 to optimize bitset::count further than with 64-bit versions

@StephanTLavavej
Copy link
Member

@fsb4000 Yes, according to my understanding, Clang has their own <intrin0.h> that they use instead of ours.

@StephanTLavavej StephanTLavavej added the ARM64 Related to the ARM64 architecture label Aug 18, 2021
@AlexGuteniev AlexGuteniev linked a pull request May 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARM64 Related to the ARM64 architecture
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants