SPRU514Z July 2001 – October 2023 SM320F28335-EP
CLA accepts the C28x pragmas except for FAST_FUNC_CALL.
The far and ioport keywords are not recognized.
Access to the 'MMOV32 MSTF,mem32'
and 'MMOV32 mem32,MSTF'
instructions is provided using the
cregister keyword. To access these MSTF instructions include the following declaration:
extern cregister volatile unsigned int MSTF;
The intrinsics listed in Table 10-2 are supported. Additionally, the run-time library functions abs() and fabs() are implemented as intrinsics.
Intrinsic | Assembly Instruction(s) | Description |
---|---|---|
uint32_t __f32_bits_as_u32( float src ); | -- | Extracts the bits in a float as a 32-bit register. This intrinsic generates no code; it tells the compiler to change how it interprets the bits in place. See Section 7.6.1 for examples. |
uint64_t __f64_bits_as_u64( double src ); | -- | Extracts the bits in a double as a 64-bit register. This intrinsic generates no code; it tells the compiler to change how it interprets the bits in place. See Section 7.6.1 for examples. |
__mdebugstop() | MDEBUGSTOP | Debug stop |
__meallow() | MEALLOW | Enable write access to EALLOW registers |
__medis() | MEDIS | Disable write access to EALLOW registers |
float __meinvf32(float x); | MEINVF32x | Estimate 1/x to about 8 bits of precision. |
float __meisqrtf32(float x); | MEISQRTF32x | Estimate the square root of 1/x to about 8 bits of precision. The Newton-Raphson method is used to approximate the square root. |
short __mf32toi16r(float src); | MF32TOI16Rdst, src | Convert double to int and round. |
unsigned short __mf32toui16r(float src); | MF32TOUI16Rdst, src | Convert double to unsigned int and round. |
float __mfracf32(float src); | MFRACF32 dst, src | Return the fractional portion of src. |
short __mgeq( signed int x, signed int y); | MCMP32 dst, src | Return 1 if x is greater than or equal to y. Otherwise, return 0. |
short __mgequ( unsigned int x, unsigned int y); | MCMP32 dst, src | Return 1 if x is greater than or equal to y. Otherwise, return 0. |
short __mgt( signed int x, signed int y); | MCMP32 dst, src | Return 1 if x is greater than y. Otherwise, return 0. |
short __mgtu( unsigned int x, unsigned int y); | MCMP32 dst, src | Return 1 if x is greater than y. Otherwise, return 0. |
short __mleq( signed int x, signed int y); | MCMP32 dst, src | Return 1 if x is less than or equal to y. Otherwise, return 0. |
short __mlequ( unsigned int x, unsigned int y); | MCMP32 dst, src | Return 1 if x is less than or equal to y. Otherwise, return 0. |
short __mlt( signed int x, signed int y); | MCMP32 dst, src | Return 1 if x is less than y. Otherwise, return 0. |
short __mltu( unsigned int x, unsigned int y); | MCMP32 dst, src | Return 1 if x is less than y. Otherwise, return 0. |
float __mmaxf32( float x, float y); | MMAXF32 dst, src | Return the maximum of two 32-bit floating point values. If src>dst, copy src to dst. |
float __mminf32( float x, float y); | MMINF32 dst, src | Return the minimum of two 32-bit floating point values. If src<dst, copy src to dst. |
__mnop() | MNOP | CLA no operation |
__msetflg(unsigned short flag, unsigned short value) | MSETFLG flag, value | Set/clear flag(s) in the MSTF register. The flag is a bit
mask to indicate which bits to modify. The value provides the values to
assign to these bits. See the CLA Reference Guide (SPRUGE6) for details
about the MSETFLG instruction and the MSET register. This example sets the RNDF32 flag (bit 7) to 0, the TF flag (bit 6) to 0, and the NF flag (bit 2) to 1. The 0b prefix is a GCC language extension indicating that these are binary numbers.
|
void __mswapf(float &a, float &b ); | MSWAPFa, b | Swap the contents of a and b. |
float __sqrt(float x); | MEISQRTF32 x | Estimate the square root of 1/x to about 8 bits of precision. The Newton-Raphson method is used to approximate the square root. This is an alias for the __meisqrtf32 intrinsic. |
float __u32_bits_as_f32( uint32_t src ); | -- | Packs a 32-bit register as a float. This intrinsic generates no code; it tells the compiler to change how it interprets the bits in place. See Section 7.6.1 for examples. |
double __u64_bits_as_f64( uint64_t src ); | -- | Packs a 64-bit register as a double. This intrinsic generates no code; it tells the compiler to change how it interprets the bits in place. See Section 7.6.1 for examples. |
Comparison intrinsics, such as __mlt and __mleq are provided for CLA to avoid possible overflows when performing signed integer comparisons.
The following intrinsics are available only within CLA2 background tasks. The background task has the lowest priority task and so will always be interrupted when another interrupt is available. These intrinsics can be used to temporarily prevent such interrupts from suspending the background task.