From 0a8c81ff159aba854bf993537778337e9733cbf0 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Tue, 21 Jun 2016 17:14:43 +0900 Subject: [PATCH] fast version of mcl_fp_addNC64 --- src/low_armv7.s | 13 ------------- test/low_test.cpp | 6 ------ 2 files changed, 19 deletions(-) diff --git a/src/low_armv7.s b/src/low_armv7.s index 61d4d94..a72d458 100644 --- a/src/low_armv7.s +++ b/src/low_armv7.s @@ -1,22 +1,9 @@ .arch armv7-a .global mcl_fp_addNC64 - .global mcl_fp_addNC64_2 .align 2 mcl_fp_addNC64: - ldrd r2, [r2] - stmfd sp!, {r4, r5} - ldrd r4, [r1] - adds r2, r2, r4 - adc r3, r3, r5 - ldmfd sp!, {r4, r5} - strd r2, [r0] - bx lr - -# slow - .align 2 -mcl_fp_addNC64_2: ldm r1, {r3, r12} ldm r2, {r1, r2} adds r1, r1, r3 diff --git a/test/low_test.cpp b/test/low_test.cpp index 2f69c94..16d8fa0 100644 --- a/test/low_test.cpp +++ b/test/low_test.cpp @@ -8,7 +8,6 @@ cybozu::XorShift rg; extern "C" void mcl_fp_addNC64(uint32_t *z, const uint32_t *x, const uint32_t *y); -extern "C" void mcl_fp_addNC64_2(uint32_t *z, const uint32_t *x, const uint32_t *y); CYBOZU_TEST_AUTO(addNC) { @@ -23,12 +22,7 @@ CYBOZU_TEST_AUTO(addNC) low_add(z, x, y); mcl_fp_addNC64(w, x, y); CYBOZU_TEST_EQUAL_ARRAY(z, w, N); - mcl_fp_addNC64_2(w, x, y); - CYBOZU_TEST_EQUAL_ARRAY(z, w, N); } CYBOZU_BENCH("add1", mcl_fp_addNC64, x, x, y); - CYBOZU_BENCH("add2", mcl_fp_addNC64_2, x, x, y); - CYBOZU_BENCH("add1", mcl_fp_addNC64, x, x, y); - CYBOZU_BENCH("add2", mcl_fp_addNC64_2, x, x, y); }