Skip to content
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

CPUDetect: improve win/arm64 support #10876

Merged
merged 1 commit into from
Jul 26, 2022
Merged

CPUDetect: improve win/arm64 support #10876

merged 1 commit into from
Jul 26, 2022

Conversation

shuffle2
Copy link
Contributor

@shuffle2 shuffle2 commented Jul 19, 2022

  • ARM64: implement all detection for windows
  • ARM64: implement model_name detection for macos, freebsd, improve on linux
  • ARM64: report MIDR in standard format
  • x64: report Family/Model/Stepping in standard format
  • make reported summary a bit easier to parse
  • remove unused flags
  • added ARMv8 AFP detection on all non-macos platforms

Notably FMA4 is also not actually used; the emitter got support but the related ops are never used. I've only removed flags which are never referenced, so same may apply to other flags as well.


return sum;
return JoinStrings(sum, ",");
Copy link
Member

Choose a reason for hiding this comment

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

Might be better to join by ", " to keep the formatting consistent with older builds.

Copy link
Contributor Author

@shuffle2 shuffle2 Jul 23, 2022

Choose a reason for hiding this comment

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

Yea I have purposefully removed that because leading space makes it a tiny bit harder to parse the output (not that we do, but it could be nice to accumulate stats on analytics for example, to just do [feature_map[x] += 1 for x in str.split(',')] or similar).

Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't this split the CPU type stats on analytics between old formatting and new formatting? Not sure if that's a concern.

Copy link
Contributor Author

@shuffle2 shuffle2 Jul 23, 2022

Choose a reason for hiding this comment

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

Yea, and I've changed formatting of first 2 elements as well: where it used to report something like
AMD Ryzen Threadripper 3990X 64-Core Processor (AuthenticAMD)
it will now report
AMD Ryzen Threadripper 3990X 64-Core Processor,17:31:0

on windows/arm64 it will report something like
Microsoft SQ1 @ 3.0 GHz,51:D:1111:805:E

This fixes:

  1. removes trailing space in the model name string (we were not following the x64 specification and stripping padding spaces)
  2. reports the family/model/stepping information instead of the brand name, because FMS actually gives us useful information instead of the brand which is already in the model name (and the brand can be determined from the FMS ). FMS is also easily parsed and may be interesting to query server-side.
  3. on windows/arm64 nothing was reported before for model/brand. now we'll get model info.

Breaking compat with the old format doesn't seem like a huge deal to me. In the future we might change it again (e.g. on arm64 - maybe just the raw MIDR would be better, similar to FMS, because that should at least be obtainable on windows and linux).

@delroth any comment?

edit: actually to make the parsing even better, i'm going to ensure the strings reported from the processor don't include any , and always include those strings (even if empty). So it will be real csv
edit2: done

Source/Core/Common/x64CPUDetect.cpp Show resolved Hide resolved
@OatmealDome
Copy link
Member

Changes for arm64 Macs LGTM.

@phire
Copy link
Member

phire commented Jul 26, 2022

Also, I'm noticing that linux appears to put all the MIDR fields in /proc/cpuinfo as the CPU implementer/architecture/variant/part/revision fields. Parsing that might be a more sane fallback than triggering MIDR_EL1 traping/emulation on the current core

processor   : 0
model name  : ARMv7 Processor rev 3 (v7l)
BogoMIPS    : 108.00
Features    : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xd08
CPU revision    : 3

@shuffle2
Copy link
Contributor Author

personally i think parsing text is insane :D (case in point: "Hardware" line)

anyway, it will only invoke the instruction if it's advertised as supported from hwcaps.

@phire
Copy link
Member

phire commented Jul 26, 2022

Yeah, I was thinking more from a stats perspective (because that's what I'm slightly more interested in). The more sane part is because you can collect MIDR for the all cores, not just the current one.

@shuffle2
Copy link
Contributor Author

considering we're uploading a text string that (currently) we just view in grafana, it seems troublesome to start reporting a lot more text. we could dedup client side first, but it still results in the <model,cpu_id> prefix of the string becoming variable sized -> harder to parse.

