From c78ba1aa689b178ebb73b2730bc1b13697371fbf Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sat, 29 May 2021 15:49:57 +0100 Subject: [PATCH] MIPS: add another mipsr2 endian function Used by WAV and AIFF encoders for recording. Change-Id: If1bf05583c6b5c123c91eb9c4dfe0e11efd3a0f7 --- firmware/target/mips/mipsr2-endian.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/firmware/target/mips/mipsr2-endian.h b/firmware/target/mips/mipsr2-endian.h index 08992bfcdd..4de1eb825b 100644 --- a/firmware/target/mips/mipsr2-endian.h +++ b/firmware/target/mips/mipsr2-endian.h @@ -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__ */