OSf32tos16

C Specification


#include <revolution/os.h>

inline void OSf32tos16(f32* in, s16* out);

Arguments

in Pointer to the 32-bit floating point value to convert.
out Pointer to the signed 16-bit value to store.

Return Values

None.

Description

Fast converts a single precision floating point value into a signed 16-bit integer in two cycles (using a load and store).

The OSInitFastCast function must be called before invoking this function.

In the standard debug builds, this function and all other fast cast functions will not be inline-expanded.

This function takes addresses as arguments to load/store instructions. Taking addresses as arguments ensures that the compiler will reserve space on the stack (rather than forcing the programmer or the inline function to allocate space). The stack-allocated variables will likely be in the cache.

See Also

OSInitFastCast, OSf32tos16, OSf32tos8, OSf32tou16, OSf32tou8, OSs16tof32, OSs8tof32, OSu16tof32, OSu8tof32

Revision History

03/01/2006 Initial version.