I am new to LLVM but working on some toy SVE extensions through intrinsics.
I find the DestructiveInstTypeEnum hard to decrypt. It seems to convey information about operands.
But I cannot figure out things like DestructiveBinaryComm vs DestructiveBinaryCommWithRev, which are used in ADD_ZPmZ and SUB_ZPmZ respectively.
Are they affecting instruction selections? This enum seems to be in TSFlags, but I don’t know what these flags do either.
I intend to use DestructiveOther for most of my toy ZPmZ instructions. Would there be issues?
Help is appreciated!
AArch64InstrFormats.td:
// Enum describing whether an instruction is
// destructive in its first source operand.
class DestructiveInstTypeEnum<bits<4> val> {
bits<4> Value = val;
}
def NotDestructive : DestructiveInstTypeEnum<0>;
// Destructive in its first operand and can be MOVPRFX'd, but has no other
// special properties.
def DestructiveOther : DestructiveInstTypeEnum<1>;
def DestructiveUnary : DestructiveInstTypeEnum<2>;
def DestructiveBinaryImm : DestructiveInstTypeEnum<3>;
def DestructiveBinaryShImmUnpred : DestructiveInstTypeEnum<4>;
def DestructiveBinary : DestructiveInstTypeEnum<5>;
def DestructiveBinaryComm : DestructiveInstTypeEnum<6>;
def DestructiveBinaryCommWithRev : DestructiveInstTypeEnum<7>;
def DestructiveTernaryCommWithRev : DestructiveInstTypeEnum<8>;
def DestructiveUnaryPassthru : DestructiveInstTypeEnum<9>;