6 |
|
* Copyright 1996 Bernd Schmidt |
7 |
|
*/ |
8 |
|
|
9 |
+ |
#ifndef M68K_FLAGS_H |
10 |
+ |
#define M68K_FLAGS_H |
11 |
+ |
|
12 |
+ |
#ifdef OPTIMIZED_FLAGS |
13 |
+ |
|
14 |
|
#if defined(__i386__) && defined(X86_ASSEMBLY) |
15 |
|
|
16 |
+ |
#ifndef SAHF_SETO_PROFITABLE |
17 |
+ |
|
18 |
|
struct flag_struct { |
19 |
< |
unsigned int cznv; |
20 |
< |
unsigned int x; |
19 |
> |
uae_u32 cznv; |
20 |
> |
uae_u32 x; |
21 |
|
}; |
22 |
|
|
23 |
< |
#define SET_ZFLG(y) (regflags.cznv = (regflags.cznv & ~0x40) | (((y) & 1) << 6)) |
24 |
< |
#define SET_CFLG(y) (regflags.cznv = (regflags.cznv & ~1) | ((y) & 1)) |
25 |
< |
#define SET_VFLG(y) (regflags.cznv = (regflags.cznv & ~0x800) | (((y) & 1) << 11)) |
26 |
< |
#define SET_NFLG(y) (regflags.cznv = (regflags.cznv & ~0x80) | (((y) & 1) << 7)) |
27 |
< |
#define SET_XFLG(y) (regflags.x = (y)) |
28 |
< |
|
29 |
< |
#define GET_ZFLG ((regflags.cznv >> 6) & 1) |
30 |
< |
#define GET_CFLG (regflags.cznv & 1) |
31 |
< |
#define GET_VFLG ((regflags.cznv >> 11) & 1) |
32 |
< |
#define GET_NFLG ((regflags.cznv >> 7) & 1) |
33 |
< |
#define GET_XFLG (regflags.x & 1) |
23 |
> |
#define FLAGVAL_Z 0x40 |
24 |
> |
#define FLAGVAL_N 0x80 |
25 |
> |
|
26 |
> |
#define SET_ZFLG(y) (regflags.cznv = (regflags.cznv & ~0x40) | (((y) & 1) << 6)) |
27 |
> |
#define SET_CFLG(y) (regflags.cznv = (regflags.cznv & ~1) | ((y) & 1)) |
28 |
> |
#define SET_VFLG(y) (regflags.cznv = (regflags.cznv & ~0x800) | (((y) & 1) << 11)) |
29 |
> |
#define SET_NFLG(y) (regflags.cznv = (regflags.cznv & ~0x80) | (((y) & 1) << 7)) |
30 |
> |
#define SET_XFLG(y) (regflags.x = (y)) |
31 |
> |
|
32 |
> |
#define GET_ZFLG ((regflags.cznv >> 6) & 1) |
33 |
> |
#define GET_CFLG (regflags.cznv & 1) |
34 |
> |
#define GET_VFLG ((regflags.cznv >> 11) & 1) |
35 |
> |
#define GET_NFLG ((regflags.cznv >> 7) & 1) |
36 |
> |
#define GET_XFLG (regflags.x & 1) |
37 |
> |
|
38 |
> |
#define CLEAR_CZNV (regflags.cznv = 0) |
39 |
> |
#define GET_CZNV (regflags.cznv) |
40 |
> |
#define IOR_CZNV(X) (regflags.cznv |= (X)) |
41 |
> |
#define SET_CZNV(X) (regflags.cznv = (X)) |
42 |
|
|
43 |
< |
#define CLEAR_CZNV (regflags.cznv = 0) |
29 |
< |
#define COPY_CARRY (regflags.x = regflags.cznv) |
43 |
> |
#define COPY_CARRY (regflags.x = regflags.cznv) |
44 |
|
|
45 |
|
extern struct flag_struct regflags __asm__ ("regflags"); |
46 |
|
|
72 |
|
return 0; |
73 |
|
} |
74 |
|
|
75 |
< |
#define x86_flag_testl(v) \ |
76 |
< |
__asm__ __volatile__ ("testl %1,%1\n\t" \ |
75 |
> |
#define optflag_testl(v) \ |
76 |
> |
__asm__ __volatile__ ("andl %1,%1\n\t" \ |
77 |
|
"pushfl\n\t" \ |
78 |
|
"popl %0\n\t" \ |
79 |
|
: "=r" (regflags.cznv) : "r" (v) : "cc") |
80 |
|
|
81 |
< |
#define x86_flag_testw(v) \ |
82 |
< |
__asm__ __volatile__ ("testw %w1,%w1\n\t" \ |
81 |
> |
#define optflag_testw(v) \ |
82 |
> |
__asm__ __volatile__ ("andw %w1,%w1\n\t" \ |
83 |
|
"pushfl\n\t" \ |
84 |
|
"popl %0\n\t" \ |
85 |
|
: "=r" (regflags.cznv) : "r" (v) : "cc") |
86 |
|
|
87 |
< |
#define x86_flag_testb(v) \ |
88 |
< |
__asm__ __volatile__ ("testb %b1,%b1\n\t" \ |
87 |
> |
#define optflag_testb(v) \ |
88 |
> |
__asm__ __volatile__ ("andb %b1,%b1\n\t" \ |
89 |
|
"pushfl\n\t" \ |
90 |
|
"popl %0\n\t" \ |
91 |
|
: "=r" (regflags.cznv) : "q" (v) : "cc") |
92 |
|
|
93 |
< |
#define x86_flag_addl(v, s, d) do { \ |
93 |
> |
#define optflag_addl(v, s, d) do { \ |
94 |
|
__asm__ __volatile__ ("addl %k2,%k1\n\t" \ |
95 |
|
"pushfl\n\t" \ |
96 |
|
"popl %0\n\t" \ |
98 |
|
COPY_CARRY; \ |
99 |
|
} while (0) |
100 |
|
|
101 |
< |
#define x86_flag_addw(v, s, d) do { \ |
101 |
> |
#define optflag_addw(v, s, d) do { \ |
102 |
|
__asm__ __volatile__ ("addw %w2,%w1\n\t" \ |
103 |
|
"pushfl\n\t" \ |
104 |
|
"popl %0\n\t" \ |
106 |
|
COPY_CARRY; \ |
107 |
|
} while (0) |
108 |
|
|
109 |
< |
#define x86_flag_addb(v, s, d) do { \ |
109 |
> |
#define optflag_addb(v, s, d) do { \ |
110 |
|
__asm__ __volatile__ ("addb %b2,%b1\n\t" \ |
111 |
|
"pushfl\n\t" \ |
112 |
|
"popl %0\n\t" \ |
114 |
|
COPY_CARRY; \ |
115 |
|
} while (0) |
116 |
|
|
117 |
< |
#define x86_flag_subl(v, s, d) do { \ |
117 |
> |
#define optflag_subl(v, s, d) do { \ |
118 |
|
__asm__ __volatile__ ("subl %k2,%k1\n\t" \ |
119 |
|
"pushfl\n\t" \ |
120 |
|
"popl %0\n\t" \ |
122 |
|
COPY_CARRY; \ |
123 |
|
} while (0) |
124 |
|
|
125 |
< |
#define x86_flag_subw(v, s, d) do { \ |
125 |
> |
#define optflag_subw(v, s, d) do { \ |
126 |
|
__asm__ __volatile__ ("subw %w2,%w1\n\t" \ |
127 |
|
"pushfl\n\t" \ |
128 |
|
"popl %0\n\t" \ |
130 |
|
COPY_CARRY; \ |
131 |
|
} while (0) |
132 |
|
|
133 |
< |
#define x86_flag_subb(v, s, d) do { \ |
133 |
> |
#define optflag_subb(v, s, d) do { \ |
134 |
|
__asm__ __volatile__ ("subb %b2,%b1\n\t" \ |
135 |
|
"pushfl\n\t" \ |
136 |
|
"popl %0\n\t" \ |
138 |
|
COPY_CARRY; \ |
139 |
|
} while (0) |
140 |
|
|
141 |
< |
#define x86_flag_cmpl(s, d) \ |
141 |
> |
#define optflag_cmpl(s, d) \ |
142 |
|
__asm__ __volatile__ ("cmpl %k1,%k2\n\t" \ |
143 |
|
"pushfl\n\t" \ |
144 |
|
"popl %0\n\t" \ |
145 |
|
: "=r" (regflags.cznv) : "rmi" (s), "r" (d) : "cc") |
146 |
|
|
147 |
< |
#define x86_flag_cmpw(s, d) \ |
147 |
> |
#define optflag_cmpw(s, d) \ |
148 |
|
__asm__ __volatile__ ("cmpw %w1,%w2\n\t" \ |
149 |
|
"pushfl\n\t" \ |
150 |
|
"popl %0\n\t" \ |
151 |
|
: "=r" (regflags.cznv) : "rmi" (s), "r" (d) : "cc") |
152 |
|
|
153 |
< |
#define x86_flag_cmpb(s, d) \ |
153 |
> |
#define optflag_cmpb(s, d) \ |
154 |
|
__asm__ __volatile__ ("cmpb %b1,%b2\n\t" \ |
155 |
|
"pushfl\n\t" \ |
156 |
|
"popl %0\n\t" \ |
157 |
|
: "=r" (regflags.cznv) : "qmi" (s), "q" (d) : "cc") |
158 |
|
|
159 |
+ |
#else |
160 |
+ |
|
161 |
+ |
struct flag_struct { |
162 |
+ |
uae_u32 cznv; |
163 |
+ |
uae_u32 x; |
164 |
+ |
}; |
165 |
+ |
|
166 |
+ |
#define FLAGVAL_Z 0x4000 |
167 |
+ |
#define FLAGVAL_N 0x8000 |
168 |
+ |
|
169 |
+ |
#define SET_ZFLG(y) (regflags.cznv = (regflags.cznv & ~0x4000) | (((y) & 1) << 14)) |
170 |
+ |
#define SET_CFLG(y) (regflags.cznv = (regflags.cznv & ~0x100) | (((y) & 1) << 8)) |
171 |
+ |
#define SET_VFLG(y) (regflags.cznv = (regflags.cznv & ~0x1) | (((y) & 1))) |
172 |
+ |
#define SET_NFLG(y) (regflags.cznv = (regflags.cznv & ~0x8000) | (((y) & 1) << 15)) |
173 |
+ |
#define SET_XFLG(y) (regflags.x = (y)) |
174 |
+ |
|
175 |
+ |
#define GET_ZFLG ((regflags.cznv >> 14) & 1) |
176 |
+ |
#define GET_CFLG ((regflags.cznv >> 8) & 1) |
177 |
+ |
#define GET_VFLG ((regflags.cznv >> 0) & 1) |
178 |
+ |
#define GET_NFLG ((regflags.cznv >> 15) & 1) |
179 |
+ |
#define GET_XFLG (regflags.x & 1) |
180 |
+ |
|
181 |
+ |
#define CLEAR_CZNV (regflags.cznv = 0) |
182 |
+ |
#define GET_CZNV (regflags.cznv) |
183 |
+ |
#define IOR_CZNV(X) (regflags.cznv |= (X)) |
184 |
+ |
#define SET_CZNV(X) (regflags.cznv = (X)) |
185 |
+ |
|
186 |
+ |
#define COPY_CARRY (regflags.x = (regflags.cznv)>>8) |
187 |
+ |
|
188 |
+ |
extern struct flag_struct regflags __asm__ ("regflags"); |
189 |
+ |
|
190 |
+ |
static __inline__ int cctrue(int cc) |
191 |
+ |
{ |
192 |
+ |
uae_u32 cznv = regflags.cznv; |
193 |
+ |
switch(cc){ |
194 |
+ |
case 0: return 1; /* T */ |
195 |
+ |
case 1: return 0; /* F */ |
196 |
+ |
case 2: return (cznv & 0x4100) == 0; /* !GET_CFLG && !GET_ZFLG; HI */ |
197 |
+ |
case 3: return (cznv & 0x4100) != 0; /* GET_CFLG || GET_ZFLG; LS */ |
198 |
+ |
case 4: return (cznv & 0x100) == 0; /* !GET_CFLG; CC */ |
199 |
+ |
case 5: return (cznv & 0x100) != 0; /* GET_CFLG; CS */ |
200 |
+ |
case 6: return (cznv & 0x4000) == 0; /* !GET_ZFLG; NE */ |
201 |
+ |
case 7: return (cznv & 0x4000) != 0; /* GET_ZFLG; EQ */ |
202 |
+ |
case 8: return (cznv & 0x01) == 0; /* !GET_VFLG; VC */ |
203 |
+ |
case 9: return (cznv & 0x01) != 0; /* GET_VFLG; VS */ |
204 |
+ |
case 10:return (cznv & 0x8000) == 0; /* !GET_NFLG; PL */ |
205 |
+ |
case 11:return (cznv & 0x8000) != 0; /* GET_NFLG; MI */ |
206 |
+ |
case 12:return (((cznv << 15) ^ cznv) & 0x8000) == 0; /* GET_NFLG == GET_VFLG; GE */ |
207 |
+ |
case 13:return (((cznv << 15) ^ cznv) & 0x8000) != 0;/* GET_NFLG != GET_VFLG; LT */ |
208 |
+ |
case 14: |
209 |
+ |
cznv &= 0xc001; |
210 |
+ |
return (((cznv << 15) ^ cznv) & 0xc000) == 0; /* !GET_ZFLG && (GET_NFLG == GET_VFLG); GT */ |
211 |
+ |
case 15: |
212 |
+ |
cznv &= 0xc001; |
213 |
+ |
return (((cznv << 15) ^ cznv) & 0xc000) != 0; /* GET_ZFLG || (GET_NFLG != GET_VFLG); LE */ |
214 |
+ |
} |
215 |
+ |
abort(); |
216 |
+ |
return 0; |
217 |
+ |
} |
218 |
+ |
|
219 |
+ |
/* Is there any way to do this without declaring *all* memory clobbered? |
220 |
+ |
I.e. any way to tell gcc that some byte-sized value is in %al? */ |
221 |
+ |
#define optflag_testl(v) \ |
222 |
+ |
__asm__ __volatile__ ("andl %0,%0\n\t" \ |
223 |
+ |
"lahf\n\t" \ |
224 |
+ |
"seto %%al\n\t" \ |
225 |
+ |
"movb %%al,regflags\n\t" \ |
226 |
+ |
"movb %%ah,regflags+1\n\t" \ |
227 |
+ |
: : "r" (v) : "%eax","cc","memory") |
228 |
+ |
|
229 |
+ |
#define optflag_testw(v) \ |
230 |
+ |
__asm__ __volatile__ ("andw %w0,%w0\n\t" \ |
231 |
+ |
"lahf\n\t" \ |
232 |
+ |
"seto %%al\n\t" \ |
233 |
+ |
"movb %%al,regflags\n\t" \ |
234 |
+ |
"movb %%ah,regflags+1\n\t" \ |
235 |
+ |
: : "r" (v) : "%eax","cc","memory") |
236 |
+ |
|
237 |
+ |
#define optflag_testb(v) \ |
238 |
+ |
__asm__ __volatile__ ("andb %b0,%b0\n\t" \ |
239 |
+ |
"lahf\n\t" \ |
240 |
+ |
"seto %%al\n\t" \ |
241 |
+ |
"movb %%al,regflags\n\t" \ |
242 |
+ |
"movb %%ah,regflags+1\n\t" \ |
243 |
+ |
: : "q" (v) : "%eax","cc","memory") |
244 |
+ |
|
245 |
+ |
#define optflag_addl(v, s, d) do { \ |
246 |
+ |
__asm__ __volatile__ ("addl %k1,%k0\n\t" \ |
247 |
+ |
"lahf\n\t" \ |
248 |
+ |
"seto %%al\n\t" \ |
249 |
+ |
"movb %%al,regflags\n\t" \ |
250 |
+ |
"movb %%ah,regflags+1\n\t" \ |
251 |
+ |
: "=r" (v) : "rmi" (s), "0" (d) : "%eax","cc","memory"); \ |
252 |
+ |
COPY_CARRY; \ |
253 |
+ |
} while (0) |
254 |
+ |
|
255 |
+ |
#define optflag_addw(v, s, d) do { \ |
256 |
+ |
__asm__ __volatile__ ("addw %w1,%w0\n\t" \ |
257 |
+ |
"lahf\n\t" \ |
258 |
+ |
"seto %%al\n\t" \ |
259 |
+ |
"movb %%al,regflags\n\t" \ |
260 |
+ |
"movb %%ah,regflags+1\n\t" \ |
261 |
+ |
: "=r" (v) : "rmi" (s), "0" (d) : "%eax","cc","memory"); \ |
262 |
+ |
COPY_CARRY; \ |
263 |
+ |
} while (0) |
264 |
+ |
|
265 |
+ |
#define optflag_addb(v, s, d) do { \ |
266 |
+ |
__asm__ __volatile__ ("addb %b1,%b0\n\t" \ |
267 |
+ |
"lahf\n\t" \ |
268 |
+ |
"seto %%al\n\t" \ |
269 |
+ |
"movb %%al,regflags\n\t" \ |
270 |
+ |
"movb %%ah,regflags+1\n\t" \ |
271 |
+ |
: "=q" (v) : "qmi" (s), "0" (d) : "%eax","cc","memory"); \ |
272 |
+ |
COPY_CARRY; \ |
273 |
+ |
} while (0) |
274 |
+ |
|
275 |
+ |
#define optflag_subl(v, s, d) do { \ |
276 |
+ |
__asm__ __volatile__ ("subl %k1,%k0\n\t" \ |
277 |
+ |
"lahf\n\t" \ |
278 |
+ |
"seto %%al\n\t" \ |
279 |
+ |
"movb %%al,regflags\n\t" \ |
280 |
+ |
"movb %%ah,regflags+1\n\t" \ |
281 |
+ |
: "=r" (v) : "rmi" (s), "0" (d) : "%eax","cc","memory"); \ |
282 |
+ |
COPY_CARRY; \ |
283 |
+ |
} while (0) |
284 |
+ |
|
285 |
+ |
#define optflag_subw(v, s, d) do { \ |
286 |
+ |
__asm__ __volatile__ ("subw %w1,%w0\n\t" \ |
287 |
+ |
"lahf\n\t" \ |
288 |
+ |
"seto %%al\n\t" \ |
289 |
+ |
"movb %%al,regflags\n\t" \ |
290 |
+ |
"movb %%ah,regflags+1\n\t" \ |
291 |
+ |
: "=r" (v) : "rmi" (s), "0" (d) : "%eax","cc","memory"); \ |
292 |
+ |
COPY_CARRY; \ |
293 |
+ |
} while (0) |
294 |
+ |
|
295 |
+ |
#define optflag_subb(v, s, d) do { \ |
296 |
+ |
__asm__ __volatile__ ("subb %b1,%b0\n\t" \ |
297 |
+ |
"lahf\n\t" \ |
298 |
+ |
"seto %%al\n\t" \ |
299 |
+ |
"movb %%al,regflags\n\t" \ |
300 |
+ |
"movb %%ah,regflags+1\n\t" \ |
301 |
+ |
: "=q" (v) : "qmi" (s), "0" (d) : "%eax","cc","memory"); \ |
302 |
+ |
COPY_CARRY; \ |
303 |
+ |
} while (0) |
304 |
+ |
|
305 |
+ |
#define optflag_cmpl(s, d) \ |
306 |
+ |
__asm__ __volatile__ ("cmpl %k0,%k1\n\t" \ |
307 |
+ |
"lahf\n\t" \ |
308 |
+ |
"seto %%al\n\t" \ |
309 |
+ |
"movb %%al,regflags\n\t" \ |
310 |
+ |
"movb %%ah,regflags+1\n\t" \ |
311 |
+ |
: : "rmi" (s), "r" (d) : "%eax","cc","memory") |
312 |
+ |
|
313 |
+ |
#define optflag_cmpw(s, d) \ |
314 |
+ |
__asm__ __volatile__ ("cmpw %w0,%w1\n\t" \ |
315 |
+ |
"lahf\n\t" \ |
316 |
+ |
"seto %%al\n\t" \ |
317 |
+ |
"movb %%al,regflags\n\t" \ |
318 |
+ |
"movb %%ah,regflags+1\n\t" \ |
319 |
+ |
: : "rmi" (s), "r" (d) : "%eax","cc","memory"); |
320 |
+ |
|
321 |
+ |
#define optflag_cmpb(s, d) \ |
322 |
+ |
__asm__ __volatile__ ("cmpb %b0,%b1\n\t" \ |
323 |
+ |
"lahf\n\t" \ |
324 |
+ |
"seto %%al\n\t" \ |
325 |
+ |
"movb %%al,regflags\n\t" \ |
326 |
+ |
"movb %%ah,regflags+1\n\t" \ |
327 |
+ |
: : "qmi" (s), "q" (d) : "%eax","cc","memory") |
328 |
+ |
|
329 |
+ |
#endif |
330 |
+ |
|
331 |
|
#elif defined(__sparc__) && (defined(SPARC_V8_ASSEMBLY) || defined(SPARC_V9_ASSEMBLY)) |
332 |
|
|
333 |
|
struct flag_struct { |
337 |
|
|
338 |
|
extern struct flag_struct regflags; |
339 |
|
|
340 |
< |
#define SET_ZFLG(y) (regflags.nzvc = (regflags.nzvc & ~0x04) | (((y) & 1) << 2)) |
341 |
< |
#define SET_CFLG(y) (regflags.nzvc = (regflags.nzvc & ~1) | ((y) & 1)) |
342 |
< |
#define SET_VFLG(y) (regflags.nzvc = (regflags.nzvc & ~0x02) | (((y) & 1) << 1)) |
343 |
< |
#define SET_NFLG(y) (regflags.nzvc = (regflags.nzvc & ~0x08) | (((y) & 1) << 3)) |
344 |
< |
#define SET_XFLG(y) (regflags.x = (y)) |
345 |
< |
|
346 |
< |
#define GET_ZFLG ((regflags.nzvc >> 2) & 1) |
347 |
< |
#define GET_CFLG (regflags.nzvc & 1) |
348 |
< |
#define GET_VFLG ((regflags.nzvc >> 1) & 1) |
349 |
< |
#define GET_NFLG ((regflags.nzvc >> 3) & 1) |
350 |
< |
#define GET_XFLG (regflags.x & 1) |
340 |
> |
#define FLAGVAL_Z 0x04 |
341 |
> |
#define FLAGVAL_N 0x08 |
342 |
> |
|
343 |
> |
#define SET_ZFLG(y) (regflags.nzvc = (regflags.nzvc & ~0x04) | (((y) & 1) << 2)) |
344 |
> |
#define SET_CFLG(y) (regflags.nzvc = (regflags.nzvc & ~1) | ((y) & 1)) |
345 |
> |
#define SET_VFLG(y) (regflags.nzvc = (regflags.nzvc & ~0x02) | (((y) & 1) << 1)) |
346 |
> |
#define SET_NFLG(y) (regflags.nzvc = (regflags.nzvc & ~0x08) | (((y) & 1) << 3)) |
347 |
> |
#define SET_XFLG(y) (regflags.x = (y)) |
348 |
> |
|
349 |
> |
#define GET_ZFLG ((regflags.nzvc >> 2) & 1) |
350 |
> |
#define GET_CFLG (regflags.nzvc & 1) |
351 |
> |
#define GET_VFLG ((regflags.nzvc >> 1) & 1) |
352 |
> |
#define GET_NFLG ((regflags.nzvc >> 3) & 1) |
353 |
> |
#define GET_XFLG (regflags.x & 1) |
354 |
> |
|
355 |
> |
#define CLEAR_CZNV (regflags.nzvc = 0) |
356 |
> |
#define GET_CZNV (reflags.nzvc) |
357 |
> |
#define IOR_CZNV(X) (refglags.nzvc |= (X)) |
358 |
> |
#define SET_CZNV(X) (regflags.nzvc = (X)) |
359 |
|
|
166 |
– |
#define CLEAR_CZNV (regflags.nzvc = 0) |
360 |
|
#define COPY_CARRY (regflags.x = regflags.nzvc) |
361 |
|
|
362 |
|
static __inline__ int cctrue(int cc) |
980 |
|
|
981 |
|
#endif /* SPARC_V9_ASSEMBLY */ |
982 |
|
|
983 |
+ |
#endif |
984 |
+ |
|
985 |
|
#else |
986 |
|
|
987 |
|
struct flag_struct { |
1000 |
|
#define VFLG (regflags.v) |
1001 |
|
#define XFLG (regflags.x) |
1002 |
|
|
1003 |
+ |
#define SET_CFLG(x) (CFLG = (x)) |
1004 |
+ |
#define SET_NFLG(x) (NFLG = (x)) |
1005 |
+ |
#define SET_VFLG(x) (VFLG = (x)) |
1006 |
+ |
#define SET_ZFLG(x) (ZFLG = (x)) |
1007 |
+ |
#define SET_XFLG(x) (XFLG = (x)) |
1008 |
+ |
|
1009 |
+ |
#define GET_CFLG CFLG |
1010 |
+ |
#define GET_NFLG NFLG |
1011 |
+ |
#define GET_VFLG VFLG |
1012 |
+ |
#define GET_ZFLG ZFLG |
1013 |
+ |
#define GET_XFLG XFLG |
1014 |
+ |
|
1015 |
+ |
#define CLEAR_CZNV do { \ |
1016 |
+ |
SET_CFLG (0); \ |
1017 |
+ |
SET_ZFLG (0); \ |
1018 |
+ |
SET_NFLG (0); \ |
1019 |
+ |
SET_VFLG (0); \ |
1020 |
+ |
} while (0) |
1021 |
+ |
|
1022 |
+ |
#define COPY_CARRY (SET_XFLG (GET_CFLG)) |
1023 |
+ |
|
1024 |
|
static __inline__ int cctrue(const int cc) |
1025 |
|
{ |
1026 |
|
switch(cc){ |
1044 |
|
return 0; |
1045 |
|
} |
1046 |
|
|
1047 |
< |
#endif |
1047 |
> |
#endif /* OPTIMIZED_FLAGS */ |
1048 |
> |
|
1049 |
> |
#endif /* M68K_FLAGS_H */ |