#include <cafe/os.h> static inline void OSInitFastCast(void)
None.
None.
Cafe OS initializes the fast floating-point number/integer casting feature for the main program and all threads.
Threads that use Espresso GQRs (quantization registers) 2 through 5 must call OSInitFastCast
to reinitialize the GQRs before any fast cast routines (in OSFastCast.h
) are called.
GQRs are managed per thread. GQR0
is reserved in advance to have the value 0
for loading and storing single-precision floating-point values. GQR1
is reserved for the compiler.
The fast cast API group uses Espresso's single load/store instructions, which include a quantization instruction that converts a floating-point number to an integer in only two instructions (load and store).
The GQRs are set to the following values:
GQR 2 | Load u8 / Store u8 . No scaling. |
---|---|
GQR 3 | Load u16 / Store u16 . No scaling. |
GQR 4 | Load s8 / Store s8 . No scaling. |
GQR 5 | Load s16 / Store s16 . No scaling. |
Multiple threads | This function is not thread-safe. |
---|
OSf32tos16
OSf32tos8
OSf32tou16
OSf32tou8
OSs16tof32
OSs8tof32
OSu16tof32
OSu8tof32
2013/05/08 Automated cleanup pass.
2010/08/30 Initial version.
CONFIDENTIAL