Commit 3f9c78f
[EraVM] Drop repeated instruction operands definitions from *.td files
Do not repeat in/out dags and operand strings in definition of each
particular instruction. Most of the times, instruction class already
defines fields such as `bits<4> rs0` and hooks them to encoded fields
(such as `Src0`), and then dags and operand string mirror these
definitions. In a few places definitions are custom enough (such as
eight variants of jump instruction) - in that case a more flexible way
to describe the operands is exposed.
Several `Ixx_x` classes are split into r- and p-versions of operands:
both are register operands but the former is `GR256` register and
the latter is `GRPTR`. For example, `ADDrrr_s` is an instance of
`Irr_r` class and `PTR_ADDrrr_s` is an instance of `Ipr_p` class.
A number of shortcuts are defined for specifying an operand (except
for the special `${cc}` predicate): `EraVMOperand` tablegen class
incapsulates both operand string and in/out dags (actually, one of the
two dags is always empty and the other defines exactly one operand).
For example, the output register of `PTR_ADDrrr_s` is `rd0_ptr`
defined as `EraVMOperand<"$rd0", (ins), (outs GRPTR:$rd0)>`.1 parent 9bc8c47 commit 3f9c78f
File tree
2 files changed
+347
-538
lines changed- llvm/lib/Target/EraVM
2 files changed
+347
-538
lines changed
0 commit comments