Changeset 1556 for trunk


Ignore:
Timestamp:
Oct 22, 2011, 3:38:20 PM (8 years ago)
Author:
cameron
Message:

bitblock::popcount; clean libgen/idisa_lib out

Location:
trunk
Files:
1 added
1 deleted
10 edited

Legend:

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

    r1548 r1556  
    4646        static IDISA_ALWAYS_INLINE bitblock256_t add_hl(bitblock256_t arg1, bitblock256_t arg2);
    4747        static IDISA_ALWAYS_INLINE bitblock256_t packss(bitblock256_t arg1, bitblock256_t arg2);
     48        static IDISA_ALWAYS_INLINE bitblock256_t packh(bitblock256_t arg1, bitblock256_t arg2);
    4849        static IDISA_ALWAYS_INLINE uint64_t signmask(bitblock256_t arg1);
    49         static IDISA_ALWAYS_INLINE bitblock256_t packh(bitblock256_t arg1, bitblock256_t arg2);
    5050        static IDISA_ALWAYS_INLINE bitblock256_t packl(bitblock256_t arg1, bitblock256_t arg2);
    5151        static IDISA_ALWAYS_INLINE bitblock256_t min_hl(bitblock256_t arg1, bitblock256_t arg2);
     
    8787        static IDISA_ALWAYS_INLINE bool all(bitblock256_t arg1);
    8888        static IDISA_ALWAYS_INLINE bool any(bitblock256_t arg1);
     89        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock256_t arg1);
    8990};
    9091
     
    32873288}
    32883289
     3290//The total number of operations is 209
     3291IDISA_ALWAYS_INLINE uint64_t bitblock256::popcount(bitblock256_t arg1)
     3292{
     3293        return mvmd256<64>::extract<0>(simd256<256>::popcount(arg1));
     3294}
     3295
    32893296//The total number of operations is 2
    32903297IDISA_ALWAYS_INLINE bool bitblock256::all(bitblock256_t arg1)
  • trunk/lib/idisa_cpp/idisa_sse2.cpp

    r1548 r1556  
    4848        static IDISA_ALWAYS_INLINE bitblock128_t add_hl(bitblock128_t arg1, bitblock128_t arg2);
    4949        static IDISA_ALWAYS_INLINE bitblock128_t packss(bitblock128_t arg1, bitblock128_t arg2);
     50        static IDISA_ALWAYS_INLINE bitblock128_t packh(bitblock128_t arg1, bitblock128_t arg2);
    5051        static IDISA_ALWAYS_INLINE uint64_t signmask(bitblock128_t arg1);
    51         static IDISA_ALWAYS_INLINE bitblock128_t packh(bitblock128_t arg1, bitblock128_t arg2);
    5252        static IDISA_ALWAYS_INLINE bitblock128_t packl(bitblock128_t arg1, bitblock128_t arg2);
    5353        static IDISA_ALWAYS_INLINE bitblock128_t min_hl(bitblock128_t arg1, bitblock128_t arg2);
     
    9090        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9191        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
     92        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
    9293};
    9394
     
    29882989}
    29892990
     2991//The total number of operations is 22
     2992IDISA_ALWAYS_INLINE uint64_t bitblock128::popcount(bitblock128_t arg1)
     2993{
     2994        return mvmd128<64>::extract<0>(simd128<128>::popcount(arg1));
     2995}
     2996
    29902997//The total number of operations is 2
    29912998IDISA_ALWAYS_INLINE bool bitblock128::all(bitblock128_t arg1)
  • trunk/lib/idisa_cpp/idisa_sse3.cpp

    r1548 r1556  
    4848        static IDISA_ALWAYS_INLINE bitblock128_t add_hl(bitblock128_t arg1, bitblock128_t arg2);
    4949        static IDISA_ALWAYS_INLINE bitblock128_t packss(bitblock128_t arg1, bitblock128_t arg2);
     50        static IDISA_ALWAYS_INLINE bitblock128_t packh(bitblock128_t arg1, bitblock128_t arg2);
    5051        static IDISA_ALWAYS_INLINE uint64_t signmask(bitblock128_t arg1);
    51         static IDISA_ALWAYS_INLINE bitblock128_t packh(bitblock128_t arg1, bitblock128_t arg2);
    5252        static IDISA_ALWAYS_INLINE bitblock128_t packl(bitblock128_t arg1, bitblock128_t arg2);
    5353        static IDISA_ALWAYS_INLINE bitblock128_t min_hl(bitblock128_t arg1, bitblock128_t arg2);
     
    9090        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9191        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
     92        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
    9293};
    9394
     
    29882989}
    29892990
     2991//The total number of operations is 22
     2992IDISA_ALWAYS_INLINE uint64_t bitblock128::popcount(bitblock128_t arg1)
     2993{
     2994        return mvmd128<64>::extract<0>(simd128<128>::popcount(arg1));
     2995}
     2996
    29902997//The total number of operations is 2
    29912998IDISA_ALWAYS_INLINE bool bitblock128::all(bitblock128_t arg1)
  • trunk/lib/idisa_cpp/idisa_sse4_1.cpp

    r1548 r1556  
    4848        static IDISA_ALWAYS_INLINE bitblock128_t add_hl(bitblock128_t arg1, bitblock128_t arg2);
    4949        static IDISA_ALWAYS_INLINE bitblock128_t packss(bitblock128_t arg1, bitblock128_t arg2);
     50        static IDISA_ALWAYS_INLINE bitblock128_t packh(bitblock128_t arg1, bitblock128_t arg2);
    5051        static IDISA_ALWAYS_INLINE uint64_t signmask(bitblock128_t arg1);
    51         static IDISA_ALWAYS_INLINE bitblock128_t packh(bitblock128_t arg1, bitblock128_t arg2);
    5252        static IDISA_ALWAYS_INLINE bitblock128_t packl(bitblock128_t arg1, bitblock128_t arg2);
    5353        static IDISA_ALWAYS_INLINE bitblock128_t min_hl(bitblock128_t arg1, bitblock128_t arg2);
     
    9191        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9292        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
     93        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
    9394};
    9495
     
    30203021}
    30213022
     3023//The total number of operations is 20
     3024IDISA_ALWAYS_INLINE uint64_t bitblock128::popcount(bitblock128_t arg1)
     3025{
     3026        return mvmd128<64>::extract<0>(simd128<128>::popcount(arg1));
     3027}
     3028
    30223029//The total number of operations is 2
    30233030IDISA_ALWAYS_INLINE bool bitblock128::all(bitblock128_t arg1)
  • trunk/lib/idisa_cpp/idisa_sse4_2.cpp

    r1548 r1556  
    4848        static IDISA_ALWAYS_INLINE bitblock128_t add_hl(bitblock128_t arg1, bitblock128_t arg2);
    4949        static IDISA_ALWAYS_INLINE bitblock128_t packss(bitblock128_t arg1, bitblock128_t arg2);
     50        static IDISA_ALWAYS_INLINE bitblock128_t packh(bitblock128_t arg1, bitblock128_t arg2);
    5051        static IDISA_ALWAYS_INLINE uint64_t signmask(bitblock128_t arg1);
    51         static IDISA_ALWAYS_INLINE bitblock128_t packh(bitblock128_t arg1, bitblock128_t arg2);
    5252        static IDISA_ALWAYS_INLINE bitblock128_t packl(bitblock128_t arg1, bitblock128_t arg2);
    5353        static IDISA_ALWAYS_INLINE bitblock128_t min_hl(bitblock128_t arg1, bitblock128_t arg2);
     
    9191        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9292        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
     93        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
    9394};
    9495
     
    30023003}
    30033004
     3005//The total number of operations is 20
     3006IDISA_ALWAYS_INLINE uint64_t bitblock128::popcount(bitblock128_t arg1)
     3007{
     3008        return mvmd128<64>::extract<0>(simd128<128>::popcount(arg1));
     3009}
     3010
    30043011//The total number of operations is 2
    30053012IDISA_ALWAYS_INLINE bool bitblock128::all(bitblock128_t arg1)
  • trunk/lib/idisa_cpp/idisa_ssse3.cpp

    r1548 r1556  
    4848        static IDISA_ALWAYS_INLINE bitblock128_t add_hl(bitblock128_t arg1, bitblock128_t arg2);
    4949        static IDISA_ALWAYS_INLINE bitblock128_t packss(bitblock128_t arg1, bitblock128_t arg2);
     50        static IDISA_ALWAYS_INLINE bitblock128_t packh(bitblock128_t arg1, bitblock128_t arg2);
    5051        static IDISA_ALWAYS_INLINE uint64_t signmask(bitblock128_t arg1);
    51         static IDISA_ALWAYS_INLINE bitblock128_t packh(bitblock128_t arg1, bitblock128_t arg2);
    5252        static IDISA_ALWAYS_INLINE bitblock128_t packl(bitblock128_t arg1, bitblock128_t arg2);
    5353        static IDISA_ALWAYS_INLINE bitblock128_t min_hl(bitblock128_t arg1, bitblock128_t arg2);
     
    9191        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9292        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
     93        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
    9394};
    9495
     
    30233024}
    30243025
     3026//The total number of operations is 22
     3027IDISA_ALWAYS_INLINE uint64_t bitblock128::popcount(bitblock128_t arg1)
     3028{
     3029        return mvmd128<64>::extract<0>(simd128<128>::popcount(arg1));
     3030}
     3031
    30253032//The total number of operations is 2
    30263033IDISA_ALWAYS_INLINE bool bitblock128::all(bitblock128_t arg1)
  • trunk/libgen/Configure/IDISAOperations.py

    r1521 r1556  
    496496    },
    497497   
     498    "bitblock_popcount":\
     499    {
     500     "signature":"int bitblock::popcount(SIMD_type arg1)",
     501     "args_type":{"arg1":"SIMD_type"},
     502     "return_type":"unsigned_int(64)",
     503    },
     504   
    498505    #"bitblock_load_aligned":\
    499506    #{
  • trunk/libgen/Library_Generator/StrategyPool.py

    r1537 r1556  
    19531953#               "Fws":[curRegSize]
    19541954#               },
     1955                "bitblock_popcount":\
     1956                {
     1957                "body":r'''
     1958return mvmd_extract(64, 0, simd_popcount(curRegSize, arg1))''',
     1959                "Ops":["bitblock_popcount"],
     1960                "Fws":[curRegSize],
     1961                "Platforms":[configure.ALL],
     1962                },
     1963       
    19551964               
    19561965        }
  • trunk/libgen/Library_Generator/UI.py

    r1548 r1556  
    104104                                codes += "typedef " + configure.SIMD_type[arch] + " " + configure.Bitblock_type[arch] + ";\n"
    105105                        else:
    106                                 codes += "#include <stdint.h>\n#include \"../config.hpp\"\n\n"
     106                                codes += "#include <stdint.h>\n"
    107107                                codes += '''#include "''' + configure.InstructionSetLibrary[arch] + '''"\n'''
    108108                                codes += "typedef " + configure.SIMD_type[arch] + " " + configure.Bitblock_type[arch] + ";\n"
  • trunk/libgen/Makefile

    r1548 r1556  
    7272        # copys the idisa128.hpp from generator's directory to idisa_lib/
    7373        python $(IDISA_GENERATOR) -a sse2 -l cpp -f $(IDISA128).hpp -g --body=$(BODY_DECLARATION)
    74         mv $(GENERATOR_DIR)/$(IDISA128).hpp $(IDISA_LIB_DIR)/
     74        mv $(GENERATOR_DIR)/$(IDISA128).hpp $(LIB_DIR)/
    7575       
    7676        # produces the idisa_sse2/sse3/ssse3/sse4_1/sse4_2.cpp containing the implementation of idisa operations
    7777        # copys the idisa_sse2/sse3/ssse3/sse4_1/sse4_2.cpp from generator's directory to idisa_lib/cpp/
    7878        python $(IDISA_GENERATOR) -a sse2 -l cpp -f $(IDISA_SSE2_CPP_LIB).cpp -g --body=$(BODY_IMPLEMENTATION)
    79         mv $(GENERATOR_DIR)/$(IDISA_SSE2_CPP_LIB).cpp $(IDISA_LIB_CPP_DIR)/
     79        mv $(GENERATOR_DIR)/$(IDISA_SSE2_CPP_LIB).cpp $(LIB_CPP_DIR)/
    8080       
    8181        python $(IDISA_GENERATOR) -a sse3 -l cpp -f $(IDISA_SSE3_CPP_LIB).cpp -g --body=$(BODY_IMPLEMENTATION)
    82         mv $(GENERATOR_DIR)/$(IDISA_SSE3_CPP_LIB).cpp $(IDISA_LIB_CPP_DIR)/
     82        mv $(GENERATOR_DIR)/$(IDISA_SSE3_CPP_LIB).cpp $(LIB_CPP_DIR)/
    8383       
    8484        python $(IDISA_GENERATOR) -a ssse3 -l cpp -f $(IDISA_SSSE3_CPP_LIB).cpp -g --body=$(BODY_IMPLEMENTATION)
    85         mv $(GENERATOR_DIR)/$(IDISA_SSSE3_CPP_LIB).cpp $(IDISA_LIB_CPP_DIR)/
     85        mv $(GENERATOR_DIR)/$(IDISA_SSSE3_CPP_LIB).cpp $(LIB_CPP_DIR)/
    8686       
    8787        python $(IDISA_GENERATOR) -a sse4_1 -l cpp -f $(IDISA_SSE4_1_CPP_LIB).cpp -g --body=$(BODY_IMPLEMENTATION)
    88         mv $(GENERATOR_DIR)/$(IDISA_SSE4_1_CPP_LIB).cpp $(IDISA_LIB_CPP_DIR)/
     88        mv $(GENERATOR_DIR)/$(IDISA_SSE4_1_CPP_LIB).cpp $(LIB_CPP_DIR)/
    8989       
    9090        python $(IDISA_GENERATOR) -a sse4_2 -l cpp -f $(IDISA_SSE4_2_CPP_LIB).cpp -g --body=$(BODY_IMPLEMENTATION)
    91         mv $(GENERATOR_DIR)/$(IDISA_SSE4_2_CPP_LIB).cpp $(IDISA_LIB_CPP_DIR)/
     91        mv $(GENERATOR_DIR)/$(IDISA_SSE4_2_CPP_LIB).cpp $(LIB_CPP_DIR)/
    9292
    9393idisa256:
     
    9595        # copys the idisa256.cpp from generator's directory to idisa_lib/
    9696        python $(IDISA_GENERATOR) -a avx -l cpp -f $(IDISA256).hpp -g --body=$(BODY_DECLARATION)
    97         mv $(GENERATOR_DIR)/$(IDISA256).hpp $(IDISA_LIB_DIR)/
     97        mv $(GENERATOR_DIR)/$(IDISA256).hpp $(LIB_DIR)/
    9898       
    9999        # produces the idisa_avx.hpp containing the implementation of idisa operations
    100100        # copys the idisa_avx.hpp from generator's directory to idisa_lib/cpp/
    101101        python $(IDISA_GENERATOR) -a avx -l cpp -f $(IDISA_AVX_CPP_LIB).cpp -g --body=$(BODY_IMPLEMENTATION)
    102         mv $(GENERATOR_DIR)/$(IDISA_AVX_CPP_LIB).cpp $(IDISA_LIB_CPP_DIR)/
     102        mv $(GENERATOR_DIR)/$(IDISA_AVX_CPP_LIB).cpp $(LIB_CPP_DIR)/
    103103
    104104idisa:
     
    106106        make idisa256
    107107        python $(IDISA_GENERATOR) -a sse2 -l cpp -f $(IDISA).hpp -g --body=$(BODY_DECLARATION)
    108         mv $(GENERATOR_DIR)/$(IDISA).hpp $(IDISA_LIB_DIR)/
     108        mv $(GENERATOR_DIR)/$(IDISA).hpp $(LIB_DIR)/
    109109       
    110         cp $(IDISA_LIB_CPP_DIR)/*.cpp $(LIB_CPP_DIR)
    111         cp $(IDISA_LIB_DIR)/$(IDISA128).hpp $(LIB_DIR)/
    112         cp $(IDISA_LIB_DIR)/$(IDISA256).hpp $(LIB_DIR)/
    113         cp $(IDISA_LIB_DIR)/$(IDISA).hpp $(LIB_DIR)/
    114110
    115111clean:
Note: See TracChangeset for help on using the changeset viewer.