Skip to content

Native Apple Silicon Support - Part 1 - #11364

Merged
stenzek merged 16 commits into
PCSX2:masterfrom
stenzek:mac
Jun 14, 2024
Merged

Native Apple Silicon Support - Part 1#11364
stenzek merged 16 commits into
PCSX2:masterfrom
stenzek:mac

Conversation

@stenzek

@stenzek stenzek commented Jun 9, 2024

Copy link
Copy Markdown
Contributor

Description of Changes

This PR is the first part of adding native Apple Silicon support for PCSX2. I'm keeping the thread locked to prevent any shenanigans.

Apple CPUs will be the only supported architecture.

Windows support is there, so if one day I get my hands on a Snapdragon Elite device, we can look at adding support for it. But I don't really feel like spending $1,500 or whatever out of pocket again for a platform that could once again flop, since obviously I can't run Windows outside of a VM on my MacBook :-).

Linux-wise, PCSX2 will support running in a VM on MacOS, as well as bare metal on Asahi Linux. No other distributions of Linux will be supported.

Apple Silicon support is still incomplete. There are no EE/VU/IOP recompilers yet.

I am not promising any date for the completion of them. Do not hassle me or any of the other team members.

The "current" version I have is quite... messy, and duplicates a ton of code. Such duplication all has to be moved out to common code first, before it can be merged. I'm PR'ing all the non-duplicate code first, so that we can make sure x86 doesn't regress, and work on optimizing the scanline JIT, which I have spent some time on, but it's definitely not optimal yet.

Rationale behind Changes

2-3x performance improvement depending on the game on Apple Silicon once the EE/VU/IOP recs are added. Honestly, Rosetta is very impressive, but that's still enough of a performance hit to make games like GoW2 drop below full speed at times.

Suggested Testing Steps

Make sure x86 performance is unaffected. Someone will need to test "real" Intel MacOS, I don't trust Rosetta for this.

@PCSX2 PCSX2 locked as resolved and limited conversation to collaborators Jun 9, 2024

@TellowKrinkle TellowKrinkle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, haven't tested

Comment on lines +192 to +201
template <typename T>
static std::optional<T> sysctlbyname_T(const char* name)
{
T output = 0;
size_t output_size = sizeof(output);
if (sysctlbyname(name, &output, &output_size, nullptr, 0) != 0)
return std::nullopt;

return output;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well switch the systctlbyname_u32 stuff above to use this as well

@stenzek
stenzek merged commit 8a18403 into PCSX2:master Jun 14, 2024
@stenzek
stenzek deleted the mac branch June 14, 2024 07:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants