[llvm-commits] PATCH: remove VICmp and VFCmp.

Duncan Sands baldrick at free.fr
Fri Jul 10 07:25:24 PDT 2009


Hi Eli,

> So your proposal is roughly equivalent to the following patch?  Seems
> like a reasonable proposal; I wasn't quite following it originally.
> Any ideas for the wording in LangRef?
> 
> Index: llvm/DerivedTypes.h
> ===================================================================
> --- llvm/DerivedTypes.h	(revision 75201)
> +++ llvm/DerivedTypes.h	(working copy)
> @@ -431,7 +431,8 @@
> 
>    /// @brief Return the number of bits in the Vector type.
>    inline unsigned getBitWidth() const {
> -    return NumElements *getElementType()->getPrimitiveSizeInBits();
> +    return NumElements *
> +           ((getElementType()->getPrimitiveSizeInBits() + 7) & -8);
>    }
> 
>    // Implement the AbstractTypeUser interface.

almost, but you need to take alignment into account.  For example,
for x86 long double the spacing between elements is 2 or 6 bytes
due to alignment (depends on the platform: on x86-32 linux it is
4 byte alignment, on darwin it is 8 byte alignment; the x86 long
double itself is 10 bytes long).  Because of this it is not possible
to get the right width without target data.

Ciao,

Duncan.



More information about the llvm-commits mailing list