Don't force byte regs for indir address#16727
Conversation
|
This came up in the process of eliminating TreeNodeInfo (#16517). Indirections that load a byte value don't need a byte register for the address. |
|
@dotnet/jit-contrib PTAL |
| GenTree* op = tree->gtOp.gtOp1; | ||
| if (op != nullptr) | ||
| // We need byte registers on the operands of most simple operators that produce a byte result. | ||
| // However, indirections are simple operators but do not require their address in a byte register. |
There was a problem hiding this comment.
In which cases does indirection produce byte results?
There was a problem hiding this comment.
If the indirection is loading a byte from memory (e.g. a field of a struct), it will be of type byte. The register it loads into must be a byte register, but the address need not be.
There was a problem hiding this comment.
Hmm, usually an indirection of type byte/ubyte will generate a movsx/movzx instruction. In that case you don't need a byte register, the destination register is really a 32 bit register.
No description provided.