-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add special cases in the x64 emit_cmp helper #5869
Copy link
Copy link
Closed
Labels
cranelift:E-easyIssues suitable for newcomers to investigate, including Rust newcomers!Issues suitable for newcomers to investigate, including Rust newcomers!cranelift:area:x64Issues related to x64 codegenIssues related to x64 codegengood first issueIssues that are good for new contributors to tackle!Issues that are good for new contributors to tackle!
Description
Feature
The x64 backend has a helper named emit_cmp in inst.isle that is used when emitting comparisons. Currently it will always use x64_cmp to emit the comparison, but for cases of equality comparisons with 0, x64_test would be a better choice. Additionally, the select lowering does not use emit_cmp right now, and could be refactored to do so with this change in place.
Benefit
This will generate better code for cases where emit_cmp is used to compile a use of icmp in the x64 backend.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
cranelift:E-easyIssues suitable for newcomers to investigate, including Rust newcomers!Issues suitable for newcomers to investigate, including Rust newcomers!cranelift:area:x64Issues related to x64 codegenIssues related to x64 codegengood first issueIssues that are good for new contributors to tackle!Issues that are good for new contributors to tackle!