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

    r1556 r1557  
    656656}
    657657
    658 //The total number of operations is 43
     658//The total number of operations is 42
    659659template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::gt(bitblock128_t arg1, bitblock128_t arg2)
    660660{
     
    784784}
    785785
    786 //The total number of operations is 41
     786//The total number of operations is 40
    787787template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ult(bitblock128_t arg1, bitblock128_t arg2)
    788788{
    789         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))));
     789        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())));
    790790}
    791791
     
    801801template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ult(bitblock128_t arg1, bitblock128_t arg2)
    802802{
    803         bitblock128_t high_bit = simd128<4>::constant<(8)>();
    804         return simd128<4>::lt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit));
     803        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())));
    805804}
    806805
     
    841840}
    842841
    843 //The total number of operations is 43
     842//The total number of operations is 42
    844843template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::lt(bitblock128_t arg1, bitblock128_t arg2)
    845844{
     
    1000999}
    10011000
    1002 //The total number of operations is 41
     1001//The total number of operations is 40
    10031002template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::ugt(bitblock128_t arg1, bitblock128_t arg2)
    10041003{
    1005         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))));
     1004        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())));
    10061005}
    10071006
     
    10171016template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<4>::ugt(bitblock128_t arg1, bitblock128_t arg2)
    10181017{
    1019         bitblock128_t high_bit = simd128<4>::constant<(8)>();
    1020         return simd128<4>::gt(simd_xor(arg1, high_bit), simd_xor(arg2, high_bit));
     1018        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())));
    10211019}
    10221020
     
    18481846}
    18491847
    1850 //The total number of operations is 72
     1848//The total number of operations is 71
    18511849template <> IDISA_ALWAYS_INLINE bitblock128_t simd128<1>::abs(bitblock128_t arg1)
    18521850{
Note: See TracChangeset for help on using the changeset viewer.