Changeset 603 for proto/u16u8


Ignore:
Timestamp:
Sep 4, 2010, 3:02:11 PM (9 years ago)
Author:
cameron
Message:

Makefile for SSE4.1

Location:
proto/u16u8/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/u16u8/src/Makefile

    r515 r603  
    44CC= g++ $(CFLAGS)
    55CFLAGS= -O3 $(SSE)
    6 SSE=-msse2 -mssse3 -msse4.2 -msse4.2
     6SSE=-msse4.1 -DUSE_PTEST #-mssse3 -msse4.1 -msse4.2
    77
    88OS = $(shell uname)
     
    3737clean: 
    3838        rm -f $(OUTFILE) $(OUTFILE).s
    39 ADSFU\cameron@cs-osl-02:~/parabix-wkg/proto/parabix2
     39
  • proto/u16u8/src/u16u8.c

    r510 r603  
    1515
    1616// Profiling
     17
    1718#include "../lib/perflib/perfsec.h"
    1819
    1920#ifdef BUFFER_PROFILING
    20 BOM_Table * transcode_timer;
    21 #endif
    22 
    23 #ifdef CODE_CLOCKER
     21        BOM_Table * transcode_timer;
     22
     23#elif CODE_CLOCKER
    2424        #define NUM_EVENTS 1
    2525        int Events[NUM_EVENTS] = {PAPI_TOT_CYC};
     
    2727        //int Events[NUM_EVENTS] = {PAPI_TOT_CYC, PAPI_BR_MSP};
    2828        int cal_size = 20;
    29         CC * parser_timer = new CC(Events,NUM_EVENTS,cal_size);
     29        CC * transcode_timer = new CC(Events,NUM_EVENTS,cal_size);
     30#else
     31        void * transcode_timer;
    3032#endif
    3133
     
    131133}
    132134
    133 static inline void bit_del_16(BitBlock &s, BitBlock delmask){
    134         BitBlock del16_rshift1;
    135         BitBlock del16_rshift2;
    136         BitBlock del16_rshift4;
    137         BitBlock del16_rshift8;
     135static inline void delinfo_16(BitBlock & del16_rshift1, BitBlock & del16_rshift2, BitBlock & del16_rshift4,
     136                              BitBlock & del16_rshift8, BitBlock delmask){
    138137       
    139138        BitBlock del16_trans2;
     
    181180        shift_bits= simd_and(del16_rshift4,del16_rshift8);
    182181        del16_rshift8= simd_or(simd_srli_16(shift_bits,4),simd_xor(del16_rshift8,shift_bits));
    183        
     182}
     183
     184static inline void bit_del_16(BitBlock &s, BitBlock del16_rshift1, BitBlock del16_rshift2, BitBlock del16_rshift4,
     185                              BitBlock del16_rshift8, BitBlock delmask) {
    184186        s = simd_andc(s, delmask);
    185         do_right16_shifts (s, del16_rshift1, del16_rshift2, del16_rshift4,  del16_rshift8)
    186 
     187        do_right16_shifts (s, del16_rshift1, del16_rshift2, del16_rshift4,  del16_rshift8);
    187188}
    188189
     
    535536
    536537
     538
     539     BitBlock shft1, shft2, shft3, shft4;
     540     delinfo_16(shft1, shft2, shft3, shft4, delmask[0]);
    537541     for (int i=0; i< 32; i=i+4){
    538         bit_del_16(doublepair[i],delmask[0]);
    539         bit_del_16(doublepair[i+1],delmask[1]);
    540         bit_del_16(doublepair[i+2],delmask[2]);
    541         bit_del_16(doublepair[i+3],delmask[3]);
     542        bit_del_16(doublepair[i],shft1, shft2, shft3, shft4, delmask[0]);
     543     }
     544     delinfo_16(shft1, shft2, shft3, shft4, delmask[1]);
     545     for (int i=0; i< 32; i=i+4){
     546        bit_del_16(doublepair[i+1],shft1, shft2, shft3, shft4, delmask[1]);
     547     }
     548     delinfo_16(shft1, shft2, shft3, shft4, delmask[2]);
     549     for (int i=0; i< 32; i=i+4){
     550        bit_del_16(doublepair[i+2],shft1, shft2, shft3, shft4, delmask[2]);
     551     }
     552     delinfo_16(shft1, shft2, shft3, shft4, delmask[3]);
     553     for (int i=0; i< 32; i=i+4){
     554        bit_del_16(doublepair[i+3],shft1, shft2, shft3, shft4, delmask[3]);
    542555     }
    543556
Note: See TracChangeset for help on using the changeset viewer.