Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a0346e5

Browse files
author
Stefan Krah
committed
Support gcc's -ansi flag: use "__asm__" instead of "asm".
1 parent e59aa8c commit a0346e5

2 files changed

Lines changed: 94 additions & 94 deletions

File tree

Modules/_decimal/libmpdec/typearith.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ _mpd_mul_words(mpd_uint_t *hi, mpd_uint_t *lo, mpd_uint_t a, mpd_uint_t b)
207207
{
208208
mpd_uint_t h, l;
209209

210-
asm ( "mulq %3\n\t"
211-
: "=d" (h), "=a" (l)
212-
: "%a" (a), "rm" (b)
213-
: "cc"
210+
__asm__ ( "mulq %3\n\t"
211+
: "=d" (h), "=a" (l)
212+
: "%a" (a), "rm" (b)
213+
: "cc"
214214
);
215215

216216
*hi = h;
@@ -223,10 +223,10 @@ _mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo,
223223
{
224224
mpd_uint_t qq, rr;
225225

226-
asm ( "divq %4\n\t"
227-
: "=a" (qq), "=d" (rr)
228-
: "a" (lo), "d" (hi), "rm" (d)
229-
: "cc"
226+
__asm__ ( "divq %4\n\t"
227+
: "=a" (qq), "=d" (rr)
228+
: "a" (lo), "d" (hi), "rm" (d)
229+
: "cc"
230230
);
231231

232232
*q = qq;
@@ -464,10 +464,10 @@ _mpd_mul_words(mpd_uint_t *hi, mpd_uint_t *lo, mpd_uint_t a, mpd_uint_t b)
464464
{
465465
mpd_uint_t h, l;
466466

467-
asm ( "mull %3\n\t"
468-
: "=d" (h), "=a" (l)
469-
: "%a" (a), "rm" (b)
470-
: "cc"
467+
__asm__ ( "mull %3\n\t"
468+
: "=d" (h), "=a" (l)
469+
: "%a" (a), "rm" (b)
470+
: "cc"
471471
);
472472

473473
*hi = h;
@@ -480,10 +480,10 @@ _mpd_div_words(mpd_uint_t *q, mpd_uint_t *r, mpd_uint_t hi, mpd_uint_t lo,
480480
{
481481
mpd_uint_t qq, rr;
482482

483-
asm ( "divl %4\n\t"
484-
: "=a" (qq), "=d" (rr)
485-
: "a" (lo), "d" (hi), "rm" (d)
486-
: "cc"
483+
__asm__ ( "divl %4\n\t"
484+
: "=a" (qq), "=d" (rr)
485+
: "a" (lo), "d" (hi), "rm" (d)
486+
: "cc"
487487
);
488488

489489
*q = qq;

Modules/_decimal/libmpdec/umodarith.h

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -402,22 +402,22 @@ ppro_mulmod(mpd_uint_t a, mpd_uint_t b, double *dmod, uint32_t *dinvmod)
402402
{
403403
mpd_uint_t retval;
404404

405-
asm (
406-
"fildl %2\n\t"
407-
"fildl %1\n\t"
408-
"fmulp %%st, %%st(1)\n\t"
409-
"fldt (%4)\n\t"
410-
"fmul %%st(1), %%st\n\t"
411-
"flds %5\n\t"
412-
"fadd %%st, %%st(1)\n\t"
413-
"fsubrp %%st, %%st(1)\n\t"
414-
"fldl (%3)\n\t"
415-
"fmulp %%st, %%st(1)\n\t"
416-
"fsubrp %%st, %%st(1)\n\t"
417-
"fistpl %0\n\t"
418-
: "=m" (retval)
419-
: "m" (a), "m" (b), "r" (dmod), "r" (dinvmod), "m" (MPD_TWO63)
420-
: "st", "memory"
405+
__asm__ (
406+
"fildl %2\n\t"
407+
"fildl %1\n\t"
408+
"fmulp %%st, %%st(1)\n\t"
409+
"fldt (%4)\n\t"
410+
"fmul %%st(1), %%st\n\t"
411+
"flds %5\n\t"
412+
"fadd %%st, %%st(1)\n\t"
413+
"fsubrp %%st, %%st(1)\n\t"
414+
"fldl (%3)\n\t"
415+
"fmulp %%st, %%st(1)\n\t"
416+
"fsubrp %%st, %%st(1)\n\t"
417+
"fistpl %0\n\t"
418+
: "=m" (retval)
419+
: "m" (a), "m" (b), "r" (dmod), "r" (dinvmod), "m" (MPD_TWO63)
420+
: "st", "memory"
421421
);
422422

423423
return retval;
@@ -432,33 +432,33 @@ static inline void
432432
ppro_mulmod2c(mpd_uint_t *a0, mpd_uint_t *a1, mpd_uint_t w,
433433
double *dmod, uint32_t *dinvmod)
434434
{
435-
asm (
436-
"fildl %2\n\t"
437-
"fildl (%1)\n\t"
438-
"fmul %%st(1), %%st\n\t"
439-
"fxch %%st(1)\n\t"
440-
"fildl (%0)\n\t"
441-
"fmulp %%st, %%st(1) \n\t"
442-
"fldt (%4)\n\t"
443-
"flds %5\n\t"
444-
"fld %%st(2)\n\t"
445-
"fmul %%st(2)\n\t"
446-
"fadd %%st(1)\n\t"
447-
"fsub %%st(1)\n\t"
448-
"fmull (%3)\n\t"
449-
"fsubrp %%st, %%st(3)\n\t"
450-
"fxch %%st(2)\n\t"
451-
"fistpl (%0)\n\t"
452-
"fmul %%st(2)\n\t"
453-
"fadd %%st(1)\n\t"
454-
"fsubp %%st, %%st(1)\n\t"
455-
"fmull (%3)\n\t"
456-
"fsubrp %%st, %%st(1)\n\t"
457-
"fistpl (%1)\n\t"
458-
: : "r" (a0), "r" (a1), "m" (w),
459-
"r" (dmod), "r" (dinvmod),
460-
"m" (MPD_TWO63)
461-
: "st", "memory"
435+
__asm__ (
436+
"fildl %2\n\t"
437+
"fildl (%1)\n\t"
438+
"fmul %%st(1), %%st\n\t"
439+
"fxch %%st(1)\n\t"
440+
"fildl (%0)\n\t"
441+
"fmulp %%st, %%st(1) \n\t"
442+
"fldt (%4)\n\t"
443+
"flds %5\n\t"
444+
"fld %%st(2)\n\t"
445+
"fmul %%st(2)\n\t"
446+
"fadd %%st(1)\n\t"
447+
"fsub %%st(1)\n\t"
448+
"fmull (%3)\n\t"
449+
"fsubrp %%st, %%st(3)\n\t"
450+
"fxch %%st(2)\n\t"
451+
"fistpl (%0)\n\t"
452+
"fmul %%st(2)\n\t"
453+
"fadd %%st(1)\n\t"
454+
"fsubp %%st, %%st(1)\n\t"
455+
"fmull (%3)\n\t"
456+
"fsubrp %%st, %%st(1)\n\t"
457+
"fistpl (%1)\n\t"
458+
: : "r" (a0), "r" (a1), "m" (w),
459+
"r" (dmod), "r" (dinvmod),
460+
"m" (MPD_TWO63)
461+
: "st", "memory"
462462
);
463463
}
464464

@@ -471,41 +471,41 @@ static inline void
471471
ppro_mulmod2(mpd_uint_t *a0, mpd_uint_t b0, mpd_uint_t *a1, mpd_uint_t b1,
472472
double *dmod, uint32_t *dinvmod)
473473
{
474-
asm (
475-
"fildl %3\n\t"
476-
"fildl (%2)\n\t"
477-
"fmulp %%st, %%st(1)\n\t"
478-
"fildl %1\n\t"
479-
"fildl (%0)\n\t"
480-
"fmulp %%st, %%st(1)\n\t"
481-
"fldt (%5)\n\t"
482-
"fld %%st(2)\n\t"
483-
"fmul %%st(1), %%st\n\t"
484-
"fxch %%st(1)\n\t"
485-
"fmul %%st(2), %%st\n\t"
486-
"flds %6\n\t"
487-
"fldl (%4)\n\t"
488-
"fxch %%st(3)\n\t"
489-
"fadd %%st(1), %%st\n\t"
490-
"fxch %%st(2)\n\t"
491-
"fadd %%st(1), %%st\n\t"
492-
"fxch %%st(2)\n\t"
493-
"fsub %%st(1), %%st\n\t"
494-
"fxch %%st(2)\n\t"
495-
"fsubp %%st, %%st(1)\n\t"
496-
"fxch %%st(1)\n\t"
497-
"fmul %%st(2), %%st\n\t"
498-
"fxch %%st(1)\n\t"
499-
"fmulp %%st, %%st(2)\n\t"
500-
"fsubrp %%st, %%st(3)\n\t"
501-
"fsubrp %%st, %%st(1)\n\t"
502-
"fxch %%st(1)\n\t"
503-
"fistpl (%2)\n\t"
504-
"fistpl (%0)\n\t"
505-
: : "r" (a0), "m" (b0), "r" (a1), "m" (b1),
506-
"r" (dmod), "r" (dinvmod),
507-
"m" (MPD_TWO63)
508-
: "st", "memory"
474+
__asm__ (
475+
"fildl %3\n\t"
476+
"fildl (%2)\n\t"
477+
"fmulp %%st, %%st(1)\n\t"
478+
"fildl %1\n\t"
479+
"fildl (%0)\n\t"
480+
"fmulp %%st, %%st(1)\n\t"
481+
"fldt (%5)\n\t"
482+
"fld %%st(2)\n\t"
483+
"fmul %%st(1), %%st\n\t"
484+
"fxch %%st(1)\n\t"
485+
"fmul %%st(2), %%st\n\t"
486+
"flds %6\n\t"
487+
"fldl (%4)\n\t"
488+
"fxch %%st(3)\n\t"
489+
"fadd %%st(1), %%st\n\t"
490+
"fxch %%st(2)\n\t"
491+
"fadd %%st(1), %%st\n\t"
492+
"fxch %%st(2)\n\t"
493+
"fsub %%st(1), %%st\n\t"
494+
"fxch %%st(2)\n\t"
495+
"fsubp %%st, %%st(1)\n\t"
496+
"fxch %%st(1)\n\t"
497+
"fmul %%st(2), %%st\n\t"
498+
"fxch %%st(1)\n\t"
499+
"fmulp %%st, %%st(2)\n\t"
500+
"fsubrp %%st, %%st(3)\n\t"
501+
"fsubrp %%st, %%st(1)\n\t"
502+
"fxch %%st(1)\n\t"
503+
"fistpl (%2)\n\t"
504+
"fistpl (%0)\n\t"
505+
: : "r" (a0), "m" (b0), "r" (a1), "m" (b1),
506+
"r" (dmod), "r" (dinvmod),
507+
"m" (MPD_TWO63)
508+
: "st", "memory"
509509
);
510510
}
511511
/* END PPRO GCC ASM */

0 commit comments

Comments
 (0)