Ignore:
Timestamp:
Oct 22, 2011, 5:58:28 PM (8 years ago)
Author:
ksherdy
Message:

IDISAfied stl template.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/pablo_template_stl.cpp

    r1488 r1561  
    44#include <sys/types.h>
    55#include <sys/stat.h>
    6 #include "../lib/lib_simd.h"
    7 
    8 #define BLOCK_SIZE (sizeof(SIMD_type) * 8)
     6
     7#define LocalCarryDeclare(name, count)\
     8CarryArray<count> name;\
     9
     10#include "../lib/types.h"
     11#include "../lib/carryQ.hpp"
     12
     13#define BLOCK_SIZE (sizeof(BitBlock) * 8)
    914#define SEGMENT_BLOCKS 12
    1015#define BUFFER_SIZE (BLOCK_SIZE * SEGMENT_BLOCKS)
    11 #define OVERLAP_BUFSIZE (sizeof(SIMD_type))
     16#define OVERLAP_BUFSIZE (sizeof(BitBlock))
    1217
    1318#include "xmldecl.h"
    1419#include "namechars.h"
    15 #include "../lib/carryQ.h"
    1620#include "../lib/perflib/perfsec.h"
    17 #include "../lib/s2p.h"
    18 
    19 #include "TagMatcher.h"
    20 #include "LineColTracker.h"
     21#include "../lib/s2p.hpp"
     22
     23#define sisd_load_unaligned(addr) _mm_loadu_si128(addr)
     24#include "TagMatcher.hpp"
     25#include "LineColTracker.hpp"
    2126#include "ErrorUtil.h"
    2227#include "ErrorTracker.h"
     
    4651TagMatcher matcher;
    4752ErrorTracker error_tracker;
    48 BitBlock EOF_mask = simd_const_1(1);
     53BitBlock EOF_mask = simd<1>::constant<1>();
    4954
    5055/* StreamScan & Post Process Declarations */
     
    362367  int check_pos = 0;
    363368  int chars_read = 0;
    364   BytePack buf[(BUFFER_SIZE+BLOCK_SIZE+OVERLAP_BUFSIZE*2)/sizeof(SIMD_type)];
     369  BytePack buf[(BUFFER_SIZE+BLOCK_SIZE+OVERLAP_BUFSIZE*2)/sizeof(BitBlock)];
    365370
    366371  char * srcbuf = ((char *) buf) + OVERLAP_BUFSIZE;
     
    454459    block_base = block_pos;
    455460    if (remaining > 0 || @any_carry) {
    456           EOF_mask = sisd_srl(simd_const_1(1),sisd_from_int(BLOCK_SIZE-remaining));
     461          EOF_mask = simd<sizeof(BitBlock)*8>::srl(simd<1>::constant<1>(), convert(BLOCK_SIZE-remaining));
    457462          s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
    458463          @final_block_stmts
Note: See TracChangeset for help on using the changeset viewer.