Changeset 2325


Ignore:
Timestamp:
Aug 24, 2012, 2:29:14 PM (7 years ago)
Author:
cameron
Message:

Field types fw1_t, fw2_t...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/idisa_cpp/idisa_sse2.cpp

    r2324 r2325  
    2828template <> struct FieldType<128> {typedef uint64_t T;};
    2929
    30 
     30typedef typename FieldType<1>::T fw1_t;
     31typedef typename FieldType<2>::T fw2_t;
     32typedef typename FieldType<4>::T fw4_t;
     33typedef typename FieldType<8>::T fw8_t;
     34typedef typename FieldType<16>::T fw16_t;
     35typedef typename FieldType<32>::T fw32_t;
     36typedef typename FieldType<64>::T fw64_t;
     37typedef typename FieldType<128>::T fw128_t;
    3138
    3239template <uint32_t fw>
     
    5360        static IDISA_ALWAYS_INLINE bitblock128_t lomask();
    5461        static IDISA_ALWAYS_INLINE bitblock128_t umin(bitblock128_t arg1, bitblock128_t arg2);
    55         template <typename FieldType<fw>::T val> static IDISA_ALWAYS_INLINE bitblock128_t constant();
     62        template <typename FieldType<fw>::T> static IDISA_ALWAYS_INLINE bitblock128_t constant();
     63//      template <int> static IDISA_ALWAYS_INLINE bitblock128_t constant();
    5664        static IDISA_ALWAYS_INLINE bitblock128_t min(bitblock128_t arg1, bitblock128_t arg2);
    5765        static IDISA_ALWAYS_INLINE bitblock128_t umax(bitblock128_t arg1, bitblock128_t arg2);
     
    257265template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srl(bitblock128_t arg1, bitblock128_t shift_mask);
    258266template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::srl(bitblock128_t arg1, bitblock128_t shift_mask);
    259 template <> template <typename FieldType<1>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::constant();
    260 template <> template <typename FieldType<2>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::constant();
    261 template <> template <typename FieldType<4>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::constant();
    262 template <> template <typename FieldType<8>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::constant();
    263 template <> template <typename FieldType<16>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::constant();
    264 template <> template <typename FieldType<32>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::constant();
    265 template <> template <typename FieldType<64>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::constant();
    266 template <> template <typename FieldType<128>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::constant();
     267//template <> template <typename FieldType<1>::T> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::constant();
     268//template <> template <typename FieldType<2>::T> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::constant();
     269//template <> template <typename FieldType<4>::T> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::constant();
     270//template <> template <typename FieldType<8>::T> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::constant();
     271//template <> template <typename FieldType<16>::T> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::constant();
     272//template <> template <fw32_t> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::constant();
     273//template <> template <typename FieldType<64>::T> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::constant();
     274//template <> template <typename FieldType<128>::T> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::constant();
     275template <> template <fw1_t> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::constant();
     276template <> template <fw2_t> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::constant();
     277template <> template <fw4_t> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::constant();
     278template <> template <fw8_t> IDISA_ALWAYS_INLINE bitblock128_t simd128<8>::constant();
     279template <> template <fw16_t> IDISA_ALWAYS_INLINE bitblock128_t simd128<16>::constant();
     280template <> template <fw32_t> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::constant();
     281template <> template <fw64_t> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::constant();
     282template <> template <fw128_t> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::constant();
    267283template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::min(bitblock128_t arg1, bitblock128_t arg2);
    268284template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<2>::min(bitblock128_t arg1, bitblock128_t arg2);
     
    354370template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::packss(bitblock128_t arg1, bitblock128_t arg2);
    355371template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::packss(bitblock128_t arg1, bitblock128_t arg2);
    356 template <> IDISA_ALWAYS_INLINE typename FieldType<32>::T hsimd128<4>::signmask(bitblock128_t arg1);
     372template <> IDISA_ALWAYS_INLINE fw32_t hsimd128<4>::signmask(bitblock128_t arg1);
    357373template <> IDISA_ALWAYS_INLINE typename FieldType<128/8>::T hsimd128<8>::signmask(bitblock128_t arg1);
    358374template <> IDISA_ALWAYS_INLINE typename FieldType<128/16>::T hsimd128<16>::signmask(bitblock128_t arg1);
     
    445461template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill(typename FieldType<8>::T val1);
    446462template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::fill(typename FieldType<16>::T val1);
    447 template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill(typename FieldType<32>::T val1);
     463template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill(fw32_t val1);
    448464template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::fill(typename FieldType<64>::T val1);
    449465template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<128>::fill(typename FieldType<128>::T val1);
     
    453469template <> template <uint8_t pos> IDISA_ALWAYS_INLINE typename FieldType<8>::T mvmd128<8>::extract(bitblock128_t arg1);
    454470template <> template <uint8_t pos> IDISA_ALWAYS_INLINE typename FieldType<16>::T mvmd128<16>::extract(bitblock128_t arg1);
    455 template <> template <uint8_t pos> IDISA_ALWAYS_INLINE typename FieldType<32>::T mvmd128<32>::extract(bitblock128_t arg1);
     471template <> template <uint8_t pos> IDISA_ALWAYS_INLINE fw32_t mvmd128<32>::extract(bitblock128_t arg1);
    456472template <> template <uint8_t pos> IDISA_ALWAYS_INLINE typename FieldType<64>::T mvmd128<64>::extract(bitblock128_t arg1);
    457473template <> template <uint8_t pos> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<1>::splat(bitblock128_t arg1);
     
    472488template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill4(typename FieldType<8>::T val1, typename FieldType<8>::T val2, typename FieldType<8>::T val3, typename FieldType<8>::T val4);
    473489template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::fill4(typename FieldType<16>::T val1, typename FieldType<16>::T val2, typename FieldType<16>::T val3, typename FieldType<16>::T val4);
    474 template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill4(typename FieldType<32>::T val1, typename FieldType<32>::T val2, typename FieldType<32>::T val3, typename FieldType<32>::T val4);
     490template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill4(fw32_t val1, fw32_t val2, fw32_t val3, fw32_t val4);
    475491template <> template <uint8_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::srli(bitblock128_t arg1);
    476492template <> template <uint8_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<4>::srli(bitblock128_t arg1);
     
    485501template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<8>::fill2(typename FieldType<8>::T val1, typename FieldType<8>::T val2);
    486502template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<16>::fill2(typename FieldType<16>::T val1, typename FieldType<16>::T val2);
    487 template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill2(typename FieldType<32>::T val1, typename FieldType<32>::T val2);
     503template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill2(fw32_t val1, fw32_t val2);
    488504template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<64>::fill2(typename FieldType<64>::T val1, typename FieldType<64>::T val2);
    489505template <> template <uint8_t sh> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<2>::dslli(bitblock128_t arg1, bitblock128_t arg2);
     
    14391455
    14401456//The total number of operations is 0
    1441 template <> template <typename FieldType<32>::T val> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::constant()
     1457template <> template <fw32_t val> IDISA_ALWAYS_INLINE bitblock128_t simd128<32>::constant()
    14421458{
    14431459        return _mm_set1_epi32((int32_t)(val));
     
    20432059template <> IDISA_ALWAYS_INLINE typename FieldType<128/4>::T hsimd128<4>::signmask(bitblock128_t arg1)
    20442060{
    2045         uint64_t tmpAns1 = hsimd128<(8)>::signmask(esimd128<4>::mergeh(arg1, simd128<4>::constant<0>()));
    2046         uint64_t tmpAns2 = hsimd128<(8)>::signmask(esimd128<4>::mergel(arg1, simd128<4>::constant<0>()));
     2061        typename FieldType<128/4>::T tmpAns1 = hsimd128<(8)>::signmask(esimd128<4>::mergeh(arg1, simd128<4>::constant<0>()));
     2062        typename FieldType<128/4>::T tmpAns2 = hsimd128<(8)>::signmask(esimd128<4>::mergel(arg1, simd128<4>::constant<0>()));
    20472063        return ((tmpAns1<<(16))+tmpAns2);
    20482064}
     
    26162632
    26172633//The total number of operations is 1.0
    2618 template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill(typename FieldType<32>::T val1)
     2634template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill(fw32_t val1)
    26192635{
    26202636        return _mm_set1_epi32((int32_t)(val1));
     
    26642680
    26652681//The total number of operations is 2.0
    2666 template <> template <uint8_t pos> IDISA_ALWAYS_INLINE typename FieldType<32>::T mvmd128<32>::extract(bitblock128_t arg1)
     2682template <> template <uint8_t pos> IDISA_ALWAYS_INLINE fw32_t mvmd128<32>::extract(bitblock128_t arg1)
    26672683{
    26682684        return ((mvmd128<(16)>::extract<((2*pos)+1)>(arg1)<<(16))|mvmd128<(16)>::extract<(2*pos)>(arg1));
     
    27842800
    27852801//The total number of operations is 1.0
    2786 template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill4(typename FieldType<32>::T val1, typename FieldType<32>::T val2, typename FieldType<32>::T val3, typename FieldType<32>::T val4)
     2802template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill4(fw32_t val1, fw32_t val2, fw32_t val3, fw32_t val4)
    27872803{
    27882804        return _mm_set_epi32((int32_t)(val1), (int32_t)(val2), (int32_t)(val3), (int32_t)(val4));
     
    28622878
    28632879//The total number of operations is 5.0
    2864 template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill2(typename FieldType<32>::T val1, typename FieldType<32>::T val2)
     2880template <> IDISA_ALWAYS_INLINE bitblock128_t mvmd128<32>::fill2(fw32_t val1, fw32_t val2)
    28652881{
    28662882        return simd128<1>::ifh(simd128<(64)>::himask(), mvmd128<32>::fill(val1), mvmd128<32>::fill(val2));
Note: See TracChangeset for help on using the changeset viewer.