Fix asm format for microblaze

This commit is contained in:
Manuel Pégourié-Gonnard 2014-01-10 15:35:41 +01:00
parent 3b05e4cce3
commit 1753e2f0a2

View file

@ -539,47 +539,57 @@
#if defined(__microblaze__) || defined(microblaze) #if defined(__microblaze__) || defined(microblaze)
#define MULADDC_INIT \ #define MULADDC_INIT \
asm( "lwi r3, %0 " :: "m" (s)); \ asm( \
asm( "lwi r4, %0 " :: "m" (d)); \ " \
asm( "lwi r5, %0 " :: "m" (c)); \ lwi r3, %3; \
asm( "lwi r6, %0 " :: "m" (b)); \ lwi r4, %4; \
asm( "andi r7, r6, 0xffff" ); \ lwi r5, %5; \
asm( "bsrli r6, r6, 16 " ); lwi r6, %6; \
andi r7, r6, 0xffff; \
bsrli r6, r6, 16; \
"
#define MULADDC_CORE \ #define MULADDC_CORE \
asm( "lhui r8, r3, 0 " ); \ " \
asm( "addi r3, r3, 2 " ); \ lhui r8, r3, 0; \
asm( "lhui r9, r3, 0 " ); \ addi r3, r3, 2; \
asm( "addi r3, r3, 2 " ); \ lhui r9, r3, 0; \
asm( "mul r10, r9, r6 " ); \ addi r3, r3, 2; \
asm( "mul r11, r8, r7 " ); \ mul r10, r9, r6; \
asm( "mul r12, r9, r7 " ); \ mul r11, r8, r7; \
asm( "mul r13, r8, r6 " ); \ mul r12, r9, r7; \
asm( "bsrli r8, r10, 16 " ); \ mul r13, r8, r6; \
asm( "bsrli r9, r11, 16 " ); \ bsrli r8, r10, 16; \
asm( "add r13, r13, r8 " ); \ bsrli r9, r11, 16; \
asm( "add r13, r13, r9 " ); \ add r13, r13, r8; \
asm( "bslli r10, r10, 16 " ); \ add r13, r13, r9; \
asm( "bslli r11, r11, 16 " ); \ bslli r10, r10, 16; \
asm( "add r12, r12, r10 " ); \ bslli r11, r11, 16; \
asm( "addc r13, r13, r0 " ); \ add r12, r12, r10; \
asm( "add r12, r12, r11 " ); \ addc r13, r13, r0; \
asm( "addc r13, r13, r0 " ); \ add r12, r12, r11; \
asm( "lwi r10, r4, 0 " ); \ addc r13, r13, r0; \
asm( "add r12, r12, r10 " ); \ lwi r10, r4, 0; \
asm( "addc r13, r13, r0 " ); \ add r12, r12, r10; \
asm( "add r12, r12, r5 " ); \ addc r13, r13, r0; \
asm( "addc r5, r13, r0 " ); \ add r12, r12, r5; \
asm( "swi r12, r4, 0 " ); \ addc r5, r13, r0; \
asm( "addi r4, r4, 4 " ); swi r12, r4, 0; \
addi r4, r4, 4; \
"
#define MULADDC_STOP \ #define MULADDC_STOP \
asm( "swi r5, %0 " : "=m" (c)); \ " \
asm( "swi r4, %0 " : "=m" (d)); \ swi r5, %0; \
asm( "swi r3, %0 " : "=m" (s) :: \ swi r4, %1; \
"r3", "r4" , "r5" , "r6" , "r7" , "r8" , \ swi r3, %2; \
"r9", "r10", "r11", "r12", "r13" ); " \
: "=m" (c), "=m" (d), "=m" (s) \
: "m" (s), "m" (d), "m" (c), "m" (b) \
: "r3", "r4" "r5", "r6", "r7", "r8", \
"r9", "r10", "r11", "r12", "r13" \
);
#endif /* MicroBlaze */ #endif /* MicroBlaze */