mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
5564 lines
140 KiB
C
5564 lines
140 KiB
C
|
|
/* autogenerated from gstcogorc.orc */
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
#ifndef DISABLE_ORC
|
|
#include <orc/orc.h>
|
|
#endif
|
|
#include <glib.h>
|
|
|
|
#ifndef _ORC_INTEGER_TYPEDEFS_
|
|
#define _ORC_INTEGER_TYPEDEFS_
|
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
|
#include <stdint.h>
|
|
typedef int8_t orc_int8;
|
|
typedef int16_t orc_int16;
|
|
typedef int32_t orc_int32;
|
|
typedef int64_t orc_int64;
|
|
typedef uint8_t orc_uint8;
|
|
typedef uint16_t orc_uint16;
|
|
typedef uint32_t orc_uint32;
|
|
typedef uint64_t orc_uint64;
|
|
#elif defined(_MSC_VER)
|
|
typedef signed __int8 orc_int8;
|
|
typedef signed __int16 orc_int16;
|
|
typedef signed __int32 orc_int32;
|
|
typedef signed __int64 orc_int64;
|
|
typedef unsigned __int8 orc_uint8;
|
|
typedef unsigned __int16 orc_uint16;
|
|
typedef unsigned __int32 orc_uint32;
|
|
typedef unsigned __int64 orc_uint64;
|
|
#else
|
|
#include <limits.h>
|
|
typedef signed char orc_int8;
|
|
typedef short orc_int16;
|
|
typedef int orc_int32;
|
|
typedef unsigned char orc_uint8;
|
|
typedef unsigned short orc_uint16;
|
|
typedef unsigned int orc_uint32;
|
|
#if INT_MAX == LONG_MAX
|
|
typedef long long orc_int64;
|
|
typedef unsigned long long orc_uint64;
|
|
#else
|
|
typedef long orc_int64;
|
|
typedef unsigned long orc_uint64;
|
|
#endif
|
|
#endif
|
|
typedef union
|
|
{
|
|
orc_int16 i;
|
|
orc_int8 x2[2];
|
|
} orc_union16;
|
|
typedef union
|
|
{
|
|
orc_int32 i;
|
|
float f;
|
|
orc_int16 x2[2];
|
|
orc_int8 x4[4];
|
|
} orc_union32;
|
|
typedef union
|
|
{
|
|
orc_int64 i;
|
|
double f;
|
|
orc_int32 x2[2];
|
|
orc_int16 x4[4];
|
|
} orc_union64;
|
|
#endif
|
|
|
|
void cogorc_downsample_horiz_cosite_1tap (orc_uint8 * d1, const orc_uint16 * s1,
|
|
int n);
|
|
void cogorc_downsample_horiz_cosite_3tap (orc_uint8 * d1, const orc_uint16 * s1,
|
|
const orc_uint16 * s2, int n);
|
|
void cogorc_downsample_420_jpeg (orc_uint8 * d1, const orc_uint16 * s1,
|
|
const orc_uint16 * s2, int n);
|
|
void cogorc_downsample_vert_halfsite_2tap (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, int n);
|
|
void cogorc_downsample_vert_cosite_3tap (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, const orc_uint8 * s3, int n);
|
|
void cogorc_downsample_vert_halfsite_4tap (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, const orc_uint8 * s3, const orc_uint8 * s4, int n);
|
|
void cogorc_upsample_horiz_cosite_1tap (guint8 * d1, const orc_uint8 * s1,
|
|
int n);
|
|
void cogorc_upsample_horiz_cosite (guint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, int n);
|
|
void cogorc_upsample_vert_avgub (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, int n);
|
|
void orc_unpack_yuyv_y (orc_uint8 * d1, const orc_uint16 * s1, int n);
|
|
void orc_unpack_yuyv_u (orc_uint8 * d1, const orc_uint32 * s1, int n);
|
|
void orc_unpack_yuyv_v (orc_uint8 * d1, const orc_uint32 * s1, int n);
|
|
void orc_pack_yuyv (orc_uint32 * d1, const guint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int n);
|
|
void orc_unpack_uyvy_y (orc_uint8 * d1, const orc_uint16 * s1, int n);
|
|
void orc_unpack_uyvy_u (orc_uint8 * d1, const orc_uint32 * s1, int n);
|
|
void orc_unpack_uyvy_v (orc_uint8 * d1, const orc_uint32 * s1, int n);
|
|
void orc_pack_uyvy (orc_uint32 * d1, const guint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int n);
|
|
void orc_addc_convert_u8_s16 (orc_uint8 * d1, const gint16 * s1, int n);
|
|
void orc_subc_convert_s16_u8 (gint16 * d1, const orc_uint8 * s1, int n);
|
|
void orc_splat_u8_ns (orc_uint8 * d1, int p1, int n);
|
|
void orc_splat_s16_ns (gint16 * d1, int p1, int n);
|
|
void orc_matrix2_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2, int p1,
|
|
int p2, int p3, int n);
|
|
void orc_matrix2_11_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
int p1, int p2, int n);
|
|
void orc_matrix2_12_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
int p1, int p2, int n);
|
|
void orc_matrix3_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
const guint8 * s3, int p1, int p2, int p3, int p4, int n);
|
|
void orc_matrix3_100_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
const guint8 * s3, int p1, int p2, int p3, int n);
|
|
void orc_matrix3_100_offset_u8 (guint8 * d1, const guint8 * s1,
|
|
const guint8 * s2, const guint8 * s3, int p1, int p2, int p3, int p4,
|
|
int p5, int n);
|
|
void orc_matrix3_000_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
const guint8 * s3, int p1, int p2, int p3, int p4, int p5, int n);
|
|
void orc_pack_123x (guint32 * d1, const orc_uint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int p1, int n);
|
|
void orc_pack_x123 (guint32 * d1, const orc_uint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int p1, int n);
|
|
void cogorc_combine2_u8 (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, int p1, int p2, int n);
|
|
void cogorc_combine4_u8 (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, const orc_uint8 * s3, const orc_uint8 * s4, int p1,
|
|
int p2, int p3, int p4, int n);
|
|
void cogorc_unpack_axyz_0 (orc_uint8 * d1, const orc_uint32 * s1, int n);
|
|
void cogorc_unpack_axyz_1 (orc_uint8 * d1, const orc_uint32 * s1, int n);
|
|
void cogorc_unpack_axyz_2 (orc_uint8 * d1, const orc_uint32 * s1, int n);
|
|
void cogorc_unpack_axyz_3 (orc_uint8 * d1, const orc_uint32 * s1, int n);
|
|
|
|
|
|
/* begin Orc C target preamble */
|
|
#define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))
|
|
#define ORC_ABS(a) ((a)<0 ? -(a) : (a))
|
|
#define ORC_MIN(a,b) ((a)<(b) ? (a) : (b))
|
|
#define ORC_MAX(a,b) ((a)>(b) ? (a) : (b))
|
|
#define ORC_SB_MAX 127
|
|
#define ORC_SB_MIN (-1-ORC_SB_MAX)
|
|
#define ORC_UB_MAX 255
|
|
#define ORC_UB_MIN 0
|
|
#define ORC_SW_MAX 32767
|
|
#define ORC_SW_MIN (-1-ORC_SW_MAX)
|
|
#define ORC_UW_MAX 65535
|
|
#define ORC_UW_MIN 0
|
|
#define ORC_SL_MAX 2147483647
|
|
#define ORC_SL_MIN (-1-ORC_SL_MAX)
|
|
#define ORC_UL_MAX 4294967295U
|
|
#define ORC_UL_MIN 0
|
|
#define ORC_CLAMP_SB(x) ORC_CLAMP(x,ORC_SB_MIN,ORC_SB_MAX)
|
|
#define ORC_CLAMP_UB(x) ORC_CLAMP(x,ORC_UB_MIN,ORC_UB_MAX)
|
|
#define ORC_CLAMP_SW(x) ORC_CLAMP(x,ORC_SW_MIN,ORC_SW_MAX)
|
|
#define ORC_CLAMP_UW(x) ORC_CLAMP(x,ORC_UW_MIN,ORC_UW_MAX)
|
|
#define ORC_CLAMP_SL(x) ORC_CLAMP(x,ORC_SL_MIN,ORC_SL_MAX)
|
|
#define ORC_CLAMP_UL(x) ORC_CLAMP(x,ORC_UL_MIN,ORC_UL_MAX)
|
|
#define ORC_SWAP_W(x) ((((x)&0xff)<<8) | (((x)&0xff00)>>8))
|
|
#define ORC_SWAP_L(x) ((((x)&0xff)<<24) | (((x)&0xff00)<<8) | (((x)&0xff0000)>>8) | (((x)&0xff000000)>>24))
|
|
#define ORC_SWAP_Q(x) ((((x)&0xffULL)<<56) | (((x)&0xff00ULL)<<40) | (((x)&0xff0000ULL)<<24) | (((x)&0xff000000ULL)<<8) | (((x)&0xff00000000ULL)>>8) | (((x)&0xff0000000000ULL)>>24) | (((x)&0xff000000000000ULL)>>40) | (((x)&0xff00000000000000ULL)>>56))
|
|
#define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (offset)))
|
|
#define ORC_RECAST_INT(x) (((orc_union32)(x)).i)
|
|
#define ORC_RECAST_FLOAT(x) (((orc_union32)(orc_int32)(x)).f)
|
|
#define ORC_DENORMAL(x) ORC_RECAST_FLOAT(ORC_RECAST_INT(x) & (((ORC_RECAST_INT(x)&0x7f800000) == 0) ? 0xff800000 : 0xffffffff))
|
|
#define ORC_ISNAN(x) (((ORC_RECAST_INT(x)&0x7f800000) == 0x7f800000) && ((ORC_RECAST_INT(x)&0x007fffff) != 0))
|
|
#define ORC_MINF(a,b) (ORC_ISNAN(a) ? a : ORC_ISNAN(b) ? b : ((a)<(b)) ? (a) : (b))
|
|
#define ORC_MAXF(a,b) (ORC_ISNAN(a) ? a : ORC_ISNAN(b) ? b : ((a)>(b)) ? (a) : (b))
|
|
#define ORC_RECAST_INT64(x) (((orc_union64)(x)).i)
|
|
#define ORC_RECAST_DOUBLE(x) (((orc_union64)(orc_int64)(x)).f)
|
|
#define ORC_DENORMAL_D(x) ORC_RECAST_DOUBLE(ORC_RECAST_INT64(x) & (((ORC_RECAST_INT64(x)&0x7ff0000000000000ULL) == 0) ? 0xfff0000000000000ULL : 0xffffffffffffffffULL))
|
|
#define ORC_ISNAN_D(x) (((ORC_RECAST_INT64(x)&0x7ff0000000000000ULL) == 0x7ff0000000000000ULL) && ((ORC_RECAST_INT64(x)&0x000fffffffffffffULL) != 0))
|
|
#define ORC_MIND(a,b) (ORC_ISNAN_D(a) ? a : ORC_ISNAN_D(b) ? b : ((a)<(b)) ? (a) : (b))
|
|
#define ORC_MAXD(a,b) (ORC_ISNAN_D(a) ? a : ORC_ISNAN_D(b) ? b : ((a)>(b)) ? (a) : (b))
|
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
|
#define ORC_RESTRICT restrict
|
|
#elif defined(__GNUC__) && __GNUC__ >= 4
|
|
#define ORC_RESTRICT __restrict__
|
|
#else
|
|
#define ORC_RESTRICT
|
|
#endif
|
|
/* end Orc C target preamble */
|
|
|
|
|
|
|
|
/* cogorc_downsample_horiz_cosite_1tap */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_downsample_horiz_cosite_1tap (orc_uint8 * d1, const orc_uint16 * s1,
|
|
int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
orc_union16 var32;
|
|
orc_int8 var33;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union16 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var32 = ptr4[i];
|
|
/* 1: select0wb */
|
|
var33 = (orc_uint16) var32.i & 0xff;
|
|
/* 2: storeb */
|
|
ptr0[i] = var33;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_downsample_horiz_cosite_1tap (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
orc_union16 var32;
|
|
orc_int8 var33;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union16 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var32 = ptr4[i];
|
|
/* 1: select0wb */
|
|
var33 = (orc_uint16) var32.i & 0xff;
|
|
/* 2: storeb */
|
|
ptr0[i] = var33;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_downsample_horiz_cosite_1tap (orc_uint8 * d1, const orc_uint16 * s1,
|
|
int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_downsample_horiz_cosite_1tap");
|
|
orc_program_set_backup_function (p,
|
|
_backup_cogorc_downsample_horiz_cosite_1tap);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 2, "s1");
|
|
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_S1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_downsample_horiz_cosite_3tap */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_downsample_horiz_cosite_3tap (orc_uint8 * d1, const orc_uint16 * s1,
|
|
const orc_uint16 * s2, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
const orc_union16 *ORC_RESTRICT ptr5;
|
|
orc_union16 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_int8 var42;
|
|
orc_union16 var43;
|
|
orc_int8 var44;
|
|
orc_int8 var45;
|
|
orc_int8 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union16 *) s1;
|
|
ptr5 = (orc_union16 *) s2;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var38 = ptr4[i];
|
|
/* 1: copyw */
|
|
var43.i = var38.i;
|
|
/* 2: select0wb */
|
|
var44 = (orc_uint16) var43.i & 0xff;
|
|
/* 3: select1wb */
|
|
var45 = ((orc_uint16) var43.i >> 8) & 0xff;
|
|
/* 4: loadw */
|
|
var39 = ptr5[i];
|
|
/* 5: select0wb */
|
|
var46 = (orc_uint16) var39.i & 0xff;
|
|
/* 6: convubw */
|
|
var47.i = (orc_uint8) var44;
|
|
/* 7: convubw */
|
|
var48.i = (orc_uint8) var45;
|
|
/* 8: convubw */
|
|
var49.i = (orc_uint8) var46;
|
|
/* 9: loadpw */
|
|
var40.i = 2;
|
|
/* 10: mullw */
|
|
var50.i = (var48.i * var40.i) & 0xffff;
|
|
/* 11: addw */
|
|
var51.i = var47.i + var49.i;
|
|
/* 12: addw */
|
|
var52.i = var51.i + var50.i;
|
|
/* 13: loadpw */
|
|
var41.i = 2;
|
|
/* 14: addw */
|
|
var53.i = var52.i + var41.i;
|
|
/* 15: shrsw */
|
|
var54.i = var53.i >> 2;
|
|
/* 16: convsuswb */
|
|
var42 = ORC_CLAMP_UB (var54.i);
|
|
/* 17: storeb */
|
|
ptr0[i] = var42;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_downsample_horiz_cosite_3tap (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
const orc_union16 *ORC_RESTRICT ptr5;
|
|
orc_union16 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_int8 var42;
|
|
orc_union16 var43;
|
|
orc_int8 var44;
|
|
orc_int8 var45;
|
|
orc_int8 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union16 *) ex->arrays[4];
|
|
ptr5 = (orc_union16 *) ex->arrays[5];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var38 = ptr4[i];
|
|
/* 1: copyw */
|
|
var43.i = var38.i;
|
|
/* 2: select0wb */
|
|
var44 = (orc_uint16) var43.i & 0xff;
|
|
/* 3: select1wb */
|
|
var45 = ((orc_uint16) var43.i >> 8) & 0xff;
|
|
/* 4: loadw */
|
|
var39 = ptr5[i];
|
|
/* 5: select0wb */
|
|
var46 = (orc_uint16) var39.i & 0xff;
|
|
/* 6: convubw */
|
|
var47.i = (orc_uint8) var44;
|
|
/* 7: convubw */
|
|
var48.i = (orc_uint8) var45;
|
|
/* 8: convubw */
|
|
var49.i = (orc_uint8) var46;
|
|
/* 9: loadpw */
|
|
var40.i = 2;
|
|
/* 10: mullw */
|
|
var50.i = (var48.i * var40.i) & 0xffff;
|
|
/* 11: addw */
|
|
var51.i = var47.i + var49.i;
|
|
/* 12: addw */
|
|
var52.i = var51.i + var50.i;
|
|
/* 13: loadpw */
|
|
var41.i = 2;
|
|
/* 14: addw */
|
|
var53.i = var52.i + var41.i;
|
|
/* 15: shrsw */
|
|
var54.i = var53.i >> 2;
|
|
/* 16: convsuswb */
|
|
var42 = ORC_CLAMP_UB (var54.i);
|
|
/* 17: storeb */
|
|
ptr0[i] = var42;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_downsample_horiz_cosite_3tap (orc_uint8 * d1, const orc_uint16 * s1,
|
|
const orc_uint16 * s2, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_downsample_horiz_cosite_3tap");
|
|
orc_program_set_backup_function (p,
|
|
_backup_cogorc_downsample_horiz_cosite_3tap);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 2, "s1");
|
|
orc_program_add_source (p, 2, "s2");
|
|
orc_program_add_constant (p, 2, 0x00000002, "c1");
|
|
orc_program_add_constant (p, 2, 0x00000002, "c2");
|
|
orc_program_add_constant (p, 2, 0x00000002, "c3");
|
|
orc_program_add_temporary (p, 1, "t1");
|
|
orc_program_add_temporary (p, 1, "t2");
|
|
orc_program_add_temporary (p, 1, "t3");
|
|
orc_program_add_temporary (p, 2, "t4");
|
|
orc_program_add_temporary (p, 2, "t5");
|
|
orc_program_add_temporary (p, 2, "t6");
|
|
|
|
orc_program_append_2 (p, "copyw", 0, ORC_VAR_T4, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T1, ORC_VAR_T4,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T2, ORC_VAR_T4,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T3, ORC_VAR_S2,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T4, ORC_VAR_T1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T5, ORC_VAR_T2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T6, ORC_VAR_T3, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T5, ORC_VAR_T5, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T6,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_C3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T4,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_downsample_420_jpeg */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_downsample_420_jpeg (orc_uint8 * d1, const orc_uint16 * s1,
|
|
const orc_uint16 * s2, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
const orc_union16 *ORC_RESTRICT ptr5;
|
|
orc_union16 var37;
|
|
orc_union16 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_int8 var41;
|
|
orc_int8 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_int8 var45;
|
|
orc_int8 var46;
|
|
orc_int8 var47;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union16 *) s1;
|
|
ptr5 = (orc_union16 *) s2;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var37 = ptr4[i];
|
|
/* 1: copyw */
|
|
var40.i = var37.i;
|
|
/* 2: select0wb */
|
|
var41 = (orc_uint16) var40.i & 0xff;
|
|
/* 3: select1wb */
|
|
var42 = ((orc_uint16) var40.i >> 8) & 0xff;
|
|
/* 4: avgub */
|
|
var43 = ((orc_uint8) var41 + (orc_uint8) var42 + 1) >> 1;
|
|
/* 5: loadw */
|
|
var38 = ptr5[i];
|
|
/* 6: copyw */
|
|
var44.i = var38.i;
|
|
/* 7: select0wb */
|
|
var45 = (orc_uint16) var44.i & 0xff;
|
|
/* 8: select1wb */
|
|
var46 = ((orc_uint16) var44.i >> 8) & 0xff;
|
|
/* 9: avgub */
|
|
var47 = ((orc_uint8) var45 + (orc_uint8) var46 + 1) >> 1;
|
|
/* 10: avgub */
|
|
var39 = ((orc_uint8) var43 + (orc_uint8) var47 + 1) >> 1;
|
|
/* 11: storeb */
|
|
ptr0[i] = var39;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_downsample_420_jpeg (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
const orc_union16 *ORC_RESTRICT ptr5;
|
|
orc_union16 var37;
|
|
orc_union16 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_int8 var41;
|
|
orc_int8 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_int8 var45;
|
|
orc_int8 var46;
|
|
orc_int8 var47;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union16 *) ex->arrays[4];
|
|
ptr5 = (orc_union16 *) ex->arrays[5];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var37 = ptr4[i];
|
|
/* 1: copyw */
|
|
var40.i = var37.i;
|
|
/* 2: select0wb */
|
|
var41 = (orc_uint16) var40.i & 0xff;
|
|
/* 3: select1wb */
|
|
var42 = ((orc_uint16) var40.i >> 8) & 0xff;
|
|
/* 4: avgub */
|
|
var43 = ((orc_uint8) var41 + (orc_uint8) var42 + 1) >> 1;
|
|
/* 5: loadw */
|
|
var38 = ptr5[i];
|
|
/* 6: copyw */
|
|
var44.i = var38.i;
|
|
/* 7: select0wb */
|
|
var45 = (orc_uint16) var44.i & 0xff;
|
|
/* 8: select1wb */
|
|
var46 = ((orc_uint16) var44.i >> 8) & 0xff;
|
|
/* 9: avgub */
|
|
var47 = ((orc_uint8) var45 + (orc_uint8) var46 + 1) >> 1;
|
|
/* 10: avgub */
|
|
var39 = ((orc_uint8) var43 + (orc_uint8) var47 + 1) >> 1;
|
|
/* 11: storeb */
|
|
ptr0[i] = var39;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_downsample_420_jpeg (orc_uint8 * d1, const orc_uint16 * s1,
|
|
const orc_uint16 * s2, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_downsample_420_jpeg");
|
|
orc_program_set_backup_function (p, _backup_cogorc_downsample_420_jpeg);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 2, "s1");
|
|
orc_program_add_source (p, 2, "s2");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 1, "t2");
|
|
orc_program_add_temporary (p, 1, "t3");
|
|
orc_program_add_temporary (p, 1, "t4");
|
|
orc_program_add_temporary (p, 1, "t5");
|
|
|
|
orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T2, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T3, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "avgub", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "copyw", 0, ORC_VAR_T1, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T4, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T5, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "avgub", 0, ORC_VAR_T4, ORC_VAR_T4, ORC_VAR_T5,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_T2, ORC_VAR_T4,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_downsample_vert_halfsite_2tap */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_downsample_vert_halfsite_2tap (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var32;
|
|
orc_int8 var33;
|
|
orc_int8 var34;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var32 = ptr4[i];
|
|
/* 1: loadb */
|
|
var33 = ptr5[i];
|
|
/* 2: avgub */
|
|
var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_downsample_vert_halfsite_2tap (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var32;
|
|
orc_int8 var33;
|
|
orc_int8 var34;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var32 = ptr4[i];
|
|
/* 1: loadb */
|
|
var33 = ptr5[i];
|
|
/* 2: avgub */
|
|
var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_downsample_vert_halfsite_2tap (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_downsample_vert_halfsite_2tap");
|
|
orc_program_set_backup_function (p,
|
|
_backup_cogorc_downsample_vert_halfsite_2tap);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
|
|
orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_downsample_vert_cosite_3tap */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_downsample_vert_cosite_3tap (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, const orc_uint8 * s3, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var35;
|
|
orc_int8 var36;
|
|
orc_int8 var37;
|
|
orc_union16 var38;
|
|
orc_union16 var39;
|
|
orc_int8 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
ptr6 = (orc_int8 *) s3;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var35 = ptr4[i];
|
|
/* 1: convubw */
|
|
var41.i = (orc_uint8) var35;
|
|
/* 2: loadb */
|
|
var36 = ptr5[i];
|
|
/* 3: convubw */
|
|
var42.i = (orc_uint8) var36;
|
|
/* 4: loadb */
|
|
var37 = ptr6[i];
|
|
/* 5: convubw */
|
|
var43.i = (orc_uint8) var37;
|
|
/* 6: loadpw */
|
|
var38.i = 2;
|
|
/* 7: mullw */
|
|
var44.i = (var42.i * var38.i) & 0xffff;
|
|
/* 8: addw */
|
|
var45.i = var41.i + var43.i;
|
|
/* 9: addw */
|
|
var46.i = var45.i + var44.i;
|
|
/* 10: loadpw */
|
|
var39.i = 2;
|
|
/* 11: addw */
|
|
var47.i = var46.i + var39.i;
|
|
/* 12: shrsw */
|
|
var48.i = var47.i >> 2;
|
|
/* 13: convsuswb */
|
|
var40 = ORC_CLAMP_UB (var48.i);
|
|
/* 14: storeb */
|
|
ptr0[i] = var40;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_downsample_vert_cosite_3tap (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var35;
|
|
orc_int8 var36;
|
|
orc_int8 var37;
|
|
orc_union16 var38;
|
|
orc_union16 var39;
|
|
orc_int8 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
ptr6 = (orc_int8 *) ex->arrays[6];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var35 = ptr4[i];
|
|
/* 1: convubw */
|
|
var41.i = (orc_uint8) var35;
|
|
/* 2: loadb */
|
|
var36 = ptr5[i];
|
|
/* 3: convubw */
|
|
var42.i = (orc_uint8) var36;
|
|
/* 4: loadb */
|
|
var37 = ptr6[i];
|
|
/* 5: convubw */
|
|
var43.i = (orc_uint8) var37;
|
|
/* 6: loadpw */
|
|
var38.i = 2;
|
|
/* 7: mullw */
|
|
var44.i = (var42.i * var38.i) & 0xffff;
|
|
/* 8: addw */
|
|
var45.i = var41.i + var43.i;
|
|
/* 9: addw */
|
|
var46.i = var45.i + var44.i;
|
|
/* 10: loadpw */
|
|
var39.i = 2;
|
|
/* 11: addw */
|
|
var47.i = var46.i + var39.i;
|
|
/* 12: shrsw */
|
|
var48.i = var47.i >> 2;
|
|
/* 13: convsuswb */
|
|
var40 = ORC_CLAMP_UB (var48.i);
|
|
/* 14: storeb */
|
|
ptr0[i] = var40;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_downsample_vert_cosite_3tap (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, const orc_uint8 * s3, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_downsample_vert_cosite_3tap");
|
|
orc_program_set_backup_function (p,
|
|
_backup_cogorc_downsample_vert_cosite_3tap);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_source (p, 1, "s3");
|
|
orc_program_add_constant (p, 2, 0x00000002, "c1");
|
|
orc_program_add_constant (p, 2, 0x00000002, "c2");
|
|
orc_program_add_constant (p, 2, 0x00000002, "c3");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
orc_program_add_temporary (p, 2, "t3");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->arrays[ORC_VAR_S3] = (void *) s3;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_downsample_vert_halfsite_4tap */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_downsample_vert_halfsite_4tap (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, const orc_uint8 * s3, const orc_uint8 * s4, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
const orc_int8 *ORC_RESTRICT ptr7;
|
|
orc_int8 var36;
|
|
orc_int8 var37;
|
|
orc_int8 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
ptr6 = (orc_int8 *) s3;
|
|
ptr7 = (orc_int8 *) s4;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var36 = ptr4[i];
|
|
/* 1: convubw */
|
|
var44.i = (orc_uint8) var36;
|
|
/* 2: loadb */
|
|
var37 = ptr5[i];
|
|
/* 3: convubw */
|
|
var45.i = (orc_uint8) var37;
|
|
/* 4: loadb */
|
|
var38 = ptr6[i];
|
|
/* 5: convubw */
|
|
var46.i = (orc_uint8) var38;
|
|
/* 6: loadb */
|
|
var39 = ptr7[i];
|
|
/* 7: convubw */
|
|
var47.i = (orc_uint8) var39;
|
|
/* 8: addw */
|
|
var48.i = var45.i + var46.i;
|
|
/* 9: loadpw */
|
|
var40.i = 26;
|
|
/* 10: mullw */
|
|
var49.i = (var48.i * var40.i) & 0xffff;
|
|
/* 11: addw */
|
|
var50.i = var44.i + var47.i;
|
|
/* 12: loadpw */
|
|
var41.i = 6;
|
|
/* 13: mullw */
|
|
var51.i = (var50.i * var41.i) & 0xffff;
|
|
/* 14: addw */
|
|
var52.i = var49.i + var51.i;
|
|
/* 15: loadpw */
|
|
var42.i = 32;
|
|
/* 16: addw */
|
|
var53.i = var52.i + var42.i;
|
|
/* 17: shrsw */
|
|
var54.i = var53.i >> 6;
|
|
/* 18: convsuswb */
|
|
var43 = ORC_CLAMP_UB (var54.i);
|
|
/* 19: storeb */
|
|
ptr0[i] = var43;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_downsample_vert_halfsite_4tap (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
const orc_int8 *ORC_RESTRICT ptr7;
|
|
orc_int8 var36;
|
|
orc_int8 var37;
|
|
orc_int8 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
ptr6 = (orc_int8 *) ex->arrays[6];
|
|
ptr7 = (orc_int8 *) ex->arrays[7];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var36 = ptr4[i];
|
|
/* 1: convubw */
|
|
var44.i = (orc_uint8) var36;
|
|
/* 2: loadb */
|
|
var37 = ptr5[i];
|
|
/* 3: convubw */
|
|
var45.i = (orc_uint8) var37;
|
|
/* 4: loadb */
|
|
var38 = ptr6[i];
|
|
/* 5: convubw */
|
|
var46.i = (orc_uint8) var38;
|
|
/* 6: loadb */
|
|
var39 = ptr7[i];
|
|
/* 7: convubw */
|
|
var47.i = (orc_uint8) var39;
|
|
/* 8: addw */
|
|
var48.i = var45.i + var46.i;
|
|
/* 9: loadpw */
|
|
var40.i = 26;
|
|
/* 10: mullw */
|
|
var49.i = (var48.i * var40.i) & 0xffff;
|
|
/* 11: addw */
|
|
var50.i = var44.i + var47.i;
|
|
/* 12: loadpw */
|
|
var41.i = 6;
|
|
/* 13: mullw */
|
|
var51.i = (var50.i * var41.i) & 0xffff;
|
|
/* 14: addw */
|
|
var52.i = var49.i + var51.i;
|
|
/* 15: loadpw */
|
|
var42.i = 32;
|
|
/* 16: addw */
|
|
var53.i = var52.i + var42.i;
|
|
/* 17: shrsw */
|
|
var54.i = var53.i >> 6;
|
|
/* 18: convsuswb */
|
|
var43 = ORC_CLAMP_UB (var54.i);
|
|
/* 19: storeb */
|
|
ptr0[i] = var43;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_downsample_vert_halfsite_4tap (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, const orc_uint8 * s3, const orc_uint8 * s4, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_downsample_vert_halfsite_4tap");
|
|
orc_program_set_backup_function (p,
|
|
_backup_cogorc_downsample_vert_halfsite_4tap);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_source (p, 1, "s3");
|
|
orc_program_add_source (p, 1, "s4");
|
|
orc_program_add_constant (p, 2, 0x0000001a, "c1");
|
|
orc_program_add_constant (p, 2, 0x00000006, "c2");
|
|
orc_program_add_constant (p, 2, 0x00000020, "c3");
|
|
orc_program_add_constant (p, 2, 0x00000006, "c4");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
orc_program_add_temporary (p, 2, "t3");
|
|
orc_program_add_temporary (p, 2, "t4");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S3, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T4, ORC_VAR_S4, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T4,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_T1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C4,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->arrays[ORC_VAR_S3] = (void *) s3;
|
|
ex->arrays[ORC_VAR_S4] = (void *) s4;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_upsample_horiz_cosite_1tap */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_upsample_horiz_cosite_1tap (guint8 * d1, const orc_uint8 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_union16 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
orc_int8 var33;
|
|
orc_union16 var34;
|
|
orc_int8 var35;
|
|
|
|
ptr0 = (orc_union16 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var33 = ptr4[i];
|
|
/* 1: copyb */
|
|
var35 = var33;
|
|
/* 2: mergebw */
|
|
var34.i = ((orc_uint8) var35) | ((orc_uint8) var35 << 8);
|
|
/* 3: storew */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_upsample_horiz_cosite_1tap (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_union16 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
orc_int8 var33;
|
|
orc_union16 var34;
|
|
orc_int8 var35;
|
|
|
|
ptr0 = (orc_union16 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var33 = ptr4[i];
|
|
/* 1: copyb */
|
|
var35 = var33;
|
|
/* 2: mergebw */
|
|
var34.i = ((orc_uint8) var35) | ((orc_uint8) var35 << 8);
|
|
/* 3: storew */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_upsample_horiz_cosite_1tap (guint8 * d1, const orc_uint8 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_upsample_horiz_cosite_1tap");
|
|
orc_program_set_backup_function (p,
|
|
_backup_cogorc_upsample_horiz_cosite_1tap);
|
|
orc_program_add_destination (p, 2, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_temporary (p, 1, "t1");
|
|
|
|
orc_program_append_2 (p, "copyb", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergebw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T1,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_upsample_horiz_cosite */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_upsample_horiz_cosite (guint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, int n)
|
|
{
|
|
int i;
|
|
orc_union16 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var34;
|
|
orc_int8 var35;
|
|
orc_union16 var36;
|
|
orc_int8 var37;
|
|
orc_int8 var38;
|
|
|
|
ptr0 = (orc_union16 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: copyb */
|
|
var37 = var34;
|
|
/* 2: loadb */
|
|
var35 = ptr5[i];
|
|
/* 3: avgub */
|
|
var38 = ((orc_uint8) var37 + (orc_uint8) var35 + 1) >> 1;
|
|
/* 4: mergebw */
|
|
var36.i = ((orc_uint8) var37) | ((orc_uint8) var38 << 8);
|
|
/* 5: storew */
|
|
ptr0[i] = var36;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_upsample_horiz_cosite (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_union16 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var34;
|
|
orc_int8 var35;
|
|
orc_union16 var36;
|
|
orc_int8 var37;
|
|
orc_int8 var38;
|
|
|
|
ptr0 = (orc_union16 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: copyb */
|
|
var37 = var34;
|
|
/* 2: loadb */
|
|
var35 = ptr5[i];
|
|
/* 3: avgub */
|
|
var38 = ((orc_uint8) var37 + (orc_uint8) var35 + 1) >> 1;
|
|
/* 4: mergebw */
|
|
var36.i = ((orc_uint8) var37) | ((orc_uint8) var38 << 8);
|
|
/* 5: storew */
|
|
ptr0[i] = var36;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_upsample_horiz_cosite (guint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_upsample_horiz_cosite");
|
|
orc_program_set_backup_function (p, _backup_cogorc_upsample_horiz_cosite);
|
|
orc_program_add_destination (p, 2, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_temporary (p, 1, "t1");
|
|
orc_program_add_temporary (p, 1, "t2");
|
|
|
|
orc_program_append_2 (p, "copyb", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "avgub", 0, ORC_VAR_T2, ORC_VAR_T1, ORC_VAR_S2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergebw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_upsample_vert_avgub */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_upsample_vert_avgub (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var32;
|
|
orc_int8 var33;
|
|
orc_int8 var34;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var32 = ptr4[i];
|
|
/* 1: loadb */
|
|
var33 = ptr5[i];
|
|
/* 2: avgub */
|
|
var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_upsample_vert_avgub (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var32;
|
|
orc_int8 var33;
|
|
orc_int8 var34;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var32 = ptr4[i];
|
|
/* 1: loadb */
|
|
var33 = ptr5[i];
|
|
/* 2: avgub */
|
|
var34 = ((orc_uint8) var32 + (orc_uint8) var33 + 1) >> 1;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_upsample_vert_avgub (orc_uint8 * d1, const orc_uint8 * s1,
|
|
const orc_uint8 * s2, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_upsample_vert_avgub");
|
|
orc_program_set_backup_function (p, _backup_cogorc_upsample_vert_avgub);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
|
|
orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_unpack_yuyv_y */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_unpack_yuyv_y (orc_uint8 * d1, const orc_uint16 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
orc_union16 var32;
|
|
orc_int8 var33;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union16 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var32 = ptr4[i];
|
|
/* 1: select0wb */
|
|
var33 = (orc_uint16) var32.i & 0xff;
|
|
/* 2: storeb */
|
|
ptr0[i] = var33;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_unpack_yuyv_y (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
orc_union16 var32;
|
|
orc_int8 var33;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union16 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var32 = ptr4[i];
|
|
/* 1: select0wb */
|
|
var33 = (orc_uint16) var32.i & 0xff;
|
|
/* 2: storeb */
|
|
ptr0[i] = var33;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_unpack_yuyv_y (orc_uint8 * d1, const orc_uint16 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_unpack_yuyv_y");
|
|
orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_y);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 2, "s1");
|
|
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_S1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_unpack_yuyv_u */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_unpack_yuyv_u (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union32 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select0lw */
|
|
var35.i = (orc_uint32) var33.i & 0xffff;
|
|
/* 2: select1wb */
|
|
var34 = ((orc_uint16) var35.i >> 8) & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_unpack_yuyv_u (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union32 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select0lw */
|
|
var35.i = (orc_uint32) var33.i & 0xffff;
|
|
/* 2: select1wb */
|
|
var34 = ((orc_uint16) var35.i >> 8) & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_unpack_yuyv_u (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_unpack_yuyv_u");
|
|
orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_u);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 4, "s1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
|
|
orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_unpack_yuyv_v */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_unpack_yuyv_v (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union32 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select1lw */
|
|
var35.i = ((orc_uint32) var33.i >> 16) & 0xffff;
|
|
/* 2: select1wb */
|
|
var34 = ((orc_uint16) var35.i >> 8) & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_unpack_yuyv_v (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union32 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select1lw */
|
|
var35.i = ((orc_uint32) var33.i >> 16) & 0xffff;
|
|
/* 2: select1wb */
|
|
var34 = ((orc_uint16) var35.i >> 8) & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_unpack_yuyv_v (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_unpack_yuyv_v");
|
|
orc_program_set_backup_function (p, _backup_orc_unpack_yuyv_v);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 4, "s1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
|
|
orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_pack_yuyv */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_pack_yuyv (orc_uint32 * d1, const guint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int n)
|
|
{
|
|
int i;
|
|
orc_union32 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_int8 var39;
|
|
orc_union32 var40;
|
|
orc_union16 var41;
|
|
orc_int8 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
|
|
ptr0 = (orc_union32 *) d1;
|
|
ptr4 = (orc_union16 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
ptr6 = (orc_int8 *) s3;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var37 = ptr4[i];
|
|
/* 1: copyw */
|
|
var41.i = var37.i;
|
|
/* 2: select0wb */
|
|
var42 = (orc_uint16) var41.i & 0xff;
|
|
/* 3: select1wb */
|
|
var43 = ((orc_uint16) var41.i >> 8) & 0xff;
|
|
/* 4: loadb */
|
|
var38 = ptr5[i];
|
|
/* 5: mergebw */
|
|
var44.i = ((orc_uint8) var42) | ((orc_uint8) var38 << 8);
|
|
/* 6: loadb */
|
|
var39 = ptr6[i];
|
|
/* 7: mergebw */
|
|
var45.i = ((orc_uint8) var43) | ((orc_uint8) var39 << 8);
|
|
/* 8: mergewl */
|
|
var40.i = ((orc_uint16) var44.i) | ((orc_uint16) var45.i << 16);
|
|
/* 9: storel */
|
|
ptr0[i] = var40;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_pack_yuyv (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_union32 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_int8 var39;
|
|
orc_union32 var40;
|
|
orc_union16 var41;
|
|
orc_int8 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
|
|
ptr0 = (orc_union32 *) ex->arrays[0];
|
|
ptr4 = (orc_union16 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
ptr6 = (orc_int8 *) ex->arrays[6];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var37 = ptr4[i];
|
|
/* 1: copyw */
|
|
var41.i = var37.i;
|
|
/* 2: select0wb */
|
|
var42 = (orc_uint16) var41.i & 0xff;
|
|
/* 3: select1wb */
|
|
var43 = ((orc_uint16) var41.i >> 8) & 0xff;
|
|
/* 4: loadb */
|
|
var38 = ptr5[i];
|
|
/* 5: mergebw */
|
|
var44.i = ((orc_uint8) var42) | ((orc_uint8) var38 << 8);
|
|
/* 6: loadb */
|
|
var39 = ptr6[i];
|
|
/* 7: mergebw */
|
|
var45.i = ((orc_uint8) var43) | ((orc_uint8) var39 << 8);
|
|
/* 8: mergewl */
|
|
var40.i = ((orc_uint16) var44.i) | ((orc_uint16) var45.i << 16);
|
|
/* 9: storel */
|
|
ptr0[i] = var40;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_pack_yuyv (orc_uint32 * d1, const guint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_pack_yuyv");
|
|
orc_program_set_backup_function (p, _backup_orc_pack_yuyv);
|
|
orc_program_add_destination (p, 4, "d1");
|
|
orc_program_add_source (p, 2, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_source (p, 1, "s3");
|
|
orc_program_add_temporary (p, 1, "t1");
|
|
orc_program_add_temporary (p, 1, "t2");
|
|
orc_program_add_temporary (p, 2, "t3");
|
|
orc_program_add_temporary (p, 2, "t4");
|
|
orc_program_add_temporary (p, 2, "t5");
|
|
|
|
orc_program_append_2 (p, "copyw", 0, ORC_VAR_T5, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T1, ORC_VAR_T5,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T2, ORC_VAR_T5,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_S2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_S3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T4,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->arrays[ORC_VAR_S3] = (void *) s3;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_unpack_uyvy_y */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_unpack_uyvy_y (orc_uint8 * d1, const orc_uint16 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
orc_union16 var32;
|
|
orc_int8 var33;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union16 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var32 = ptr4[i];
|
|
/* 1: select1wb */
|
|
var33 = ((orc_uint16) var32.i >> 8) & 0xff;
|
|
/* 2: storeb */
|
|
ptr0[i] = var33;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_unpack_uyvy_y (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
orc_union16 var32;
|
|
orc_int8 var33;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union16 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var32 = ptr4[i];
|
|
/* 1: select1wb */
|
|
var33 = ((orc_uint16) var32.i >> 8) & 0xff;
|
|
/* 2: storeb */
|
|
ptr0[i] = var33;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_unpack_uyvy_y (orc_uint8 * d1, const orc_uint16 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_unpack_uyvy_y");
|
|
orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_y);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 2, "s1");
|
|
|
|
orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_S1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_unpack_uyvy_u */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_unpack_uyvy_u (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union32 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select0lw */
|
|
var35.i = (orc_uint32) var33.i & 0xffff;
|
|
/* 2: select0wb */
|
|
var34 = (orc_uint16) var35.i & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_unpack_uyvy_u (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union32 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select0lw */
|
|
var35.i = (orc_uint32) var33.i & 0xffff;
|
|
/* 2: select0wb */
|
|
var34 = (orc_uint16) var35.i & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_unpack_uyvy_u (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_unpack_uyvy_u");
|
|
orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_u);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 4, "s1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
|
|
orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_unpack_uyvy_v */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_unpack_uyvy_v (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union32 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select1lw */
|
|
var35.i = ((orc_uint32) var33.i >> 16) & 0xffff;
|
|
/* 2: select0wb */
|
|
var34 = (orc_uint16) var35.i & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_unpack_uyvy_v (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union32 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select1lw */
|
|
var35.i = ((orc_uint32) var33.i >> 16) & 0xffff;
|
|
/* 2: select0wb */
|
|
var34 = (orc_uint16) var35.i & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_unpack_uyvy_v (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_unpack_uyvy_v");
|
|
orc_program_set_backup_function (p, _backup_orc_unpack_uyvy_v);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 4, "s1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
|
|
orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_pack_uyvy */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_pack_uyvy (orc_uint32 * d1, const guint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int n)
|
|
{
|
|
int i;
|
|
orc_union32 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_int8 var39;
|
|
orc_union32 var40;
|
|
orc_union16 var41;
|
|
orc_int8 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
|
|
ptr0 = (orc_union32 *) d1;
|
|
ptr4 = (orc_union16 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
ptr6 = (orc_int8 *) s3;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var37 = ptr4[i];
|
|
/* 1: copyw */
|
|
var41.i = var37.i;
|
|
/* 2: select0wb */
|
|
var42 = (orc_uint16) var41.i & 0xff;
|
|
/* 3: select1wb */
|
|
var43 = ((orc_uint16) var41.i >> 8) & 0xff;
|
|
/* 4: loadb */
|
|
var38 = ptr5[i];
|
|
/* 5: mergebw */
|
|
var44.i = ((orc_uint8) var38) | ((orc_uint8) var42 << 8);
|
|
/* 6: loadb */
|
|
var39 = ptr6[i];
|
|
/* 7: mergebw */
|
|
var45.i = ((orc_uint8) var39) | ((orc_uint8) var43 << 8);
|
|
/* 8: mergewl */
|
|
var40.i = ((orc_uint16) var44.i) | ((orc_uint16) var45.i << 16);
|
|
/* 9: storel */
|
|
ptr0[i] = var40;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_pack_uyvy (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_union32 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_int8 var39;
|
|
orc_union32 var40;
|
|
orc_union16 var41;
|
|
orc_int8 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
|
|
ptr0 = (orc_union32 *) ex->arrays[0];
|
|
ptr4 = (orc_union16 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
ptr6 = (orc_int8 *) ex->arrays[6];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var37 = ptr4[i];
|
|
/* 1: copyw */
|
|
var41.i = var37.i;
|
|
/* 2: select0wb */
|
|
var42 = (orc_uint16) var41.i & 0xff;
|
|
/* 3: select1wb */
|
|
var43 = ((orc_uint16) var41.i >> 8) & 0xff;
|
|
/* 4: loadb */
|
|
var38 = ptr5[i];
|
|
/* 5: mergebw */
|
|
var44.i = ((orc_uint8) var38) | ((orc_uint8) var42 << 8);
|
|
/* 6: loadb */
|
|
var39 = ptr6[i];
|
|
/* 7: mergebw */
|
|
var45.i = ((orc_uint8) var39) | ((orc_uint8) var43 << 8);
|
|
/* 8: mergewl */
|
|
var40.i = ((orc_uint16) var44.i) | ((orc_uint16) var45.i << 16);
|
|
/* 9: storel */
|
|
ptr0[i] = var40;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_pack_uyvy (orc_uint32 * d1, const guint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_pack_uyvy");
|
|
orc_program_set_backup_function (p, _backup_orc_pack_uyvy);
|
|
orc_program_add_destination (p, 4, "d1");
|
|
orc_program_add_source (p, 2, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_source (p, 1, "s3");
|
|
orc_program_add_temporary (p, 1, "t1");
|
|
orc_program_add_temporary (p, 1, "t2");
|
|
orc_program_add_temporary (p, 2, "t3");
|
|
orc_program_add_temporary (p, 2, "t4");
|
|
orc_program_add_temporary (p, 2, "t5");
|
|
|
|
orc_program_append_2 (p, "copyw", 0, ORC_VAR_T5, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_T1, ORC_VAR_T5,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select1wb", 0, ORC_VAR_T2, ORC_VAR_T5,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T3, ORC_VAR_S2, ORC_VAR_T1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T4, ORC_VAR_S3, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T3, ORC_VAR_T4,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->arrays[ORC_VAR_S3] = (void *) s3;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_addc_convert_u8_s16 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_addc_convert_u8_s16 (orc_uint8 * d1, const gint16 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
orc_union16 var33;
|
|
orc_union16 var34;
|
|
orc_int8 var35;
|
|
orc_union16 var36;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union16 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var33 = ptr4[i];
|
|
/* 1: loadpw */
|
|
var34.i = 128;
|
|
/* 2: addw */
|
|
var36.i = var33.i + var34.i;
|
|
/* 3: convsuswb */
|
|
var35 = ORC_CLAMP_UB (var36.i);
|
|
/* 4: storeb */
|
|
ptr0[i] = var35;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_addc_convert_u8_s16 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union16 *ORC_RESTRICT ptr4;
|
|
orc_union16 var33;
|
|
orc_union16 var34;
|
|
orc_int8 var35;
|
|
orc_union16 var36;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union16 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadw */
|
|
var33 = ptr4[i];
|
|
/* 1: loadpw */
|
|
var34.i = 128;
|
|
/* 2: addw */
|
|
var36.i = var33.i + var34.i;
|
|
/* 3: convsuswb */
|
|
var35 = ORC_CLAMP_UB (var36.i);
|
|
/* 4: storeb */
|
|
ptr0[i] = var35;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_addc_convert_u8_s16 (orc_uint8 * d1, const gint16 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_addc_convert_u8_s16");
|
|
orc_program_set_backup_function (p, _backup_orc_addc_convert_u8_s16);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 2, "s1");
|
|
orc_program_add_constant (p, 2, 0x00000080, "c1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_subc_convert_s16_u8 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_subc_convert_s16_u8 (gint16 * d1, const orc_uint8 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_union16 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
orc_int8 var33;
|
|
orc_union16 var34;
|
|
orc_union16 var35;
|
|
orc_union16 var36;
|
|
|
|
ptr0 = (orc_union16 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var33 = ptr4[i];
|
|
/* 1: convubw */
|
|
var36.i = (orc_uint8) var33;
|
|
/* 2: loadpw */
|
|
var34.i = 128;
|
|
/* 3: subw */
|
|
var35.i = var36.i - var34.i;
|
|
/* 4: storew */
|
|
ptr0[i] = var35;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_subc_convert_s16_u8 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_union16 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
orc_int8 var33;
|
|
orc_union16 var34;
|
|
orc_union16 var35;
|
|
orc_union16 var36;
|
|
|
|
ptr0 = (orc_union16 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var33 = ptr4[i];
|
|
/* 1: convubw */
|
|
var36.i = (orc_uint8) var33;
|
|
/* 2: loadpw */
|
|
var34.i = 128;
|
|
/* 3: subw */
|
|
var35.i = var36.i - var34.i;
|
|
/* 4: storew */
|
|
ptr0[i] = var35;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_subc_convert_s16_u8 (gint16 * d1, const orc_uint8 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_subc_convert_s16_u8");
|
|
orc_program_set_backup_function (p, _backup_orc_subc_convert_s16_u8);
|
|
orc_program_add_destination (p, 2, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_constant (p, 2, 0x00000080, "c1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "subw", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_splat_u8_ns */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_splat_u8_ns (orc_uint8 * d1, int p1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
orc_int8 var32;
|
|
orc_int8 var33;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadpb */
|
|
var32 = p1;
|
|
/* 1: copyb */
|
|
var33 = var32;
|
|
/* 2: storeb */
|
|
ptr0[i] = var33;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_splat_u8_ns (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
orc_int8 var32;
|
|
orc_int8 var33;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadpb */
|
|
var32 = ex->params[24];
|
|
/* 1: copyb */
|
|
var33 = var32;
|
|
/* 2: storeb */
|
|
ptr0[i] = var33;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_splat_u8_ns (orc_uint8 * d1, int p1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_splat_u8_ns");
|
|
orc_program_set_backup_function (p, _backup_orc_splat_u8_ns);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_parameter (p, 1, "p1");
|
|
|
|
orc_program_append_2 (p, "copyb", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_splat_s16_ns */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_splat_s16_ns (gint16 * d1, int p1, int n)
|
|
{
|
|
int i;
|
|
orc_union16 *ORC_RESTRICT ptr0;
|
|
orc_union16 var32;
|
|
orc_union16 var33;
|
|
|
|
ptr0 = (orc_union16 *) d1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadpw */
|
|
var32.i = p1;
|
|
/* 1: copyw */
|
|
var33.i = var32.i;
|
|
/* 2: storew */
|
|
ptr0[i] = var33;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_splat_s16_ns (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_union16 *ORC_RESTRICT ptr0;
|
|
orc_union16 var32;
|
|
orc_union16 var33;
|
|
|
|
ptr0 = (orc_union16 *) ex->arrays[0];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadpw */
|
|
var32.i = ex->params[24];
|
|
/* 1: copyw */
|
|
var33.i = var32.i;
|
|
/* 2: storew */
|
|
ptr0[i] = var33;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_splat_s16_ns (gint16 * d1, int p1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_splat_s16_ns");
|
|
orc_program_set_backup_function (p, _backup_orc_splat_s16_ns);
|
|
orc_program_add_destination (p, 2, "d1");
|
|
orc_program_add_parameter (p, 2, "p1");
|
|
|
|
orc_program_append_2 (p, "copyw", 0, ORC_VAR_D1, ORC_VAR_P1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_matrix2_u8 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_matrix2_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2, int p1,
|
|
int p2, int p3, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_union16 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: convubw */
|
|
var40.i = (orc_uint8) var34;
|
|
/* 2: loadpw */
|
|
var35.i = p1;
|
|
/* 3: mullw */
|
|
var41.i = (var40.i * var35.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var36 = ptr5[i];
|
|
/* 5: convubw */
|
|
var42.i = (orc_uint8) var36;
|
|
/* 6: loadpw */
|
|
var37.i = p2;
|
|
/* 7: mullw */
|
|
var43.i = (var42.i * var37.i) & 0xffff;
|
|
/* 8: addw */
|
|
var44.i = var41.i + var43.i;
|
|
/* 9: loadpw */
|
|
var38.i = p3;
|
|
/* 10: addw */
|
|
var45.i = var44.i + var38.i;
|
|
/* 11: shrsw */
|
|
var46.i = var45.i >> 6;
|
|
/* 12: convsuswb */
|
|
var39 = ORC_CLAMP_UB (var46.i);
|
|
/* 13: storeb */
|
|
ptr0[i] = var39;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_matrix2_u8 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_union16 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: convubw */
|
|
var40.i = (orc_uint8) var34;
|
|
/* 2: loadpw */
|
|
var35.i = ex->params[24];
|
|
/* 3: mullw */
|
|
var41.i = (var40.i * var35.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var36 = ptr5[i];
|
|
/* 5: convubw */
|
|
var42.i = (orc_uint8) var36;
|
|
/* 6: loadpw */
|
|
var37.i = ex->params[25];
|
|
/* 7: mullw */
|
|
var43.i = (var42.i * var37.i) & 0xffff;
|
|
/* 8: addw */
|
|
var44.i = var41.i + var43.i;
|
|
/* 9: loadpw */
|
|
var38.i = ex->params[26];
|
|
/* 10: addw */
|
|
var45.i = var44.i + var38.i;
|
|
/* 11: shrsw */
|
|
var46.i = var45.i >> 6;
|
|
/* 12: convsuswb */
|
|
var39 = ORC_CLAMP_UB (var46.i);
|
|
/* 13: storeb */
|
|
ptr0[i] = var39;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_matrix2_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2, int p1,
|
|
int p2, int p3, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_matrix2_u8");
|
|
orc_program_set_backup_function (p, _backup_orc_matrix2_u8);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_constant (p, 2, 0x00000006, "c1");
|
|
orc_program_add_parameter (p, 2, "p1");
|
|
orc_program_add_parameter (p, 2, "p2");
|
|
orc_program_add_parameter (p, 2, "p3");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
ex->params[ORC_VAR_P2] = p2;
|
|
ex->params[ORC_VAR_P3] = p3;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_matrix2_11_u8 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_matrix2_11_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2, int p1,
|
|
int p2, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_union16 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var36 = ptr4[i];
|
|
/* 1: convubw */
|
|
var44.i = (orc_uint8) var36;
|
|
/* 2: loadpw */
|
|
var37.i = 16;
|
|
/* 3: subw */
|
|
var45.i = var44.i - var37.i;
|
|
/* 4: loadpw */
|
|
var38.i = p1;
|
|
/* 5: mullw */
|
|
var46.i = (var45.i * var38.i) & 0xffff;
|
|
/* 6: loadb */
|
|
var39 = ptr5[i];
|
|
/* 7: convubw */
|
|
var47.i = (orc_uint8) var39;
|
|
/* 8: loadpw */
|
|
var40.i = 128;
|
|
/* 9: subw */
|
|
var48.i = var47.i - var40.i;
|
|
/* 10: loadpw */
|
|
var41.i = p2;
|
|
/* 11: mullw */
|
|
var49.i = (var48.i * var41.i) & 0xffff;
|
|
/* 12: addw */
|
|
var50.i = var46.i + var49.i;
|
|
/* 13: loadpw */
|
|
var42.i = 128;
|
|
/* 14: addw */
|
|
var51.i = var50.i + var42.i;
|
|
/* 15: shrsw */
|
|
var52.i = var51.i >> 8;
|
|
/* 16: addw */
|
|
var53.i = var52.i + var45.i;
|
|
/* 17: addw */
|
|
var54.i = var53.i + var48.i;
|
|
/* 18: convsuswb */
|
|
var43 = ORC_CLAMP_UB (var54.i);
|
|
/* 19: storeb */
|
|
ptr0[i] = var43;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_matrix2_11_u8 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_union16 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var36 = ptr4[i];
|
|
/* 1: convubw */
|
|
var44.i = (orc_uint8) var36;
|
|
/* 2: loadpw */
|
|
var37.i = 16;
|
|
/* 3: subw */
|
|
var45.i = var44.i - var37.i;
|
|
/* 4: loadpw */
|
|
var38.i = ex->params[24];
|
|
/* 5: mullw */
|
|
var46.i = (var45.i * var38.i) & 0xffff;
|
|
/* 6: loadb */
|
|
var39 = ptr5[i];
|
|
/* 7: convubw */
|
|
var47.i = (orc_uint8) var39;
|
|
/* 8: loadpw */
|
|
var40.i = 128;
|
|
/* 9: subw */
|
|
var48.i = var47.i - var40.i;
|
|
/* 10: loadpw */
|
|
var41.i = ex->params[25];
|
|
/* 11: mullw */
|
|
var49.i = (var48.i * var41.i) & 0xffff;
|
|
/* 12: addw */
|
|
var50.i = var46.i + var49.i;
|
|
/* 13: loadpw */
|
|
var42.i = 128;
|
|
/* 14: addw */
|
|
var51.i = var50.i + var42.i;
|
|
/* 15: shrsw */
|
|
var52.i = var51.i >> 8;
|
|
/* 16: addw */
|
|
var53.i = var52.i + var45.i;
|
|
/* 17: addw */
|
|
var54.i = var53.i + var48.i;
|
|
/* 18: convsuswb */
|
|
var43 = ORC_CLAMP_UB (var54.i);
|
|
/* 19: storeb */
|
|
ptr0[i] = var43;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_matrix2_11_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2, int p1,
|
|
int p2, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_matrix2_11_u8");
|
|
orc_program_set_backup_function (p, _backup_orc_matrix2_11_u8);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_constant (p, 2, 0x00000010, "c1");
|
|
orc_program_add_constant (p, 2, 0x00000080, "c2");
|
|
orc_program_add_constant (p, 2, 0x00000080, "c3");
|
|
orc_program_add_constant (p, 2, 0x00000008, "c4");
|
|
orc_program_add_parameter (p, 2, "p1");
|
|
orc_program_add_parameter (p, 2, "p2");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
orc_program_add_temporary (p, 2, "t3");
|
|
orc_program_add_temporary (p, 2, "t4");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_P1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_P2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C4,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T3,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
ex->params[ORC_VAR_P2] = p2;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_matrix2_12_u8 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_matrix2_12_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2, int p1,
|
|
int p2, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_union16 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
orc_union16 var55;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var36 = ptr4[i];
|
|
/* 1: convubw */
|
|
var44.i = (orc_uint8) var36;
|
|
/* 2: loadpw */
|
|
var37.i = 16;
|
|
/* 3: subw */
|
|
var45.i = var44.i - var37.i;
|
|
/* 4: loadpw */
|
|
var38.i = p1;
|
|
/* 5: mullw */
|
|
var46.i = (var45.i * var38.i) & 0xffff;
|
|
/* 6: loadb */
|
|
var39 = ptr5[i];
|
|
/* 7: convubw */
|
|
var47.i = (orc_uint8) var39;
|
|
/* 8: loadpw */
|
|
var40.i = 128;
|
|
/* 9: subw */
|
|
var48.i = var47.i - var40.i;
|
|
/* 10: loadpw */
|
|
var41.i = p2;
|
|
/* 11: mullw */
|
|
var49.i = (var48.i * var41.i) & 0xffff;
|
|
/* 12: addw */
|
|
var50.i = var46.i + var49.i;
|
|
/* 13: loadpw */
|
|
var42.i = 128;
|
|
/* 14: addw */
|
|
var51.i = var50.i + var42.i;
|
|
/* 15: shrsw */
|
|
var52.i = var51.i >> 8;
|
|
/* 16: addw */
|
|
var53.i = var52.i + var45.i;
|
|
/* 17: addw */
|
|
var54.i = var53.i + var48.i;
|
|
/* 18: addw */
|
|
var55.i = var54.i + var48.i;
|
|
/* 19: convsuswb */
|
|
var43 = ORC_CLAMP_UB (var55.i);
|
|
/* 20: storeb */
|
|
ptr0[i] = var43;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_matrix2_12_u8 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_union16 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
orc_union16 var55;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var36 = ptr4[i];
|
|
/* 1: convubw */
|
|
var44.i = (orc_uint8) var36;
|
|
/* 2: loadpw */
|
|
var37.i = 16;
|
|
/* 3: subw */
|
|
var45.i = var44.i - var37.i;
|
|
/* 4: loadpw */
|
|
var38.i = ex->params[24];
|
|
/* 5: mullw */
|
|
var46.i = (var45.i * var38.i) & 0xffff;
|
|
/* 6: loadb */
|
|
var39 = ptr5[i];
|
|
/* 7: convubw */
|
|
var47.i = (orc_uint8) var39;
|
|
/* 8: loadpw */
|
|
var40.i = 128;
|
|
/* 9: subw */
|
|
var48.i = var47.i - var40.i;
|
|
/* 10: loadpw */
|
|
var41.i = ex->params[25];
|
|
/* 11: mullw */
|
|
var49.i = (var48.i * var41.i) & 0xffff;
|
|
/* 12: addw */
|
|
var50.i = var46.i + var49.i;
|
|
/* 13: loadpw */
|
|
var42.i = 128;
|
|
/* 14: addw */
|
|
var51.i = var50.i + var42.i;
|
|
/* 15: shrsw */
|
|
var52.i = var51.i >> 8;
|
|
/* 16: addw */
|
|
var53.i = var52.i + var45.i;
|
|
/* 17: addw */
|
|
var54.i = var53.i + var48.i;
|
|
/* 18: addw */
|
|
var55.i = var54.i + var48.i;
|
|
/* 19: convsuswb */
|
|
var43 = ORC_CLAMP_UB (var55.i);
|
|
/* 20: storeb */
|
|
ptr0[i] = var43;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_matrix2_12_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2, int p1,
|
|
int p2, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_matrix2_12_u8");
|
|
orc_program_set_backup_function (p, _backup_orc_matrix2_12_u8);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_constant (p, 2, 0x00000010, "c1");
|
|
orc_program_add_constant (p, 2, 0x00000080, "c2");
|
|
orc_program_add_constant (p, 2, 0x00000080, "c3");
|
|
orc_program_add_constant (p, 2, 0x00000008, "c4");
|
|
orc_program_add_parameter (p, 2, "p1");
|
|
orc_program_add_parameter (p, 2, "p2");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
orc_program_add_temporary (p, 2, "t3");
|
|
orc_program_add_temporary (p, 2, "t4");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_P1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T4, ORC_VAR_T2, ORC_VAR_P2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T4,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C4,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T3,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
ex->params[ORC_VAR_P2] = p2;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_matrix3_u8 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_matrix3_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
const guint8 * s3, int p1, int p2, int p3, int p4, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
orc_int8 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
ptr6 = (orc_int8 *) s3;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: convubw */
|
|
var42.i = (orc_uint8) var34;
|
|
/* 2: loadpw */
|
|
var35.i = p1;
|
|
/* 3: mullw */
|
|
var43.i = (var42.i * var35.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var36 = ptr5[i];
|
|
/* 5: convubw */
|
|
var44.i = (orc_uint8) var36;
|
|
/* 6: loadpw */
|
|
var37.i = p2;
|
|
/* 7: mullw */
|
|
var45.i = (var44.i * var37.i) & 0xffff;
|
|
/* 8: addw */
|
|
var46.i = var43.i + var45.i;
|
|
/* 9: loadb */
|
|
var38 = ptr6[i];
|
|
/* 10: convubw */
|
|
var47.i = (orc_uint8) var38;
|
|
/* 11: loadpw */
|
|
var39.i = p3;
|
|
/* 12: mullw */
|
|
var48.i = (var47.i * var39.i) & 0xffff;
|
|
/* 13: addw */
|
|
var49.i = var46.i + var48.i;
|
|
/* 14: loadpw */
|
|
var40.i = p4;
|
|
/* 15: addw */
|
|
var50.i = var49.i + var40.i;
|
|
/* 16: shrsw */
|
|
var51.i = var50.i >> 6;
|
|
/* 17: convsuswb */
|
|
var41 = ORC_CLAMP_UB (var51.i);
|
|
/* 18: storeb */
|
|
ptr0[i] = var41;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_matrix3_u8 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
orc_int8 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
ptr6 = (orc_int8 *) ex->arrays[6];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: convubw */
|
|
var42.i = (orc_uint8) var34;
|
|
/* 2: loadpw */
|
|
var35.i = ex->params[24];
|
|
/* 3: mullw */
|
|
var43.i = (var42.i * var35.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var36 = ptr5[i];
|
|
/* 5: convubw */
|
|
var44.i = (orc_uint8) var36;
|
|
/* 6: loadpw */
|
|
var37.i = ex->params[25];
|
|
/* 7: mullw */
|
|
var45.i = (var44.i * var37.i) & 0xffff;
|
|
/* 8: addw */
|
|
var46.i = var43.i + var45.i;
|
|
/* 9: loadb */
|
|
var38 = ptr6[i];
|
|
/* 10: convubw */
|
|
var47.i = (orc_uint8) var38;
|
|
/* 11: loadpw */
|
|
var39.i = ex->params[26];
|
|
/* 12: mullw */
|
|
var48.i = (var47.i * var39.i) & 0xffff;
|
|
/* 13: addw */
|
|
var49.i = var46.i + var48.i;
|
|
/* 14: loadpw */
|
|
var40.i = ex->params[27];
|
|
/* 15: addw */
|
|
var50.i = var49.i + var40.i;
|
|
/* 16: shrsw */
|
|
var51.i = var50.i >> 6;
|
|
/* 17: convsuswb */
|
|
var41 = ORC_CLAMP_UB (var51.i);
|
|
/* 18: storeb */
|
|
ptr0[i] = var41;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_matrix3_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
const guint8 * s3, int p1, int p2, int p3, int p4, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_matrix3_u8");
|
|
orc_program_set_backup_function (p, _backup_orc_matrix3_u8);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_source (p, 1, "s3");
|
|
orc_program_add_constant (p, 2, 0x00000006, "c1");
|
|
orc_program_add_parameter (p, 2, "p1");
|
|
orc_program_add_parameter (p, 2, "p2");
|
|
orc_program_add_parameter (p, 2, "p3");
|
|
orc_program_add_parameter (p, 2, "p4");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->arrays[ORC_VAR_S3] = (void *) s3;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
ex->params[ORC_VAR_P2] = p2;
|
|
ex->params[ORC_VAR_P3] = p3;
|
|
ex->params[ORC_VAR_P4] = p4;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_matrix3_100_u8 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_matrix3_100_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
const guint8 * s3, int p1, int p2, int p3, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var35;
|
|
orc_union16 var36;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
orc_int8 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_int8 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
orc_union16 var55;
|
|
orc_union16 var56;
|
|
orc_union16 var57;
|
|
orc_union16 var58;
|
|
orc_union16 var59;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
ptr6 = (orc_int8 *) s3;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var35 = ptr4[i];
|
|
/* 1: convubw */
|
|
var46.i = (orc_uint8) var35;
|
|
/* 2: loadpw */
|
|
var36.i = 16;
|
|
/* 3: subw */
|
|
var47.i = var46.i - var36.i;
|
|
/* 4: loadpw */
|
|
var37.i = p1;
|
|
/* 5: mullw */
|
|
var48.i = (var47.i * var37.i) & 0xffff;
|
|
/* 6: loadb */
|
|
var38 = ptr5[i];
|
|
/* 7: convubw */
|
|
var49.i = (orc_uint8) var38;
|
|
/* 8: loadpw */
|
|
var39.i = 128;
|
|
/* 9: subw */
|
|
var50.i = var49.i - var39.i;
|
|
/* 10: loadpw */
|
|
var40.i = p2;
|
|
/* 11: mullw */
|
|
var51.i = (var50.i * var40.i) & 0xffff;
|
|
/* 12: addw */
|
|
var52.i = var48.i + var51.i;
|
|
/* 13: loadb */
|
|
var41 = ptr6[i];
|
|
/* 14: convubw */
|
|
var53.i = (orc_uint8) var41;
|
|
/* 15: loadpw */
|
|
var42.i = 128;
|
|
/* 16: subw */
|
|
var54.i = var53.i - var42.i;
|
|
/* 17: loadpw */
|
|
var43.i = p3;
|
|
/* 18: mullw */
|
|
var55.i = (var54.i * var43.i) & 0xffff;
|
|
/* 19: addw */
|
|
var56.i = var52.i + var55.i;
|
|
/* 20: loadpw */
|
|
var44.i = 128;
|
|
/* 21: addw */
|
|
var57.i = var56.i + var44.i;
|
|
/* 22: shrsw */
|
|
var58.i = var57.i >> 8;
|
|
/* 23: addw */
|
|
var59.i = var58.i + var47.i;
|
|
/* 24: convsuswb */
|
|
var45 = ORC_CLAMP_UB (var59.i);
|
|
/* 25: storeb */
|
|
ptr0[i] = var45;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_matrix3_100_u8 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var35;
|
|
orc_union16 var36;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
orc_int8 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_int8 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
orc_union16 var55;
|
|
orc_union16 var56;
|
|
orc_union16 var57;
|
|
orc_union16 var58;
|
|
orc_union16 var59;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
ptr6 = (orc_int8 *) ex->arrays[6];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var35 = ptr4[i];
|
|
/* 1: convubw */
|
|
var46.i = (orc_uint8) var35;
|
|
/* 2: loadpw */
|
|
var36.i = 16;
|
|
/* 3: subw */
|
|
var47.i = var46.i - var36.i;
|
|
/* 4: loadpw */
|
|
var37.i = ex->params[24];
|
|
/* 5: mullw */
|
|
var48.i = (var47.i * var37.i) & 0xffff;
|
|
/* 6: loadb */
|
|
var38 = ptr5[i];
|
|
/* 7: convubw */
|
|
var49.i = (orc_uint8) var38;
|
|
/* 8: loadpw */
|
|
var39.i = 128;
|
|
/* 9: subw */
|
|
var50.i = var49.i - var39.i;
|
|
/* 10: loadpw */
|
|
var40.i = ex->params[25];
|
|
/* 11: mullw */
|
|
var51.i = (var50.i * var40.i) & 0xffff;
|
|
/* 12: addw */
|
|
var52.i = var48.i + var51.i;
|
|
/* 13: loadb */
|
|
var41 = ptr6[i];
|
|
/* 14: convubw */
|
|
var53.i = (orc_uint8) var41;
|
|
/* 15: loadpw */
|
|
var42.i = 128;
|
|
/* 16: subw */
|
|
var54.i = var53.i - var42.i;
|
|
/* 17: loadpw */
|
|
var43.i = ex->params[26];
|
|
/* 18: mullw */
|
|
var55.i = (var54.i * var43.i) & 0xffff;
|
|
/* 19: addw */
|
|
var56.i = var52.i + var55.i;
|
|
/* 20: loadpw */
|
|
var44.i = 128;
|
|
/* 21: addw */
|
|
var57.i = var56.i + var44.i;
|
|
/* 22: shrsw */
|
|
var58.i = var57.i >> 8;
|
|
/* 23: addw */
|
|
var59.i = var58.i + var47.i;
|
|
/* 24: convsuswb */
|
|
var45 = ORC_CLAMP_UB (var59.i);
|
|
/* 25: storeb */
|
|
ptr0[i] = var45;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_matrix3_100_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
const guint8 * s3, int p1, int p2, int p3, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_matrix3_100_u8");
|
|
orc_program_set_backup_function (p, _backup_orc_matrix3_100_u8);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_source (p, 1, "s3");
|
|
orc_program_add_constant (p, 2, 0x00000010, "c1");
|
|
orc_program_add_constant (p, 2, 0x00000080, "c2");
|
|
orc_program_add_constant (p, 2, 0x00000080, "c3");
|
|
orc_program_add_constant (p, 2, 0x00000080, "c4");
|
|
orc_program_add_constant (p, 2, 0x00000008, "c5");
|
|
orc_program_add_parameter (p, 2, "p1");
|
|
orc_program_add_parameter (p, 2, "p2");
|
|
orc_program_add_parameter (p, 2, "p3");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
orc_program_add_temporary (p, 2, "t3");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "subw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T3, ORC_VAR_T1, ORC_VAR_P1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "subw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_C3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C4,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_C5,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T3, ORC_VAR_T3, ORC_VAR_T1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T3,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->arrays[ORC_VAR_S3] = (void *) s3;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
ex->params[ORC_VAR_P2] = p2;
|
|
ex->params[ORC_VAR_P3] = p3;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_matrix3_100_offset_u8 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_matrix3_100_offset_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
const guint8 * s3, int p1, int p2, int p3, int p4, int p5, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var35;
|
|
orc_union16 var36;
|
|
orc_int8 var37;
|
|
orc_union16 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_int8 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
ptr6 = (orc_int8 *) s3;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var35 = ptr4[i];
|
|
/* 1: convubw */
|
|
var43.i = (orc_uint8) var35;
|
|
/* 2: loadpw */
|
|
var36.i = p1;
|
|
/* 3: mullw */
|
|
var44.i = (var43.i * var36.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var37 = ptr5[i];
|
|
/* 5: convubw */
|
|
var45.i = (orc_uint8) var37;
|
|
/* 6: loadpw */
|
|
var38.i = p2;
|
|
/* 7: mullw */
|
|
var46.i = (var45.i * var38.i) & 0xffff;
|
|
/* 8: addw */
|
|
var47.i = var44.i + var46.i;
|
|
/* 9: loadb */
|
|
var39 = ptr6[i];
|
|
/* 10: convubw */
|
|
var48.i = (orc_uint8) var39;
|
|
/* 11: loadpw */
|
|
var40.i = p3;
|
|
/* 12: mullw */
|
|
var49.i = (var48.i * var40.i) & 0xffff;
|
|
/* 13: addw */
|
|
var50.i = var47.i + var49.i;
|
|
/* 14: loadpw */
|
|
var41.i = p4;
|
|
/* 15: addw */
|
|
var51.i = var50.i + var41.i;
|
|
/* 16: shrsw */
|
|
var52.i = var51.i >> p5;
|
|
/* 17: addw */
|
|
var53.i = var52.i + var43.i;
|
|
/* 18: convsuswb */
|
|
var42 = ORC_CLAMP_UB (var53.i);
|
|
/* 19: storeb */
|
|
ptr0[i] = var42;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_matrix3_100_offset_u8 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var35;
|
|
orc_union16 var36;
|
|
orc_int8 var37;
|
|
orc_union16 var38;
|
|
orc_int8 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_int8 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
ptr6 = (orc_int8 *) ex->arrays[6];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var35 = ptr4[i];
|
|
/* 1: convubw */
|
|
var43.i = (orc_uint8) var35;
|
|
/* 2: loadpw */
|
|
var36.i = ex->params[24];
|
|
/* 3: mullw */
|
|
var44.i = (var43.i * var36.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var37 = ptr5[i];
|
|
/* 5: convubw */
|
|
var45.i = (orc_uint8) var37;
|
|
/* 6: loadpw */
|
|
var38.i = ex->params[25];
|
|
/* 7: mullw */
|
|
var46.i = (var45.i * var38.i) & 0xffff;
|
|
/* 8: addw */
|
|
var47.i = var44.i + var46.i;
|
|
/* 9: loadb */
|
|
var39 = ptr6[i];
|
|
/* 10: convubw */
|
|
var48.i = (orc_uint8) var39;
|
|
/* 11: loadpw */
|
|
var40.i = ex->params[26];
|
|
/* 12: mullw */
|
|
var49.i = (var48.i * var40.i) & 0xffff;
|
|
/* 13: addw */
|
|
var50.i = var47.i + var49.i;
|
|
/* 14: loadpw */
|
|
var41.i = ex->params[27];
|
|
/* 15: addw */
|
|
var51.i = var50.i + var41.i;
|
|
/* 16: shrsw */
|
|
var52.i = var51.i >> ex->params[28];
|
|
/* 17: addw */
|
|
var53.i = var52.i + var43.i;
|
|
/* 18: convsuswb */
|
|
var42 = ORC_CLAMP_UB (var53.i);
|
|
/* 19: storeb */
|
|
ptr0[i] = var42;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_matrix3_100_offset_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
const guint8 * s3, int p1, int p2, int p3, int p4, int p5, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_matrix3_100_offset_u8");
|
|
orc_program_set_backup_function (p, _backup_orc_matrix3_100_offset_u8);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_source (p, 1, "s3");
|
|
orc_program_add_parameter (p, 2, "p1");
|
|
orc_program_add_parameter (p, 2, "p2");
|
|
orc_program_add_parameter (p, 2, "p3");
|
|
orc_program_add_parameter (p, 2, "p4");
|
|
orc_program_add_parameter (p, 2, "p5");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
orc_program_add_temporary (p, 2, "t3");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T3, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T3, ORC_VAR_P1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P5,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->arrays[ORC_VAR_S3] = (void *) s3;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
ex->params[ORC_VAR_P2] = p2;
|
|
ex->params[ORC_VAR_P3] = p3;
|
|
ex->params[ORC_VAR_P4] = p4;
|
|
ex->params[ORC_VAR_P5] = p5;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_matrix3_000_u8 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_matrix3_000_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
const guint8 * s3, int p1, int p2, int p3, int p4, int p5, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
orc_int8 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
ptr6 = (orc_int8 *) s3;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: convubw */
|
|
var42.i = (orc_uint8) var34;
|
|
/* 2: loadpw */
|
|
var35.i = p1;
|
|
/* 3: mullw */
|
|
var43.i = (var42.i * var35.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var36 = ptr5[i];
|
|
/* 5: convubw */
|
|
var44.i = (orc_uint8) var36;
|
|
/* 6: loadpw */
|
|
var37.i = p2;
|
|
/* 7: mullw */
|
|
var45.i = (var44.i * var37.i) & 0xffff;
|
|
/* 8: addw */
|
|
var46.i = var43.i + var45.i;
|
|
/* 9: loadb */
|
|
var38 = ptr6[i];
|
|
/* 10: convubw */
|
|
var47.i = (orc_uint8) var38;
|
|
/* 11: loadpw */
|
|
var39.i = p3;
|
|
/* 12: mullw */
|
|
var48.i = (var47.i * var39.i) & 0xffff;
|
|
/* 13: addw */
|
|
var49.i = var46.i + var48.i;
|
|
/* 14: loadpw */
|
|
var40.i = p4;
|
|
/* 15: addw */
|
|
var50.i = var49.i + var40.i;
|
|
/* 16: shrsw */
|
|
var51.i = var50.i >> p5;
|
|
/* 17: convwb */
|
|
var41 = var51.i;
|
|
/* 18: storeb */
|
|
ptr0[i] = var41;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_matrix3_000_u8 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
orc_int8 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
ptr6 = (orc_int8 *) ex->arrays[6];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: convubw */
|
|
var42.i = (orc_uint8) var34;
|
|
/* 2: loadpw */
|
|
var35.i = ex->params[24];
|
|
/* 3: mullw */
|
|
var43.i = (var42.i * var35.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var36 = ptr5[i];
|
|
/* 5: convubw */
|
|
var44.i = (orc_uint8) var36;
|
|
/* 6: loadpw */
|
|
var37.i = ex->params[25];
|
|
/* 7: mullw */
|
|
var45.i = (var44.i * var37.i) & 0xffff;
|
|
/* 8: addw */
|
|
var46.i = var43.i + var45.i;
|
|
/* 9: loadb */
|
|
var38 = ptr6[i];
|
|
/* 10: convubw */
|
|
var47.i = (orc_uint8) var38;
|
|
/* 11: loadpw */
|
|
var39.i = ex->params[26];
|
|
/* 12: mullw */
|
|
var48.i = (var47.i * var39.i) & 0xffff;
|
|
/* 13: addw */
|
|
var49.i = var46.i + var48.i;
|
|
/* 14: loadpw */
|
|
var40.i = ex->params[27];
|
|
/* 15: addw */
|
|
var50.i = var49.i + var40.i;
|
|
/* 16: shrsw */
|
|
var51.i = var50.i >> ex->params[28];
|
|
/* 17: convwb */
|
|
var41 = var51.i;
|
|
/* 18: storeb */
|
|
ptr0[i] = var41;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_matrix3_000_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2,
|
|
const guint8 * s3, int p1, int p2, int p3, int p4, int p5, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_matrix3_000_u8");
|
|
orc_program_set_backup_function (p, _backup_orc_matrix3_000_u8);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_source (p, 1, "s3");
|
|
orc_program_add_parameter (p, 2, "p1");
|
|
orc_program_add_parameter (p, 2, "p2");
|
|
orc_program_add_parameter (p, 2, "p3");
|
|
orc_program_add_parameter (p, 2, "p4");
|
|
orc_program_add_parameter (p, 2, "p5");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P4,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P5,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convwb", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->arrays[ORC_VAR_S3] = (void *) s3;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
ex->params[ORC_VAR_P2] = p2;
|
|
ex->params[ORC_VAR_P3] = p3;
|
|
ex->params[ORC_VAR_P4] = p4;
|
|
ex->params[ORC_VAR_P5] = p5;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_pack_123x */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_pack_123x (guint32 * d1, const orc_uint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int p1, int n)
|
|
{
|
|
int i;
|
|
orc_union32 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var34;
|
|
orc_int8 var35;
|
|
orc_int8 var36;
|
|
orc_int8 var37;
|
|
orc_union32 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
|
|
ptr0 = (orc_union32 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
ptr6 = (orc_int8 *) s3;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: loadb */
|
|
var35 = ptr5[i];
|
|
/* 2: mergebw */
|
|
var39.i = ((orc_uint8) var34) | ((orc_uint8) var35 << 8);
|
|
/* 3: loadb */
|
|
var36 = ptr6[i];
|
|
/* 4: loadpb */
|
|
var37 = p1;
|
|
/* 5: mergebw */
|
|
var40.i = ((orc_uint8) var36) | ((orc_uint8) var37 << 8);
|
|
/* 6: mergewl */
|
|
var38.i = ((orc_uint16) var39.i) | ((orc_uint16) var40.i << 16);
|
|
/* 7: storel */
|
|
ptr0[i] = var38;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_pack_123x (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_union32 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var34;
|
|
orc_int8 var35;
|
|
orc_int8 var36;
|
|
orc_int8 var37;
|
|
orc_union32 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
|
|
ptr0 = (orc_union32 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
ptr6 = (orc_int8 *) ex->arrays[6];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: loadb */
|
|
var35 = ptr5[i];
|
|
/* 2: mergebw */
|
|
var39.i = ((orc_uint8) var34) | ((orc_uint8) var35 << 8);
|
|
/* 3: loadb */
|
|
var36 = ptr6[i];
|
|
/* 4: loadpb */
|
|
var37 = ex->params[24];
|
|
/* 5: mergebw */
|
|
var40.i = ((orc_uint8) var36) | ((orc_uint8) var37 << 8);
|
|
/* 6: mergewl */
|
|
var38.i = ((orc_uint16) var39.i) | ((orc_uint16) var40.i << 16);
|
|
/* 7: storel */
|
|
ptr0[i] = var38;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_pack_123x (guint32 * d1, const orc_uint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int p1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_pack_123x");
|
|
orc_program_set_backup_function (p, _backup_orc_pack_123x);
|
|
orc_program_add_destination (p, 4, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_source (p, 1, "s3");
|
|
orc_program_add_parameter (p, 1, "p1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
|
|
orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_S2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_P1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->arrays[ORC_VAR_S3] = (void *) s3;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* orc_pack_x123 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
orc_pack_x123 (guint32 * d1, const orc_uint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int p1, int n)
|
|
{
|
|
int i;
|
|
orc_union32 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var34;
|
|
orc_int8 var35;
|
|
orc_int8 var36;
|
|
orc_int8 var37;
|
|
orc_union32 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
|
|
ptr0 = (orc_union32 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
ptr6 = (orc_int8 *) s3;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadpb */
|
|
var34 = p1;
|
|
/* 1: loadb */
|
|
var35 = ptr4[i];
|
|
/* 2: mergebw */
|
|
var39.i = ((orc_uint8) var34) | ((orc_uint8) var35 << 8);
|
|
/* 3: loadb */
|
|
var36 = ptr5[i];
|
|
/* 4: loadb */
|
|
var37 = ptr6[i];
|
|
/* 5: mergebw */
|
|
var40.i = ((orc_uint8) var36) | ((orc_uint8) var37 << 8);
|
|
/* 6: mergewl */
|
|
var38.i = ((orc_uint16) var39.i) | ((orc_uint16) var40.i << 16);
|
|
/* 7: storel */
|
|
ptr0[i] = var38;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_orc_pack_x123 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_union32 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
orc_int8 var34;
|
|
orc_int8 var35;
|
|
orc_int8 var36;
|
|
orc_int8 var37;
|
|
orc_union32 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
|
|
ptr0 = (orc_union32 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
ptr6 = (orc_int8 *) ex->arrays[6];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadpb */
|
|
var34 = ex->params[24];
|
|
/* 1: loadb */
|
|
var35 = ptr4[i];
|
|
/* 2: mergebw */
|
|
var39.i = ((orc_uint8) var34) | ((orc_uint8) var35 << 8);
|
|
/* 3: loadb */
|
|
var36 = ptr5[i];
|
|
/* 4: loadb */
|
|
var37 = ptr6[i];
|
|
/* 5: mergebw */
|
|
var40.i = ((orc_uint8) var36) | ((orc_uint8) var37 << 8);
|
|
/* 6: mergewl */
|
|
var38.i = ((orc_uint16) var39.i) | ((orc_uint16) var40.i << 16);
|
|
/* 7: storel */
|
|
ptr0[i] = var38;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
orc_pack_x123 (guint32 * d1, const orc_uint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, int p1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "orc_pack_x123");
|
|
orc_program_set_backup_function (p, _backup_orc_pack_x123);
|
|
orc_program_add_destination (p, 4, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_source (p, 1, "s3");
|
|
orc_program_add_parameter (p, 1, "p1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
|
|
orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T1, ORC_VAR_P1, ORC_VAR_S1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergebw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_S3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mergewl", 0, ORC_VAR_D1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->arrays[ORC_VAR_S3] = (void *) s3;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_combine2_u8 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_combine2_u8 (orc_uint8 * d1, const orc_uint8 * s1, const orc_uint8 * s2,
|
|
int p1, int p2, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: convubw */
|
|
var39.i = (orc_uint8) var34;
|
|
/* 2: loadpw */
|
|
var35.i = p1;
|
|
/* 3: mullw */
|
|
var40.i = (var39.i * var35.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var36 = ptr5[i];
|
|
/* 5: convubw */
|
|
var41.i = (orc_uint8) var36;
|
|
/* 6: loadpw */
|
|
var37.i = p2;
|
|
/* 7: mullw */
|
|
var42.i = (var41.i * var37.i) & 0xffff;
|
|
/* 8: addw */
|
|
var43.i = var40.i + var42.i;
|
|
/* 9: shruw */
|
|
var44.i = ((orc_uint16) var43.i) >> 8;
|
|
/* 10: convuuswb */
|
|
var38 = ORC_CLAMP_UB ((orc_uint16) var44.i);
|
|
/* 11: storeb */
|
|
ptr0[i] = var38;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_combine2_u8 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_union16 var39;
|
|
orc_union16 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_union16 var43;
|
|
orc_union16 var44;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: convubw */
|
|
var39.i = (orc_uint8) var34;
|
|
/* 2: loadpw */
|
|
var35.i = ex->params[24];
|
|
/* 3: mullw */
|
|
var40.i = (var39.i * var35.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var36 = ptr5[i];
|
|
/* 5: convubw */
|
|
var41.i = (orc_uint8) var36;
|
|
/* 6: loadpw */
|
|
var37.i = ex->params[25];
|
|
/* 7: mullw */
|
|
var42.i = (var41.i * var37.i) & 0xffff;
|
|
/* 8: addw */
|
|
var43.i = var40.i + var42.i;
|
|
/* 9: shruw */
|
|
var44.i = ((orc_uint16) var43.i) >> 8;
|
|
/* 10: convuuswb */
|
|
var38 = ORC_CLAMP_UB ((orc_uint16) var44.i);
|
|
/* 11: storeb */
|
|
ptr0[i] = var38;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_combine2_u8 (orc_uint8 * d1, const orc_uint8 * s1, const orc_uint8 * s2,
|
|
int p1, int p2, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_combine2_u8");
|
|
orc_program_set_backup_function (p, _backup_cogorc_combine2_u8);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_constant (p, 2, 0x00000008, "c1");
|
|
orc_program_add_parameter (p, 2, "p1");
|
|
orc_program_add_parameter (p, 2, "p2");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shruw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convuuswb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
ex->params[ORC_VAR_P2] = p2;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_combine4_u8 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_combine4_u8 (orc_uint8 * d1, const orc_uint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, const orc_uint8 * s4, int p1, int p2, int p3, int p4,
|
|
int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
const orc_int8 *ORC_RESTRICT ptr7;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_union16 var39;
|
|
orc_int8 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
orc_union16 var55;
|
|
orc_union16 var56;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_int8 *) s1;
|
|
ptr5 = (orc_int8 *) s2;
|
|
ptr6 = (orc_int8 *) s3;
|
|
ptr7 = (orc_int8 *) s4;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: convubw */
|
|
var44.i = (orc_uint8) var34;
|
|
/* 2: loadpw */
|
|
var35.i = p1;
|
|
/* 3: mullw */
|
|
var45.i = (var44.i * var35.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var36 = ptr5[i];
|
|
/* 5: convubw */
|
|
var46.i = (orc_uint8) var36;
|
|
/* 6: loadpw */
|
|
var37.i = p2;
|
|
/* 7: mullw */
|
|
var47.i = (var46.i * var37.i) & 0xffff;
|
|
/* 8: addw */
|
|
var48.i = var45.i + var47.i;
|
|
/* 9: loadb */
|
|
var38 = ptr6[i];
|
|
/* 10: convubw */
|
|
var49.i = (orc_uint8) var38;
|
|
/* 11: loadpw */
|
|
var39.i = p3;
|
|
/* 12: mullw */
|
|
var50.i = (var49.i * var39.i) & 0xffff;
|
|
/* 13: addw */
|
|
var51.i = var48.i + var50.i;
|
|
/* 14: loadb */
|
|
var40 = ptr7[i];
|
|
/* 15: convubw */
|
|
var52.i = (orc_uint8) var40;
|
|
/* 16: loadpw */
|
|
var41.i = p4;
|
|
/* 17: mullw */
|
|
var53.i = (var52.i * var41.i) & 0xffff;
|
|
/* 18: addw */
|
|
var54.i = var51.i + var53.i;
|
|
/* 19: loadpw */
|
|
var42.i = 32;
|
|
/* 20: addw */
|
|
var55.i = var54.i + var42.i;
|
|
/* 21: shrsw */
|
|
var56.i = var55.i >> 6;
|
|
/* 22: convsuswb */
|
|
var43 = ORC_CLAMP_UB (var56.i);
|
|
/* 23: storeb */
|
|
ptr0[i] = var43;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_combine4_u8 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_int8 *ORC_RESTRICT ptr4;
|
|
const orc_int8 *ORC_RESTRICT ptr5;
|
|
const orc_int8 *ORC_RESTRICT ptr6;
|
|
const orc_int8 *ORC_RESTRICT ptr7;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
orc_int8 var36;
|
|
orc_union16 var37;
|
|
orc_int8 var38;
|
|
orc_union16 var39;
|
|
orc_int8 var40;
|
|
orc_union16 var41;
|
|
orc_union16 var42;
|
|
orc_int8 var43;
|
|
orc_union16 var44;
|
|
orc_union16 var45;
|
|
orc_union16 var46;
|
|
orc_union16 var47;
|
|
orc_union16 var48;
|
|
orc_union16 var49;
|
|
orc_union16 var50;
|
|
orc_union16 var51;
|
|
orc_union16 var52;
|
|
orc_union16 var53;
|
|
orc_union16 var54;
|
|
orc_union16 var55;
|
|
orc_union16 var56;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_int8 *) ex->arrays[4];
|
|
ptr5 = (orc_int8 *) ex->arrays[5];
|
|
ptr6 = (orc_int8 *) ex->arrays[6];
|
|
ptr7 = (orc_int8 *) ex->arrays[7];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadb */
|
|
var34 = ptr4[i];
|
|
/* 1: convubw */
|
|
var44.i = (orc_uint8) var34;
|
|
/* 2: loadpw */
|
|
var35.i = ex->params[24];
|
|
/* 3: mullw */
|
|
var45.i = (var44.i * var35.i) & 0xffff;
|
|
/* 4: loadb */
|
|
var36 = ptr5[i];
|
|
/* 5: convubw */
|
|
var46.i = (orc_uint8) var36;
|
|
/* 6: loadpw */
|
|
var37.i = ex->params[25];
|
|
/* 7: mullw */
|
|
var47.i = (var46.i * var37.i) & 0xffff;
|
|
/* 8: addw */
|
|
var48.i = var45.i + var47.i;
|
|
/* 9: loadb */
|
|
var38 = ptr6[i];
|
|
/* 10: convubw */
|
|
var49.i = (orc_uint8) var38;
|
|
/* 11: loadpw */
|
|
var39.i = ex->params[26];
|
|
/* 12: mullw */
|
|
var50.i = (var49.i * var39.i) & 0xffff;
|
|
/* 13: addw */
|
|
var51.i = var48.i + var50.i;
|
|
/* 14: loadb */
|
|
var40 = ptr7[i];
|
|
/* 15: convubw */
|
|
var52.i = (orc_uint8) var40;
|
|
/* 16: loadpw */
|
|
var41.i = ex->params[27];
|
|
/* 17: mullw */
|
|
var53.i = (var52.i * var41.i) & 0xffff;
|
|
/* 18: addw */
|
|
var54.i = var51.i + var53.i;
|
|
/* 19: loadpw */
|
|
var42.i = 32;
|
|
/* 20: addw */
|
|
var55.i = var54.i + var42.i;
|
|
/* 21: shrsw */
|
|
var56.i = var55.i >> 6;
|
|
/* 22: convsuswb */
|
|
var43 = ORC_CLAMP_UB (var56.i);
|
|
/* 23: storeb */
|
|
ptr0[i] = var43;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_combine4_u8 (orc_uint8 * d1, const orc_uint8 * s1, const orc_uint8 * s2,
|
|
const orc_uint8 * s3, const orc_uint8 * s4, int p1, int p2, int p3, int p4,
|
|
int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_combine4_u8");
|
|
orc_program_set_backup_function (p, _backup_cogorc_combine4_u8);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 1, "s1");
|
|
orc_program_add_source (p, 1, "s2");
|
|
orc_program_add_source (p, 1, "s3");
|
|
orc_program_add_source (p, 1, "s4");
|
|
orc_program_add_constant (p, 2, 0x00000020, "c1");
|
|
orc_program_add_constant (p, 2, 0x00000006, "c2");
|
|
orc_program_add_parameter (p, 2, "p1");
|
|
orc_program_add_parameter (p, 2, "p2");
|
|
orc_program_add_parameter (p, 2, "p3");
|
|
orc_program_add_parameter (p, 2, "p4");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
orc_program_add_temporary (p, 2, "t2");
|
|
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T1, ORC_VAR_S1, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_P1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S2, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S3, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P3,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convubw", 0, ORC_VAR_T2, ORC_VAR_S4, ORC_VAR_D1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "mullw", 0, ORC_VAR_T2, ORC_VAR_T2, ORC_VAR_P4,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_T2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "addw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C1,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "shrsw", 0, ORC_VAR_T1, ORC_VAR_T1, ORC_VAR_C2,
|
|
ORC_VAR_D1);
|
|
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
ex->arrays[ORC_VAR_S2] = (void *) s2;
|
|
ex->arrays[ORC_VAR_S3] = (void *) s3;
|
|
ex->arrays[ORC_VAR_S4] = (void *) s4;
|
|
ex->params[ORC_VAR_P1] = p1;
|
|
ex->params[ORC_VAR_P2] = p2;
|
|
ex->params[ORC_VAR_P3] = p3;
|
|
ex->params[ORC_VAR_P4] = p4;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_unpack_axyz_0 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_unpack_axyz_0 (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union32 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select0lw */
|
|
var35.i = (orc_uint32) var33.i & 0xffff;
|
|
/* 2: select0wb */
|
|
var34 = (orc_uint16) var35.i & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_unpack_axyz_0 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union32 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select0lw */
|
|
var35.i = (orc_uint32) var33.i & 0xffff;
|
|
/* 2: select0wb */
|
|
var34 = (orc_uint16) var35.i & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_unpack_axyz_0 (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_unpack_axyz_0");
|
|
orc_program_set_backup_function (p, _backup_cogorc_unpack_axyz_0);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 4, "s1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
|
|
orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_unpack_axyz_1 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_unpack_axyz_1 (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union32 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select0lw */
|
|
var35.i = (orc_uint32) var33.i & 0xffff;
|
|
/* 2: select1wb */
|
|
var34 = ((orc_uint16) var35.i >> 8) & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_unpack_axyz_1 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union32 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select0lw */
|
|
var35.i = (orc_uint32) var33.i & 0xffff;
|
|
/* 2: select1wb */
|
|
var34 = ((orc_uint16) var35.i >> 8) & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_unpack_axyz_1 (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_unpack_axyz_1");
|
|
orc_program_set_backup_function (p, _backup_cogorc_unpack_axyz_1);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 4, "s1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
|
|
orc_program_append_2 (p, "select0lw", 0, ORC_VAR_T1, ORC_VAR_S1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_unpack_axyz_2 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_unpack_axyz_2 (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union32 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select1lw */
|
|
var35.i = ((orc_uint32) var33.i >> 16) & 0xffff;
|
|
/* 2: select0wb */
|
|
var34 = (orc_uint16) var35.i & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_unpack_axyz_2 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union32 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select1lw */
|
|
var35.i = ((orc_uint32) var33.i >> 16) & 0xffff;
|
|
/* 2: select0wb */
|
|
var34 = (orc_uint16) var35.i & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_unpack_axyz_2 (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_unpack_axyz_2");
|
|
orc_program_set_backup_function (p, _backup_cogorc_unpack_axyz_2);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 4, "s1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
|
|
orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select0wb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|
|
|
|
|
|
/* cogorc_unpack_axyz_3 */
|
|
#ifdef DISABLE_ORC
|
|
void
|
|
cogorc_unpack_axyz_3 (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
int i;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) d1;
|
|
ptr4 = (orc_union32 *) s1;
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select1lw */
|
|
var35.i = ((orc_uint32) var33.i >> 16) & 0xffff;
|
|
/* 2: select1wb */
|
|
var34 = ((orc_uint16) var35.i >> 8) & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
static void
|
|
_backup_cogorc_unpack_axyz_3 (OrcExecutor * ORC_RESTRICT ex)
|
|
{
|
|
int i;
|
|
int n = ex->n;
|
|
orc_int8 *ORC_RESTRICT ptr0;
|
|
const orc_union32 *ORC_RESTRICT ptr4;
|
|
orc_union32 var33;
|
|
orc_int8 var34;
|
|
orc_union16 var35;
|
|
|
|
ptr0 = (orc_int8 *) ex->arrays[0];
|
|
ptr4 = (orc_union32 *) ex->arrays[4];
|
|
|
|
for (i = 0; i < n; i++) {
|
|
/* 0: loadl */
|
|
var33 = ptr4[i];
|
|
/* 1: select1lw */
|
|
var35.i = ((orc_uint32) var33.i >> 16) & 0xffff;
|
|
/* 2: select1wb */
|
|
var34 = ((orc_uint16) var35.i >> 8) & 0xff;
|
|
/* 3: storeb */
|
|
ptr0[i] = var34;
|
|
}
|
|
|
|
}
|
|
|
|
void
|
|
cogorc_unpack_axyz_3 (orc_uint8 * d1, const orc_uint32 * s1, int n)
|
|
{
|
|
OrcExecutor _ex, *ex = &_ex;
|
|
static int p_inited = 0;
|
|
static OrcProgram *p = 0;
|
|
void (*func) (OrcExecutor *);
|
|
|
|
if (!p_inited) {
|
|
orc_once_mutex_lock ();
|
|
if (!p_inited) {
|
|
OrcCompileResult result;
|
|
|
|
p = orc_program_new ();
|
|
orc_program_set_name (p, "cogorc_unpack_axyz_3");
|
|
orc_program_set_backup_function (p, _backup_cogorc_unpack_axyz_3);
|
|
orc_program_add_destination (p, 1, "d1");
|
|
orc_program_add_source (p, 4, "s1");
|
|
orc_program_add_temporary (p, 2, "t1");
|
|
|
|
orc_program_append_2 (p, "select1lw", 0, ORC_VAR_T1, ORC_VAR_S1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
orc_program_append_2 (p, "select1wb", 0, ORC_VAR_D1, ORC_VAR_T1,
|
|
ORC_VAR_D1, ORC_VAR_D1);
|
|
|
|
result = orc_program_compile (p);
|
|
}
|
|
p_inited = TRUE;
|
|
orc_once_mutex_unlock ();
|
|
}
|
|
ex->program = p;
|
|
|
|
ex->n = n;
|
|
ex->arrays[ORC_VAR_D1] = d1;
|
|
ex->arrays[ORC_VAR_S1] = (void *) s1;
|
|
|
|
func = p->code_exec;
|
|
func (ex);
|
|
}
|
|
#endif
|