Skip to content

Commit 2552b27

Browse files
committed
Add simpasm header and footer and change to assembly code in dev/
- This commit add simpasm header and footer to all assembly code in dev/ - Change balign from 16 to 4 in poly_caddq_asm.S to match our standard setting. - The llvm-objdump discards one of the consecutive labels, which causes the autogen script to fail. We removed the end label since it is not used anywhere, and also simplified this two in a separate commit. Signed-off-by: willieyz <[email protected]>
1 parent b029d92 commit 2552b27

30 files changed

+65
-26
lines changed

dev/aarch64_clean/src/intt.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "../../../common.h"
2727
#if defined(MLD_ARITH_BACKEND_AARCH64)
28+
/* simpasm: header-end */
2829

2930
.macro mulmodq dst, src, const, idx0, idx1
3031
sqrdmulh t2.4s, \src\().4s, \const\().s[\idx1\()]
@@ -367,4 +368,5 @@ layer1234_start:
367368
pop_stack
368369
ret
369370

371+
/* simpasm: footer-start */
370372
#endif /* MLD_ARITH_BACKEND_AARCH64 */

dev/aarch64_clean/src/mld_polyvecl_pointwise_acc_montgomery_l4.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "../../../common.h"
66
#if defined(MLD_ARITH_BACKEND_AARCH64)
7+
/* simpasm: header-end */
78

89
.macro montgomery_reduce_long res, inl, inh
910
uzp1 \res\().4s, \inl\().4s, \inh\().4s
@@ -109,4 +110,6 @@ l4_loop_start:
109110
cbnz count, l4_loop_start
110111

111112
ret
113+
114+
/* simpasm: footer-start */
112115
#endif /* MLD_ARITH_BACKEND_AARCH64 */

dev/aarch64_clean/src/mld_polyvecl_pointwise_acc_montgomery_l5.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "../../../common.h"
66
#if defined(MLD_ARITH_BACKEND_AARCH64)
7+
/* simpasm: header-end */
78

89
.macro montgomery_reduce_long res, inl, inh
910
uzp1 \res\().4s, \inl\().4s, \inh\().4s
@@ -117,4 +118,5 @@ l5_loop_start:
117118
cbnz count, l5_loop_start
118119

119120
ret
121+
/* simpasm: footer-start */
120122
#endif /* MLD_ARITH_BACKEND_AARCH64 */

dev/aarch64_clean/src/mld_polyvecl_pointwise_acc_montgomery_l7.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "../../../common.h"
66
#if defined(MLD_ARITH_BACKEND_AARCH64)
7+
/* simpasm: header-end */
78

89
.macro montgomery_reduce_long res, inl, inh
910
uzp1 \res\().4s, \inl\().4s, \inh\().4s
@@ -133,4 +134,5 @@ l7_loop_start:
133134
cbnz count, l7_loop_start
134135

135136
ret
137+
/* simpasm: footer-start */
136138
#endif /* MLD_ARITH_BACKEND_AARCH64 */

dev/aarch64_clean/src/ntt.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#include "../../../common.h"
2727
#if defined(MLD_ARITH_BACKEND_AARCH64)
28+
/* simpasm: header-end */
2829

2930
.macro mulmodq dst, src, const, idx0, idx1
3031
sqrdmulh t2.4s, \src\().4s, \const\().s[\idx1\()]
@@ -302,4 +303,5 @@ layer45678_start:
302303
pop_stack
303304
ret
304305

306+
/* simpasm: footer-start */
305307
#endif /* MLD_ARITH_BACKEND_AARCH64 */

dev/aarch64_clean/src/pointwise_montgomery.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "../../../common.h"
66
#if defined(MLD_ARITH_BACKEND_AARCH64)
7+
/* simpasm: header-end */
78

89
.macro montgomery_reduce_long res, inl, inh
910
uzp1 \res\().4s, \inl\().4s, \inh\().4s
@@ -73,4 +74,5 @@ loop_start:
7374
cbnz count, loop_start
7475

7576
ret
77+
/* simpasm: footer-start */
7678
#endif /* MLD_ARITH_BACKEND_AARCH64 */

dev/aarch64_clean/src/poly_caddq_asm.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
#include "../../../common.h"
66

77
#if defined(MLD_ARITH_BACKEND_AARCH64) && !defined(MLD_CONFIG_MULTILEVEL_NO_SHARED)
8+
/* simpasm: header-end */
89

910
.macro caddq inout
1011
ushr tmp.4s, \inout\().4s, #31
1112
mla \inout\().4s, tmp.4s, q_reg.4s
1213
.endm
1314

1415
.global MLD_ASM_NAMESPACE(poly_caddq_asm)
15-
.balign 16
16+
.balign 4
1617
MLD_ASM_FN_SYMBOL(poly_caddq_asm)
1718
// Function signature: void mld_poly_caddq_asm(int32_t *a)
1819
// x0: pointer to polynomial coefficients
@@ -55,5 +56,5 @@ poly_caddq_loop:
5556
.unreq count
5657
.unreq q_reg
5758
.unreq tmp
58-
59+
/* simpasm: footer-start */
5960
#endif /* MLD_ARITH_BACKEND_AARCH64 && !MLD_CONFIG_MULTILEVEL_NO_SHARED */

dev/aarch64_clean/src/poly_chknorm_asm.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "../../../common.h"
66

77
#if defined(MLD_ARITH_BACKEND_AARCH64) && !defined(MLD_CONFIG_MULTILEVEL_NO_SHARED)
8+
/* simpasm: header-end */
89

910
.macro chknorm a
1011
abs \a\().4s, \a\().4s
@@ -58,5 +59,5 @@ poly_chknorm_loop:
5859
.unreq count
5960
.unreq bound
6061
.unreq flags
61-
62+
/* simpasm: footer-start */
6263
#endif /* MLD_ARITH_BACKEND_AARCH64 && !MLD_CONFIG_MULTILEVEL_NO_SHARED */

dev/aarch64_clean/src/poly_decompose_32_asm.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "../../../common.h"
66

77
#if defined(MLD_ARITH_BACKEND_AARCH64) && !defined(MLD_CONFIG_MULTILEVEL_NO_SHARED)
8+
/* simpasm: header-end */
89

910
// a aliased with a0
1011
.macro decompose32 a1, a, temp
@@ -100,5 +101,5 @@ poly_decompose_32_loop:
100101
.unreq q_bound
101102
.unreq gamma2_2x
102103
.unreq barrett_const
103-
104+
/* simpasm: footer-start */
104105
#endif /* MLD_ARITH_BACKEND_AARCH64 && !MLD_CONFIG_MULTILEVEL_NO_SHARED */

dev/aarch64_clean/src/poly_decompose_88_asm.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "../../../common.h"
66

77
#if defined(MLD_ARITH_BACKEND_AARCH64) && !defined(MLD_CONFIG_MULTILEVEL_NO_SHARED)
8+
/* simpasm: header-end */
89

910
// a aliased with a0
1011
.macro decompose88 a1, a, temp
@@ -98,5 +99,5 @@ poly_decompose_88_loop:
9899
.unreq q_bound
99100
.unreq gamma2_2x
100101
.unreq barrett_const
101-
102+
/* simpasm: footer-start */
102103
#endif /* MLD_ARITH_BACKEND_AARCH64 && !MLD_CONFIG_MULTILEVEL_NO_SHARED */

0 commit comments

Comments
 (0)