~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
math/mpx-mul4-*.S: Use more portable type syntax for ambiguous instructions.
[catacomb]
/
math
/
mpmont.c
diff --git
a/math/mpmont.c
b/math/mpmont.c
index
094ac40
..
b4bf982
100644
(file)
--- a/
math/mpmont.c
+++ b/
math/mpmont.c
@@
-98,6
+98,14
@@
static void simple_redccore(mpw *dv, mpw *dvl, const mpw *mv,
MAYBE_REDC4(amd64_avx)
#endif
MAYBE_REDC4(amd64_avx)
#endif
+#if CPUFAM_ARMEL
+ MAYBE_REDC4(arm_neon)
+#endif
+
+#if CPUFAM_ARM64
+ MAYBE_REDC4(arm64_simd)
+#endif
+
static redccore__functype *pick_redccore(void)
{
#if CPUFAM_X86
static redccore__functype *pick_redccore(void)
{
#if CPUFAM_X86
@@
-112,10
+120,18
@@
static redccore__functype *pick_redccore(void)
DISPATCH_PICK_COND(mpmont_reduce, maybe_redc4_amd64_sse2,
cpu_feature_p(CPUFEAT_X86_SSE2));
#endif
DISPATCH_PICK_COND(mpmont_reduce, maybe_redc4_amd64_sse2,
cpu_feature_p(CPUFEAT_X86_SSE2));
#endif
+#if CPUFAM_ARMEL
+ DISPATCH_PICK_COND(mpmont_reduce, maybe_redc4_arm_neon,
+ cpu_feature_p(CPUFEAT_ARM_NEON));
+#endif
+#if CPUFAM_ARM64
+ DISPATCH_PICK_COND(mpmont_reduce, maybe_redc4_arm64_simd,
+ cpu_feature_p(CPUFEAT_ARM_NEON));
+#endif
DISPATCH_PICK_FALLBACK(mpmont_reduce, simple_redccore);
}
DISPATCH_PICK_FALLBACK(mpmont_reduce, simple_redccore);
}
-/* --- @
redc
core@ --- *
+/* --- @
mul
core@ --- *
*
* Arguments: @mpw *dv, *dvl@ = base and limit of source/destination
* @const mpw *av, *avl@ = base and limit of first multiplicand
*
* Arguments: @mpw *dv, *dvl@ = base and limit of source/destination
* @const mpw *av, *avl@ = base and limit of first multiplicand
@@
-204,6
+220,14
@@
static void simple_mulcore(mpw *dv, mpw *dvl,
MAYBE_MUL4(amd64_avx)
#endif
MAYBE_MUL4(amd64_avx)
#endif
+#if CPUFAM_ARMEL
+ MAYBE_MUL4(arm_neon)
+#endif
+
+#if CPUFAM_ARM64
+ MAYBE_MUL4(arm64_simd)
+#endif
+
static mulcore__functype *pick_mulcore(void)
{
#if CPUFAM_X86
static mulcore__functype *pick_mulcore(void)
{
#if CPUFAM_X86
@@
-218,6
+242,14
@@
static mulcore__functype *pick_mulcore(void)
DISPATCH_PICK_COND(mpmont_mul, maybe_mul4_amd64_sse2,
cpu_feature_p(CPUFEAT_X86_SSE2));
#endif
DISPATCH_PICK_COND(mpmont_mul, maybe_mul4_amd64_sse2,
cpu_feature_p(CPUFEAT_X86_SSE2));
#endif
+#if CPUFAM_ARMEL
+ DISPATCH_PICK_COND(mpmont_mul, maybe_mul4_arm_neon,
+ cpu_feature_p(CPUFEAT_ARM_NEON));
+#endif
+#if CPUFAM_ARM64
+ DISPATCH_PICK_COND(mpmont_mul, maybe_mul4_arm64_simd,
+ cpu_feature_p(CPUFEAT_ARM_NEON));
+#endif
DISPATCH_PICK_FALLBACK(mpmont_mul, simple_mulcore);
}
DISPATCH_PICK_FALLBACK(mpmont_mul, simple_mulcore);
}
@@
-444,6
+476,10
@@
mp *mpmont_mul(const mpmont *mm, mp *d, mp *a, mp *b)
#ifdef TEST_RIG
#ifdef TEST_RIG
+#ifdef ENABLE_ASM_DEBUG
+# include "regdump.h"
+#endif
+
static int tcreate(dstr *v)
{
mp *m = *(mp **)v[0].buf;
static int tcreate(dstr *v)
{
mp *m = *(mp **)v[0].buf;
@@
-539,7
+575,6
@@
static int tmul(dstr *v)
mp_drop(mr);
}
mp_drop(mr);
}
-
MP_DROP(m);
MP_DROP(a);
MP_DROP(b);
MP_DROP(m);
MP_DROP(a);
MP_DROP(b);
@@
-558,6
+593,9
@@
static test_chunk tests[] = {
int main(int argc, char *argv[])
{
sub_init();
int main(int argc, char *argv[])
{
sub_init();
+#ifdef ENABLE_ASM_DEBUG
+ regdump_init();
+#endif
test_run(argc, argv, tests, SRCDIR "/t/mpmont");
return (0);
}
test_run(argc, argv, tests, SRCDIR "/t/mpmont");
return (0);
}