[llvm-commits] [llvm] r40506 - in /llvm/trunk: include/llvm/CodeGen/ValueTypes.h include/llvm/CodeGen/ValueTypes.td lib/VMCore/ValueTypes.cpp

Evan Cheng evan.cheng at apple.com
Wed Jul 25 22:50:44 PDT 2007


Hi Chris,

Can codegen handle non-pow 2 vector types? Are you planning to add it  
soon? :-)

Also, can you check if tblgen need to be taught the new types? I'm  
away from my Mac so I can't check.

Thanks,

Evan

Sent from my iPhone

On Jul 25, 2007, at 6:46 PM, Christopher Lamb <christopher.lamb at gmail.com 
 > wrote:

> Author: clamb
> Date: Wed Jul 25 20:46:52 2007
> New Revision: 40506
>
> URL: http://llvm.org/viewvc/llvm-project?rev=40506&view=rev
> Log:
> Add support for 3 element 32-bit vector ValueTypes.
>
> Modified:
>    llvm/trunk/include/llvm/CodeGen/ValueTypes.h
>    llvm/trunk/include/llvm/CodeGen/ValueTypes.td
>    llvm/trunk/lib/VMCore/ValueTypes.cpp
>
> Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=40506&r1=40505&r2=40506&view=diff
>
> === 
> === 
> === 
> =====================================================================
> --- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Wed Jul 25 20:46:52  
> 2007
> @@ -52,16 +52,19 @@
>     v1i64          =  16,   //  1 x i64
>     v16i8          =  17,   // 16 x i8
>     v8i16          =  18,   //  8 x i16
> -    v4i32          =  19,   //  4 x i32
> -    v2i64          =  20,   //  2 x i64
> -
> -    v2f32          =  21,   //  2 x f32
> -    v4f32          =  22,   //  4 x f32
> -    v2f64          =  23,   //  2 x f64
> +    v3i32           = 19,   //  3 x i32
> +    v4i32          =  20,   //  4 x i32
> +    v2i64          =  21,   //  2 x i64
> +
> +    v2f32          =  22,   //  2 x f32
> +    v3f32           = 23,   //  3 x f32
> +    v4f32          =  24,   //  4 x f32
> +    v2f64          =  25,   //  2 x f64
> +
>     FIRST_VECTOR_VALUETYPE = v8i8,
>     LAST_VECTOR_VALUETYPE  = v2f64,
>
> -    LAST_VALUETYPE =  24,   // This always remains at the end of  
> the list.
> +    LAST_VALUETYPE =  26,   // This always remains at the end of  
> the list.
>
>     // iAny - An integer value of any bit width. This is used for  
> intrinsics
>     // that have overloadings based on integer bit widths. This is  
> only for
> @@ -133,10 +136,12 @@
>     case v4i16:
>     case v8i16: return i16;
>     case v2i32:
> +    case v3i32:
>     case v4i32: return i32;
>     case v1i64:
>     case v2i64: return i64;
>     case v2f32:
> +    case v3f32:
>     case v4f32: return f32;
>     case v2f64: return f64;
>     }
> @@ -156,6 +161,8 @@
>     case v4i16:
>     case v4i32:
>     case v4f32: return 4;
> +    case v3i32:
> +    case v3f32: return 3;
>     case v2i32:
>     case v2i64:
>     case v2f32:
> @@ -187,6 +194,8 @@
>     case MVT::v1i64:
>     case MVT::v2f32: return 64;
>     case MVT::f80 :  return 80;
> +    case MVT::v3i32:
> +    case MVT::v3f32: return 96;
>     case MVT::f128:
>     case MVT::i128:
>     case MVT::v16i8:
> @@ -215,6 +224,7 @@
>       break;
>     case MVT::i32:
>       if (NumElements == 2)  return MVT::v2i32;
> +      if (NumElements == 3)  return MVT::v3i32;
>       if (NumElements == 4)  return MVT::v4i32;
>       break;
>     case MVT::i64:
> @@ -223,6 +233,7 @@
>       break;
>     case MVT::f32:
>       if (NumElements == 2)  return MVT::v2f32;
> +      if (NumElements == 3)  return MVT::v3f32;
>       if (NumElements == 4)  return MVT::v4f32;
>       break;
>     case MVT::f64:
> @@ -244,6 +255,7 @@
>     default: return getVectorType(i8, NumElts);
>     case  1: return v1i64;
>     case  2: return v2i32;
> +    case  3: return v3i32;
>     case  4: return v4i16;
>     case  8: return v8i8;
>     case 16: return v16i8;
>
> Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.td?rev=40506&r1=40505&r2=40506&view=diff
>
> === 
> === 
> === 
> =====================================================================
> --- llvm/trunk/include/llvm/CodeGen/ValueTypes.td (original)
> +++ llvm/trunk/include/llvm/CodeGen/ValueTypes.td Wed Jul 25  
> 20:46:52 2007
> @@ -39,11 +39,14 @@
>
> def v16i8  : ValueType<128, 17>;   // 16 x i8  vector value
> def v8i16  : ValueType<128, 18>;   //  8 x i16 vector value
> -def v4i32  : ValueType<128, 19>;   //  4 x i32 vector value
> -def v2i64  : ValueType<128, 20>;   //  2 x i64 vector value
> -def v2f32  : ValueType<64,  21>;   //  2 x f32 vector value
> -def v4f32  : ValueType<128, 22>;   //  4 x f32 vector value
> -def v2f64  : ValueType<128, 23>;   //  2 x f64 vector value
> +def v3i32  : ValueType<96 , 19>;   //  3 x f32 vector value
> +def v4i32  : ValueType<128, 20>;   //  4 x i32 vector value
> +def v2i64  : ValueType<128, 21>;   //  2 x i64 vector value
> +
> +def v2f32  : ValueType<64,  22>;   //  2 x f32 vector value
> +def v3f32  : ValueType<96 , 23>;   //  3 x f64 vector value
> +def v4f32  : ValueType<128, 24>;   //  4 x f32 vector value
> +def v2f64  : ValueType<128, 25>;   //  2 x f64 vector value
>
> // Pseudo valuetype to represent "integer of any bit width"
> def iAny   : ValueType<0  , 254>;   // integer value of any bit width
>
> Modified: llvm/trunk/lib/VMCore/ValueTypes.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/ValueTypes.cpp?rev=40506&r1=40505&r2=40506&view=diff
>
> === 
> === 
> === 
> =====================================================================
> --- llvm/trunk/lib/VMCore/ValueTypes.cpp (original)
> +++ llvm/trunk/lib/VMCore/ValueTypes.cpp Wed Jul 25 20:46:52 2007
> @@ -50,6 +50,8 @@
>   case MVT::v2f32: return "v2f32";
>   case MVT::v4f32: return "v4f32";
>   case MVT::v2f64: return "v2f64";
> +  case MVT::v3i32: return "v3i32";
> +  case MVT::v3f32: return "v3f32";
>   }
> }
>
> @@ -83,6 +85,8 @@
>   case MVT::v2f32: return VectorType::get(Type::FloatTy, 2);
>   case MVT::v4f32: return VectorType::get(Type::FloatTy, 4);
>   case MVT::v2f64: return VectorType::get(Type::DoubleTy, 2);
> +  case MVT::v3i32: return VectorType::get(Type::Int32Ty, 3);
> +  case MVT::v3f32: return VectorType::get(Type::FloatTy, 3);
>   }
> }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list