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_ssse3.cpp

    r1556 r1557  
    661661}
    662662
    663 //The total number of operations is 43
     663//The total number of operations is 42
    664664template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::gt(bitblock128_t arg1, bitblock128_t arg2)
    665665{
     
    789789}
    790790
    791 //The total number of operations is 41
     791//The total number of operations is 40
    792792template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ult(bitblock128_t arg1, bitblock128_t arg2)
    793793{
    794         return simd_or(simd_and(simd128<(2)>::himask(), simd128<(2)>::ult(simd_and(simd128<(2)>::himask(), arg1), simd_and(simd128<(2)>::himask(), arg2))), simd_and(simd128<(2)>::lomask(), simd128<(2)>::ult(simd_and(simd128<(2)>::lomask(), arg1), simd_and(simd128<(2)>::lomask(), arg2))));
     794        return simd128<1>::ifh(simd128<(2)>::himask(), simd128<(2)>::ult(arg1, simd_and(simd128<(2)>::himask(), arg2)), simd128<(2)>::ult(simd_andc(arg1, simd128<(2)>::himask()), simd_andc(arg2, simd128<(2)>::himask())));
    795795}
    796796
     
    806806template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ult(bitblock128_t arg1, bitblock128_t arg2)
    807807{
    808         bitblock128_t high_bit = simd128<4>::constant<(8)>();
    809         return simd128<4>::lt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit));
     808        return simd128<1>::ifh(simd128<(8)>::himask(), simd128<(8)>::ult(arg1, simd_and(simd128<(8)>::himask(), arg2)), simd128<(8)>::ult(simd_andc(arg1, simd128<(8)>::himask()), simd_andc(arg2, simd128<(8)>::himask())));
    810809}
    811810
     
    846845}
    847846
    848 //The total number of operations is 43
     847//The total number of operations is 42
    849848template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::lt(bitblock128_t arg1, bitblock128_t arg2)
    850849{
     
    10051004}
    10061005
    1007 //The total number of operations is 41
     1006//The total number of operations is 40
    10081007template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ugt(bitblock128_t arg1, bitblock128_t arg2)
    10091008{
    1010         return simd_or(simd_and(simd128<(2)>::himask(), simd128<(2)>::ugt(simd_and(simd128<(2)>::himask(), arg1), simd_and(simd128<(2)>::himask(), arg2))), simd_and(simd128<(2)>::lomask(), simd128<(2)>::ugt(simd_and(simd128<(2)>::lomask(), arg1), simd_and(simd128<(2)>::lomask(), arg2))));
     1009        return simd128<1>::ifh(simd128<(2)>::himask(), simd128<(2)>::ugt(simd_and(simd128<(2)>::himask(), arg1), arg2), simd128<(2)>::ugt(simd_andc(arg1, simd128<(2)>::himask()), simd_andc(arg2, simd128<(2)>::himask())));
    10111010}
    10121011
     
    10221021template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ugt(bitblock128_t arg1, bitblock128_t arg2)
    10231022{
    1024         bitblock128_t high_bit = simd128<4>::constant<(8)>();
    1025         return simd128<4>::gt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit));
     1023        return simd128<1>::ifh(simd128<(8)>::himask(), simd128<(8)>::ugt(simd_and(simd128<(8)>::himask(), arg1), arg2), simd128<(8)>::ugt(simd_andc(arg1, simd128<(8)>::himask()), simd_andc(arg2, simd128<(8)>::himask())));
    10261024}
    10271025
     
    18531851}
    18541852
    1855 //The total number of operations is 72
     1853//The total number of operations is 71
    18561854template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::abs(bitblock128_t arg1)
    18571855{
Note: See TracChangeset for help on using the changeset viewer.