read brand_string on macos/arm64
remove unused flags
report family/model info instead of vendor name
@dolphin-emu-bot
Copy link
Contributor

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

  • aeon-charge-attack on ogl-lin-radeon: diff
  • chibi-robo-fastdepth on ogl-lin-radeon: diff
  • chibi-robo-zfighting on ogl-lin-radeon: diff
  • dbz-depth on ogl-lin-radeon: diff
  • djfny-menu on ogl-lin-radeon: diff
  • DKCR-Char on ogl-lin-radeon: diff
  • ea-vp6 on ogl-lin-radeon: diff
  • find-mii on ogl-lin-radeon: diff
  • fog-adj on ogl-lin-radeon: diff
  • fortune-street on ogl-lin-radeon: diff
  • fortune-street-fog on ogl-lin-radeon: diff
  • fortune-street-white-box on ogl-lin-radeon: diff
  • fsa-layers on ogl-lin-radeon: diff
  • inverted-depth-range on ogl-lin-radeon: diff
  • kirby-shadows on ogl-lin-radeon: diff
  • line-width-test on ogl-lin-radeon: diff
  • luigi-shadows on ogl-lin-radeon: diff
  • mario-sluggers-bar on ogl-lin-radeon: diff
  • mario-tennis-menu on ogl-lin-radeon: diff
  • megaman-heat on ogl-lin-radeon: diff
  • melee-lighting on ogl-lin-radeon: diff
  • mii-channel on ogl-lin-radeon: diff
  • milotic-texture on ogl-lin-radeon: diff
  • mini-ninjas on ogl-lin-radeon: diff
  • mkdd-efb on ogl-lin-radeon: diff
  • mkwii-bluebox on ogl-lin-radeon: diff
  • monkeyball-fuse on ogl-lin-radeon: diff
  • mp7-text on ogl-lin-radeon: diff
  • mtennis-zfreeze on ogl-lin-radeon: diff
  • my-word-coach on ogl-lin-radeon: diff
  • nddemo-bumpmapping on ogl-lin-radeon: diff
  • nfsu-purplerect on ogl-lin-radeon: diff
  • nfsu-reflections on ogl-lin-radeon: diff
  • nsmbw-coins on ogl-lin-radeon: diff
  • nsmbw-intro on ogl-lin-radeon: diff
  • pm-hc-jp on ogl-lin-radeon: diff
  • puzzle-collection on ogl-lin-radeon: diff
  • pw-black-bars on ogl-lin-radeon: diff
  • rs2-glass on ogl-lin-radeon: diff
  • rs2-skybox on ogl-lin-radeon: diff
  • rs2-zfreeze on ogl-lin-radeon: diff
  • sadx-ui on ogl-lin-radeon: diff
  • sf-assault-flashing on ogl-lin-radeon: diff
  • smg2-fog on ogl-lin-radeon: diff
  • smg-marioeyes on ogl-lin-radeon: diff
  • sms-bubbles on ogl-lin-radeon: diff
  • sms-gc on ogl-lin-radeon: diff
  • soa-black on ogl-lin-radeon: diff
  • soniccolors-mm on ogl-lin-radeon: diff
  • sonicriderszg-gb on ogl-lin-radeon: diff
  • spyro-bloom on ogl-lin-radeon: diff
  • ssbm-pointsize on ogl-lin-radeon: diff
  • ss-map on ogl-lin-radeon: diff
  • super-sluggers-white-out on ogl-lin-radeon: diff
  • thps4-shadow on ogl-lin-radeon: diff
  • tos-invis-char on ogl-lin-radeon: diff
  • tsp3-pinkgrass on ogl-lin-radeon: diff
  • xenoblade-menu on ogl-lin-radeon: diff
  • zelda1-vc on ogl-lin-radeon: diff
  • ztp-grass on ogl-lin-radeon: diff
  • zww-armos on ogl-lin-radeon: diff
  • zww-water on ogl-lin-radeon: diff
  • zww-waves on ogl-lin-radeon: diff

automated-fifoci-reporter

@AdmiralCurtiss AdmiralCurtiss merged commit 6b419c7 into dolphin-emu:master Jul 26, 2022
@shuffle2 shuffle2 deleted the cpudetect branch July 31, 2022 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants