12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #include <linux/export.h>
- #include "libgcc.h"
- #if defined(CONFIG_64BIT) && defined(CONFIG_CPU_MIPSR6) && (__GNUC__ == 7)
- static inline long long notrace dmulu(long long a, long long b)
- {
- long long res;
- asm ("dmulu %0,%1,%2" : "=r" (res) : "r" (a), "r" (b));
- return res;
- }
- static inline long long notrace dmuhu(long long a, long long b)
- {
- long long res;
- asm ("dmuhu %0,%1,%2" : "=r" (res) : "r" (a), "r" (b));
- return res;
- }
- ti_type notrace __multi3(ti_type a, ti_type b)
- {
- TWunion res, aa, bb;
- aa.ti = a;
- bb.ti = b;
-
- res.s.low = dmulu(aa.s.low, bb.s.low);
- res.s.high = dmuhu(aa.s.low, bb.s.low);
- res.s.high += dmulu(aa.s.high, bb.s.low);
- res.s.high += dmulu(aa.s.low, bb.s.high);
- return res.ti;
- }
- EXPORT_SYMBOL(__multi3);
- #endif
|