Annotation of OpenXM_contrib/pari/src/kernel/ix86/l0asm.h, Revision 1.1.1.1
1.1 maekawa 1: #ifdef _MSC_VER
2: # define C(entrypoint) entrypoint
3: # define L(label) L##label
4: #else
5: # ifdef ASM_UNDERSCORE
6: # if defined(__STDC__) || defined(__cplusplus)
7: # define C(entrypoint) _##entrypoint
8: # define L(label) L##label
9: # else
10: # define C(entrypoint) _/**/entrypoint
11: # define L(label) L/**/label
12: # endif
13: # else
14: # define C(entrypoint) entrypoint
15: # if defined(__STDC__) || defined(__cplusplus)
16: # define L(label) .L##label
17: # else
18: # define L(label) .L/**/label
19: # endif
20: # endif
21: #endif
22:
23: #ifdef _MSC_VER
24: # define INTEL_SYNTAX
25: #else
26: # ifdef ASM_UNDERSCORE
27: # define BSD_SYNTAX
28: # else
29: # define ELF_SYNTAX
30: # endif
31: #endif
32:
33: #if defined (BSD_SYNTAX) || defined (ELF_SYNTAX)
34: # define R(r) %r
35: # define NUM(n) $##n
36: # define ADDR(a) $##a
37: # define X1
38: # define X2
39: # define X4
40: # define X8
41: # define MEM(base)(R(base))
42: # define MEM_DISP(base,displacement)displacement(R(base))
43: # define MEM_INDEX(base,index)(R(base),R(index))
44: # define MEM_SHINDEX(base,index,size)(R(base),R(index),size)
45: # define MEM_DISP_SHINDEX0(displacement,index,size)displacement(,R(index),size)
46: # define MEM_DISP_SHINDEX(base,displacement,index,size)displacement(R(base),R(index),size)
47: # define INDIR(value)*value
48: # define INSNCONC(mnemonic,size_suffix)mnemonic##size_suffix
49: # define INSN1(mnemonic,size_suffix,dst)INSNCONC(mnemonic,size_suffix) dst
50: # define INSN2(mnemonic,size_suffix,src,dst)INSNCONC(mnemonic,size_suffix) src,dst
51: # define INSN2MOVX(mnemonic,size_suffix,src,dst)INSNCONC(INSNCONC(mnemonic,size_suffix),l) src,dst
52: # if defined(BSD_SYNTAX) || defined(COHERENT)
53: # define INSN2SHCL(mnemonic,size_suffix,src,dst)INSNCONC(mnemonic,size_suffix) R(cl),src,dst
54: # define REPZ repe ;
55: # else
56: # define INSN2SHCL(mnemonic,size_suffix,src,dst)INSNCONC(mnemonic,size_suffix) src,dst
57: # define REPZ repz ;
58: # endif
59: # define REP rep ;
60: # if defined(BSD_SYNTAX) && !(defined(__CYGWIN32__) || defined(__MINGW32__))
61: # define ALIGN(log) .align log,0x90
62: # endif
63: # if defined(ELF_SYNTAX) || defined(__CYGWIN32__) || defined(__MINGW32__)
64: # define ALIGN(log) .align 1<<(log)
65: # endif
66: #endif
67:
68: #ifdef INTEL_SYNTAX
69: # define R(r) r
70: # define NUM(n) n
71: # define ADDR(a) OFFSET a
72: # define X1 BYTE PTR
73: # define X2 WORD PTR
74: # define X4 DWORD PTR
75: # define X8 QWORD PTR
76: # define MEM(base) [base]
77: # define MEM_DISP(base,displacement) [base+(displacement)]
78: # define MEM_INDEX(base,index) [base+index]
79: # define MEM_SHINDEX(base,index,size) [base+index*size]
80: # define MEM_DISP_SHINDEX0(displacement,index,size) [(displacement)+index*size]
81: # define MEM_DISP_SHINDEX(base,displacement,index,size) [base+(displacement)+index*size]
82: # define INDIR(value)value
83: # define INSNCONC(mnemonic,suffix)mnemonic##suffix
84: # define INSN1(mnemonic,size_suffix,dst)mnemonic dst
85: # define INSN2(mnemonic,size_suffix,src,dst)mnemonic dst,src
86: # define INSN2MOVX(mnemonic,size_suffix,src,dst)INSNCONC(mnemonic,x) dst,src
87: # define INSN2SHCL(mnemonic,size_suffix,src,dst)mnemonic dst,src,R(cl)
88: # define REPZ repz
89: # define REP rep
90: # define movsl movs R(eax)
91: # define stosl stos R(eax)
92: # define scasl scas R(eax)
93: # define cmpsl cmpsd
94: # ifdef _MSC_VER
95: # define ALIGN(log)
96: # else
97: # define ALIGN(log) .align log
98: # endif
99: #endif
100:
101: #ifdef _MSC_VER
102: # define TEXT()
103: # define GLOBL(name)
104: # define FUNBEGIN(name) __declspec(naked) void name () { __asm {
105: # define FUNEND() } }
106: #else
107: # define TEXT() .text
108: # define GLOBL(name) .globl name
109: # define FUNBEGIN(name) C(name##:)
110: # define FUNEND()
111: #endif
112:
113: #define _
114:
115: TEXT()
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>