OSf32tou8

Syntax

#include <revolution/os.h>

inline void OSf32tou8(f32* in, u8* out);

Arguments

in Pointer to the 32-bit floating point value to be converted.
out Pointer to the unsigned 8-bit value to be stored.

Return Values

None.

Description

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

Note that the OSInitFastCast function must be called prior to 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, OSs16tof32, OSs8tof32, OSu16tof32, OSu8tof32

Revision History

2006/03/01 Initial version.


CONFIDENTIAL