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

RESOLVED FIXED in Firefox 65

Status

()

enhancement
P3
normal
RESOLVED FIXED
8 months ago
5 months ago

People

(Reporter: bbouvier, Assigned: bbouvier)

Tracking

(Blocks 1 bug)

Trunk
mozilla65
Points:
---

Firefox Tracking Flags

(firefox64 wontfix, firefox65 fixed)

Details

Attachments

(1 attachment)

Comment hidden (empty)
Priority: -- → P3
(Assignee)

Comment 1

5 months ago
Posted 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.

Comment 4

5 months ago
Pushed by bbouvier@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9e6f82773bdc
Implement CPU detection of LZCNT, BMI1, BMI2; r=sunfish

Comment 5

5 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9e6f82773bdc
Status: ASSIGNED → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.