本文整理汇总了C#中Mono.Simd.Vector16b类的典型用法代码示例。如果您正苦于以下问题:C# Vector16b类的具体用法?C# Vector16b怎么用?C# Vector16b使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Vector16b类属于Mono.Simd命名空间,在下文中一共展示了Vector16b类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Vector16b
public static unsafe Vector16b operator + (Vector16b va, Vector16b vb)
{
Vector16b res = new Vector16b ();
byte *a = &va.v0;
byte *b = &vb.v0;
byte *c = &res.v0;
for (int i = 0; i < 16; ++i)
*c++ = (byte)(*a++ + *b++);
return res;
}
示例2: PrefetchTemporalAllCacheLevels
public static void PrefetchTemporalAllCacheLevels (ref Vector16b res)
{
}
示例3: test_0_vector16b_accessors
static int test_0_vector16b_accessors () {
Vector16b a = new Vector16b (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
if (a.V0 != 0)
return 1;
if (a.V1 != 1)
return 2;
if (a.V2 != 2)
return 3;
if (a.V3 != 3)
return 4;
if (a.V4 != 4)
return 5;
if (a.V5 != 5)
return 6;
if (a.V6 != 6)
return 7;
if (a.V7 != 7)
return 8;
if (a.V8 != 8)
return 9;
if (a.V9 != 9)
return 10;
if (a.V10 != 10)
return 11;
if (a.V11 != 11)
return 12;
if (a.V12 != 12)
return 13;
if (a.V13 != 13)
return 14;
if (a.V14 != 14)
return 15;
if (a.V15 != 15)
return 16;
a.V0 = 10;
a.V1 = 20;
a.V2 = 30;
a.V3 = 40;
a.V4 = 50;
a.V5 = 60;
a.V6 = 70;
a.V7 = 80;
a.V8 = 90;
a.V9 = 100;
a.V10 = 110;
a.V11 = 120;
a.V12 = 130;
a.V13 = 140;
a.V14 = 150;
a.V15 = 160;
if (a.V0 != 10)
return 17;
if (a.V1 != 20)
return 18;
if (a.V2 != 30)
return 19;
if (a.V3 != 40)
return 20;
if (a.V4 != 50)
return 21;
if (a.V5 != 60)
return 22;
if (a.V6 != 70)
return 23;
if (a.V7 != 80)
return 24;
if (a.V8 != 90)
return 25;
if (a.V9 != 100)
return 26;
if (a.V10 != 110)
return 27;
if (a.V11 != 120)
return 28;
if (a.V12 != 130)
return 29;
if (a.V13 != 140)
return 30;
if (a.V14 != 150)
return 31;
if (a.V15 != 160)
return 32;
return 0;
}
示例4: test_0_vector16b_add_sat
static int test_0_vector16b_add_sat () {
Vector16b a = new Vector16b (200,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
Vector16b b = new Vector16b (200,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8);
Vector16b c = a.AddWithSaturation (b);
if (c.V0 != 255)
return 1;
if (c.V1 != 11)
return 2;
if (c.V15 != 23)
return 3;
return 0;
}
示例5: test_0_vector16b_unpack_low
static int test_0_vector16b_unpack_low () {
Vector16b a = new Vector16b (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
Vector16b b = new Vector16b (9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8);
Vector16b c = a.UnpackLow (b);
if (c.V0 != 0)
return 1;
if (c.V1 != 9)
return 2;
if (c.V2 != 1)
return 3;
if (c.V3 != 10)
return 4;
if (c.V4 != 2)
return 5;
if (c.V5 != 11)
return 6;
if (c.V14 != 7)
return 7;
if (c.V15 != 0)
return 8;
return 0;
}
示例6: test_10_local_simplifier_regression_first_block
/*This bug was caused the simplifier not taking notice of LDADDR on the first block.*/
public static int test_10_local_simplifier_regression_first_block () {
Vector16b a = new Vector16b ();
Vector16b b = new Vector16b ();
Vector8us res = bad_method_regression (a,b);
return (int)res.V0;
}
示例7: test_2_local_simplifier_regression_other_blocks
/*This bug was caused the simplifier not taking notice of LDADDR on the remaining blocks.*/
public static int test_2_local_simplifier_regression_other_blocks () {
Vector16b a = new Vector16b (1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1);
Vector16b b = new Vector16b (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
Vector8us res = bad_method_regression_2 (a,b);
return (int)res.V0 + res.V4;
}
示例8: test_0_vector16b_avg
public static int test_0_vector16b_avg () {
Vector16b a = new Vector16b (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
Vector16b b = new Vector16b (9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,8);
Vector16b c = a.Average (b);
if (c.V0 != 5)
return 1;
if (c.V1 != 6)
return 2;
if (c.V2 != 7)
return 3;
if (c.V3 != 8)
return 4;
if (c.V4 != 9)
return 5;
if (c.V5 != 10)
return 6;
if (c.V6 != 11)
return 7;
if (c.V7 != 4)
return 8;
if (c.V8 != 5)
return 9;
if (c.V9 != 6)
return 10;
if (c.V10 != 7)
return 11;
if (c.V11 != 8)
return 12;
if (c.V12 != 9)
return 13;
if (c.V13 != 10)
return 14;
if (c.V14 != 11)
return 15;
if (c.V15 != 12)
return 16;
return 0;
}
示例9: SubtractWithSaturation
public static unsafe Vector16b SubtractWithSaturation (this Vector16b va, Vector16b vb) {
Vector16b res = new Vector16b ();
byte *a = &va.v0;
byte *b = &vb.v0;
byte *c = &res.v0;
for (int i = 0; i < 16; ++i)
*c++ = (byte) System.Math.Max (*a++ - *b++, 0);
return res;
}
示例10: AddWithSaturation
public static unsafe Vector16b AddWithSaturation (this Vector16b va, Vector16b vb) {
Vector16b res = new Vector16b ();
byte *a = &va.v0;
byte *b = &vb.v0;
byte *c = &res.v0;
for (int i = 0; i < 16; ++i)
*c++ = (byte) System.Math.Min (*a++ + *b++, byte.MaxValue);
return res;
}
示例11: PrefetchNonTemporal
public static unsafe void PrefetchNonTemporal (Vector16b *res)
{
}
示例12: PrefetchTemporal2ndLevelCache
public static unsafe void PrefetchTemporal2ndLevelCache (Vector16b *res)
{
}
示例13: vector16b_sum_abs_diff
public static int vector16b_sum_abs_diff () {
Vector16b a = new Vector16b (100,20,20,20,0,0,0,0,0,0,0,0,0,0, 0, 0);
Vector16sb b = new Vector16sb (0, 10,10,10,0,0,0,0,0,0,0,0,0,0,10,10);
Vector8us c = a.SumOfAbsoluteDifferences (b);
if (c.V0 != 130)
return 1;
if (c.V1 != 0)
return 2;
if (c.V2 != 0)
return 3;
if (c.V3 != 0)
return 4;
if (c.V4 != 20)
return 5;
if (c.V5 != 0)
return 6;
if (c.V6 != 0)
return 7;
if (c.V7 != 0)
return 8;
return 0;
}
示例14: test_0_vector16b_extract_mask
public static int test_0_vector16b_extract_mask () {
Vector16b a = new Vector16b (0xF0,0,0xF0,0,0,0,0xF0,0xAA,0x0F,0,0xFF,0,0,0,0,0);
int c = a.ExtractByteMask ();
if (c != 0x4C5)
return 1;
return 0;
}
示例15: Average
public static unsafe Vector16b Average (this Vector16b va, Vector16b vb) {
Vector16b res = new Vector16b ();
byte *a = &va.v0;
byte *b = &vb.v0;
byte *c = &res.v0;
for (int i = 0; i < 16; ++i)
*c++ = (byte) ((*a++ + *b++ + 1) >> 1);
return res;
}