Closed Bug 1488726 Opened 6 years ago Closed 6 years ago

x86: Implement CPU feature detection for bmi1, bmi2, lzcnt

Categories

(Core :: JavaScript Engine: JIT, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox64 --- wontfix
firefox65 --- fixed

People

(Reporter: bbouvier, Assigned: bbouvier)

References

Details

Attachments

(1 file)

      No description provided.
Priority: -- → P3
Attached patch fix.patchSplinter Review
This also refactors cpuid reading so we can pass it specific eax input values, and implements detection for these features accordingly.

I actually wonder if it wouldn't make more sense for Cranelift to do this itself? In the meanwhile, that's an easy thing to implement in Spidermonkey. It's a bit sad we have a few implementations of ReadCPUInfo in tree, but the other ones are part of embedded libraries if I understand correctly.
Assignee: nobody → bbouvier
Status: NEW → ASSIGNED
Attachment #9023607 - Flags: review?(sunfish)
Comment on attachment 9023607 [details] [diff] [review]
fix.patch

Review of attachment 9023607 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good!
Attachment #9023607 - Flags: review?(sunfish) → review+
Cranelift has cranelift-native which can do CPU feature detection, but using SpiderMonkey's has the advantage of using SpiderMonkey's existing command-line flags for enabling/disabling use of various features, like --no-sse3.
Pushed by bbouvier@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9e6f82773bdc
Implement CPU detection of LZCNT, BMI1, BMI2; r=sunfish
https://hg.mozilla.org/mozilla-central/rev/9e6f82773bdc
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: