Skip to content

Conversation

@tannergooding
Copy link
Member

@tannergooding tannergooding commented Jun 27, 2025

Most hardware we run on is currently VEX capable and we can spend a decent amount of time simply copying the instruction names into a temporary buffer just to add the v prefix.

This cleans that up by defaulting the instruction tables to have the v prefixed name already and to instead simply return that + 1 in the case we're in a legacy hardware scenario.

It also makes it easier to add instructions with pseudo names in the future.

@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 27, 2025
@dotnet-policy-service
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 27, 2025 22:47
Copilot AI review requested due to automatic review settings June 27, 2025 22:47
Copy link
Contributor

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 refactors the disassembly output path for x86 instructions by precomputing pseudo-names for instructions, reducing unnecessary string copying in the common VEX path and simplifying the legacy hardware fallback.

  • Introduces a new flag (INS_FLAGS_HasPseudoName) in the instruction flags.
  • Updates display name generation in instr.cpp to remove redundant prefix operations.
  • Refactors checks for pseudo-names in emitxarch.cpp and exposes the helper via codegeninterface.h.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
src/coreclr/jit/instr.h Added a new flag to mark instructions with a pseudo display name.
src/coreclr/jit/instr.cpp Refactored display name functions with new lambdas and logic.
src/coreclr/jit/emitxarch.cpp Simplified dispatch for instructions with pseudo names.
src/coreclr/jit/codegeninterface.h Declared the new instHasPseudoName helper.

@tannergooding
Copy link
Member Author

CC. @dotnet/jit-contrib, small refactoring to make the instruction name fixups easier to understand and maintain. Reduces the amount of string copying for a typical jit disasm output by a decent amount as well.

@tannergooding tannergooding merged commit 774ba97 into dotnet:main Jul 1, 2025
110 of 112 checks passed
@tannergooding tannergooding deleted the disasm-improv branch July 1, 2025 14:31
@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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