Changeset 1228


Ignore:
Timestamp:
Jul 27, 2011, 4:05:14 PM (8 years ago)
Author:
vla24
Message:

Integrated symbol table with xmlwf. There are various implementations for the symbol table, please read /proto/SymbolTable/README_SymbolTable for more information.

Files:
26 added
5 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/src/multiliteral.h

    r424 r1228  
    2323#include "charsets/ASCII_EBCDIC.h"
    2424
    25 #if BYTE_ORDER == BIG_ENDIAN
    26 const int LOW_BYTE_SHIFT = 8;
    27 const int HIGH_BYTE_SHIFT = 0;
     25#if (BYTE_ORDER == BIG_ENDIAN)& !defined(BYTE_SHIFT)
     26#define BYTE_SHIFT
     27#define LOW_BYTE_SHIFT 8
     28#define HIGH_BYTE_SHIFT 0
    2829#endif
    29 #if BYTE_ORDER == LITTLE_ENDIAN
    30 const int LOW_BYTE_SHIFT = 0;
    31 const int HIGH_BYTE_SHIFT = 8;
     30
     31#if (BYTE_ORDER == LITTLE_ENDIAN)& !defined(BYTE_SHIFT)
     32#define BYTE_SHIFT
     33#define LOW_BYTE_SHIFT 0
     34#define HIGH_BYTE_SHIFT 8
    3235#endif
     36
    3337
    3438/*
  • trunk/lib/carryQ.h

    r1213 r1228  
    88
    99#ifdef CARRYQ_AVX
     10#include "avx_simd.h"
    1011#define bitblock_adc adc256
    1112#define bitblock_sbb sbb256
    1213#define bitblock_advance_with_carry advance_with_carry256
    1314#else
     15#include "sse_simd.h"
    1416#define bitblock_adc adc128
    1517#define bitblock_sbb sbb128
    1618#define bitblock_advance_with_carry advance_with_carry
    1719#endif
    18 
    1920
    2021#ifndef CARRY_Q_H
  • trunk/lib/lib_simd.h

    r961 r1228  
    286286}
    287287
    288 #endif
    289 
     288static inline int bitblock_has_bit(SIMD_type v) {
     289#ifdef TEMPLATED_SIMD_LIB
     290    return !simd_all_true<8>(simd<8>::eq(v, simd<8>::constant<0>()));
     291#else
     292
     293#ifndef USE_PTEST
     294  return !simd_all_true_8(simd_eq_8(v, simd_const_8(0)));
     295#endif
     296#ifdef USE_PTEST
     297  return !_mm_testz_si128(v,v);
     298#endif
     299
     300#endif //TEMPLATED_SIMD_LIB
     301}
     302
     303static inline int bitblock_bit_count(SIMD_type v) {
     304#ifdef TEMPLATED_SIMD_LIB
     305
     306    int bit_count = 0;
     307    SIMD_type cts_2 = simd<2>::add<l,h>(v, v);
     308    SIMD_type cts_4 = simd<4>::add<l,h>(cts_2, cts_2);
     309    SIMD_type cts_8 = simd<8>::add<l,h>(cts_4, cts_4);
     310    SIMD_type cts_64 = _mm_sad_epu8(cts_8, simd<8>::constant<0>());
     311    /* SIMD_type cts_128 = simd<a28>::add<l,h>(cts_64, cts_64) */;
     312    SIMD_type cts_128 = simd<64>::add(cts_64, simd<128>::srli<64>(cts_64));
     313    return (int) sisd_to_int(cts_128);
     314
     315#else
     316
     317    int bit_count = 0;
     318    SIMD_type cts_2 = simd_add_2_lh(v, v);
     319    SIMD_type cts_4 = simd_add_4_lh(cts_2, cts_2);
     320    SIMD_type cts_8 = simd_add_8_lh(cts_4, cts_4);
     321    SIMD_type cts_64 = _mm_sad_epu8(cts_8, simd_const_8(0));
     322    /* SIMD_type cts_128 = simd_add_128_lh(cts_64, cts_64) */;
     323    SIMD_type cts_128 = simd_add_64(cts_64, sisd_srli(cts_64,64));
     324    return (int) sisd_to_int(cts_128);
     325
     326#endif //TEMPLATED_SIMD_LIB
     327}
     328
     329#endif
     330
  • trunk/lib/sse_simd.h

    r745 r1228  
    223223
    224224
    225 static inline int bitblock_has_bit(SIMD_type v) {
    226 #ifndef USE_PTEST
    227   return !simd_all_true_8(simd_eq_8(v, simd_const_8(0)));
    228 #endif
    229 #ifdef USE_PTEST
    230   return !_mm_testz_si128(v,v);
    231 #endif
    232 }
     225//static inline int bitblock_has_bit(SIMD_type v) {
     226//#ifndef USE_PTEST
     227//  return !simd_all_true_8(simd_eq_8(v, simd_const_8(0)));
     228//#endif
     229//#ifdef USE_PTEST
     230//  return !_mm_testz_si128(v,v);
     231//#endif
     232//}
    233233
    234234
     
    663663}
    664664
    665 static inline int bitblock_bit_count(SIMD_type v) {
    666   int bit_count = 0;
    667   SIMD_type cts_2 = simd_add_2_lh(v, v);
    668   SIMD_type cts_4 = simd_add_4_lh(cts_2, cts_2);
    669   SIMD_type cts_8 = simd_add_8_lh(cts_4, cts_4);
    670   SIMD_type cts_64 = _mm_sad_epu8(cts_8, simd_const_8(0));
    671   /* SIMD_type cts_128 = simd_add_128_lh(cts_64, cts_64) */;
    672   SIMD_type cts_128 = simd_add_64(cts_64, sisd_srli(cts_64,64));
    673   return (int) sisd_to_int(cts_128);
    674 }
     665//static inline int bitblock_bit_count(SIMD_type v) {
     666//  int bit_count = 0;
     667//  SIMD_type cts_2 = simd_add_2_lh(v, v);
     668//  SIMD_type cts_4 = simd_add_4_lh(cts_2, cts_2);
     669//  SIMD_type cts_8 = simd_add_8_lh(cts_4, cts_4);
     670//  SIMD_type cts_64 = _mm_sad_epu8(cts_8, simd_const_8(0));
     671//  /* SIMD_type cts_128 = simd_add_128_lh(cts_64, cts_64) */;
     672//  SIMD_type cts_128 = simd_add_64(cts_64, sisd_srli(cts_64,64));
     673//  return (int) sisd_to_int(cts_128);
     674//}
    675675
    676676/*
  • trunk/lib/sse_simd_t.h

    r1182 r1228  
    919919
    920920
    921 static inline int bitblock_has_bit(SIMD_type v) {
    922   return !simd_all_true<8>(simd<8>::eq(v, simd<8>::constant<0>()));
    923 }
    924 
    925 static inline int bitblock_bit_count(SIMD_type v) {
    926   int bit_count = 0;
    927   SIMD_type cts_2 = simd<2>::add<l,h>(v, v);
    928   SIMD_type cts_4 = simd<4>::add<l,h>(cts_2, cts_2);
    929   SIMD_type cts_8 = simd<8>::add<l,h>(cts_4, cts_4);
    930   SIMD_type cts_64 = _mm_sad_epu8(cts_8, simd<8>::constant<0>());
    931   /* SIMD_type cts_128 = simd<a28>::add<l,h>(cts_64, cts_64) */;
    932   SIMD_type cts_128 = simd<64>::add(cts_64, simd<128>::srli<64>(cts_64));
    933   return (int) sisd_to_int(cts_128);
    934 }
    935 
    936 #endif
    937 
     921//static inline int bitblock_has_bit(SIMD_type v) {
     922//  return !simd_all_true<8>(simd<8>::eq(v, simd<8>::constant<0>()));
     923//}
     924
     925//static inline int bitblock_bit_count(SIMD_type v) {
     926//  int bit_count = 0;
     927//  SIMD_type cts_2 = simd<2>::add<l,h>(v, v);
     928//  SIMD_type cts_4 = simd<4>::add<l,h>(cts_2, cts_2);
     929//  SIMD_type cts_8 = simd<8>::add<l,h>(cts_4, cts_4);
     930//  SIMD_type cts_64 = _mm_sad_epu8(cts_8, simd<8>::constant<0>());
     931//  /* SIMD_type cts_128 = simd<a28>::add<l,h>(cts_64, cts_64) */;
     932//  SIMD_type cts_128 = simd<64>::add(cts_64, simd<128>::srli<64>(cts_64));
     933//  return (int) sisd_to_int(cts_128);
     934//}
     935
     936#endif
     937
Note: See TracChangeset for help on using the changeset viewer.