Skip to content

Add special cases in the x64 emit_cmp helper #5869

@elliottt

Description

@elliottt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cranelift:E-easyIssues suitable for newcomers to investigate, including Rust newcomers!cranelift:area:x64Issues related to x64 codegengood first issueIssues that are good for new contributors to tackle!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions