mirror of
https://github.com/kmackay/micro-ecc.git
synced 2026-08-01 16:17:46 +00:00
Fixed constraints on inline asm.
This commit is contained in:
@@ -192,7 +192,11 @@ static uint32_t vli_add(uint32_t *p_result, uint32_t *p_left, uint32_t *p_right)
|
||||
#if (ECC_ASM != ecc_asm_thumb2)
|
||||
".syntax divided \n\t"
|
||||
#endif
|
||||
#if (ECC_ASM == ecc_asm_thumb)
|
||||
: [dptr] "+l" (p_result), [lptr] "+l" (p_left), [rptr] "+l" (p_right), [ctr] "+l" (l_counter), [carry] "+l" (l_carry), [left] "=l" (l_left), [right] "=l" (l_right)
|
||||
#else
|
||||
: [dptr] "+r" (p_result), [lptr] "+r" (p_left), [rptr] "+r" (p_right), [ctr] "+r" (l_counter), [carry] "+r" (l_carry), [left] "=r" (l_left), [right] "=r" (l_right)
|
||||
#endif
|
||||
:
|
||||
: "cc", "memory"
|
||||
);
|
||||
@@ -238,7 +242,11 @@ static uint32_t vli_sub(uint32_t *p_result, uint32_t *p_left, uint32_t *p_right)
|
||||
#if (ECC_ASM != ecc_asm_thumb2)
|
||||
".syntax divided \n\t"
|
||||
#endif
|
||||
#if (ECC_ASM == ecc_asm_thumb)
|
||||
: [dptr] "+l" (p_result), [lptr] "+l" (p_left), [rptr] "+l" (p_right), [ctr] "+l" (l_counter), [carry] "+l" (l_carry), [left] "=l" (l_left), [right] "=l" (l_right)
|
||||
#else
|
||||
: [dptr] "+r" (p_result), [lptr] "+r" (p_left), [rptr] "+r" (p_right), [ctr] "+r" (l_counter), [carry] "+r" (l_carry), [left] "=r" (l_left), [right] "=r" (l_right)
|
||||
#endif
|
||||
:
|
||||
: "cc", "memory"
|
||||
);
|
||||
|
||||
@@ -14,7 +14,7 @@ ECC_USE_NAF - If enabled, this will convert the private key to a non-adjacent fo
|
||||
|
||||
/* Inline assembly options.
|
||||
Inline assembly (gcc format) is provided for selected operations for Thumb and Thumb2/ARM.
|
||||
Improves speed by about 57% on Cortex-M0.
|
||||
Improves speed by about 57% on Cortex-M0 when using ecc_asm_thumb.
|
||||
|
||||
Note: You must choose the appropriate option for your target architecture, or compilation will fail
|
||||
with strange assembler messages.
|
||||
|
||||
Reference in New Issue
Block a user