Commit Graph

159 Commits

Author SHA1 Message Date
gbeauche
b48a5a3253 Detect x86-64 2003-03-20 13:49:49 +00:00
gbeauche
96ae75cd7e Optimize TEST[BWLQ]ir case where dest register is %rax
Add JCCSii and JCCii which directly takes the displacement value to encode
2003-03-19 17:06:22 +00:00
gbeauche
ecab19aa4e Emulate CMOV in the new code generator for processors that don't support
this intruction
2003-03-19 17:05:02 +00:00
gbeauche
06af072a40 Add missing wrappers of the new runtime-assembler primitives 2003-03-19 16:32:51 +00:00
gbeauche
a3b815366a Add facility to filter out some opcodes from the compfunctbl[] et al. 2003-03-19 16:28:23 +00:00
gbeauche
547bd6ab2c Fix MOVBrr 2003-03-19 16:25:12 +00:00
gbeauche
c4bf8e0695 Fix 0(%rbp,<reg>,1) operand encoding 2003-03-19 11:34:10 +00:00
gbeauche
da8d81509e Add new backend, disabled for until it's proofread and fully functional
Remove obsolete string-related instructions
2003-03-18 17:26:32 +00:00
gbeauche
5fb74e3592 Add sign/zero-extend instructions 2003-03-18 17:01:44 +00:00
gbeauche
29f636c2eb Fix _REXBmr(). Add CPUID. Some C++ compiler fixes. Make x86_emit_failure()
be void, and let x86_emit_failure0() be an int expression instead.
2003-03-18 16:28:23 +00:00
gbeauche
8271c0503e Add CMOV and BSF/BSR instructions 2003-03-18 13:12:56 +00:00
gbeauche
e07bfdbc8b Handle absolute and RIP addressing modes in x86-64 2003-03-18 10:08:16 +00:00
gbeauche
ce3d90ff5e clobber "cc" for flags, not "flags". Thanks Milan for noticing it. 2003-03-17 22:37:55 +00:00
gbeauche
08e9f936eb Add some SSE/SSE2 instructions 2003-03-17 17:18:24 +00:00
gbeauche
c2566295af Implement a generic setzflg_l() for P4, thus permitting to re-enable
translation of ADDX/SUBX/BCLR/BTST/BSET/BCHG instructions. i.e. make
it faster. ;-)
2003-03-13 20:34:34 +00:00
gbeauche
0cfa3126b3 Workaround change in flags handling for BSF instruction on Pentium 4.
i.e. currently disable translation of ADDX/SUBX/B<CHG,CLR,SET,TST> instructions
in that case. That is to say, better (much?) slower than inaccurate. :-(
2003-03-13 15:57:01 +00:00
gbeauche
a8e76deb69 Fix align_target with a padding of 0 bytes 2003-03-13 09:51:31 +00:00
gbeauche
45289042e6 Add some FPU instructions. Minor clean-ups. 2003-01-31 23:48:10 +00:00
gbeauche
ee7cea923a Add new run-time assembler derived from GNU lightning. It is suitable for
both i386 and x86-64 architectures. Still needs some work (see TODO) and
an actual glue to the JIT backend.

Original work is LGPL, but per section 3 of this license, I opt for GPL v2
for Basilisk II purposes.
2003-01-31 20:39:53 +00:00
gbeauche
144e6f4e87 Use old x87 FPU stack on x86-64 too because we now use long doubles there for
better accuracy. Aka. prefer compatibility over speed.
2002-11-16 15:28:25 +00:00
gbeauche
bc5d7f9490 OPTIMIZED_FLAGS for x86-64 with the pushf/pop method since sahf/lahf are
invalid in long mode.
2002-11-05 11:59:12 +00:00
gbeauche
0a201217bf Remove obsolete CFLOW_* constants but keep cpuop_{begin,end} for an
inline-threaded core.
2002-11-02 18:13:29 +00:00
gbeauche
2cda26edae Fix buffer overflow reported by Aranym people 2002-11-02 17:23:20 +00:00
gbeauche
2cb7e02c9e Some instructions assume offsets are only 1-byte long. I don't think this
is 100% correct. Therefore, insert some asserts so that would fail.
2002-10-13 11:14:24 +00:00
gbeauche
aa6b264d21 Add raw_emit_nop_filler() with more efficient no-op fillers stolen from
GNU binutils 2.12.90.0.15. Speed bump is marginal (less than 6%). Make it
default though, that's conditionalized by tune_nop_fillers constant.
2002-10-12 16:27:13 +00:00
gbeauche
78ac3e667f Don't forget to note CPU detection code mostly comes from Linux kernel. 2002-10-03 16:16:57 +00:00
gbeauche
d4ed937de6 JIT add copyright notices just to notify people that's real derivative
work from GPL code (UAE-JIT). Additions and improvements are from B2
developers.
2002-10-03 16:13:46 +00:00
gbeauche
8de7ad1091 - Turn on runtime detection of loop and jump alignment as Aranym people
reported they got some improvement with it and larger loops. Small
  loops are an issue for now until unrolling is implemented for DBcc.
- Const jumps are identified in readcpu. I don't want to duplicate code
  uselessly. Rather, it's the JIT job to know whether we are doing block
  inlining and un-marking those instructions as end-of-block.
2002-10-03 15:05:01 +00:00
gbeauche
a60c6da7c3 Turn on block inlining so that people could test this feature and report
if they do gain something or renders JIT less stable.
2002-10-03 15:01:53 +00:00
gbeauche
724516511a Do translate BSR.L, we don't have any issue with that even if we are
doing block inlining since we have a complete chain of information about
the blocks to checksum.
2002-10-03 14:59:35 +00:00
gbeauche
e11dd3d375 Do translate FMUL instructions, the core needs to be fixed and this is
not translation of that instruction. I believe this is related to some
misgeneration of FPU core sequence and allocation of FP registers?
2002-10-03 14:58:02 +00:00
gbeauche
e9584dbcc1 Add PROFILE_UNTRANSLATED_INSNS information. Interestingly, the following
are the bottleneck now: DIVS, BSR.L (why isn't it translated yet?),
bit-field instructions (I need to self-motivate enough for that), and
A-Traps.
2002-10-02 16:22:51 +00:00
gbeauche
94a9038826 - Remove dead code in readcpu.cpp concerning CONST_JUMP control flow.
- Replace unused fl_compiled with fl_const_jump
- Implement block inlining enabled with USE_INLINING && USE_CHECKSUM_INFO.
  However, this is currently disabled as it doesn't give much and exhibits
  even more a cache/code generation problem with FPU JIT compiled code.
- Actual checksum values are now integral part of a blockinfo regardless
  of USE_CHECKSUM_INFO is set or not. Reduce number of elements in that
  structure and speeds up a little calculation of checksum of chained blocks.
- Don't care about show_checksum() for now.
2002-10-02 15:55:10 +00:00
gbeauche
21909f1eed - Rewrite blockinfo allocator et al. Use a template class so that this
can work with other types related to blockinfos.
- Add new method to compute checksums. This should permit code inlining
  and follow-ups of const_jumps without breaking the lazy cache invalidator.
  aka. chain infos for checksuming. TODO: Incomplete support thus disabled.
2002-10-01 16:22:36 +00:00
gbeauche
75de104c92 - Optimize use of quit_program variable. This is a real boolean for B2.
- Remove unused/dead code concerning surroundings of (debugging).
- m68k_compile_execute() is generated and optimized code now.
2002-10-01 09:39:55 +00:00
gbeauche
bdf9d76bb8 - #include "flags_x86.h" here to get NATICE_CC_?? helper macros
- Add raw_cmp_b_mi() and raw_call_m_indexed() for generated
  m68k_compile_execute() function
2002-10-01 09:37:03 +00:00
gbeauche
8748b48b7a Disable USE_QUAD_DOUBLE for now and probably for good as (i) the emulator
implementation is not correct, (ii) I don't know of any CPU which
handles this kind of format *natively* with conformance to IEEE.
2002-09-20 16:52:48 +00:00
gbeauche
ec92457d68 Fix align_jumps for athlon, that's really "16" and gcc-3.2 sources contained
the same error. ;-)
2002-09-20 14:55:50 +00:00
gbeauche
d7c677d077 - Implement {make,extract}_extended() for USE_QUAD_DOUBLE
- Don't forget to fill in mantissa3 member for USE_QUAD_DOUBLE in
  make_extended_*() but make sure NaN, inf, zeros are handled beforehand
2002-09-19 20:52:50 +00:00
gbeauche
a5ba7ea5ac Don't define USE_LONG_DOUBLE when sizeof(long double) == 16. This still
is not very clean but it should build now. Probably live with USE_LONG_DOUBLE
for any case where native long double exists and sizeof > 8 ?
2002-09-19 16:02:13 +00:00
gbeauche
b765112cf9 Get rid of any "extern inline" bits. Use static inline instead as MIPS
compilers don't really like the former syntax.
2002-09-19 15:42:16 +00:00
gbeauche
ecd3db832e - Rewrite raw_init_cpu() to match more details, from kernel sources.
- Add possibility to tune code alignment to the underlying processor. However,
  this is turned off as I don't see much improvement and align_jumps = 64
  for Athlon looks suspicious to me.
- Remove two extra align_target() that are already covered.
- Remove unused may_trap() predicate.
2002-09-19 14:59:03 +00:00
gbeauche
feca66d43e Optimize runtime assembler with shorter equivalents when the accumulator
(%eax) is referenced along with immediates.
2002-09-18 15:56:17 +00:00
gbeauche
54ac7a1493 Move -DSAHF_SETO_PROFITABLE down in x86 & gas specific block. Also ensure
SAHF_SETO_PROFITABLE is defined when compiling the JIT. Aka I don't want
to support obsolete and probably bogus code nowadays.
2002-09-18 11:41:56 +00:00
gbeauche
c40279294a Don't forget to use vm_realease() to free up translation cache. Also free
the right amount of memory that was previously allocated.
2002-09-18 09:55:37 +00:00
gbeauche
599f7e845f Use vm_acquire() to allocate translation cache 2002-09-18 07:50:55 +00:00
gbeauche
4fc127c8df - Changes to support 68040 -> x86 dynamic translator
- Globalize FLIGHT_RECORDER, possibly used in compiler/ sources as well
2002-09-17 16:05:39 +00:00
gbeauche
c0526db089 Import JIT compiler 2002-09-17 16:04:06 +00:00
gbeauche
6af88bc787 Only use *l() math functions when they are available 2002-09-16 15:40:23 +00:00
gbeauche
48986febc6 - FP endianness is now testing at configure time
- Fix junk introduced in previous rev for extract_extended()
2002-09-16 12:01:38 +00:00
gbeauche
e59e4904d3 Fix "ieee" FPU core on big endian and without long double > double support
- Handle conversions to/from host double for m68k long doubles formats
- Make mathlib aware of sizeof(long double) == sizeof(double) arches
- Attempt to fix FSCALE implementation
2002-09-15 18:21:13 +00:00
gbeauche
57e73de5f6 USE_LONG_DOUBLE guards 2002-09-13 15:06:42 +00:00
gbeauche
a50871f87c Updates for new FPU core architecture 2002-09-13 12:50:56 +00:00
gbeauche
c327eee41b * Basilisk II JIT integration, phase 2:
- Add new FPU core architecture
- Clean fpu_x86_asm.h as it is no longer automatically generated
2002-09-13 12:50:40 +00:00
gbeauche
d3bda319a8 Use B2_mutex instead of pthread mutexes when ENABLE_EXCLUSIVE_SPCFLAGS is
set. However, this is not used at the moment. Is there an advantage? People
may want to add arch-optimized SPCFLAGS_{SET,CLEAR}.
2002-09-01 16:32:02 +00:00
gbeauche
7972082c56 - Merge with Basilisk II/JIT cpu core, interpretive part for now
- Clean use of USE_PREFETCH_BUFFER macro and dependent bits
2002-09-01 15:17:13 +00:00
gbeauche
9534ec2fc8 - Update to fix build with gcc-3.1 and -O3 optimization level 2002-03-27 10:45:59 +00:00
gbeauche
f5e58c95d6 - When X86_ASSEMBLY is set, aka when cpuopti is used, do call the
instruction handler by hand and make sure to save %ebp too
- Really merge cpu core with uae-0.8.21:
  - Trace mode fixes (Bernd Roesch & Bernd Schmidt)
  - Reintegrate PTEST and PFLUSH instructions back as no-ops
2002-03-23 13:57:38 +00:00
gbeauche
a42a559bf1 - Close log file 2002-03-18 21:25:07 +00:00
gbeauche
2762a7dd48 - Add Flight Recorder for m68k too. That helps. ;-) 2002-03-16 16:31:54 +00:00
cebix
628533940d - documentation updates
- 2001 -> 2002
- version 0.9 -> 1.0
2002-01-15 14:58:43 +00:00
gbeauche
eec091e56b - Fix condition codes handling for BFINS instructions (uae 0.8.20) 2002-01-06 08:21:09 +00:00
gbeauche
f93d1b483d - merge 680x0 emulation core with uae 0.8.17 2001-08-19 16:21:01 +00:00
cebix
20db0c7260 - 1-bit mode under X11 always uses default visual
- fixed possible crash in driver_window dtor (image data would be freed twice,
  once by XDestroyImage() and once in driver_base dtor)
