Convert custom maths to inlines (#10728)

This commit is contained in:
Scott Lahteine
2018-05-13 08:10:08 -05:00
committed by GitHub
parent 8f3d313086
commit 883b0c9880
4 changed files with 100 additions and 100 deletions

View File

@@ -23,11 +23,13 @@
#ifndef MATH_32BIT_H
#define MATH_32BIT_H
#include "../core/macros.h"
/**
* Math helper functions for 32 bit CPUs
*/
#define MultiU32X32toH32(intRes, longIn1, longIn2) intRes = ((uint64_t)longIn1 * longIn2 + 0x80000000) >> 32
#define MultiU32X24toH32(intRes, longIn1, longIn2) intRes = ((uint64_t)longIn1 * longIn2 + 0x00800000) >> 24
static FORCE_INLINE uint32_t MultiU32X24toH32(uint32_t longIn1, uint32_t longIn2) {
return ((uint64_t)longIn1 * longIn2 + 0x00800000) >> 24;
}
#endif // MATH_32BIT_H