The following intrinsics perform faster trigonometric calculations using the Trigonometric Math Unit (TMU). These intrinsics are enabled if the --tmu_support=tmu0 compiler option is used. The shaded rows list intrinsics that are supported only if --tmu_support=tmu1, and are supported for EABI only.
If you are using the COFF ABI, arguments and return values listed as floats may also use doubles, because both are 32-bit types. If you are using EABI, these functions require the float type, because double is a 64-bit type.
Intrinsic | Assembly Instruction(s) | Description |
---|---|---|
float __atan( float src); | ATANPUF32dst, src
MPY2PIF32dst, src |
Return the principal value of the arc tangent of src radians. |
float __atanpuf32( float src); | ATANPUF32dst, src | Return the principal value of the arc tangent of src, which is provided as a per unit value. |
float __atan2( float y , float x); | QUADF32quadrant, ratio, y, x
ATANPUF32atanpu, ratio ADDF32atan2pu, atanpu MPY2PIF32atan2, atan2pu |
Return the principal value of the arc tangent plus the quadrant for x, y. |
float __atan2puf32( float x, float y); | QUADF32quadrant, ratio, y, x
ATANPUF32atanpu, ratio ADDF32dst, atanpu |
Return the principal value of the arc tangent plus the quadrant value for y, x. The value is returned as a per unit value. |
float __cos( float src); | DIV2PIF32dst, src
COSPUF32dst, src |
Return the cosine of src, where src is provided in radians. |
float __cospuf32( float src); | COSPUF32dst, src | Return the cosine of src, where src is provided as a per unit value. |
float __divf32( float num , float denom); | DIVF32dst, num, denom | Return num divided by denom using the TMU hardware instruction for floating point division. |
float __div2pif32( float src); | DIV2PIF32dst, src | Return the result of multiplying src by 1/2pi (effectively dividing by 2pi). This converts a value in radians to a per unit value. |
float __iexp2( float x); | IEXP2F32result,x | Return the result of 2^^-|x|, which is the same as (1.0 / 2^^|x|). (tmu1 and EABI only) |
float __log2( float x); | LOG2F32logarithm,x | Return the binary logarithm, which is the power to which the number 2 must be raised to obtain the value x. (tmu1 and EABI only) |
float __mpy2pif32( float src); | MPY2PIF32dst, src | Return the result of multiplying src by 2pi. This converts a per unit value to radians. Per unit values are commonly used in control applications to represent normalized radians. |
float __quadf32( float ratio, float y, float x); | QUADF32quadrant, ratio, y, x | Return the quadrant value (0.0, +/-0.25, or +/-0.5) and the ratio of x and y, which are provided as per unit values. |
float __sin( float src); | DIV2PIF32dst, src
SINPUF32dst, src |
Return the sine of src, where src is provided in radians. |
float __sinpuf32( float src); | SINPUF32dst, src | Return the sine of src, where src is provided as a per unit value. |
float __sqrt( float src); | SQRTF32dst, src | Return the square root of src. |