Closed GoogleCodeExporter closed 8 years ago
Note: even if the issue from revision 317 gets resolved, I'll leave this open
for the
next major x64 breakage.
Original comment by arcum42@gmail.com
on 16 Nov 2008 at 5:58
I only made two changes to the recompiler that should have affected anything
functionally. Both of those changes are in the iR3000a recompiler, and not the
iR5900 recompiler. The R3000a (IOP) has no specialized 64 bit version though,
so I
dunno what to think. The main thing I did was add a single basic ADD32ItoM
instruction after bios calls. It should have been completely harmless to the
64 bit
build. I also made some changes to how the IOP cycles through its branches
though,
and if there's some IOP code mirrored in the 64 bit folders that I'm not aware
of, it
might be the culprit.
Namely, the EEsCycles global var is handled differently now. If there's any
code in
the 64 bit build that acts on that code, then it should be double checked for
proper
mirroring of the working 32 bit code.
(this mirrored code between the recompilers of 32 and 64 bits could indeed get
old
fast -- I was looking at iR5900-64 for that matter and it appears to have a
handful
of small code cleanups and other improvements that the 32 bit version lacks, so
it
goes both ways .. it sure would be nice to only have to worry about one or the
other.)
Original comment by Jake.Stine
on 17 Nov 2008 at 4:49
The handful of minor cleanups may have been me. I committed various changes
trying to
get any changes I'd noticed had been made to iR5900-32.c in playground, and
then from
0.92 - 0.9.4, and I think I cleaned up a few minor things in there while I was
doing
that.
Since that, well, things I do in the group generally are make sure the Linux
build
keeps compiling, and mirror iR5900-32.c, any time I see changes made. In the
sections
that are the same, anyways.
I'd actually meant to apply a few cleanups to iR5900-32.c, too; I just never
got to
it. Gcc nags me about it enough to justify it.
And, you know, I bet ADD32ItoM was what did it. Half the changes to ix86.c made
in r4
broke Linux 64, and one of the ones that didn't get reverted, because it seemed
to be
working properly was ADD32ItoM. I'll have to test that, because the symptoms had
aready been reminding me of that breakage...
Original comment by arcum42@gmail.com
on 17 Nov 2008 at 12:50
Or, wait, maybe that one was reverted. Oh well, long day...
Original comment by arcum42@gmail.com
on 17 Nov 2008 at 12:53
I suspect the problem is in x86/aR3000A.S. Despite being directly in the x86
folder,
most of the file is in an ifdef applying only to x64, and makes use of
EEsCycle, so
if that's majorly changed, that could easily have affected it.
Original comment by arcum42@gmail.com
on 2 Dec 2008 at 3:33
Yeah, right around line 42, you can see in the comments that it is mirroring a
spot
in iR3000A.cpp that was changed *in assembly*. Unfortunately, assembly isn't
exactly
my strong suit...
Original comment by arcum42@gmail.com
on 2 Dec 2008 at 3:44
Try the attached patch. As you'll see the modification was simple, and I hope
it's
all that is needed. I changed the code such that the iR3000A's branchtest code
manages the EEsCycle counts, which was in part an optimization (requires one
less
while loop) and also better emulation since the branchtest codes knows better
when
exactly it should exit.
In the old method, the IOP would run indefinitely until it performed an actual
psxBranchTest call which could have been dozens or hundreds of cycles later
than what
the EE requested.
Original comment by Jake.Stine
on 2 Dec 2008 at 5:00
Attachments:
Hmmm... That's clearly on the right track, as it gets a lot further. Oddly, it
now
gets to the point of loading pnatches, passes control to ZeroGS, then quits.
Not even
with an error.
I may very well commit that change anyways, just because it's a step in the
right
direction...
Original comment by arcum42@gmail.com
on 2 Dec 2008 at 5:19
In fact, it works when applied to 317. The second break is from a later
revision...
Time for some testing...
Original comment by arcum42@gmail.com
on 2 Dec 2008 at 5:38
Now I don't know what the break was from, since I can't reproduce it with this
patch.
Oh well; I went ahead and committed.
Original comment by arcum42@gmail.com
on 2 Dec 2008 at 6:59
The Linux port is currently not broken. I will leave this open, though, as I
expect
it to break again eventually.
Original comment by arcum42@gmail.com
on 3 Dec 2008 at 11:51
Original comment by arcum42@gmail.com
on 4 Dec 2008 at 6:46
I suppose I should note here that currently both Linux ports are broken. Oh
well,
I'll figure out how to fix the linkage one of these days. Practically eveything
is
ix86 gives undefined references in x86...
Original comment by arcum42@gmail.com
on 17 Dec 2008 at 11:56
@@#!$!$%
It's all the bloody functions with _inline in front of them in ix86.c doing it.
I
just commented out all occurrances of _inline in that file, and half the linker
errors vanished. Now, to figure out a better way to get rid of them.
Presumably, its inconsistancies between ix86.h and all the million files it is a
header for doing it.
Original comment by arcum42@gmail.com
on 17 Dec 2008 at 12:30
Usually adding "extern" to the prototypes fixes _inline type linker errors.
Original comment by Jake.Stine
on 17 Dec 2008 at 2:59
They already are extern. The function declarations in the header don't mention
them
being _inline, though, and there are enough that are __forceinline, or not
inlined at
all, that I can't just do a search and replace...
Original comment by arcum42@gmail.com
on 17 Dec 2008 at 8:06
So I've got an idea of how to proceed, it's just going to be a major hassle.
Fortunately, my weekend is coming up...
Original comment by arcum42@gmail.com
on 17 Dec 2008 at 8:21
Adding _inline to prototypes shouldn't matter.
Does changing them to __forceinline fix them? Other forceinlines work, right?
Original comment by Jake.Stine
on 17 Dec 2008 at 8:34
__forceinlining them does work, so for expediency, for the moment, all _inlines
will
become __forceinlines. We can change them later if neccessary, if need be.
The other main breakers are calls to and from assembly files. I'm wrapping the
calls
to them in extern "C" for the moment. From, I'll have to look at a bit closer...
Original comment by arcum42@gmail.com
on 18 Dec 2008 at 11:32
All right, that's the 32 bit port taken care of. I still need to look at the 64
bit port.
Original comment by arcum42@gmail.com
on 18 Dec 2008 at 12:09
Original comment by arcum42@gmail.com
on 20 Dec 2008 at 8:45
Given recent announcements, I think I can close this. :(
Original comment by arcum42@gmail.com
on 25 Dec 2008 at 12:33
Original issue reported on code.google.com by
arcum42@gmail.com
on 16 Nov 2008 at 5:57