Commit Graph

45 Commits

Author SHA1 Message Date
Alexei Svitkine
b150b42fc6 Fix some string conversion warnings. 2017-12-10 11:27:08 -05:00
James Touton
73f3af6c3b gencomp builds cleanly (and produces clean-building code) on MSVC. 2015-08-06 01:28:01 -07:00
gbeauche
c8cb4879a4 Happy New Year! 2008-01-01 09:40:36 +00:00
gbeauche
9c13d5cda9 Implement CMOV.B and CMOV.W translations. Only the latter has a native
x86 equivalent however.
2007-06-29 16:36:03 +00:00
gbeauche
b05833a86b Fix JIT for 68020/68030 emulation mode. 2007-06-15 08:09:01 +00:00
gbeauche
3f535d30da Add support for comma-separated elements in "jitblacklist" item. 2007-06-15 07:55:03 +00:00
gbeauche
2e95c43bf2 Remove the 33-bit addressing hack as it's overly complex for not much gain.
Rather, use an address override prefix (0x67) though Intel Core optimization
reference guide says to avoid LCP prefixes. In practise, impact on performance
is measurably marginal on e.g. Speedometer tests.
2007-01-13 18:21:30 +00:00
gbeauche
24af8d27c3 Fix for LAZY_FLUSH_ICACHE_RANGE. Blocks are indexed by native addresses. 2006-05-08 16:56:07 +00:00
gbeauche
dbc467e316 prefer lower indexes in register allocation, this avoids REX prefixes on
x86_64 when %r8 - %r15 are used (very light speedup expected)
2006-02-26 18:58:18 +00:00
gbeauche
12f103a83a JIT generated code is not guaranteed to be leaf, e.g. there could be a call
to a generic instruction handler (untranslated code). This caused problems
on MacOS X for Intel where the unaligned stack conditions turned out to be
more visible. Performance loss is really neglectable and this is the right
fix now anyway.
2006-01-16 21:31:08 +00:00
gbeauche
1b99c9501f fix stack alignment (theoritically but it was OK in practise) in generated
functions, move m68k_compile_execute() to compiler/ dir since it's JIT
generic and it now depends on USE_PUSH_POP (as it should)
2006-01-15 22:42:51 +00:00
gbeauche
0f0b06b099 Much improved responsiveness on NetBSD systems.
On those systems, it's really hard to get high resolution timings and the
system oftens fails to honour a timeout in less than 20 ms. The idea here
is to have an average m68k instruction count (countdown quantum) that
triggers real interrupt checks. The quantum is calibrated every 10 ticks
and has a 1000 Hz resolution on average.
2005-06-11 06:43:24 +00:00
gbeauche
c0cc43a87b Really make translation through constant jumps functional. This can be
disabled with the new prefs item "jitinline". Some rapid Speedometer 4
benchmarks showed only a 4% improvement.
2005-06-06 19:22:56 +00:00
gbeauche
08c4acd21f Enable FLIGHT_RECORDER for generated code but don't record registers in
that case (yet).
2005-06-04 16:47:14 +00:00
gbeauche
380a9ed970 ensure allocated code fits under 32-bit boundaries 2005-04-24 23:02:48 +00:00
gbeauche
57169c7923 Recognize lahf_lm from Dual Core Opterons. This enables use of LAHF/SETO
instructions in long mode (64-bit). However, there seems to be another bug
in the JIT preventing it from being fully supported. m68k.h & codegen_x86.h
are easily fixed bug another patch is still needed.
2005-04-21 09:08:57 +00:00
gbeauche
30632aed4f Happy New Year! 2005-01-30 21:42:16 +00:00
gbeauche
a6bf2d0928 add some code to gather stats on m68k registers used in translated blocks 2004-11-20 23:35:16 +00:00
gbeauche
20f5f531ca fix inline dispatcher to really generate a cmove on x86-64 (silly bug!) 2004-11-08 23:24:54 +00:00
gbeauche
0c255e1fbd Merge BSF simulation on P4 from Amithlon. Use 33-bit memory addressing model. 2004-11-08 21:10:46 +00:00
gbeauche
c21650b7a8 fix protection changes on translation cache + cosmetic fixlet 2004-11-02 23:52:00 +00:00
gbeauche
e58fbc745b revive and fix almost two-year old port to x86_64 2004-11-01 16:01:51 +00:00
cebix
9e7932abf0 Happy New Year! :) 2004-01-12 15:29:31 +00:00
gbeauche
45df157a5e Implement lazy icache range invalidation. Disable for now until it shows
a real benefit over only 2%
2003-11-21 14:20:01 +00:00
gbeauche
309c2f0bd5 Add "jitblacklist" prefs item so that opcodes ranges could be excluded for
translation. This should help debugging of (badly) translated code.

Usage: jitblacklist xxxx(-yyyy)?(;xxxx(-yyyy)?)*
where xxxx/yyyy are hexadecimal numbers
2003-10-14 10:29:19 +00:00
gbeauche
b66f5972f9 Make sure a 32-bit B2/JIT works reasonnably well on AMD64 too. This implies
to force RAMBaseHost < 0x80000000. This is empirically determined to work on
Linux/x86 and Linux/amd64.
2003-10-03 18:18:15 +00:00
gbeauche
87e4d48b3e flags are live after a call to fflags_into_flags_internal() 2003-10-02 09:51:14 +00:00
gbeauche
9ed554b3a9 Remove some dead code. Start implementation of optimized calls to interpretive
fallbacks for untranslatable instruction handlers. Disabled for now since
call_m_01() is not correctly imeplemented yet.
2003-03-21 19:12:44 +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
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
0a201217bf Remove obsolete CFLOW_* constants but keep cpuop_{begin,end} for an
inline-threaded core.
2002-11-02 18:13:29 +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
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
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
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
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
c0526db089 Import JIT compiler 2002-09-17 16:04:06 +00:00