[llvm-dev] supporting a type but not supporting an operaion

Krzysztof Parzyszek via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 23 11:55:58 PDT 2016

On 3/23/2016 1:51 PM, Rail Shafigulin via llvm-dev wrote:
> 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.

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.


Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation

More information about the llvm-dev mailing list