Jump to conversation
Unresolved conversations (1)
@overmighty overmighty Jun 20, 2024
I should try putting all of these `if`s for special values under a single `if (LIBC_UNLIKELY(...))` and running a benchmark to compare.
Outdated
libc/src/__support/FPUtil/generic/div.h
overmighty lntue
Resolved conversations (14)
@overmighty overmighty Jun 24, 2024
I shouldn't have removed this one.
Outdated
libc/src/__support/FPUtil/generic/div.h
@lntue lntue Jun 24, 2024
maybe it is cheaper to test if output is `+Inf` or subnormal/zero?
Outdated
libc/src/__support/FPUtil/generic/div.h
lntue overmighty
@overmighty overmighty Jun 24, 2024
GitHub won't let me comment on collapsed unedited lines, but it is currently assumed that `FE_INEXACT` will be raised if required when `DyadicFloat::operator T()` returns, by these intermediate calculations: https://github.com/llvm/llvm-project/blob/44fb4248d6c63630a3e3f398c1edb086c52a32e6/libc/src/__support/FPUtil/dyadic_float.h#L168-L169 https://github.com/llvm/llvm-project/blob/44fb4248d6c63630a3e3f398c1edb086c52a32e6/libc/src/__support/FPUtil/dyadic_float.h#L176-L177
libc/src/__support/FPUtil/dyadic_float.h
overmighty lntue
@overmighty overmighty Jun 22, 2024
I think in this case `errno` should also be set to `EDOM` if required.
Outdated
libc/src/__support/FPUtil/generic/div.h
@overmighty overmighty Jun 21, 2024
Should raise `FE_INEXACT` if nonzero bits were shifted out of the mantissa.
Outdated
libc/src/__support/FPUtil/generic/div.h
@overmighty overmighty Jun 21, 2024
Should raise `FE_INEXACT` if non-zero bits were shifted out of the mantissa.
Outdated
libc/src/__support/FPUtil/generic/div.h
@overmighty overmighty Jun 21, 2024
- Should set `ERANGE` if required. - Should raise `FE_UNDERFLOW` and `FE_INEXACT`. - Should use `result_sign` and handle FE_UPWARD and FE_DOWNWARD appropriately.
Outdated
libc/src/__support/FPUtil/generic/div.h
@overmighty overmighty Jun 21, 2024
- Should set `ERANGE` if required. - Should raise `FE_OVERFLOW` and `FE_INEXACT`. - Should use `result_sign` and handle `FE_UPWARD` and `FE_DOWNWARD` appropriately.
Outdated
libc/src/__support/FPUtil/generic/div.h
@overmighty overmighty Jun 21, 2024
Nit: should probably use `using OutType = ...;` instead in C++.
Outdated
libc/test/src/math/DivTest.h
@overmighty overmighty Jun 21, 2024
Nit: should probably use `using OutType = ...;` instead in C++.
Outdated
libc/test/src/math/smoke/DivTest.h
@overmighty overmighty Jun 21, 2024
Not sure why I copy-pasted this.
Outdated
libc/test/src/math/smoke/DivTest.h
@overmighty overmighty Jun 20, 2024
The `& OutFPBits::SIG_MASK` part is redundant, `FPBits::create_value` does it already.
Outdated
libc/src/__support/FPUtil/generic/div.h
@lntue lntue Jun 20, 2024
I think you only need `OutFPBits::FRACTION_LEN + 1` iterations, then the rounding logic could be simpler.
Outdated
libc/src/__support/FPUtil/generic/div.h
overmighty
@overmighty overmighty Jun 20, 2024
Waiting for #95159 to be merged for this.
Outdated
libc/src/__support/FPUtil/generic/div.h