- fixed compilation problems with banked memory
- fixed typos
2001-07-14 15:02:49 +00:00
gbeauche
1c6d6d7cb2 - merged some code from uae-0.8.16 2001-07-13 10:13:58 +00:00
gbeauche
cb59a85240 - Experimental fixes for 64-bit addressing systems (e.g. Linux/ia64). The
cpu emulation almost work correctly. FP emulation seems totaly boguous.
2001-07-07 09:08:54 +00:00
cebix
0cf3f32b7d video_x.cpp supports resolution switching in windowed mode: the available
resolutions are 512x384, 640x480, 800x600, 1024x768 and 1280x1024 (the prefs
editor has to be updated to reflect this). The resolution selected in the
prefs editor is used as the default, but it can be changed in the Monitors
control panel. So far only tested with direct addressing.
2001-06-28 21:20:02 +00:00
gbeauche
dae4fb627c - added SIGSEGV support for Linux/Alpha (to be checked), Darwin/PPC
- added uniform virtual memory allocation
  (supports mmap(), vm_allocate(), or fallbacks to malloc()/free())
- cleaned up memory allocation in main_unix.cpp
2001-06-26 22:35:42 +00:00
gbeauche
19cda89b5e - NEGX may use X & Z flags 2001-06-05 12:23:27 +00:00
gbeauche
fedb56d8af - fixes for gcc-3.0 2001-04-25 14:53:45 +00:00
gbeauche
ebb5be06cf - fixed operand number for source register (do_fmod) 2001-04-09 14:19:58 +00:00
cebix
3b54f1f8de - FreeBSD configure script cleanups [Michael Alyn Miller]
- ether_linux.cpp moved and renamed to ether_unix.cpp, now also works with
  the tap driver under FreeBSD [Michael Alyn Miller]
