iLLD_TC27xD  1.0
Fractional Arithmetic Support
Collaboration diagram for Fractional Arithmetic Support:

Functions

IFX_INLINE sint16 __clssf (sfract a)
 
IFX_INLINE float __fract_to_float (fract a)
 
IFX_INLINE fract __float_to_fract (float a)
 
IFX_INLINE fract __getfract (laccum a)
 
IFX_INLINE sfract __mac_r_sf (sfract a, sfract b, sfract c)
 
IFX_INLINE sfract __mac_sf (sfract a, sfract b, sfract c)
 
IFX_INLINE long __mulfractfract (fract a, fract b)
 
IFX_INLINE long __mulfractlong (fract a, long b)
 
IFX_INLINE sfract __round16 (fract a)
 
IFX_INLINE sfract __s16_to_sfract (sint16 a)
 
IFX_INLINE sint16 __sfract_to_s16 (sfract a)
 
IFX_INLINE uint16 __sfract_to_u16 (sfract a)
 
IFX_INLINE laccum __shaaccum (laccum a, sint32 b)
 
IFX_INLINE fract __shafracts (fract a, sint32 b)
 
IFX_INLINE sfract __shasfracts (sfract a, sint32 b)
 
IFX_INLINE sfract __u16_to_sfract (uint16 a)
 

Detailed Description

The next table provides an overview of intrinsic functions to convert fractional values. Note that the TASKING VX-toolset C compiler for TriCore fully supports the fractional type so normally you should not need these intrinsic functions (except for __mulfractlong). For compatibility reasons the TASKING C compiler does support these functions.

Function Documentation

IFX_INLINE sint16 __clssf ( sfract  a)

Count the consecutive number of bits that have the same value as bit 15 of an sfract

Definition at line 184 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE fract __float_to_fract ( float  a)

Convert float to fract

Definition at line 202 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE float __fract_to_float ( fract  a)

Convert fract to float

Definition at line 193 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE fract __getfract ( laccum  a)

Convert laccum to fract

Definition at line 211 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE sfract __mac_r_sf ( sfract  a,
sfract  b,
sfract  c 
)

Multiply-add with rounding. Returns the rounded result of ( a + b * c )

Definition at line 220 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE sfract __mac_sf ( sfract  a,
sfract  b,
sfract  c 
)

Multiply-add sfract. Returns ( a + b * c )

Definition at line 229 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE long __mulfractfract ( fract  a,
fract  b 
)

Integer part of the multiplication of a fract and a fract

Definition at line 238 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE long __mulfractlong ( fract  a,
long  b 
)

Integer part of the multiplication of a fract and a long

Definition at line 247 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE sfract __round16 ( fract  a)

Convert fract to sfract

Definition at line 256 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE sfract __s16_to_sfract ( sint16  a)

Convert signed sint16 to sfract

Definition at line 268 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE sint16 __sfract_to_s16 ( sfract  a)

Convert sfract to sint16

Definition at line 277 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE uint16 __sfract_to_u16 ( sfract  a)

Convert sfract to uint16

Definition at line 286 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE laccum __shaaccum ( laccum  a,
sint32  b 
)

Left/right shift of an laccum

Definition at line 295 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE fract __shafracts ( fract  a,
sint32  b 
)

Left/right shift of an fract

Definition at line 312 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE sfract __shasfracts ( sfract  a,
sint32  b 
)

Left/right shift of an sfract

Definition at line 321 of file IfxCpu_IntrinsicsGnuc.h.

IFX_INLINE sfract __u16_to_sfract ( uint16  a)

Convert uint16 to sfract

Definition at line 330 of file IfxCpu_IntrinsicsGnuc.h.