summaryrefslogtreecommitdiff
path: root/longlong.h
diff options
context:
space:
mode:
authorTorbjorn Granlund <tg@gmplib.org>2016-10-14 11:48:53 +0200
committerTorbjorn Granlund <tg@gmplib.org>2016-10-14 11:48:53 +0200
commitf6a353cd1acf1f81e48ebe38f1da4d7a7819c11e (patch)
tree960d73dbd2e1217e85245c48f95b28661593fd42 /longlong.h
parent231e6305ce18dda6e98e43c1bc53ba85682d3d89 (diff)
downloadgmp-f6a353cd1acf1f81e48ebe38f1da4d7a7819c11e.tar.gz
(riscv umul_ppmm): New.
Diffstat (limited to 'longlong.h')
-rw-r--r--longlong.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/longlong.h b/longlong.h
index 1f798fcbe..b1d3f11dd 100644
--- a/longlong.h
+++ b/longlong.h
@@ -1,6 +1,6 @@
/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
-Copyright 1991-1994, 1996, 1997, 1999-2005, 2007-2009, 2011-2015 Free Software
+Copyright 1991-1994, 1996, 1997, 1999-2005, 2007-2009, 2011-2016 Free Software
Foundation, Inc.
This file is part of the GNU MP Library.
@@ -1584,6 +1584,15 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
} while (0)
#endif /* RT/ROMP */
+#if defined (__riscv64) && W_TYPE_SIZE == 64
+#define umul_ppmm(ph, pl, u, v) \
+ do { \
+ UDItype __u = (u), __v = (v); \
+ (pl) = __u * __v; \
+ __asm__ ("mulhu\t%2, %1, %0" : "=r" (ph) : "%r" (__u), "r" (__v)); \
+ } while (0)
+#endif
+
#if (defined (__SH2__) || defined (__SH3__) || defined (__SH4__)) && W_TYPE_SIZE == 32
#define umul_ppmm(w1, w0, u, v) \
__asm__ ("dmulu.l %2,%3\n\tsts macl,%1\n\tsts mach,%0" \