x86_64 bit port, experimental.
#11
Thanks for explaining some important stuff, Urisma. I had all but forgotten about Air3000 (R3000, get it? hah Tongue2 ).
If I remember correctly, this was a very ambitious rewrite of our crusty IOP rec. Initially it would be an interpreter
that would run pretty fast, enabling it to replace the IOP rec. Later on it was supposed to become a recompiler as well,
for even more speed Smile

About the fastcall convention: This is squarely in Pseudonym's area of expertise and I'm sure he could help out with it.
All I know is that it's one of the calling conventions that don't exist on x64 anymore.
Reply

Sponsored links

#12
Thanks for explanation indeed Smile
Hmm fastcall is dead yep, but basically it's more like it's the normal one now. Basically, the idea was to use register for argument passing if I am not wrong. Nowadays there are more registers so I guess it is used by default. Simply, before there were only 4 general purpose registers, so it gave quite a limit. Now there are 12. Hmm it looks very interesting, I look a litlle into it, I will try to use it, However I will concentrate on r5900/emitter for now. Maybe I will expand it for the r5900 too.
Laptop: Arch Linux x86_64
CPU :Core i3-3217U @ 1.8Ghz
GPU: intel HD4000
4GO RAM DDR3-1600Mhz
Desktop: Arch Linux x86_64
CPU : Core i7 2600k @ 4.1Ghz
GPU : Nvidia GTX 770 OC Gigabyte
8GO Ram dual channel DDR3-1600 Mhz
Reply
#13
So, I look into the old 64 bits code. The problem is, it does not look like anything now(date from 7 years actually...) Why was it removed by the way?
Well, anyway, my problem is that I can not really identify anything I could use there, there is some kind of r5900 stuff also, but I have no way of finding the code emmiter there.. Which would be quite useful, because right now this one is pissing me off... Was there one at that time? Or all was mixed? Did it actually work? I guess so beacuse I found it in a "stable" release(0.9.1).
Thanks for the help Wink
Laptop: Arch Linux x86_64
CPU :Core i3-3217U @ 1.8Ghz
GPU: intel HD4000
4GO RAM DDR3-1600Mhz
Desktop: Arch Linux x86_64
CPU : Core i7 2600k @ 4.1Ghz
GPU : Nvidia GTX 770 OC Gigabyte
8GO Ram dual channel DDR3-1600 Mhz
Reply
#14
(11-26-2014, 08:59 PM)rama Wrote: Thanks for explaining some important stuff, Urisma. I had all but forgotten about Air3000 (R3000, get it? hah Tongue2 ).

Lol AiR3000. That is awesome.
Reply
#15
OK, found a bit more recent version... It is still quite old, 0.9.5.. It looks a bit more like now but still... However it seems I may be able to exctract a few things from there... At least there are some structures looking a bit like now that may be useful... The registers to be saved between others... I will try to see how everything was handled... But is there no recent source where you kept 64bit somewhere under the hood but a bit more up to date?
Laptop: Arch Linux x86_64
CPU :Core i3-3217U @ 1.8Ghz
GPU: intel HD4000
4GO RAM DDR3-1600Mhz
Desktop: Arch Linux x86_64
CPU : Core i7 2600k @ 4.1Ghz
GPU : Nvidia GTX 770 OC Gigabyte
8GO Ram dual channel DDR3-1600 Mhz
Reply
#16
I have an x64 emitter from an old project of mine. It's written in C and has a very different style than PCSX2, so you'll need to wrap it in C++ or something. The link is under my repo here. The emitter is under x86emitter.c (I think). Usage can be found under x86backend.c. If you're feeling brave you can look at how I implement my intermediate language under R4400rec.c, which just makes really big token trees (I learned the technique in my compilers class. Never planning on writing a token based IL again, lol). If you need any advice or help then I'm happy to provide whatever guidance I can.
Main Rig: i5 4670k, 16GB RAM, Nvidia 770 GTX, Windows 8.1/Arch
Main Laptop: Toshiba Kirabook. i5 4200U, 8 GB RAM, windows 8.1/Arch
Reply
#17
Thanks a bunch, I will use it especially for opcodesa and all, no need to wrap, I will extract the informations I need, I will still use their emmiter for now. I will integrate x64 ability, then I will see what can be cleaned and optimized maybe... Anyway, once it emites x64 code, even in a sub optimal way, we should obtain a 64bit version I think, well, roughly anyway. I will see to refactor and optimize after. I am sure there are things which can be cleaned... Abstracting the recompilers from emiters completely would be nice...Make the code look nice and all... For abstract representation, I already have knowledge in that, anyway it's something I use already for work... I will see to use it here also, will allow to avoid dependency to emmiter and maybe optimization.
Laptop: Arch Linux x86_64
CPU :Core i3-3217U @ 1.8Ghz
GPU: intel HD4000
4GO RAM DDR3-1600Mhz
Desktop: Arch Linux x86_64
CPU : Core i7 2600k @ 4.1Ghz
GPU : Nvidia GTX 770 OC Gigabyte
8GO Ram dual channel DDR3-1600 Mhz
Reply
#18
Hi,
Just to give a little report on how things goes, first, I am quite a bit busy right now and will still be for the next two weeks I guess so I can not concentrate on it as much as I would like.
Then, I struggled with emmiter to begin to put it in shape, it is not quite ready yet but mainly because I ping pong with micro vu and iR5900 code that does not compile, I have to change a stuff threre before I can check anything, then I will probably have to go through an infinity of bug... Will be fun... However it should be doable, I will need to change a few opcodes here and there, add save register I guess as it does not seem to me that it will be done for me, not sure, at least I begin to have a global view of the code. After hopefully I can begin to optimize slightly, like using all registers and stuff like that.
Also, I would like to have an idea of the exact limit between the frontend and the backend, it seems to me that some part in x86/ix86-32/64 are actually part of the frontend, I see decoding loops and all... Also, in iR5900-32/64 what does the pc point to? it's host register? because I see fix pc increment which does not seems coherent with intel however.
Laptop: Arch Linux x86_64
CPU :Core i3-3217U @ 1.8Ghz
GPU: intel HD4000
4GO RAM DDR3-1600Mhz
Desktop: Arch Linux x86_64
CPU : Core i7 2600k @ 4.1Ghz
GPU : Nvidia GTX 770 OC Gigabyte
8GO Ram dual channel DDR3-1600 Mhz
Reply
#19
Head over to #pcsx2dev on Efnet and try to talk to pseudonym for your in depth questions.

Generally, if you see some confusing bits that shouldn't be where they are, you're most likely right.
This is caused by PCSX2's long history of different contributors rewriting parts of the emulator as
knowledge about the system increased.
There shouldn't be any real roadblocks in anymore, as those went out over the last couple years.
Reply




Users browsing this thread: 1 Guest(s)