Skip to content

Commit

Permalink
[flang] arm build fix (llvm#124562)
Browse files Browse the repository at this point in the history
  • Loading branch information
vdonaldson authored Jan 27, 2025
1 parent 5592875 commit 1eb4e9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flang/runtime/exceptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ bool RTNAME(GetUnderflowMode)(void) {
return _MM_GET_FLUSH_ZERO_MODE() == _MM_FLUSH_ZERO_OFF;
#elif defined(_FPU_GETCW)
uint32_t fpcr;
_FPU_GETCW(fpcr);
__asm__ __volatile__("mrs %w0, fpcr" : "=r"(fpcr));
return (fpcr & _FPU_FPCR_FZ_MASK_) != _FPU_FPCR_FZ_MASK_;
#else
return false;
Expand All @@ -119,13 +119,13 @@ void RTNAME(SetUnderflowMode)(bool flag) {
_MM_SET_FLUSH_ZERO_MODE(flag ? _MM_FLUSH_ZERO_OFF : _MM_FLUSH_ZERO_ON);
#elif defined(_FPU_GETCW)
uint32_t fpcr;
_FPU_GETCW(fpcr);
__asm__ __volatile__("mrs %w0, fpcr" : "=r"(fpcr));
if (flag) {
fpcr &= ~_FPU_FPCR_FZ_MASK_;
} else {
fpcr |= _FPU_FPCR_FZ_MASK_;
}
_FPU_SETCW(fpcr);
__asm__ __volatile__("msr fpcr, %w0" : : "r"(fpcr));
#endif
}

Expand Down

0 comments on commit 1eb4e9f

Please sign in to comment.