Changeset 3577


Ignore:
Timestamp:
Nov 29, 2013, 5:06:24 PM (5 years ago)
Author:
linmengl
Message:

fix srai<-32> problem

File:
1 edited

Legend:

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

    r3576 r3577  
    619619}
    620620
    621 //The total number of operations is 17.5
     621//The total number of operations is 18.0
    622622template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::max(bitblock128_t arg1, bitblock128_t arg2)
    623623{
     
    625625}
    626626
    627 //The total number of operations is 54.75
     627//The total number of operations is 60.6666666667
    628628template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::max(bitblock128_t arg1, bitblock128_t arg2)
    629629{
     
    744744}
    745745
    746 //The total number of operations is 14.5
     746//The total number of operations is 15.0
    747747template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::gt(bitblock128_t arg1, bitblock128_t arg2)
    748748{
     
    754754}
    755755
    756 //The total number of operations is 51.75
     756//The total number of operations is 57.6666666667
    757757template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::gt(bitblock128_t arg1, bitblock128_t arg2)
    758758{
     
    874874}
    875875
    876 //The total number of operations is 17.5
     876//The total number of operations is 18.0
    877877template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::ult(bitblock128_t arg1, bitblock128_t arg2)
    878878{
     
    883883}
    884884
    885 //The total number of operations is 40.0833333333
     885//The total number of operations is 45.0
    886886template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::ult(bitblock128_t arg1, bitblock128_t arg2)
    887887{
     
    11231123}
    11241124
    1125 //The total number of operations is 13.5
     1125//The total number of operations is 14.0
    11261126template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::ugt(bitblock128_t arg1, bitblock128_t arg2)
    11271127{
     
    11321132}
    11331133
    1134 //The total number of operations is 37.25
     1134//The total number of operations is 42.6666666667
    11351135template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::ugt(bitblock128_t arg1, bitblock128_t arg2)
    11361136{
     
    12641264}
    12651265
    1266 //The total number of operations is 13.5
     1266//The total number of operations is 14.0
    12671267template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::any(bitblock128_t arg1)
    12681268{
     
    15711571}
    15721572
    1573 //The total number of operations is 17.5
     1573//The total number of operations is 18.0
    15741574template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::min(bitblock128_t arg1, bitblock128_t arg2)
    15751575{
     
    15771577}
    15781578
    1579 //The total number of operations is 54.75
     1579//The total number of operations is 60.6666666667
    15801580template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::min(bitblock128_t arg1, bitblock128_t arg2)
    15811581{
     
    18181818}
    18191819
    1820 //The total number of operations is 4.5
     1820//The total number of operations is 5.0
    18211821template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::srai(bitblock128_t arg1)
    18221822{
    1823         return simd_or(simd_and(simd128<64>::himask(), simd128<(32)>::srai<((sh < (32)) ? sh : (32))>(arg1)), ((sh <= (32)) ? simd128<64>::srli<sh>(arg1) : simd128<(32)>::srai<(sh-(32))>(simd128<64>::srli<(32)>(arg1))));
    1824 }
    1825 
    1826 //The total number of operations is 11.0833333333
     1823        bitblock128_t tmp = simd128<64>::srli<((sh >= 64) ? (63) : ((sh < 0) ? 0 : sh))>(arg1);
     1824        return simd_or(tmp, simd128<64>::sub(simd128<64>::constant<0>(), simd_and(simd128<64>::slli<((64-((sh >= 64) ? (63) : ((sh < 0) ? 0 : sh)))-1)>(simd128<64>::constant<1>()), tmp)));
     1825}
     1826
     1827//The total number of operations is 16.0
    18271828template <> template <uint16_t sh> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::srai(bitblock128_t arg1)
    18281829{
    1829         return simd_or(simd_and(simd128<128>::himask(), simd128<(64)>::srai<((sh < (64)) ? sh : (64))>(arg1)), ((sh <= (64)) ? simd128<128>::srli<sh>(arg1) : simd128<(64)>::srai<(sh-(64))>(simd128<128>::srli<(64)>(arg1))));
     1830        bitblock128_t tmp = simd128<128>::srli<((sh >= 128) ? (127) : ((sh < 0) ? 0 : sh))>(arg1);
     1831        return simd_or(tmp, simd128<128>::sub(simd128<128>::constant<0>(), simd_and(simd128<128>::slli<((128-((sh >= 128) ? (127) : ((sh < 0) ? 0 : sh)))-1)>(simd128<128>::constant<1>()), tmp)));
    18301832}
    18311833
     
    18681870}
    18691871
    1870 //The total number of operations is 19.5
     1872//The total number of operations is 20.0
    18711873template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<64>::lt(bitblock128_t arg1, bitblock128_t arg2)
    18721874{
     
    18751877}
    18761878
    1877 //The total number of operations is 60.75
     1879//The total number of operations is 66.6666666667
    18781880template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<128>::lt(bitblock128_t arg1, bitblock128_t arg2)
    18791881{
     
    21552157}
    21562158
    2157 //The total number of operations is 77.0
     2159//The total number of operations is 79.0
    21582160template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<64>::packss(bitblock128_t arg1, bitblock128_t arg2)
    21592161{
     
    21632165}
    21642166
    2165 //The total number of operations is 227.666666667
     2167//The total number of operations is 251.333333333
    21662168template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::packss(bitblock128_t arg1, bitblock128_t arg2)
    21672169{
     
    23292331}
    23302332
    2331 //The total number of operations is 28.1666666667
     2333//The total number of operations is 28.6666666667
    23322334template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::min_hl(bitblock128_t arg1, bitblock128_t arg2)
    23332335{
     
    23852387}
    23862388
    2387 //The total number of operations is 34.1666666667
     2389//The total number of operations is 34.6666666667
    23882390template <> IDISA_ALWAYS_INLINE bitblock128_t hsimd128<128>::packus(bitblock128_t arg1, bitblock128_t arg2)
    23892391{
     
    25902592}
    25912593
    2592 //The total number of operations is 11.0
     2594//The total number of operations is 12.0
    25932595template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::signextendh(bitblock128_t arg1)
    25942596{
     
    25962598}
    25972599
    2598 //The total number of operations is 11.0833333333
     2600//The total number of operations is 16.0
    25992601template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::signextendh(bitblock128_t arg1)
    26002602{
     
    26322634}
    26332635
    2634 //The total number of operations is 11.0
     2636//The total number of operations is 12.0
    26352637template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<32>::signextendl(bitblock128_t arg1)
    26362638{
     
    26382640}
    26392641
    2640 //The total number of operations is 13.4166666667
     2642//The total number of operations is 18.3333333333
    26412643template <> IDISA_ALWAYS_INLINE bitblock128_t esimd128<64>::signextendl(bitblock128_t arg1)
    26422644{
Note: See TracChangeset for help on using the changeset viewer.