i’m looking at https://github.com/llvm-mirror/llvm/blob/master/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp#L2107 but i don’t quite understand the comment. how is it possible for a target not to support an operation and yet support a type? can someone give an example. i realize the question might sound silly, but i’m not really getting it.
any help is appreciated.
A type is "supported" (i.e. legal) if there is a register that can hold it. Specifically, if there is a register class associated with that type. A support of an operation means that there is an instruction (or a short sequence of instructions) that implements given operation.
For example, a target can have 128-bit registers, but the only instructions that use them may be load, store and an arithmetic "add". In such a case, i128 is a supported type, but a "sub" operation on 128-bit values is not.