Skip to content

[libc] {u}lkbits broken on riscv32 #115778

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

Open
nickdesaulniers opened this issue Nov 11, 2024 · 3 comments
Open

[libc] {u}lkbits broken on riscv32 #115778

nickdesaulniers opened this issue Nov 11, 2024 · 3 comments
Assignees
Labels

Comments

@nickdesaulniers
Copy link
Member

#114912 broke the riscv32 buildbot:

libc/src/stdfix/lkbits.cpp:16:10: error: no matching function for call to 'bit_cast' 16 | return cpp::bit_cast<long accum, int_lk_t>(x); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvm-project/libc/src/__support/CPP/bit.h:38:1: note: candidate template ignored: substitution failure [with To = long _Accum, From = int_lk_t]: implicit instantiation of undefined template '__llvm_libc_20_0_0_git::cpp::enable_if<false, long _Accum>' 38 | bit_cast(const From &from) { | ^

I'm going to disable this for now.

Reproducible via:

$ cmake ../runtimes -G Ninja -DLLVM_ENABLE_LLD=ON -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_RUNTIMES="libc" -DLIBC_TARGET_TRIPLE=riscv32-linux-gnu -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
$ ninja libc

cc @smallp-o-p

@llvmbot
Copy link
Member

llvmbot commented Nov 11, 2024

@llvm/issue-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

#114912 broke the riscv32 buildbot: ``` libc/src/stdfix/lkbits.cpp:16:10: error: no matching function for call to 'bit_cast' 16 | return cpp::bit_cast<long accum, int_lk_t>(x); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvm-project/libc/src/__support/CPP/bit.h:38:1: note: candidate template ignored: substitution failure [with To = long _Accum, From = int_lk_t]: implicit instantiation of undefined template '__llvm_libc_20_0_0_git::cpp::enable_if<false, long _Accum>' 38 | bit_cast(const From &from) { | ^ ``` I'm going to disable this for now.

Reproducible via:

$ cmake ../runtimes -G Ninja -DLLVM_ENABLE_LLD=ON -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_RUNTIMES="libc" -DLIBC_TARGET_TRIPLE=riscv32-linux-gnu -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
$ ninja libc

cc @smallp-o-p

@smallp-o-p
Copy link
Contributor

I'll investigate.

@nickdesaulniers
Copy link
Member Author

argh ulkbits also has this issue

nickdesaulniers added a commit to nickdesaulniers/llvm-project that referenced this issue Nov 12, 2024
I should have disabled this in llvm#115781. Mea culpa.

Link: llvm#114912
Link: llvm#115778
Link: llvm#115781
@nickdesaulniers nickdesaulniers changed the title [libc] lkbits broken on riscv32 [libc] {u}lkbits broken on riscv32 Nov 12, 2024
nickdesaulniers added a commit that referenced this issue Nov 12, 2024
I should have disabled this in #115781. Mea culpa.

Link: #114912
Link: #115778
Link: #115781
michaelrj-google pushed a commit that referenced this issue Nov 12, 2024
- Re-enabled ulkbits and lkbits for Risc-V
- Bumped `int_lk_t` to a `signed long long` and a `uint_ulk_t` to an
`unsigned long long` to guarantee they both fit in 8 bytes, which `long
_Accum` and `unsigned long _Accum` are defaulted to on 32bit
architectures.

This is probably inconvenient on systems that have a word size larger
than 64 bits?

#115778
Groverkss pushed a commit to iree-org/llvm-project that referenced this issue Nov 15, 2024
Groverkss pushed a commit to iree-org/llvm-project that referenced this issue Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants