Fixed constraints on inline asm.

This commit is contained in:
Ken MacKay
2013-05-30 21:04:21 -07:00
parent 8c5fc3146d
commit 2d8a6e3856
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -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"
);
+1 -1
View File
@@ -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.