-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Big Endian fixes. #13399
base: master
Are you sure you want to change the base?
Big Endian fixes. #13399
Conversation
How is performance? Do games at least generally run well, or are we sacrificing the complexity of to_le<> and LEndian<> in lots of places for mostly not great performance? I liked the previous u32_le etc. because there was almost no impact on code readability and you could just do -[Unknown] |
I had to remove the constructor to make while the non-pod struct does have its benefits, it did hide a lot of bad uses which were mostly bugs or performace loss on big endian hosts. https://github.com/hrydgard/ppsspp/blob/master/Core/HLE/HLE.cpp#L79-L93
|
if |
Well, just trying to understand the gain is all. Is there a reason we'd want a BE PSPPointer? Is it just to optimize the few cases in sceCcc where a PSPPointer is used not to directly reference memory? If we want to optimize those cases, it's probably best to convert to host pointers instead. -[Unknown] |
well I assumed a I didn't want to break the original design completely that is all, and it seemed wrong to use an |
this PR got a little more complex than I had originally planned, so I've decided to nuke it all and start over! the only immediate downside was that I had to name two structs in an unnamed union. |
5010d10
to
3d1c20e
Compare
also allow using the scalar_storage_order attribute to enforce endianess (gcc only).
struct { | ||
u32_le ra; | ||
u32_le v0; | ||
u32_le v1; | ||
}; | ||
} regs; | ||
}; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this struct ever read by non native code ? because, as the name suggests, it is HLE, so even if the data lives in psp memory, it might not necessarily need to be little endian.
I did test it briefly with native types and nothing collapsed, so maybe that's the much simpler solution to this as opposed to naming the structs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I think that might be fine indeed... Although, savestate compatibility might suffer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah savestates. even if they might not be entirely endian safe right now, let's not make the matter worse.
ok better to leave it like this then I guess...
variables to their native types when used as parameters in GenericLog calls.
Got a bunch of this merged in #14180, as well as a few extra missing ones with index/vertex decoding. Unfortunately, that means this'll need a rebase. -[Unknown] |
Hi @aliaspider, I saw this PR and I thought I'd give building upstream on my G5 Quad.
What platform are you targeting for this big endian work? |
I've subsequently pulled in your branch @aliaspider and applied my changes and now I get the following error
I'm not sure if this is a better error or a worse one than the one I tried on upstream. It does appear to get further in the build process mind you (67% vs. 38%). |
Those are fixes I pulled from my Wii-U branch (32-bit PowerPC 750), but it should still build for your target platform too. also keep in mind that this PR isn't a complete solution, so don't expect it to actually run even if it builds. |
this PR focuses mostly on the simple / functional big endian fixes to get those out of the way first.
gfx and audio problems are a bit more complex and were deliberately left out. they can be addressed better later on with separate PRs.