]> granicus.if.org Git - libx264/commitdiff
add AltiVec 16 <-> 32 bits conversions macros
authorGuillaume Poirier <gpoirier@mplayerhq.hu>
Fri, 23 Jan 2009 09:11:20 +0000 (01:11 -0800)
committerGuillaume Poirier <gpoirier@mplayerhq.hu>
Fri, 23 Jan 2009 09:11:20 +0000 (01:11 -0800)
common/ppc/ppccommon.h

index 7c8788596f1298c7db2056367ad944f13dc9864a..510ab2667f886afcb81e85fd0397dd68d8638e45 100644 (file)
@@ -87,6 +87,22 @@ typedef union {
 #define vec_u16_to_u8(v) vec_pack( v, zero_u16v )
 #define vec_s16_to_u8(v) vec_packsu( v, zero_s16v )
 
+
+/***********************************************************************
+ * 16 <-> 32 bits conversions
+ **********************************************************************/
+#define vec_u16_to_u32_h(v) (vec_u32_t) vec_mergeh( zero_u16v, (vec_u16_t) v )
+#define vec_u16_to_u32_l(v) (vec_u32_t) vec_mergel( zero_u16v, (vec_u16_t) v )
+#define vec_u16_to_s32_h(v) (vec_s32_t) vec_mergeh( zero_u16v, (vec_u16_t) v )
+#define vec_u16_to_s32_l(v) (vec_s32_t) vec_mergel( zero_u16v, (vec_u16_t) v )
+
+#define vec_u16_to_u32(v) vec_u16_to_u32_h(v)
+#define vec_u16_to_s32(v) vec_u16_to_s32_h(v)
+
+#define vec_u32_to_u16(v) vec_pack( v, zero_u32v )
+#define vec_s32_to_u16(v) vec_packsu( v, zero_s32v )
+
+
 /***********************************************************************
  * PREP_LOAD: declares two vectors required to perform unaligned loads
  * VEC_LOAD:  loads n bytes from u8 * p into vector v of type t where o is from original src offset