Skip to content

shz_divf

Markdown
SHZ_INLINE float shz_divf(float num, float denom) SHZ_NOEXCEPT;

Approximate division by a signed denominator.

NameTypeDescription
numfloatNumerator to divide into.
denomfloatSigned denominoator to divide by.

The approximated quotient num / denom.

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.
  • No division-by-zero protection: denom == 0.0f returns infinity, or NaN when num is also 0.0f.
  • 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"

shz_divf_fsrra, shz_vec2_divf, shz_vec3_divf, shz_vec4_divf