[libc-commits] [libc] Add explicit conversion to fix arm64 builds. (PR #82429)
via libc-commits
libc-commits at lists.llvm.org
Tue Feb 20 14:18:45 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Moshe (MosheBerman)
<details>
<summary>Changes</summary>
Fixes issue preventing builds on ARM-based Macs.
https://github.com/llvm/llvm-project/issues/82205.
---
Full diff: https://github.com/llvm/llvm-project/pull/82429.diff
1 Files Affected:
- (modified) libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h (+4-4)
``````````diff
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index ea1fd68a5fcdfc..fd915373020ec9 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++ b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
@@ -161,8 +161,8 @@ LIBC_INLINE int set_except(int excepts) {
LIBC_INLINE int raise_except(int excepts) {
float zero = 0.0f;
float one = 1.0f;
- float large_value = FPBits<float>::max_normal();
- float small_value = FPBits<float>::min_normal();
+ float large_value = FPBits<float>::max_normal().get_val();
+ float small_value = FPBits<float>::min_normal().get_val();
auto divfunc = [](float a, float b) {
__asm__ __volatile__("ldr s0, %0\n\t"
"ldr s1, %1\n\t"
@@ -277,8 +277,8 @@ LIBC_INLINE int set_env(const fenv_t *envp) {
return 0;
}
const FEnv::FPState *state = reinterpret_cast<const FEnv::FPState *>(envp);
- FEnv::set_control_word(state->ControlWord);
- FEnv::set_status_word(state->StatusWord);
+ FEnv::set_control_word(static_cast<uint32_t>(state->ControlWord));
+ FEnv::set_status_word(static_cast<uint32_t>(state->StatusWord));
return 0;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/82429
More information about the libc-commits
mailing list