- fpu_x86_asm.h: fixed problem in with newer GCC pre-processors
2001-03-29 14:20:55 +00:00
gbeauche
6059507910 Moved FPU emulation code sources to uae_cpu/fpu/ 2001-03-20 18:05:36 +00:00
gbeauche
28b71c0972 - removed old JIT compiler, its related support functions and files
(compiler.{h,cpp})
2001-03-20 17:35:46 +00:00
gbeauche
7535a1042f Additions:
- MOVE16 (Ay)+,(xxx).L
- MOVE16 (xxx).L,(Ay)+
- MOVE16 (Ay),(xxx).L
- MOVE16 (xxx).L,(Ay)

Fixes:
- MOVE16 (Ax)+,(Ay)+ where x == y: address register shall be incremented
  only once
- CINV, CPUSH: 'p' field matches correctly the instruction 'cache field'
2001-03-19 13:11:40 +00:00
cebix
4785ea2b9a fixed compilation problems under BeOS 2001-02-09 20:04:15 +00:00
cebix
c23567ab14 - bumped version number to 0.9
- updated copyright dates
2001-02-02 20:53:00 +00:00
gbeauche
d21cbd327d - From Lauri's ChangeLog: "Fixed a bug in FPU FTAN opcode (didn't pop the value
1.0 that x86 partial tangent FPTAN always pushes to stack for 8087/287
  compatibility)."
