Skip to content

Use the better pseudo-names where available on xarch #116923

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

Merged
merged 4 commits into from
Jun 25, 2025

Conversation

tannergooding
Copy link
Member

The vector comparison instructions all have preferred pseudo-names that make the disasm easier to read. We should prefer using them

@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 23, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@tannergooding tannergooding marked this pull request as ready for review June 23, 2025 18:20
@Copilot Copilot AI review requested due to automatic review settings June 23, 2025 18:20
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances disassembly readability by using preferred pseudo-names for various x86/x64 vector comparison and carry-less multiplication instructions.

  • Introduces fltCmpOpNames and intCmpOpNames arrays for mapping immediates to mnemonic suffixes.
  • Updates genInsDisplayName to format vcmp* and vpcmp* instructions using those pseudo-names.
  • Adjusts emitDispIns to skip printing immediates for the newly supported instructions.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
instr.cpp Added pseudo-name arrays and switch handling for VEX/EVEX instructions in genInsDisplayName.
emitxarch.cpp Modified PRINT_CONSTANT path to omit immediates for the new pseudo-named instructions.
Comments suppressed due to low confidence (1)

src/coreclr/jit/instr.cpp:121

  • There don't appear to be unit tests verifying that each immediate value correctly maps to its pseudo-name; consider adding tests for a few representative values (e.g., control=0, 3, 7) for each instruction to ensure coverage.
    static const char* const fltCmpOpNames[] = {

@tannergooding
Copy link
Member Author

CC. @dotnet/jit-contrib for review.

Some minor cleanup to the xarch disasm output to make vector comparisons more readable by using the friendly pseudo-names where available. As part of that, it refactored the general logic for displaying a constant from a bunch of goto PRINT_CONSTANT into a reusable helper method that utilizes the relevant instrDesc queries instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants