Commit graph

28 commits

Author SHA1 Message Date
skidau
c584bd5333 LLE JIT: Added simple block linking at immediate CALL's and JUMP's. The code checks if the block being jump to has already been compiled and jumps there if it has, bypassing the dispatcher. This results in a speed-up of around 7 - 10%.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6585 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-15 07:08:36 +00:00
skidau
f67afb4fca LLE JIT:
* Optimised the updating of g_dsp.pc in the compile loop (code by kiesel-stein)
* Added JIT version of LRI (code by kiesel-stein)
* Added JIT versions of the branch instructions (code by Jack Frost)
* DSP_SendAIBuffer fix (code by Mylek)
* Marked instructions that update g_dsp.pc in the DSP table and updated PC based on the table (speed up)
* Fixed the signed bits not being set properly in the addr instruction
* Created a MainOpFallback function to use interpreted versions of the instructions if necessary (code by kiesel-stein)
* Disabled the jit versions of subarn and addarn as they are slowing down NSMBW

The above work in both x86 and x64 modes.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6582 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-12-15 01:42:32 +00:00
Glenn Rice
fb9387a38e Fix for linux screensaver inhibit caused by a misinterpretation of the window id.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6493 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-28 17:23:13 +00:00
pierre
f370650660 Fix the ASM dispatcher to work with linux 64
ESI is not available as callee save register on linux 64, so use R12, which
is available on windows 64, too. The only callee save register still available on
all platforms is EBP, but i guess we don't want to fiddle with that one.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6492 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-28 16:29:58 +00:00
skidau
c79f41d114 LLE JIT: Speed up the dispatcher by removing the compiled block check. Initialised the blocks with a stub which calls the compiler.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6490 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-28 13:06:52 +00:00
skidau
93a901dd1d LLE JIT: Speed up the dispatcher by removing one of the cycle checks. This results in the DSP executing cycles slightly above what it is supposed to. This is not a problem currently but might be later on.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6489 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-28 12:28:03 +00:00
skidau
9c1fb241c7 LLE JIT: Speed up the idle skip detection by moving the logic into the block and removing it from the dispatcher. This works because we can detect the idle skip blocks at compile time.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6488 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-28 11:04:50 +00:00
skidau
6a6fb9cce9 LLE JIT: Added an ASM dispatcher. Should help pave the way for future optimisation.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6486 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-28 05:28:21 +00:00
pierre
2e0274dd1f Core/DSPCore: Implement Jit emitters for all extended operations.
May break things, although my testing didn't reveal any regressions.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6357 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-11-07 23:43:26 +00:00
pierre
4b9831cdce Core/DSPCore: Extended opcode handling fixes
* Make writeToBackLog private to DSPIntExtOps.cpp 
  (JIT variants of 'l and 'ln are disabled and broken as is)
* Make zeroing of the backlog conditional on doing an interpreter fallback and
  do it at a few more places
