Ignore:
Timestamp:
Oct 22, 2011, 5:03:53 PM (8 years ago)
Author:
cameron
Message:

New strategies for ugt, ult

File:
1 edited

Legend:

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

    r1556 r1557  
    723723}
    724724
    725 //The total number of operations is 131
     725//The total number of operations is 124
    726726template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<1>::gt(bitblock256_t arg1, bitblock256_t arg2)
    727727{
     
    730730}
    731731
    732 //The total number of operations is 63
     732//The total number of operations is 60
    733733template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<2>::gt(bitblock256_t arg1, bitblock256_t arg2)
    734734{
     
    737737}
    738738
    739 //The total number of operations is 29
     739//The total number of operations is 28
    740740template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<4>::gt(bitblock256_t arg1, bitblock256_t arg2)
    741741{
     
    875875}
    876876
    877 //The total number of operations is 187
     877//The total number of operations is 186
    878878template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<1>::ult(bitblock256_t arg1, bitblock256_t arg2)
    879879{
    880         return simd_or(simd_and(simd256<(2)>::himask(), simd256<(2)>::ult(simd_and(simd256<(2)>::himask(), arg1), simd_and(simd256<(2)>::himask(), arg2))), simd_and(simd256<(2)>::lomask(), simd256<(2)>::ult(simd_and(simd256<(2)>::lomask(), arg1), simd_and(simd256<(2)>::lomask(), arg2))));
     880        return simd256<1>::ifh(simd256<(2)>::himask(), simd256<(2)>::ult(arg1, simd_and(simd256<(2)>::himask(), arg2)), simd256<(2)>::ult(simd_andc(arg1, simd256<(2)>::himask()), simd_andc(arg2, simd256<(2)>::himask())));
    881881}
    882882
     
    889889}
    890890
    891 //The total number of operations is 49
     891//The total number of operations is 48
    892892template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<4>::ult(bitblock256_t arg1, bitblock256_t arg2)
    893893{
    894         return simd_or(simd_and(simd256<(8)>::himask(), simd256<(8)>::ult(simd_and(simd256<(8)>::himask(), arg1), simd_and(simd256<(8)>::himask(), arg2))), simd_and(simd256<(8)>::lomask(), simd256<(8)>::ult(simd_and(simd256<(8)>::lomask(), arg1), simd_and(simd256<(8)>::lomask(), arg2))));
     894        return simd256<1>::ifh(simd256<(8)>::himask(), simd256<(8)>::ult(arg1, simd_and(simd256<(8)>::himask(), arg2)), simd256<(8)>::ult(simd_andc(arg1, simd256<(8)>::himask()), simd_andc(arg2, simd256<(8)>::himask())));
    895895}
    896896
     
    938938}
    939939
    940 //The total number of operations is 189
     940//The total number of operations is 188
    941941template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<1>::lt(bitblock256_t arg1, bitblock256_t arg2)
    942942{
     
    953953}
    954954
    955 //The total number of operations is 51
     955//The total number of operations is 50
    956956template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<4>::lt(bitblock256_t arg1, bitblock256_t arg2)
    957957{
     
    11061106}
    11071107
    1108 //The total number of operations is 129
     1108//The total number of operations is 122
    11091109template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<1>::ugt(bitblock256_t arg1, bitblock256_t arg2)
    11101110{
    1111         return simd_or(simd_and(simd256<(2)>::himask(), simd256<(2)>::ugt(simd_and(simd256<(2)>::himask(), arg1), simd_and(simd256<(2)>::himask(), arg2))), simd_and(simd256<(2)>::lomask(), simd256<(2)>::ugt(simd_and(simd256<(2)>::lomask(), arg1), simd_and(simd256<(2)>::lomask(), arg2))));
    1112 }
    1113 
    1114 //The total number of operations is 61
     1111        return simd256<1>::ifh(simd256<(2)>::himask(), simd256<(2)>::ugt(simd_and(simd256<(2)>::himask(), arg1), arg2), simd256<(2)>::ugt(simd_andc(arg1, simd256<(2)>::himask()), simd_andc(arg2, simd256<(2)>::himask())));
     1112}
     1113
     1114//The total number of operations is 58
    11151115template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<2>::ugt(bitblock256_t arg1, bitblock256_t arg2)
    11161116{
    1117         return simd_or(simd_and(simd256<(4)>::himask(), simd256<(4)>::ugt(simd_and(simd256<(4)>::himask(), arg1), simd_and(simd256<(4)>::himask(), arg2))), simd_and(simd256<(4)>::lomask(), simd256<(4)>::ugt(simd_and(simd256<(4)>::lomask(), arg1), simd_and(simd256<(4)>::lomask(), arg2))));
    1118 }
    1119 
    1120 //The total number of operations is 27
     1117        return simd256<1>::ifh(simd256<(4)>::himask(), simd256<(4)>::ugt(simd_and(simd256<(4)>::himask(), arg1), arg2), simd256<(4)>::ugt(simd_andc(arg1, simd256<(4)>::himask()), simd_andc(arg2, simd256<(4)>::himask())));
     1118}
     1119
     1120//The total number of operations is 26
    11211121template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<4>::ugt(bitblock256_t arg1, bitblock256_t arg2)
    11221122{
    1123         return simd_or(simd_and(simd256<(8)>::himask(), simd256<(8)>::ugt(simd_and(simd256<(8)>::himask(), arg1), simd_and(simd256<(8)>::himask(), arg2))), simd_and(simd256<(8)>::lomask(), simd256<(8)>::ugt(simd_and(simd256<(8)>::lomask(), arg1), simd_and(simd256<(8)>::lomask(), arg2))));
     1123        return simd256<1>::ifh(simd256<(8)>::himask(), simd256<(8)>::ugt(simd_and(simd256<(8)>::himask(), arg1), arg2), simd256<(8)>::ugt(simd_andc(arg1, simd256<(8)>::himask()), simd_andc(arg2, simd256<(8)>::himask())));
    11241124}
    11251125
     
    20522052}
    20532053
    2054 //The total number of operations is 226
     2054//The total number of operations is 219
    20552055template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<1>::abs(bitblock256_t arg1)
    20562056{
     
    20652065}
    20662066
    2067 //The total number of operations is 52
     2067//The total number of operations is 51
    20682068template <> IDISA_ALWAYS_INLINE bitblock256_t simd256<4>::abs(bitblock256_t arg1)
    20692069{
     
    22072207}
    22082208
    2209 //The total number of operations is 546
     2209//The total number of operations is 534
    22102210template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<2>::packss(bitblock256_t arg1, bitblock256_t arg2)
    22112211{
     
    22152215}
    22162216
    2217 //The total number of operations is 322
     2217//The total number of operations is 318
    22182218template <> IDISA_ALWAYS_INLINE bitblock256_t hsimd256<4>::packss(bitblock256_t arg1, bitblock256_t arg2)
    22192219{
Note: See TracChangeset for help on using the changeset viewer.