xref: /inferno-os/utils/5c/5.out.h (revision e45fa0eb0763b57d6fb0649c064bc3b95ccdea6c)
1 #define	NSNAME		8
2 #define	NSYM		50
3 #define	NREG		16
4 
5 #define NOPROF		(1<<0)
6 #define DUPOK		(1<<1)
7 #define	ALLTHUMBS	(1<<2)
8 
9 #define	REGRET		0
10 #define	REGARG		0
11 /* compiler allocates R1 up as temps */
12 /* compiler allocates register variables R2 up */
13 #define	REGMIN		2
14 #define	REGMAX		8
15 #define	REGEXT		10
16 /* compiler allocates external registers R10 down */
17 #define	REGTMP		11
18 #define	REGSB		12
19 #define	REGSP		13
20 #define	REGLINK		14
21 #define	REGPC		15
22 
23 #define	REGTMPT		7	/* used by the loader for thumb code */
24 
25 #define	NFREG		8
26 #define	FREGRET		0
27 #define	FREGEXT		7
28 #define	FREGTMP		15
29 /* compiler allocates register variables F0 up */
30 /* compiler allocates external registers F7 down */
31 
32 enum	as
33 {
34 	AXXX,
35 
36 	AAND,
37 	AEOR,
38 	ASUB,
39 	ARSB,
40 	AADD,
41 	AADC,
42 	ASBC,
43 	ARSC,
44 	ATST,
45 	ATEQ,
46 	ACMP,
47 	ACMN,
48 	AORR,
49 	ABIC,
50 
51 	AMVN,
52 
53 	AB,
54 	ABL,
55 
56 /*
57  * Do not reorder or fragment the conditional branch
58  * opcodes, or the predication code will break
59  */
60 	ABEQ,
61 	ABNE,
62 	ABCS,
63 	ABHS,
64 	ABCC,
65 	ABLO,
66 	ABMI,
67 	ABPL,
68 	ABVS,
69 	ABVC,
70 	ABHI,
71 	ABLS,
72 	ABGE,
73 	ABLT,
74 	ABGT,
75 	ABLE,
76 
77 	AMOVWD,
78 	AMOVWF,
79 	AMOVDW,
80 	AMOVFW,
81 	AMOVFD,
82 	AMOVDF,
83 	AMOVF,
84 	AMOVD,
85 
86 	ACMPF,
87 	ACMPD,
88 	AADDF,
89 	AADDD,
90 	ASUBF,
91 	ASUBD,
92 	AMULF,
93 	AMULD,
94 	ADIVF,
95 	ADIVD,
96 //	ASQRTF,
97 //	ASQRTD,
98 
99 	ASRL,
100 	ASRA,
101 	ASLL,
102 	AMULU,
103 	ADIVU,
104 	AMUL,
105 	ADIV,
106 	AMOD,
107 	AMODU,
108 
109 	AMOVB,
110 	AMOVBU,
111 	AMOVH,
112 	AMOVHU,
113 	AMOVW,
114 	AMOVM,
115 	ASWPBU,
116 	ASWPW,
117 
118 	ANOP,
119 	ARFE,
120 	ASWI,
121 	AMULA,
122 
123 	ADATA,
124 	AGLOBL,
125 	AGOK,
126 	AHISTORY,
127 	ANAME,
128 	ARET,
129 	ATEXT,
130 	AWORD,
131 	ADYNT,
132 	AINIT,
133 	ABCASE,
134 	ACASE,
135 
136 	AEND,
137 
138 	AMULL,
139 	AMULAL,
140 	AMULLU,
141 	AMULALU,
142 
143 	ABX,
144 	ABXRET,
145 	ADWORD,
146 
147 	ASIGNAME,
148 
149 	/* moved here to preserve values of older identifiers */
150 	ASQRTF,
151 	ASQRTD,
152 
153 	ALDREX,
154 	ASTREX,
155 
156 	ALDREXD,
157 	ASTREXD,
158 
159 	ALAST,
160 };
161 
162 /* scond byte */
163 #define	C_SCOND	((1<<4)-1)
164 #define	C_SBIT	(1<<4)
165 #define	C_PBIT	(1<<5)
166 #define	C_WBIT	(1<<6)
167 #define	C_FBIT	(1<<7)	/* psr flags-only */
168 #define	C_UBIT	(1<<7)	/* up bit */
169 
170 /* type/name */
171 #define	D_GOK	0
172 #define	D_NONE	1
173 
174 /* type */
175 #define	D_BRANCH	(D_NONE+1)
176 #define	D_OREG		(D_NONE+2)
177 #define	D_CONST		(D_NONE+7)
178 #define	D_FCONST	(D_NONE+8)
179 #define	D_SCONST	(D_NONE+9)
180 #define	D_PSR		(D_NONE+10)
181 #define	D_REG		(D_NONE+12)
182 #define	D_FREG		(D_NONE+13)
183 #define	D_FILE		(D_NONE+16)
184 #define	D_OCONST	(D_NONE+17)
185 #define	D_FILE1		(D_NONE+18)
186 
187 #define	D_SHIFT		(D_NONE+19)
188 #define	D_FPCR		(D_NONE+20)
189 #define	D_REGREG	(D_NONE+21)
190 #define	D_ADDR		(D_NONE+22)
191 
192 /* name */
193 #define	D_EXTERN	(D_NONE+3)
194 #define	D_STATIC	(D_NONE+4)
195 #define	D_AUTO		(D_NONE+5)
196 #define	D_PARAM		(D_NONE+6)
197 
198 /*
199  * this is the ranlib header
200  */
201 #define	SYMDEF	"__.SYMDEF"
202 
203 /*
204  * this is the simulated IEEE floating point
205  */
206 typedef	struct	ieee	Ieee;
207 struct	ieee
208 {
209 	long	l;	/* contains ls-man	0xffffffff */
210 	long	h;	/* contains sign	0x80000000
211 				    exp		0x7ff00000
212 				    ms-man	0x000fffff */
213 };
214