SPRU514Z July 2001 – October 2023 SM320F28335-EP
The following intrinsics perform faster trigonometric calculations using the Trigonometric Math Unit (TMU). These intrinsics are enabled if the --tmu_support=tmu0 or --tmu_support=tmu1 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 ); | ATANPUF32
dst,
src
MPY2PIF32 dst, src |
Return the principal value of the arc tangent of src radians. |
float __atanpuf32( float src ); | ATANPUF32 dst, 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); | QUADF32
quadrant,
ratio,
y,
x ATANPUF32 atanpu, ratio ADDF32 atan2pu, atanpu MPY2PIF32 atan2, atan2pu |
Return the principal value of the arc tangent plus the quadrant for x, y. |
float __atan2puf32( float y, float x); | QUADF32
quadrant,
ratio,
y,
x ATANPUF32 atanpu, ratio ADDF32 dst, 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 ); | DIV2PIF32
dst,
src COSPUF32 dst, src |
Return the cosine of src, where src is provided in radians. |
float __cospuf32( float src ); | COSPUF32 dst, 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 ); | DIV2PIF32 dst, 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 __fmodf( float x, float y); | DIVF32 R0H,R2H,R1H NOP; NOP; NOP; NOP; F32TOI32 R0H,R0H NOP I32TOF32 R0H,R0H NOP MPYF32 R0H,R1H,R0H NOP SUBF32 R0H,R2H,R0H |
Returns the floating-point remainder of the division operation x/y, which is computed using x - ((int)(x/y)) * y. (The fmodf() RTS function is available to perform this instrinsic if --fp_mode=relaxed is used.) |
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 ); | MPY2PIF32 dst, 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 ); | QUADF32 quadrant, 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 ); | DIV2PIF32
dst,
src SINPUF32 dst, src |
Return the sine of src, where src is provided in radians. |
float __sinpuf32( float src ); | SINPUF32 dst, src | Return the sine of src, where src is provided as a per unit value. |
float __sqrt( float src ); | SQRTF32 dst, src | Return the square root of src. |