[LLVMdev] More AVX Advice Needed
eli.friedman at gmail.com
Wed Dec 2 15:24:18 PST 2009
On Wed, Dec 2, 2009 at 3:08 PM, David Greene <dag at cray.com> wrote:
> On Wednesday 02 December 2009 16:51, Eli Friedman wrote:
>> On Wed, Dec 2, 2009 at 2:44 PM, David Greene <dag at cray.com> wrote:
>> > I'm working on some of the AVX insert/extract instructions. They're
>> > stupid. They do not operate on ymm registers, meaning we have to
>> > use VINSERTF128/VEXTRACTF128 and then do the real operation.
>> > Anyway, I'm looking at how INSERTPS and friends work and noticed that
>> > there are special SelectionDAG nodes for them and corresponding TableGen
>> > dag operators (X86insrtps, for example).
>> > What's the reason for using special dag operators as opposed to
>> > intrinsics?
>> INSERTPS isn't an intrinsic because there's a standard way to
>> represent the operation, and we try to avoid adding intrinsics when
> I don't get it. How is X86insrtps "standard?" It looks just like an
> intrinsic to me.
X86insrtps is roughly equivalent to the LLVM IR instruction
insertelement, so there's no need for an IR intrinsic.
X86ISD::INSERTPS is an extra instruction for ISel; it's used inside
the custom lowering for INSERT_VECTOR_ELT and VECTOR_SHUFFLE.
More information about the llvm-dev