1 |
+ |
/* |
2 |
+ |
* compiler/codegen_x86.cpp - IA-32 code generator |
3 |
+ |
* |
4 |
+ |
* Original 68040 JIT compiler for UAE, copyright 2000-2002 Bernd Meyer |
5 |
+ |
* |
6 |
+ |
* Adaptation for Basilisk II and improvements, copyright 2000-2002 |
7 |
+ |
* Gwenole Beauchesne |
8 |
+ |
* |
9 |
+ |
* Basilisk II (C) 1997-2002 Christian Bauer |
10 |
+ |
* |
11 |
+ |
* This program is free software; you can redistribute it and/or modify |
12 |
+ |
* it under the terms of the GNU General Public License as published by |
13 |
+ |
* the Free Software Foundation; either version 2 of the License, or |
14 |
+ |
* (at your option) any later version. |
15 |
+ |
* |
16 |
+ |
* This program is distributed in the hope that it will be useful, |
17 |
+ |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
18 |
+ |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19 |
+ |
* GNU General Public License for more details. |
20 |
+ |
* |
21 |
+ |
* You should have received a copy of the GNU General Public License |
22 |
+ |
* along with this program; if not, write to the Free Software |
23 |
+ |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 |
+ |
*/ |
25 |
+ |
|
26 |
|
/* This should eventually end up in machdep/, but for now, x86 is the |
27 |
|
only target, and it's easier this way... */ |
28 |
|
|
29 |
+ |
#include "flags_x86.h" |
30 |
+ |
|
31 |
|
/************************************************************************* |
32 |
|
* Some basic information about the the target CPU * |
33 |
|
*************************************************************************/ |
1746 |
|
} |
1747 |
|
LENDFUNC(WRITE,NONE,2,raw_cmp_w,(R2 d, R2 s)) |
1748 |
|
|
1749 |
+ |
LOWFUNC(WRITE,READ,2,raw_cmp_b_mi,(MEMR d, IMM s)) |
1750 |
+ |
{ |
1751 |
+ |
emit_byte(0x80); |
1752 |
+ |
emit_byte(0x3d); |
1753 |
+ |
emit_long(d); |
1754 |
+ |
emit_byte(s); |
1755 |
+ |
} |
1756 |
+ |
LENDFUNC(WRITE,READ,2,raw_cmp_l_mi,(MEMR d, IMM s)) |
1757 |
+ |
|
1758 |
|
LOWFUNC(WRITE,NONE,2,raw_cmp_b_ri,(R1 d, IMM i)) |
1759 |
|
{ |
1760 |
|
if (optimize_accum && isaccum(d)) |
1929 |
|
emit_byte(0xd0+r); |
1930 |
|
} |
1931 |
|
|
1932 |
+ |
static __inline__ void raw_call_m_indexed(uae_u32 base, uae_u32 r, uae_u32 m) |
1933 |
+ |
{ |
1934 |
+ |
int mu; |
1935 |
+ |
switch(m) { |
1936 |
+ |
case 1: mu=0; break; |
1937 |
+ |
case 2: mu=1; break; |
1938 |
+ |
case 4: mu=2; break; |
1939 |
+ |
case 8: mu=3; break; |
1940 |
+ |
default: abort(); |
1941 |
+ |
} |
1942 |
+ |
emit_byte(0xff); |
1943 |
+ |
emit_byte(0x14); |
1944 |
+ |
emit_byte(0x05+8*r+0x40*mu); |
1945 |
+ |
emit_long(base); |
1946 |
+ |
} |
1947 |
+ |
|
1948 |
|
static __inline__ void raw_jmp_r(R4 r) |
1949 |
|
{ |
1950 |
|
emit_byte(0xff); |