From c8af6dcd70535e60ba8957a6b4b1a12812c6ee95 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 10 Aug 2016 09:53:35 -0700 Subject: [PATCH] Add SMULL instruction inline function. --- .../os/hal/platforms/LPC43xx_M4/lpc43xx_m4.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/firmware/chibios-portapack/os/hal/platforms/LPC43xx_M4/lpc43xx_m4.h b/firmware/chibios-portapack/os/hal/platforms/LPC43xx_M4/lpc43xx_m4.h index 25f569079..d56457ae8 100644 --- a/firmware/chibios-portapack/os/hal/platforms/LPC43xx_M4/lpc43xx_m4.h +++ b/firmware/chibios-portapack/os/hal/platforms/LPC43xx_M4/lpc43xx_m4.h @@ -196,6 +196,20 @@ __attribute__( ( always_inline ) ) __STATIC_INLINE int32_t __SMULTT(uint32_t op1 return result; } +#undef __SMULL + +__attribute__( ( always_inline ) ) static inline int64_t __SMULL (int32_t op1, int32_t op2) +{ + union llreg_u{ + uint32_t w32[2]; + int64_t w64; + } llr; + + __asm volatile ("smull %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2)); + + return(llr.w64); +} + #undef __SMLALD __attribute__( ( always_inline ) ) static inline int64_t __SMLALD (uint32_t op1, uint32_t op2, int64_t acc)