* Fix selection of cleanup for extended opcodes.
* Fix the DSP unit tests to correctly emit the function prolog/epilog
  (else EBX wouldn't be saved)
* Add a few more DSP unit tests


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6325 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-10-31 23:26:18 +00:00
pierre
6d2c35a332 Core/DSPCore: Jit: only end emitting the current block when hitting an
unconditional branch(or idle skip), emit check g_dsp.pc and return when
hitting a conditional branch.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6281 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-10-14 13:17:38 +00:00
pierre
47eb5c3416 Core/DSPCore: Only check for internal exceptions in DSPEmitter::checkException, but
call it for every instruction, like in DSPInterpreter::Step. Fix the analysis lookups
for DSP_IDLE_SKIP and DSP_LOOP_END.

After this patch, the block_size and the return value from the block always match,
except when an internal exception is detected. This will change in a later patch,
so we actually get some benefits from checking if we need to call HandleLoop().


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6280 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-10-14 11:37:59 +00:00
pierre
e9d91fb9f3 Core/DSPCore: Initialise all of the code blocks
It is pure luck that we did get a fresh (thus zeroed) memory area when not putting DSPLLE on thread. ClearIRAM() is supposed to only clear the non-static part.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6278 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-10-13 21:07:16 +00:00
pierre
34909ecebc Core/DSPCore: Make the JIT blocks return the number of cycles executed.
The block_size seems to be not reliable, even after trying to more closely match
the interpreter by looking at the analysis for (addr+opcode->size-1) for detecting
the end of the block.

Since we need to "calculate" this number shortly before returning to
RunForCycles, it seemed logical to use the (up to now) unused return value
of the blocks.

Improves SMG2 here.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6266 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-10-09 21:43:57 +00:00
pierre
b80e207a8a Core/DSPCore: Make JIT work on 64 bit hosts
This is the safe variant that does not assume other
functions use R11 for &g_dsp.r, which they actually do.
So there is a lot unnecessary reloading of the register
getting emitted.

There are a few small changes exploiting pointers known
at emission time and making use of MComplex math.

Also renames m_LLEplaying to m_AIplaying in Core/AudioCommon.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6245 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-10-01 23:23:13 +00:00
j4ck.fr0st
89c4068663 Fix a bug in DSP Jit where branches had a blockSize of zero.
Add some useful checking to J_CC/SetJumpTarget.
Refactor increment/decrement and reuse code with increase/decrease.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5816 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-06-30 16:17:20 +00:00
hrydgard
a88e09edc2 DSPLLE: followup to last change: bugfix + remove extraneous exception checks
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5542 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-05-29 21:43:46 +00:00
hrydgard
1d1b08a091 Core audio system work (Watch for regressions please!):
* Restore Audio Throttle to function properly, broken by Ayuanx many hundreds of revisions back. 
* Simplify DSPLLE JIT dispatcher in preparation for an asm rewrite
* Remove hack that made DSPLLE JIT seem faster than it was by running fewer cycles, but resulting in bad sound. This shows off how mysteriously slow it is - I don't understand why it's not faster. Use the DSPLLE interpreter for now if you want to use DSPLLE.
* Made "DSPLLE on Thread" work properly with correct-ish timing - although the speed benefit is really small now.

If it seems like this change slows anything non-LLE down, try turning off Audio Throttle and use the frame limiter in options instead.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5541 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-05-29 21:34:34 +00:00
hrydgard
659d5705c9 DSPLLE: Some cleanup. Possibly very small speed increase.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5535 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-05-29 18:22:50 +00:00
nakeee
de081d0900 DSP jit: fixed some crash by pop/push (close to bhaal's solution)
If it breaks 64bit you know what to uncomment :-)



git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5400 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-23 08:15:00 +00:00
nakeee
d86167961c DSP Jit enable ls* and sl* in jit.
Anyone feel like helping with the unit test?


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5390 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-19 13:29:05 +00:00
nakeee
282cf6c6b5 DSP jit: 'mv 's 'sn are now jitted. Added
void pushExtValueFromReg(u16 dreg, u16 sreg);
	void popExtValueToReg();
instead of the backlog.
Someone might want to add it to the Unit test


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5389 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-19 13:02:24 +00:00
nakeee
3fb80c52af DSP LLE: trying to clean up exception handling. Hopefully it didn't break anything
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5381 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-17 20:42:39 +00:00
nakeee
ebac492716 DSP Jit some code cleanup
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5376 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-16 10:50:52 +00:00
skidau
122d5e7b4e Fixed the crash in DSP LLE JIT on x64 by aligning the stack.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5357 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-13 10:18:05 +00:00
nakeee
d950726041 DSP Jit: Jit some more AR action and added compile SR which suppose to hold the status for
flags such as S40 which we can use to optimize compile.



git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5331 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-11 18:06:29 +00:00
nakeee
91c6f5acba DSP Jit removed useless push/pop (at least I hope they were useless).
enabled nr in jit after getting skid_au's help in writing the inscrease_addr_reg.
ector can you please take a look and see if the loop code makes sense? it seems
no one it really sure how loops suppose to work in jit 


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5301 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-09 15:11:02 +00:00
nakeee
499936561a DSP LLE Jit, joined work with XK and skidu.
VERY EXPERIMENTAL DON'T EXPECT HIGH PERFORMANCE!.



git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5288 8ced0084-cf51-0410-be5f-012b33b47a6e
2010-04-07 15:04:45 +00:00