From 16ee7fd48740fe92397ae688f94623d4de6582c7 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Fri, 31 May 2024 13:00:31 +0200 Subject: [PATCH] asm/ct_inverse_mod_*-armv8.pl: use alignd to align scratch pointer. --- src/asm/ct_inverse_mod_256-armv8.pl | 6 ++++-- src/asm/ct_inverse_mod_384-armv8.pl | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/asm/ct_inverse_mod_256-armv8.pl b/src/asm/ct_inverse_mod_256-armv8.pl index f28426c8..88b036f7 100755 --- a/src/asm/ct_inverse_mod_256-armv8.pl +++ b/src/asm/ct_inverse_mod_256-armv8.pl @@ -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 diff --git a/src/asm/ct_inverse_mod_384-armv8.pl b/src/asm/ct_inverse_mod_384-armv8.pl index cbf55d25..6b363e5d 100755 --- a/src/asm/ct_inverse_mod_384-armv8.pl +++ b/src/asm/ct_inverse_mod_384-armv8.pl @@ -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