2001-01-11 13:19:30 +00:00
gbeauche
5ec4d31f86 - fixed ADDQ and SUBQ bitmasks 2000-09-22 17:22:09 +00:00
gbeauche
d3f64dcb5f - changed set/get PC to better reflect direct or real addressing modes
- removed m68k_get_pc_p()
- default to not using prefetch buffer
2000-09-22 17:21:45 +00:00
gbeauche
b7177f6932 - changed set/get PC to better reflect direct or real addressing modes 2000-09-22 17:21:25 +00:00
gbeauche
1f2183a186 - merged DIRECT_ADDRESSING and REAL_ADDRESSING
- conditionally removed unused code for direct addressing or real addressing modes
2000-09-22 17:20:33 +00:00
gbeauche
b25e3eef89 - fixed 15 and 16 bpp frame_host_* functions for big endian systems
- conditionally removed unused code for direct addressing or real addressing modes
2000-09-22 17:20:01 +00:00
gbeauche
21822f8745 - removed generation of unused handlers in direct or real addressing modes
(no prefetch buffer, nor exception 3 handling)
2000-09-22 17:19:12 +00:00
gbeauche
51c093134b - removed memory access functions for real addressing and included <memory.h>
instead
- added Host2MacAddr
2000-09-22 17:18:46 +00:00
gbeauche
86832e0d1a - added memory initilization for direct addressing (MEMBaseDiff) 2000-09-22 17:18:15 +00:00
gbeauche
9b2887536f Ported Lauri's FPU core to GCC/i386 2000-09-05 16:54:42 +00:00
gbeauche
fdf9c9938a - added FPU initialization routines 2000-09-05 16:53:47 +00:00
gbeauche
fbc2092471 - updated init_m68k with fpu_init() and fpu_set_integral_fpu() calls
- added exit_m68k() and handle deinitialization of the FPU
- updated m68k_reset to call fpu_reset()
2000-09-05 16:53:19 +00:00
gbeauche
e1724ba3d3 - added some prototypes for the new FPU core 2000-09-05 16:52:34 +00:00
gbeauche
0ca8dcaf08 - added call to exit_m68k() 2000-09-05 16:52:10 +00:00
cebix
2bebaceabc - fixed compilation problem under Linux
- TriggerNMI() declaration moved to cpu_emulation.h
2000-08-22 12:44:30 +00:00
cebix
de3164ecc0 - AmigaOS bug fixes by J.Lachmann (floppy, 2060scsi.device, "Add Volume" in
prefs editor)
- imported some changes from the Windows source (1Hz interrupt, FPU fixes)
2000-07-14 21:29:16 +00:00
cebix
97d96bddea - updated copyright info: 1999->2000 2000-04-10 18:53:46 +00:00
cebix
ee6f4a15b9 - fixes for AmigaOS 2000-01-30 19:26:05 +00:00
cebix
29f01500c0 - minor fixes for BeOS 2000-01-30 18:55:46 +00:00
cebix
90312d104c - imported UAE CPU 0.8.10 changes
- new utility functions Mac_memset, Mac2Host_memcpy, Host2Mac_memcpu and
  Mac2Mac_memcpy
- extfs.cpp: fixed bug in fs_rename() and fs_cat_move() (auxiliary IOParam
  block was not in Mac address space)
- some provisions for using UAE CPU compiler (doesn't work yet)
1999-11-03 10:56:43 +00:00
cebix
d60bc94de7 - removed MemoryDispatch() replacement; routine from ROM is now used if
possible
- rom_patches.cpp: check for double PACK 4 resources; if only one is found,
  assume that the ROM requires an FPU and issue a warning if FPU emulation
  is turned off
- UAE CPU opcode routines no longer return the cycle count
- main_unix.cpp: pressing Ctrl-C dumps the UAE CPU state before entering mon
- sys_unix.cpp: under Linux, partition sizes are read with BLKGETSIZE instead
  of llseek()
1999-10-31 23:18:44 +00:00
cebix
b892f8850d - removed Gwenole's patches as they didn't work on SPARC V9 1999-10-28 16:52:32 +00:00
cebix
ce2610521d - new SPARC optimizations from Gwenole 1999-10-28 16:00:28 +00:00