summaryrefslogtreecommitdiff
path: root/mpn/generic
diff options
context:
space:
mode:
authorTorbjorn Granlund <tg@gmplib.org>2020-12-04 17:35:54 +0100
committerTorbjorn Granlund <tg@gmplib.org>2020-12-04 17:35:54 +0100
commit03e6256df20a8d88236a7cf62e0e33713a6a478c (patch)
tree8245627c7e8c0ef434d89c6e5d08a478d29fd280 /mpn/generic
parent302457056bf541ca7b96a329e42c3ed577ced37b (diff)
downloadgmp-03e6256df20a8d88236a7cf62e0e33713a6a478c.tar.gz
Provide add_mssaaaa for arm64.
Diffstat (limited to 'mpn/generic')
-rw-r--r--mpn/generic/div_qr_1n_pi1.c11
-rw-r--r--mpn/generic/mod_1_1.c9
2 files changed, 19 insertions, 1 deletions
diff --git a/mpn/generic/div_qr_1n_pi1.c b/mpn/generic/div_qr_1n_pi1.c
index 5c3281000..2b67c3acd 100644
--- a/mpn/generic/div_qr_1n_pi1.c
+++ b/mpn/generic/div_qr_1n_pi1.c
@@ -115,7 +115,7 @@ see https://www.gnu.org/licenses/. */
"nor %0, %0, %0" \
: "=r" (m), "=r" (s1), "=&r" (s0) \
: "r" (a1), "r" (b1), "%r" (a0), "rI" (b0) \
- __CLOBBER_CC)
+ __CLOBBER_CC)
#endif
#if defined (__s390x__) && W_TYPE_SIZE == 64
@@ -139,6 +139,15 @@ see https://www.gnu.org/licenses/. */
: "=r" (m), "=r" (sh), "=&r" (sl) \
: "r" (ah), "rI" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
#endif
+
+#if defined (__aarch64__) && W_TYPE_SIZE == 64
+#define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
+ __asm__ ( "adds %2, %5, %6\n\t" \
+ "adcs %1, %3, %4\n\t" \
+ "csinv %0, xzr, xzr, cs\n\t" \
+ : "=r" (m), "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "rI" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
+#endif
#endif /* defined (__GNUC__) */
#ifndef add_mssaaaa
diff --git a/mpn/generic/mod_1_1.c b/mpn/generic/mod_1_1.c
index f6342d681..3e7f0fda7 100644
--- a/mpn/generic/mod_1_1.c
+++ b/mpn/generic/mod_1_1.c
@@ -138,6 +138,15 @@ see https://www.gnu.org/licenses/. */
: "=r" (m), "=r" (sh), "=&r" (sl) \
: "r" (ah), "rI" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
#endif
+
+#if defined (__aarch64__) && W_TYPE_SIZE == 64
+#define add_mssaaaa(m, sh, sl, ah, al, bh, bl) \
+ __asm__ ( "adds %2, %5, %6\n\t" \
+ "adcs %1, %3, %4\n\t" \
+ "csinv %0, xzr, xzr, cs\n\t" \
+ : "=r" (m), "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "rI" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
+#endif
#endif /* defined (__GNUC__) */
#ifndef add_mssaaaa