shz_divf
SHZ_INLINE float shz_divf(float num, float denom) SHZ_NOEXCEPT;Approximate division by a signed denominator.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
num | float | Numerator to divide into. |
denom | float | Signed denominoator to divide by. |
Returns
Section titled “Returns”The approximated quotient num / denom.
Details
Section titled “Details”This routine takes approximately the same number of cycles as a full float division on the SH4; however, it can be paired with a real division to perform two in parallel.
- The vector forms of this routine automatically handle optimal parallelization of this operation across multiple lanes.
Warnings
Section titled “Warnings”- No division-by-zero protection:
denom==0.0freturns infinity, or NaN whennumis also0.0f.
Availability
Section titled “Availability”- C++ equivalent:
shz::divf - Type-generic form: none
- Back-ends: SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- Defined in:
sh4zam/shz_scalar.h:337 - Module: Scalar, section "FSRRA"