version 1.7, 2005/02/13 16:01:02 |
version 1.13, 2015/08/06 10:01:52 |
|
|
#include "inline.h" |
#include "inline.h" |
|
|
#if defined(__GNUC__) |
#if defined(__GNUC__) |
#define INLINE inline |
#define INLINE static inline |
#elif defined(VISUAL) |
#elif defined(VISUAL) || defined(__MINGW32__) || defined(__MINGW64__) |
#define INLINE __inline |
#define INLINE __inline |
#else |
#else |
#define INLINE |
#define INLINE |
|
|
INLINE void _addz(Z n1,Z n2,Z nr); |
INLINE void _addz(Z n1,Z n2,Z nr); |
INLINE void _subz(Z n1,Z n2,Z nr); |
INLINE void _subz(Z n1,Z n2,Z nr); |
INLINE void _mulz(Z n1,Z n2,Z nr); |
INLINE void _mulz(Z n1,Z n2,Z nr); |
INLINE int _addz_main(unsigned int *m1,int d1,unsigned int *m2,int d2,unsigned int *mr); |
int _addz_main(unsigned int *m1,int d1,unsigned int *m2,int d2,unsigned int *mr); |
INLINE int _subz_main(unsigned int *m1,int d1,unsigned int *m2,int d2,unsigned int *mr); |
int _subz_main(unsigned int *m1,int d1,unsigned int *m2,int d2,unsigned int *mr); |
|
|
/* immediate int -> Z */ |
/* immediate int -> Z */ |
#define UTOZ(c,n) (n)=(!((unsigned int)(c))?0:(((unsigned int)(c))<=IMM_MAX?((Z)((((unsigned int)(c))<<1)|1)):utoz((unsigned int)(c)))) |
#define UTOZ(c,n) (n)=(!((unsigned int)(c))?0:(((unsigned int)(c))<=IMM_MAX?((Z)((((unsigned int)(c))<<1)|1)):utoz((unsigned int)(c)))) |
Line 677 int _addz_main(unsigned int *m1,int d1,unsigned int *m |
|
Line 677 int _addz_main(unsigned int *m1,int d1,unsigned int *m |
|
t = m1; m1 = m2; m2 = t; |
t = m1; m1 = m2; m2 = t; |
d = d1; d1 = d2; d2 = d; |
d = d1; d1 = d2; d2 = d; |
} |
} |
#if defined(VISUAL) |
#if defined(_M_IX86) |
__asm { |
__asm { |
push esi |
push esi |
push edi |
push edi |
Line 704 int _addz_main(unsigned int *m1,int d1,unsigned int *m |
|
Line 704 int _addz_main(unsigned int *m1,int d1,unsigned int *m |
|
} |
} |
#elif defined(i386) |
#elif defined(i386) |
asm volatile("\ |
asm volatile("\ |
|
pushl %%ebx;\ |
movl %1,%%esi;\ |
movl %1,%%esi;\ |
movl %2,%%edi;\ |
movl %2,%%edi;\ |
movl %3,%%ebx;\ |
movl %3,%%ebx;\ |
Line 721 int _addz_main(unsigned int *m1,int d1,unsigned int *m |
|
Line 722 int _addz_main(unsigned int *m1,int d1,unsigned int *m |
|
jnz Lstart__addz;\ |
jnz Lstart__addz;\ |
movl $0,%%eax;\ |
movl $0,%%eax;\ |
adcl %%eax,%%eax;\ |
adcl %%eax,%%eax;\ |
movl %%eax,%0"\ |
movl %%eax,%0;\ |
|
popl %%ebx"\ |
:"=m"(c)\ |
:"=m"(c)\ |
:"m"(m1),"m"(m2),"m"(mr),"m"(d2)\ |
:"m"(m1),"m"(m2),"m"(mr),"m"(d2)\ |
:"eax","ebx","ecx","edx","esi","edi"); |
:"eax","ecx","edx","esi","edi"); |
#else |
#else |
for ( i = 0, c = 0; i < d2; i++, m1++, m2++, mr++ ) { |
for ( i = 0, c = 0; i < d2; i++, m1++, m2++, mr++ ) { |
tmp = *m1 + *m2; |
tmp = *m1 + *m2; |
Line 767 int _subz_main(unsigned int *m1,int d1,unsigned int *m |
|
Line 769 int _subz_main(unsigned int *m1,int d1,unsigned int *m |
|
m = m1; m1 = m2; m2 = m; |
m = m1; m1 = m2; m2 = m; |
d = d1; d1 = d2; d2 = d; |
d = d1; d1 = d2; d2 = d; |
} |
} |
#if defined(VISUAL) |
#if defined(_M_IX86) |
__asm { |
__asm { |
push esi |
push esi |
push edi |
push edi |
Line 794 int _subz_main(unsigned int *m1,int d1,unsigned int *m |
|
Line 796 int _subz_main(unsigned int *m1,int d1,unsigned int *m |
|
} |
} |
#elif defined(i386) |
#elif defined(i386) |
asm volatile("\ |
asm volatile("\ |
|
pushl %%ebx;\ |
movl %1,%%esi;\ |
movl %1,%%esi;\ |
movl %2,%%edi;\ |
movl %2,%%edi;\ |
movl %3,%%ebx;\ |
movl %3,%%ebx;\ |
Line 811 int _subz_main(unsigned int *m1,int d1,unsigned int *m |
|
Line 814 int _subz_main(unsigned int *m1,int d1,unsigned int *m |
|
jnz Lstart__subz;\ |
jnz Lstart__subz;\ |
movl $0,%%eax;\ |
movl $0,%%eax;\ |
adcl %%eax,%%eax;\ |
adcl %%eax,%%eax;\ |
movl %%eax,%0"\ |
movl %%eax,%0;\ |
|
popl %%ebx"\ |
:"=m"(br)\ |
:"=m"(br)\ |
:"m"(m1),"m"(m2),"m"(mr),"m"(d2)\ |
:"m"(m1),"m"(m2),"m"(mr),"m"(d2)\ |
:"eax","ebx","ecx","edx","esi","edi"); |
:"eax","ecx","edx","esi","edi"); |
#else |
#else |
for ( i = 0, br = 0; i < d2; i++, mr++ ) { |
for ( i = 0, br = 0; i < d2; i++, mr++ ) { |
t = *m1++; |
t = *m1++; |