5 Commits

Author SHA1 Message Date
Matt Arsenault
9b88cd9945
CodeGen: Remove PointerLikeRegClass handling from codegen (#159883)
All uses have been migrated to RegClassByHwMode. This is now
an implementation detail of InstrInfoEmitter for pseudoinstructions.
2025-11-26 10:14:37 -05:00
Sergei Barannikov
6a43c669d1
[TableGen][DecoderEmitter][RISCV] Always handle bits<0> (#159951)
Previously, `bits<0>` only had effect if `ignore-non-decodable-operands`
wasn't specified. Handle it even if the option was specified. This
should allow for a smoother transition to the option removed.

The change revealed a couple of inaccuracies in RISCV compressed
instruction definitions.
* `C_ADDI4SPN` has `bits<5> rs1` field, but `rs1` is not encoded. It
should be `bits<0>`.
* `C_ADDI16SP` has `bits<5> rd` in the base class, but it is unused
since `Inst{11-7}` is overwritten with constant bits.
We should instead set `rd = 2` and `Inst{11-7} = rd`. There are a couple
of alternative fixes, but this one is the shortest.
2025-09-22 20:50:17 +03:00
Sergei Barannikov
386301cd5c
[TableGen] Remove unused Target from InstructionEncoding methods (NFC) (#159833) 2025-09-20 03:05:55 +03:00
Matt Arsenault
6b54c92be0
CodeGen: Add RegisterClass by HwMode (#158269)
This is a generalization of the LookupPtrRegClass mechanism.
AMDGPU has several use cases for swapping the register class of
instruction operands based on the subtarget, but none of them
really fit into the box of being pointer-like.

The current system requires manual management of an arbitrary integer
ID. For the AMDGPU use case, this would end up being around 40 new
entries to manage.

This just introduces the base infrastructure. I have ports of all
the target specific usage of PointerLikeRegClass ready.
2025-09-19 20:08:51 +09:00
Sergei Barannikov
de8030e63c
[TableGen] Extract InstructionEncoding class into a separate file (NFC) (#158505)
So that it can be used in CodeEmitterGen / VarLenCodeEmitterGen.
2025-09-15 21:17:54 +03:00