[llvm-commits] [llvm] r74964 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp test/CodeGen/X86/vec_compare.ll

Eli Friedman eli.friedman at gmail.com
Thu Jul 9 11:39:33 PDT 2009


On Thu, Jul 9, 2009 at 11:21 AM, Dan Gohman<gohman at apple.com> wrote:
> This change to EXTRACT_VECTOR_ELT seems like a good idea -- it nicely
> mirrors INSERT_VECTOR_ELT, and the ARM target may have a use for it.

Okay, cool.

> The main question is what type of extension it does -- sign, zero, or
> any? It appears the answer is currently any

Correct.

> though that doesn't sound
> correct here, since i1 values promoted to i8 are usually required to
> be zero-extended. Would it make sense to define EXTRACT_VECTOR_ELT as
> explicitly using zero-extension?

There is no such guarantee in general; promoted values are in general
any-extended by legalization.  I think there are some narrow
guarantees for loads and stores, but that isn't really relevant here.

> For the ARM target, we could then define a separate
> EXTRACT_VECTOR_ELT_SEXT, as it needs both.

That isn't really necessary either way: you can just pattern-match a
sext_in_reg of an extract_vector_elt to the appropriate instruction.

-Eli



More information about the llvm-commits mailing list