Skip to content

Commit

Permalink
asm/ct_inverse_mod_*-armv8.pl: use alignd to align scratch pointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
dot-asm committed Jul 23, 2024
1 parent 58ca202 commit 16ee7fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/asm/ct_inverse_mod_256-armv8.pl
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@
ldp @acc[0], @acc[1], [$in_ptr,#8*0]
ldp @acc[2], @acc[3], [$in_ptr,#8*2]

#ifdef __CHERI_PURE_CAPABILITY__
cadd $in_ptr, csp, #16+511
alignd $in_ptr, $in_ptr, #9
#else
add $in_ptr, sp, #16+511 // find closest 512-byte-aligned spot
and $in_ptr, $in_ptr, #-512 // in the frame...
#ifdef __CHERI_PURE_CAPABILITY__
scvalue $in_ptr, csp, $in_ptr
#endif
str c0, [csp] // offload out_ptr

Expand Down
6 changes: 4 additions & 2 deletions src/asm/ct_inverse_mod_384-armv8.pl
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@
ldp @acc[2], @acc[3], [$in_ptr,#8*2]
ldp @acc[4], @acc[5], [$in_ptr,#8*4]

#ifdef __CHERI_PURE_CAPABILITY__
cadd $in_ptr, csp, #32+511
alignd $in_ptr, $in_ptr, #9
#else
add $in_ptr, sp, #32+511 // find closest 512-byte-aligned spot
and $in_ptr, $in_ptr, #-512 // in the frame...
#ifdef __CHERI_PURE_CAPABILITY__
scvalue $in_ptr, csp, $in_ptr
#endif
stp c0, c3, [csp] // offload out_ptr, nx_ptr

Expand Down

0 comments on commit 16ee7fd

Please sign in to comment.