Changeset 1897


Ignore:
Timestamp:
Jan 28, 2012, 11:55:37 AM (7 years ago)
Author:
cameron
Message:

Using _mm_castsi128_pd and _mm_castsi128_ps for casting.

Location:
trunk
Files:
7 edited

Legend:

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

    r1884 r1897  
    20452045template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<32>::signmask(bitblock128_t arg1)
    20462046{
    2047         return _mm_movemask_ps(reinterpret_cast<__m128>(arg1));
     2047        return _mm_movemask_ps(_mm_castsi128_ps(arg1));
    20482048}
    20492049
     
    20512051template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<64>::signmask(bitblock128_t arg1)
    20522052{
    2053         return _mm_movemask_pd(reinterpret_cast<__m128d>(arg1));
     2053        return _mm_movemask_pd(_mm_castsi128_pd(arg1));
    20542054}
    20552055
  • trunk/lib/idisa_cpp/idisa_sse3.cpp

    r1884 r1897  
    20512051template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<64>::signmask(bitblock128_t arg1)
    20522052{
    2053         return _mm_movemask_pd(reinterpret_cast<__m128d>(arg1));
     2053        return _mm_movemask_pd(_mm_castsi128_pd(arg1));
    20542054}
    20552055
  • trunk/lib/idisa_cpp/idisa_sse4_1.cpp

    r1884 r1897  
    20592059template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<64>::signmask(bitblock128_t arg1)
    20602060{
    2061         return _mm_movemask_pd(reinterpret_cast<__m128d>(arg1));
     2061        return _mm_movemask_pd(_mm_castsi128_pd(arg1));
    20622062}
    20632063
  • trunk/lib/idisa_cpp/idisa_sse4_2.cpp

    r1884 r1897  
    20412041template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<64>::signmask(bitblock128_t arg1)
    20422042{
    2043         return _mm_movemask_pd(reinterpret_cast<__m128d>(arg1));
     2043        return _mm_movemask_pd(_mm_castsi128_pd(arg1));
    20442044}
    20452045
  • trunk/lib/idisa_cpp/idisa_ssse3.cpp

    r1884 r1897  
    20532053template <> IDISA_ALWAYS_INLINE uint64_t hsimd128<64>::signmask(bitblock128_t arg1)
    20542054{
    2055         return _mm_movemask_pd(reinterpret_cast<__m128d>(arg1));
     2055        return _mm_movemask_pd(_mm_castsi128_pd(arg1));
    20562056}
    20572057
  • trunk/libgen/Library_Generator/IDISAFunctionSupport.py

    r1884 r1897  
    3333        assert len(argsList)-1 == 2, "IDISA_CASTING can't accept these many arguments!"
    3434        castExpr = str(argsList[0])
     35        if castExpr == "_mm_castsi128_ps": 
     36                return (castExpr + "(" + str(argsList[1]) + ")", "__m128")
     37        if castExpr == "_mm_castsi128_pd": 
     38                return (castExpr + "(" + str(argsList[1]) + ")", "__m128d")
    3539        returnType = configure.Bitblock_type[self.arch] if castExpr == "SIMD_type" else castExpr
    3640        codes = "reinterpret_cast" + "<" + returnType + ">(" + str(argsList[1]) + ")"
  • trunk/libgen/Library_Generator/StrategyPool.py

    r1884 r1897  
    14641464                "signmask_32_SSE":\
    14651465                {
    1466                 "body":r'''return  _mm_movemask_ps(IDISA_CASTING("__m128",arg1))''',
     1466                "body":r'''return  _mm_movemask_ps(IDISA_CASTING("_mm_castsi128_ps",arg1))''',
    14671467                "Ops":["hsimd_signmask"],
    14681468                "Fws":[32],
     
    14721472                "signmask_64_SSE":\
    14731473                {
    1474                 "body":r'''return  _mm_movemask_pd(IDISA_CASTING("__m128d",arg1))''',
     1474                "body":r'''return  _mm_movemask_pd(IDISA_CASTING("_mm_castsi128_pd",arg1))''',
    14751475                "Ops":["hsimd_signmask"],
    14761476                "Fws":[64],
Note: See TracChangeset for help on using the changeset viewer.