Forum: PC-Programmierung asm operand has impossible constraints in tomsfastmath


von Johannes (Gast)


Lesenswert?

Hallo,
ich möchte gerne von der tomsfatmath eine lib erstellen, bekomme aber 
beim bauen in der fp_sqr_comba.c einen Error
1
..\src\sqr\fp_sqr_comba.c:40:1: error: 'asm' operand has impossible constraints
2
 asm(                                            \
3
 ^~~
1
#define SQRADD2(i, j)                                     \
2
asm(                                            \
3
     "movl  %6,%%eax     \n\t"                            \
4
     "mull  %7           \n\t"                            \
5
     "addl  %%eax,%0     \n\t"                            \
6
     "adcl  %%edx,%1     \n\t"                            \
7
     "adcl  $0,%2        \n\t"                            \
8
     "addl  %%eax,%0     \n\t"                            \
9
     "adcl  %%edx,%1     \n\t"                            \
10
     "adcl  $0,%2        \n\t"                            \
11
     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j)  :"%eax","%edx","cc");

aufgerufen wird es aus der fp_sqr_comba_28.c
1
   /* clear carries */
2
   CLEAR_CARRY;
3
4
   /* output 0 */
5
   SQRADD(a[0],a[0]);
6
   COMBA_STORE(b[0]);
7
8
   /* output 1 */
9
   CARRY_FORWARD;
10
   SQRADD2(a[0], a[1]);
11
   COMBA_STORE(b[1]);

SQRADD ist auch ein define wie SQRADD2. Hier bekomme ich allerdings 
keinen Error
1
#define SQRADD(i, j)                                      \
2
asm(                                            \
3
     "movl  %6,%%eax     \n\t"                            \
4
     "mull  %%eax        \n\t"                            \
5
     "addl  %%eax,%0     \n\t"                            \
6
     "adcl  %%edx,%1     \n\t"                            \
7
     "adcl  $0,%2        \n\t"                            \
8
     :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","cc");

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.