Changeset 1584


Ignore:
Timestamp:
Oct 24, 2011, 1:20:43 PM (7 years ago)
Author:
huah
Message:

fixed the bitblock::load/store for AVX; added testing modules for bitblock::srl/sll/srli/slli

Location:
trunk
Files:
4 added
14 edited

Legend:

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

    r1580 r1584  
    8585{
    8686public:
    87         static IDISA_ALWAYS_INLINE bitblock256_t load_unaligned(bitblock256_t* arg1);
     87        static IDISA_ALWAYS_INLINE bitblock256_t load_unaligned(float const* arg1);
    8888        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock256_t srli(bitblock256_t arg1);
    89         static IDISA_ALWAYS_INLINE void store_aligned(bitblock256_t* arg1, bitblock256_t arg2);
     89        static IDISA_ALWAYS_INLINE void store_aligned(float* arg1, bitblock256_t arg2);
    9090        static IDISA_ALWAYS_INLINE bool all(bitblock256_t arg1);
    9191        static IDISA_ALWAYS_INLINE bool any(bitblock256_t arg1);
    9292        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock256_t arg1);
    9393        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock256_t slli(bitblock256_t arg1);
    94         static IDISA_ALWAYS_INLINE bitblock256_t load_aligned(bitblock256_t* arg1);
    95         static IDISA_ALWAYS_INLINE void store_unaligned(bitblock256_t* arg1, bitblock256_t arg2);
     94        static IDISA_ALWAYS_INLINE bitblock256_t load_aligned(float const* arg1);
     95        static IDISA_ALWAYS_INLINE void store_unaligned(float* arg1, bitblock256_t arg2);
    9696};
    9797
     
    33053305
    33063306//The total number of operations is 1
    3307 IDISA_ALWAYS_INLINE bitblock256_t bitblock256::load_unaligned(bitblock256_t* arg1)
    3308 {
    3309         return _mm256_loadu_ps((bitblock256_t*)(arg1));
     3307IDISA_ALWAYS_INLINE bitblock256_t bitblock256::load_unaligned(float const* arg1)
     3308{
     3309        return _mm256_loadu_ps((float const*)(arg1));
    33103310}
    33113311
     
    33173317
    33183318//The total number of operations is 1
    3319 IDISA_ALWAYS_INLINE void bitblock256::store_aligned(bitblock256_t* arg1, bitblock256_t arg2)
    3320 {
    3321         _mm256_store_ps((bitblock256_t*)(arg1), arg2);
     3319IDISA_ALWAYS_INLINE void bitblock256::store_aligned(float* arg1, bitblock256_t arg2)
     3320{
     3321        _mm256_store_ps((float*)(arg1), arg2);
    33223322}
    33233323
     
    33473347
    33483348//The total number of operations is 1
    3349 IDISA_ALWAYS_INLINE bitblock256_t bitblock256::load_aligned(bitblock256_t* arg1)
    3350 {
    3351         return _mm256_load_ps((bitblock256_t*)(arg1));
    3352 }
    3353 
    3354 //The total number of operations is 1
    3355 IDISA_ALWAYS_INLINE void bitblock256::store_unaligned(bitblock256_t* arg1, bitblock256_t arg2)
    3356 {
    3357         _mm256_storeu_ps((bitblock256_t*)(arg1), arg2);
     3349IDISA_ALWAYS_INLINE bitblock256_t bitblock256::load_aligned(float const* arg1)
     3350{
     3351        return _mm256_load_ps((float const*)(arg1));
     3352}
     3353
     3354//The total number of operations is 1
     3355IDISA_ALWAYS_INLINE void bitblock256::store_unaligned(float* arg1, bitblock256_t arg2)
     3356{
     3357        _mm256_storeu_ps((float*)(arg1), arg2);
    33583358}
    33593359
  • trunk/lib/idisa_cpp/idisa_sse2.cpp

    r1580 r1584  
    8989public:
    9090        static IDISA_ALWAYS_INLINE bitblock128_t sll(bitblock128_t arg1, bitblock128_t arg2);
    91         static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(bitblock128_t* arg1);
     91        static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(float const* arg1);
    9292        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t srli(bitblock128_t arg1);
    9393        static IDISA_ALWAYS_INLINE bitblock128_t srl(bitblock128_t arg1, bitblock128_t arg2);
    94         static IDISA_ALWAYS_INLINE void store_aligned(bitblock128_t* arg1, bitblock128_t arg2);
     94        static IDISA_ALWAYS_INLINE void store_aligned(float* arg1, bitblock128_t arg2);
    9595        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9696        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
    9797        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
    9898        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t slli(bitblock128_t arg1);
    99         static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(bitblock128_t* arg1);
    100         static IDISA_ALWAYS_INLINE void store_unaligned(bitblock128_t* arg1, bitblock128_t arg2);
     99        static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(float const* arg1);
     100        static IDISA_ALWAYS_INLINE void store_unaligned(float* arg1, bitblock128_t arg2);
    101101};
    102102
     
    29862986
    29872987//The total number of operations is 1
    2988 IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(bitblock128_t* arg1)
     2988IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(float const* arg1)
    29892989{
    29902990        return _mm_loadu_si128((bitblock128_t*)(arg1));
     
    29982998
    29992999//The total number of operations is 1
    3000 IDISA_ALWAYS_INLINE void bitblock128::store_aligned(bitblock128_t* arg1, bitblock128_t arg2)
     3000IDISA_ALWAYS_INLINE void bitblock128::store_aligned(float* arg1, bitblock128_t arg2)
    30013001{
    30023002        _mm_store_si128((bitblock128_t*)(arg1), arg2);
     
    30343034
    30353035//The total number of operations is 1
    3036 IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(bitblock128_t* arg1)
     3036IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(float const* arg1)
    30373037{
    30383038        return _mm_load_si128((bitblock128_t*)(arg1));
     
    30403040
    30413041//The total number of operations is 1
    3042 IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(bitblock128_t* arg1, bitblock128_t arg2)
     3042IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(float* arg1, bitblock128_t arg2)
    30433043{
    30443044        _mm_storeu_si128((bitblock128_t*)(arg1), arg2);
  • trunk/lib/idisa_cpp/idisa_sse3.cpp

    r1580 r1584  
    8989public:
    9090        static IDISA_ALWAYS_INLINE bitblock128_t sll(bitblock128_t arg1, bitblock128_t arg2);
    91         static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(bitblock128_t* arg1);
     91        static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(float const* arg1);
    9292        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t srli(bitblock128_t arg1);
    9393        static IDISA_ALWAYS_INLINE bitblock128_t srl(bitblock128_t arg1, bitblock128_t arg2);
    94         static IDISA_ALWAYS_INLINE void store_aligned(bitblock128_t* arg1, bitblock128_t arg2);
     94        static IDISA_ALWAYS_INLINE void store_aligned(float* arg1, bitblock128_t arg2);
    9595        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9696        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
    9797        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
    9898        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t slli(bitblock128_t arg1);
    99         static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(bitblock128_t* arg1);
    100         static IDISA_ALWAYS_INLINE void store_unaligned(bitblock128_t* arg1, bitblock128_t arg2);
     99        static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(float const* arg1);
     100        static IDISA_ALWAYS_INLINE void store_unaligned(float* arg1, bitblock128_t arg2);
    101101};
    102102
     
    29862986
    29872987//The total number of operations is 1
    2988 IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(bitblock128_t* arg1)
     2988IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(float const* arg1)
    29892989{
    29902990        return _mm_loadu_si128((bitblock128_t*)(arg1));
     
    29982998
    29992999//The total number of operations is 1
    3000 IDISA_ALWAYS_INLINE void bitblock128::store_aligned(bitblock128_t* arg1, bitblock128_t arg2)
     3000IDISA_ALWAYS_INLINE void bitblock128::store_aligned(float* arg1, bitblock128_t arg2)
    30013001{
    30023002        _mm_store_si128((bitblock128_t*)(arg1), arg2);
     
    30343034
    30353035//The total number of operations is 1
    3036 IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(bitblock128_t* arg1)
     3036IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(float const* arg1)
    30373037{
    30383038        return _mm_load_si128((bitblock128_t*)(arg1));
     
    30403040
    30413041//The total number of operations is 1
    3042 IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(bitblock128_t* arg1, bitblock128_t arg2)
     3042IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(float* arg1, bitblock128_t arg2)
    30433043{
    30443044        _mm_storeu_si128((bitblock128_t*)(arg1), arg2);
  • trunk/lib/idisa_cpp/idisa_sse4_1.cpp

    r1580 r1584  
    9090public:
    9191        static IDISA_ALWAYS_INLINE bitblock128_t sll(bitblock128_t arg1, bitblock128_t arg2);
    92         static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(bitblock128_t* arg1);
     92        static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(float const* arg1);
    9393        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t srli(bitblock128_t arg1);
    9494        static IDISA_ALWAYS_INLINE bitblock128_t srl(bitblock128_t arg1, bitblock128_t arg2);
    95         static IDISA_ALWAYS_INLINE void store_aligned(bitblock128_t* arg1, bitblock128_t arg2);
     95        static IDISA_ALWAYS_INLINE void store_aligned(float* arg1, bitblock128_t arg2);
    9696        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9797        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
    9898        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
    9999        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t slli(bitblock128_t arg1);
    100         static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(bitblock128_t* arg1);
    101         static IDISA_ALWAYS_INLINE void store_unaligned(bitblock128_t* arg1, bitblock128_t arg2);
     100        static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(float const* arg1);
     101        static IDISA_ALWAYS_INLINE void store_unaligned(float* arg1, bitblock128_t arg2);
    102102};
    103103
     
    30183018
    30193019//The total number of operations is 1
    3020 IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(bitblock128_t* arg1)
     3020IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(float const* arg1)
    30213021{
    30223022        return _mm_loadu_si128((bitblock128_t*)(arg1));
     
    30303030
    30313031//The total number of operations is 1
    3032 IDISA_ALWAYS_INLINE void bitblock128::store_aligned(bitblock128_t* arg1, bitblock128_t arg2)
     3032IDISA_ALWAYS_INLINE void bitblock128::store_aligned(float* arg1, bitblock128_t arg2)
    30333033{
    30343034        _mm_store_si128((bitblock128_t*)(arg1), arg2);
     
    30663066
    30673067//The total number of operations is 1
    3068 IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(bitblock128_t* arg1)
     3068IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(float const* arg1)
    30693069{
    30703070        return _mm_load_si128((bitblock128_t*)(arg1));
     
    30723072
    30733073//The total number of operations is 1
    3074 IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(bitblock128_t* arg1, bitblock128_t arg2)
     3074IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(float* arg1, bitblock128_t arg2)
    30753075{
    30763076        _mm_storeu_si128((bitblock128_t*)(arg1), arg2);
  • trunk/lib/idisa_cpp/idisa_sse4_2.cpp

    r1580 r1584  
    9090public:
    9191        static IDISA_ALWAYS_INLINE bitblock128_t sll(bitblock128_t arg1, bitblock128_t arg2);
    92         static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(bitblock128_t* arg1);
     92        static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(float const* arg1);
    9393        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t srli(bitblock128_t arg1);
    9494        static IDISA_ALWAYS_INLINE bitblock128_t srl(bitblock128_t arg1, bitblock128_t arg2);
    95         static IDISA_ALWAYS_INLINE void store_aligned(bitblock128_t* arg1, bitblock128_t arg2);
     95        static IDISA_ALWAYS_INLINE void store_aligned(float* arg1, bitblock128_t arg2);
    9696        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9797        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
    9898        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
    9999        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t slli(bitblock128_t arg1);
    100         static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(bitblock128_t* arg1);
    101         static IDISA_ALWAYS_INLINE void store_unaligned(bitblock128_t* arg1, bitblock128_t arg2);
     100        static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(float const* arg1);
     101        static IDISA_ALWAYS_INLINE void store_unaligned(float* arg1, bitblock128_t arg2);
    102102};
    103103
     
    30003000
    30013001//The total number of operations is 1
    3002 IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(bitblock128_t* arg1)
     3002IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(float const* arg1)
    30033003{
    30043004        return _mm_loadu_si128((bitblock128_t*)(arg1));
     
    30123012
    30133013//The total number of operations is 1
    3014 IDISA_ALWAYS_INLINE void bitblock128::store_aligned(bitblock128_t* arg1, bitblock128_t arg2)
     3014IDISA_ALWAYS_INLINE void bitblock128::store_aligned(float* arg1, bitblock128_t arg2)
    30153015{
    30163016        _mm_store_si128((bitblock128_t*)(arg1), arg2);
     
    30483048
    30493049//The total number of operations is 1
    3050 IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(bitblock128_t* arg1)
     3050IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(float const* arg1)
    30513051{
    30523052        return _mm_load_si128((bitblock128_t*)(arg1));
     
    30543054
    30553055//The total number of operations is 1
    3056 IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(bitblock128_t* arg1, bitblock128_t arg2)
     3056IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(float* arg1, bitblock128_t arg2)
    30573057{
    30583058        _mm_storeu_si128((bitblock128_t*)(arg1), arg2);
  • trunk/lib/idisa_cpp/idisa_ssse3.cpp

    r1580 r1584  
    9090public:
    9191        static IDISA_ALWAYS_INLINE bitblock128_t sll(bitblock128_t arg1, bitblock128_t arg2);
    92         static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(bitblock128_t* arg1);
     92        static IDISA_ALWAYS_INLINE bitblock128_t load_unaligned(float const* arg1);
    9393        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t srli(bitblock128_t arg1);
    9494        static IDISA_ALWAYS_INLINE bitblock128_t srl(bitblock128_t arg1, bitblock128_t arg2);
    95         static IDISA_ALWAYS_INLINE void store_aligned(bitblock128_t* arg1, bitblock128_t arg2);
     95        static IDISA_ALWAYS_INLINE void store_aligned(float* arg1, bitblock128_t arg2);
    9696        static IDISA_ALWAYS_INLINE bool all(bitblock128_t arg1);
    9797        static IDISA_ALWAYS_INLINE bool any(bitblock128_t arg1);
    9898        static IDISA_ALWAYS_INLINE uint64_t popcount(bitblock128_t arg1);
    9999        template <uint64_t sh> static IDISA_ALWAYS_INLINE bitblock128_t slli(bitblock128_t arg1);
    100         static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(bitblock128_t* arg1);
    101         static IDISA_ALWAYS_INLINE void store_unaligned(bitblock128_t* arg1, bitblock128_t arg2);
     100        static IDISA_ALWAYS_INLINE bitblock128_t load_aligned(float const* arg1);
     101        static IDISA_ALWAYS_INLINE void store_unaligned(float* arg1, bitblock128_t arg2);
    102102};
    103103
     
    30213021
    30223022//The total number of operations is 1
    3023 IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(bitblock128_t* arg1)
     3023IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_unaligned(float const* arg1)
    30243024{
    30253025        return _mm_loadu_si128((bitblock128_t*)(arg1));
     
    30333033
    30343034//The total number of operations is 1
    3035 IDISA_ALWAYS_INLINE void bitblock128::store_aligned(bitblock128_t* arg1, bitblock128_t arg2)
     3035IDISA_ALWAYS_INLINE void bitblock128::store_aligned(float* arg1, bitblock128_t arg2)
    30363036{
    30373037        _mm_store_si128((bitblock128_t*)(arg1), arg2);
     
    30693069
    30703070//The total number of operations is 1
    3071 IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(bitblock128_t* arg1)
     3071IDISA_ALWAYS_INLINE bitblock128_t bitblock128::load_aligned(float const* arg1)
    30723072{
    30733073        return _mm_load_si128((bitblock128_t*)(arg1));
     
    30753075
    30763076//The total number of operations is 1
    3077 IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(bitblock128_t* arg1, bitblock128_t arg2)
     3077IDISA_ALWAYS_INLINE void bitblock128::store_unaligned(float* arg1, bitblock128_t arg2)
    30783078{
    30793079        _mm_storeu_si128((bitblock128_t*)(arg1), arg2);
  • trunk/libgen/Configure/IDISAOperations.py

    r1579 r1584  
    533533    "bitblock_load_aligned":\
    534534    {
    535      "signature":"SIMD_type bitblock::load_aligned(SIMD_type* arg1)",
    536      "args_type":{"arg1":"SIMD_type*"},
     535     "signature":"SIMD_type bitblock::load_aligned(float const* arg1)",
     536     "args_type":{"arg1":"float const*"},
    537537     "return_type":"SIMD_type",
    538538    },
    539539    "bitblock_load_unaligned":\
    540540    {
    541      "signature":"SIMD_type bitblock::load_unaligned(SIMD_type* arg1)",
    542      "args_type":{"arg1":"SIMD_type*"},
     541     "signature":"SIMD_type bitblock::load_unaligned(float const* arg1)",
     542     "args_type":{"arg1":"float const*"},
    543543     "return_type":"SIMD_type",
    544544    },
     
    546546    "bitblock_store_aligned":\
    547547    {
    548      "signature":"void bitblock::store_aligned(SIMD_type* arg1, SIMD_type arg2)",
    549      "args_type":{"arg1":"SIMD_type*", "arg2":"SIMD_type"},
     548     "signature":"void bitblock::store_aligned(float* arg1, SIMD_type arg2)",
     549     "args_type":{"arg1":"float*", "arg2":"SIMD_type"},
    550550     "return_type":"void",
    551551    },
    552552    "bitblock_store_unaligned":\
    553553    {
    554      "signature":"void bitblock::store_unaligned(SIMD_type* arg1, SIMD_type arg2)",
    555      "args_type":{"arg1":"SIMD_type*", "arg2":"SIMD_type"},
     554     "signature":"void bitblock::store_unaligned(float* arg1, SIMD_type arg2)",
     555     "args_type":{"arg1":"float*", "arg2":"SIMD_type"},
    556556     "return_type":"void",
    557557    },
  • trunk/libgen/Library_Generator/AVXInstructions.py

    r1570 r1584  
    199199        "bitblock_load_aligned":\
    200200        {
    201                 "signature":"SIMD_type _mm256_load_ps(SIMD_type* arg1)",
    202                 "args_type":{"arg1":"SIMD_type*"},
     201                "signature":"SIMD_type _mm256_load_ps(float const* arg1)",
     202                "args_type":{"arg1":"float const*"},
    203203                "return_type":"SIMD_type",
    204204                "fws":[256],
     
    206206        "bitblock_store_aligned":\
    207207        {
    208                 "signature":"void _mm256_store_ps(SIMD_type* arg1, SIMD_type arg2)",
    209                 "args_type":{"arg1":"SIMD_type*", "arg2":"SIMD_type"},
     208                "signature":"void _mm256_store_ps(float* arg1, SIMD_type arg2)",
     209                "args_type":{"arg1":"float*", "arg2":"SIMD_type"},
    210210                "return_type":"void",
    211211                "fws":[256],
     
    213213        "bitblock_load_unaligned":\
    214214        {
    215                 "signature":"SIMD_type _mm256_loadu_ps(SIMD_type* arg1)",
    216                 "args_type":{"arg1":"SIMD_type*"},
     215                "signature":"SIMD_type _mm256_loadu_ps(float const* arg1)",
     216                "args_type":{"arg1":"float const*"},
    217217                "return_type":"SIMD_type",
    218218                "fws":[256],
     
    220220        "bitblock_store_unaligned":\
    221221        {
    222                 "signature":"void _mm256_storeu_ps(SIMD_type* arg1, SIMD_type arg2)",
    223                 "args_type":{"arg1":"SIMD_type*", "arg2":"SIMD_type"},
     222                "signature":"void _mm256_storeu_ps(float* arg1, SIMD_type arg2)",
     223                "args_type":{"arg1":"float*", "arg2":"SIMD_type"},
    224224                "return_type":"void",
    225225                "fws":[256],
    226226        },
    227 
    228227        "_mm256_set_epi32":\
    229228        {
  • trunk/libgen/Library_Generator/BuiltIns.py

    r1570 r1584  
    2626                for arg in opSignature.split(","):
    2727                        arg0 = arg.strip()
    28                         self.args.append(arg0[arg0.find(" ")+1:])
     28                        spacePos, lastSpacePos = 0, 0
     29                        while arg0.find(" ", spacePos) != -1:
     30                                lastSpacePos = arg0.find(" ", spacePos)
     31                                spacePos = lastSpacePos + 1
     32                        self.args.append(arg0[lastSpacePos+1:])
    2933                self.arguments = self.args
    3034               
     
    4650                        elif StandardTypes.Is64BitFloatingType(self.argsType[self.args[i]]):
    4751                                txt += "(" + StandardTypes.Get64BitFloatingType(self.argsType[self.args[i]], configure.RegisterSize[self.arch]) + ")" + "(" + self.arguments[i] + ")" + ", "
     52                        elif StandardTypes.IsFloatConstantPointer(self.argsType[self.args[i]]):
     53                                txt += "(" + StandardTypes.GetFloatConstantPointer() + ")" + "(" + self.arguments[i] + ")" + ", "
     54                        elif StandardTypes.IsFloatPointer(self.argsType[self.args[i]]):
     55                                txt += "(" + StandardTypes.GetFloatPointer() + ")" + "(" + self.arguments[i] + ")" + ", "
    4856                        else:
    4957                                assert False, "unknown data type for built-ins"
  • trunk/libgen/Library_Generator/Operation.py

    r1582 r1584  
    9999                        elif StandardTypes.IsSIMDPointer(argType):
    100100                                argType = configure.Bitblock_type[self.arch] + "*"
     101                        elif StandardTypes.IsFloatConstantPointer(argType):
     102                                argType = StandardTypes.GetFloatConstantPointer()
     103                        elif StandardTypes.IsFloatPointer(argType):
     104                                argType = StandardTypes.GetFloatPointer()
    101105                        else:
    102106                                #it must be a SIMD_type
     
    168172                                args = re.split(",", args)
    169173                                for arg in args:
     174                                        arg0 = arg.strip()
     175                                        spacePos, lastSpacePos = 0, 0
     176                                        while arg0.find(" ", spacePos) != -1:
     177                                                lastSpacePos = arg0.find(" ", spacePos)
     178                                                spacePos = lastSpacePos + 1
    170179                                        #argPart0 is the data type of the first argument, it could be SIMD_type or SIMD_type*
    171                                         argPart0 = re.search("[a-zA-Z_\*]+ ", arg).group().strip()
     180                                        argPart0 = arg0[:lastSpacePos].strip()
    172181                                        #argPart1 is the name of the first argument, it could be any variable name or '&'+variable_name
    173                                         argPart1 = re.search("[a-zA-Z_\*]+\s([a-zA-Z0-9_&]+)", arg).group(1).strip()
     182                                        argPart1 = arg0[lastSpacePos+1:].strip()
    174183                                        self.arguments.append( Utility.LibVariable(argPart0, argPart1) )
    175184                except Exception, e:
     
    204213                if self.opPattern == 4:
    205214                        #bitblock::op<val>(...)
    206                         cppText = self.name + "<" + str(templateArg) + ">"
     215                        if testingFlag:
     216                                cppText = self.newClassType + "::" + self.name + "<" + "(" + str(self.templateArg.type) + ")" + "(" + str(templateArg) + "UL)" + ">"
     217                        else:
     218                                cppText = self.newClassType + "::" + self.name + "<" + str(templateArg) + ">"
    207219                elif self.opPattern == 2:
    208220                        cppText = self.name
  • trunk/libgen/Library_Generator/StandardTypes.py

    r1570 r1584  
    5656    return configure.Bitblock_type[arch] + "*"
    5757
     58def GetFloatConstantPointer():
     59    return "float const*"
     60
     61def GetFloatPointer():
     62    return "float*"
     63
    5864def Is64BitFloatingType(typeStr):
    5965    return "__m256d" in typeStr
     
    6167def IsSIMDPointer(typeStr):
    6268    return "SIMD_type*" == typeStr
     69
     70def IsFloatPointer(typeStr):
     71    return "float*" == typeStr
     72
     73def IsFloatConstantPointer(typeStr):
     74    return "float const*" == typeStr
    6375
    6476def IsSIMDType(typeStr):
  • trunk/libgen/Library_Tester/CalculateResult.py

    r1582 r1584  
    3030                        ret = calcModule.GetResult(data)
    3131                elif operation.opPattern == 4:
    32                         #bitblock operations
    33                         #ret = calcModule.GetResult(data[-1], data)
    34                         pass
     32                        #bitblock srli/slli operations
     33                        ret = calcModule.GetResult(data[-1], data)
     34                        #pass
    3535                else:
    3636                        print "unknown operation!"
  • trunk/libgen/Library_Tester/GenerateCppTests.py

    r1582 r1584  
    8585                                test_body += "\t\t\t" + "ans.push_back(Int2String($call_op$));\n".replace("$call_op$", operation.CallingStatementToCppText(vop.fw, args, testingData[op_fw][i][-1], True)).replace("$optId$", str(TesterUtility.GetOptId(arch)))
    8686                        else:
    87                                 print "can't process this data type", operation.returnType
     87                                assert False, "can't process this data type" + str(operation.returnType)
    8888                test_body += "\t\t\t" + "break;\n"
    8989
     
    139139                operation = definedOperations[opFullName][1]
    140140               
    141                 if operation.opPattern == 1:
     141                if operation.opPattern == 1 or operation.opPattern == 4:
    142142                        #operations with other types
    143143                        funcDefs += TemplatedFuncMakeCppText(arch, operation, validOperations, testingData)
     
    153153        for opFullName in validOperations:
    154154                operation = definedOperations[opFullName][1]
    155                 if operation.opPattern == 4: continue
     155                #if operation.opPattern == 4: continue
    156156                for vop in validOperations[opFullName]:
    157157                        mainBody += "\t" + "Testing_" + opFullName + "(" + str(vop.fw) + ")" + ";\n"
     
    177177                        testingData[opFullName + "_" + str(regSize)] = GenData.MakeRandomData(operation, regSize, maxTestCase)
    178178                elif operation.opPattern == 4:
    179                         pass
     179                        testingData[opFullName + "_" + str(regSize)] = GenData.MakeRandomData(operation, regSize, maxTestCase)
     180                        templatedData = []
     181                        for key in operation.valueRange:
     182                                lowBound = operation.valueRange[key]["min"]
     183                                upBound = operation.valueRange[key]["max"]
     184                                templatedData = TesterUtility.GetRandomNums(lowBound, upBound, maxTestCase)
     185                                break
     186                        for i in range(len(templatedData)):
     187                                testingData[opFullName + "_" + str(regSize)][i].append(templatedData[i])
    180188                else:
    181189                        #operations with other types
  • trunk/libgen/Makefile

    r1556 r1584  
    117117        rm -f $(TESTER_DIR)/AVX*_test
    118118        rm -f $(TESTER_DIR)/idisa*.*
     119        rm -f $(TESTER_DIR)/CalculatingModules/*.pyc
    119120        rm -f $(TESTER_DIR)/input/*
    120121        rm -f $(TESTER_DIR)/output/*
Note: See TracChangeset for help on using the changeset viewer.