libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:164:9: error: no viable conversion from '__llvm_libc_19_0_0_git::fputil::FPBits<float>' to 'float'
I'm building on macOS using Xcode 15.2 with my repo at commit 79709498eaa5 and hitting these errors:
/Users/rudkx/src/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:164:9: error: no viable conversion from '__llvm_libc_19_0_0_git::fputil::FPBits<float>' to 'float'
164 | float large_value = FPBits<float>::max_normal();
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/rudkx/src/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:165:9: error: no viable conversion from '__llvm_libc_19_0_0_git::fputil::FPBits<float>' to 'float'
165 | float small_value = FPBits<float>::min_normal();
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/rudkx/src/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:280:33: error: implicit conversion loses integer precision: 'const uint64_t' (aka 'const unsigned long long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
280 | FEnv::set_control_word(state->ControlWord);
| ~~~~ ~~~~~~~^~~~~~~~~~~
/Users/rudkx/src/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:281:32: error: implicit conversion loses integer precision: 'const uint64_t' (aka 'const unsigned long long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
281 | FEnv::set_status_word(state->StatusWord);
| ~~~~ ~~~~~~~^~~~~~~~~~
4 errors generated.
I configured and built like this:
cmake -S llvm -B assert -G Ninja -DLLVM_ENABLE_PROJECTS="clang;mlir;openmp;pstl" -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libc;libunwind;libcxxabi;libcxx;compiler-rt"
cmake --build assert
@llvm/issue-subscribers-libc
Author: Mark Lacey (rudkx)
/Users/rudkx/src/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:164:9: error: no viable conversion from '__llvm_libc_19_0_0_git::fputil::FPBits<float>' to 'float'
164 | float large_value = FPBits<float>::max_normal();
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/rudkx/src/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:165:9: error: no viable conversion from '__llvm_libc_19_0_0_git::fputil::FPBits<float>' to 'float'
165 | float small_value = FPBits<float>::min_normal();
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/rudkx/src/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:280:33: error: implicit conversion loses integer precision: 'const uint64_t' (aka 'const unsigned long long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
280 | FEnv::set_control_word(state->ControlWord);
| ~~~~ ~~~~~~~^~~~~~~~~~~
/Users/rudkx/src/llvm-project/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h:281:32: error: implicit conversion loses integer precision: 'const uint64_t' (aka 'const unsigned long long') to 'uint32_t' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
281 | FEnv::set_status_word(state->StatusWord);
| ~~~~ ~~~~~~~^~~~~~~~~~
4 errors generated.
I configured and built like this:
cmake -S llvm -B assert -G Ninja -DLLVM_ENABLE_PROJECTS="clang;mlir;openmp;pstl" -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RUNTIMES="libc;libunwind;libcxxabi;libcxx;compiler-rt"
cmake --build assert
following
I don't have an ARM mac to test right now, but it looks like both of those would be solved by casting to the correct type.
For the FPBits calls add .get_val() on the end.
For the set_*_word calls add a static_cast<uint32_t>.
I'll see about getting a patch out for those in a bit, or if you send me the patch I'll approve it.
Best place to submit a patch? I'll give it a shot.
the easiest way is to create a github PR and add me as a reviewer. If you don't want to do that then you can just send me the diff and I can create the PR for you, though that'll take a bit longer.
I can do that, np.
@michaelrj-google Created https://github.com/llvm/llvm-project/pull/82429 but it's not letting me add reviewers.
Do we get to close this now?
Forgot to mention, if you put Fixes: https://github.com/llvm/llvm-project/issues/82205 in your commit message it will close automatically when the patch lands.
Neat.