source: trunk/lib_ir/test_pack.cpp @ 3918

Last change on this file since 3918 was 3918, checked in by linmengl, 5 years ago

have pack_16 work

File size: 887 bytes
Line 
1#include "utility.h"
2#include "s2p.h"
3#include <iostream>
4#include <cstdlib>
5using namespace std;
6
7int main(int argc, char **argv)
8{
9  SIMD_type a, b, c, d;
10
11  //Test packh_16
12  a = mvmd<32>::fill((int)rand() % 10000);
13  b = mvmd<32>::fill((int)rand() % 1000);
14  c = hsimd<16>::packh(a, b);
15  d = packh_16(a, b);
16
17  if (Store2String(c,1) != Store2String(d,1)) {
18    cout << Store2String(c,1) << endl;
19    cout << Store2String(d,1) << endl;
20    cout << "Matching faild." << endl;
21    return 1;
22  }
23
24  //Test packl_16
25  a = mvmd<32>::fill((int)rand() % 10000);
26  b = mvmd<32>::fill((int)rand() % 1000);
27  c = hsimd<16>::packl(a, b);
28  d = packl_16(a, b);
29
30  if (Store2String(c,1) != Store2String(d,1)) {
31    cout << Store2String(c,1) << endl;
32    cout << Store2String(d,1) << endl;
33    cout << "Matching faild." << endl;
34    return 1;
35  }
36
37  cout << "Test passed." << endl;
38  return 0;
39}
40
Note: See TracBrowser for help on using the repository browser.