MIPS: add another mipsr2 endian function

Used by WAV and AIFF encoders for recording.

Change-Id: If1bf05583c6b5c123c91eb9c4dfe0e11efd3a0f7
This commit is contained in:
Aidan MacDonald 2021-05-29 15:49:57 +01:00
parent f64e8dc33c
commit c78ba1aa68

View file

@ -41,4 +41,11 @@ static inline uint16_t swap16_hw(uint16_t value)
return (uint16_t)out;
}
static inline uint32_t swap_odd_even32_hw(uint32_t value)
{
register uint32_t out;
__asm__ ("wsbh %0, %1" : "=r"(out) : "r"(value));
return out;
}
#endif /* __MIPSR2_ENDIAN_H__ */