Ignore:
Timestamp:
Jul 21, 2014, 7:00:26 PM (5 years ago)
Author:
linmengl
Message:

s2p_bytepack pure ir library works for sse2 now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib_ir/test_pack.cpp

    r3919 r3920  
    11#include "utility.h"
    22#include "s2p.h"
     3#include "s2p.hpp"
    34#include <iostream>
    45#include <cstdlib>
     
    8283  }
    8384
     85  //Test s2p_step
     86  SIMD_type hi_mask = simd<2>::himask(), p0, p1, q0, q1;
     87  a = mvmd<32>::fill((int)rand() % 10000);
     88  b = mvmd<32>::fill((int)rand() % 10000);
     89  c = mvmd<16>::fill(2);
     90  s2p_step(a, b, hi_mask, 2, p0, p1);
     91  s2p_step_ir(a, b, hi_mask, c, &q0, &q1);
     92  if (Store2String(p0,1) != Store2String(q0,1) ||
     93      Store2String(p1,1) != Store2String(q1,1)) {
     94    cout << "s2p_step failed." << endl;
     95    return 1;
     96  }
     97  a = mvmd<32>::fill((int)rand() % 10000);
     98  b = mvmd<32>::fill((int)rand() % 10000);
     99  c = mvmd<16>::fill(4);
     100  s2p_step(a, b, hi_mask, 4, p0, p1);
     101  s2p_step_ir(a, b, hi_mask, c, &q0, &q1);
     102  if (Store2String(p0,1) != Store2String(q0,1) ||
     103      Store2String(p1,1) != Store2String(q1,1)) {
     104    cout << "s2p_step failed." << endl;
     105    return 1;
     106  }
    84107
    85108  cout << "Test passed." << endl;
Note: See TracChangeset for help on using the changeset viewer.