OSf32tos16

Syntax

#include <cafe/os.h>

static inline void OSf32tos16 (const f32* in, volatile s16* out);
static inline s16 __OSf32tos16Value (const f32 in);

Parameters

in (OSf32tos16) Pointer to the 32-bit floating-point value to convert.
(__OSf32tos16Value) The 32-bit floating-point value to convert.
out Pointer to the signed 16-bit value to store.

Return Values

OSf32tos16 None.
__OSf32tos16Value Result as an 16-bit signed integer value.

Description

The OSf32tos16 function takes addresses as arguments to load/store instructions. It converts single-precision floating-point memory into signed 16-bit integer memory in two instructions (using a load and a store).

The __OSf32tos16Value function takes an argument by value. It converts a single-precision floating-point value into a signed 16-bit integer in two instructions (using a store and a load).

Call the OSInitFastCast function before invoking these functions if the state of GQRs 2 through 5 have been changed on the current thread.

Do Not Call From

__OSf32tos16Value

None.

OSf32tos16

None.

See Also

OSInitFastCast
OSf32tos8
OSf32tou16
OSf32tou8
OSs16tof32
OSs8tof32
OSu16tof32
OSu8tof32

Revision History

2013-05-08 Automated cleanup pass.
2012-08-08 Cleanup Pass.
2011-07-19 Updated for Cafe OS.
2010-08-30 Initial version.


CONFIDENTIAL