ppc32: fix fp_montgomery_reduce assembly

Previous patch modified constraints from =m to =g. Turns out this also
allows registers which doesn't work with the inline assembly
instructions.

If we change back to =m GCC 5.0 warns that constraints do not allow a
register.

In order to work around these issues we now pass the arguments in
registers and let GCC handle the loading & storing.
This commit is contained in:
Patrick Oppenlander 2015-04-17 10:16:24 +10:00
parent 9fe2d66519
commit c9ae4c70d4

View File

@ -325,22 +325,18 @@ asm( \
asm( \ asm( \
" mullw 16,%3,%4 \n\t" \ " mullw 16,%3,%4 \n\t" \
" mulhwu 17,%3,%4 \n\t" \ " mulhwu 17,%3,%4 \n\t" \
" addc 16,16,%0 \n\t" \ " addc 16,16,%2 \n\t" \
" addze 17,17 \n\t" \ " addze 17,17 \n\t" \
" lwz 18,%1 \n\t" \ " addc %1,16,%5 \n\t" \
" addc 16,16,18 \n\t" \
" addze %0,17 \n\t" \ " addze %0,17 \n\t" \
" stw 16,%1 \n\t" \ :"=r"(cy),"=r"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "cc"); ++tmpm;
:"=r"(cy),"=g"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17", "18","cc"); ++tmpm;
#define PROPCARRY \ #define PROPCARRY \
asm( \ asm( \
" lwz 16,%1 \n\t" \ " addc %1,%3,%2 \n\t" \
" addc 16,16,%0 \n\t" \ " xor %0,%2,%2 \n\t" \
" stw 16,%1 \n\t" \ " addze %0,%2 \n\t" \
" xor %0,%0,%0 \n\t" \ :"=r"(cy),"=r"(_c[0]):"0"(cy),"1"(_c[0]):"cc");
" addze %0,%0 \n\t" \
:"=r"(cy),"=g"(_c[0]):"0"(cy),"1"(_c[0]):"16","cc");
/******************************************************************/ /******************************************************************/
#elif defined(TFM_PPC64) #elif defined(TFM_PPC64)