2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _DOLPHIN_OSFASTCAST
|
|
|
|
#define _DOLPHIN_OSFASTCAST
|
2022-08-13 12:57:38 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2022-09-18 06:05:46 +00:00
|
|
|
|
2022-12-06 04:11:13 +00:00
|
|
|
#define OS_GQR_F32 0x0000
|
|
|
|
#define OS_GQR_U8 0x0004
|
|
|
|
#define OS_GQR_U16 0x0005
|
|
|
|
#define OS_GQR_S8 0x0006
|
|
|
|
#define OS_GQR_S16 0x0007
|
|
|
|
|
2022-08-13 12:57:38 +00:00
|
|
|
#define OS_FASTCAST_U8 2
|
2022-10-21 21:40:29 +00:00
|
|
|
#define OS_FASTCAST_U16 3
|
2024-09-28 19:43:23 +00:00
|
|
|
#define OS_FASTCAST_S8 4
|
2022-09-05 04:00:04 +00:00
|
|
|
#define OS_FASTCAST_S16 5
|
2022-12-06 04:11:13 +00:00
|
|
|
// clang-format off
|
|
|
|
static inline void OSInitFastCast(void) {
|
|
|
|
#ifdef __MWERKS__
|
|
|
|
asm
|
|
|
|
{
|
|
|
|
li r3, OS_GQR_U8
|
|
|
|
oris r3, r3, OS_GQR_U8
|
|
|
|
mtspr GQR2, r3
|
|
|
|
|
|
|
|
li r3, OS_GQR_U16
|
|
|
|
oris r3, r3, OS_GQR_U16
|
|
|
|
mtspr GQR3, r3
|
|
|
|
|
|
|
|
li r3, OS_GQR_S8
|
|
|
|
oris r3, r3, OS_GQR_S8
|
|
|
|
mtspr GQR4, r3
|
|
|
|
|
|
|
|
li r3, OS_GQR_S16
|
|
|
|
oris r3, r3, OS_GQR_S16
|
|
|
|
mtspr GQR5, r3
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
// clang-format off
|
2022-09-05 04:00:04 +00:00
|
|
|
|
2022-08-13 12:57:38 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2022-09-05 04:00:04 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _DOLPHIN_OSFASTCAST
|