source: trunk/symtab/hash_strms.hpp

Last change on this file was 1929, checked in by ksherdy, 7 years ago

Updated identity symbol table.

File size: 1.5 KB
Line 
1#ifndef HASH_STRMS_TEMPLATE_HPP
2#define HASH_STRMS_TEMPLATE_HPP
3
4#include "../lib/bitblock.hpp"
5#include "../lib/carryQ.hpp"
6#include "basis_bits.hpp"
7
8// GENERATED
9  struct Hash {
10  BitBlock h0;
11  BitBlock h1;
12};
13
14  struct Gen_hash_streams {
15 
16  void do_block(Basis_bits & basis_bits, Hash & hash) {
17
18
19
20        hash.h0 = simd_xor(simd_xor(simd_xor(basis_bits.bit_2, basis_bits.bit_3), basis_bits.bit_4), basis_bits.bit_5);
21        hash.h1 = simd_xor(simd_xor(simd_xor(basis_bits.bit_0, basis_bits.bit_1), basis_bits.bit_6), basis_bits.bit_7);
22  }
23  void do_final_block(Basis_bits & basis_bits, Hash & hash, BitBlock EOF_mask) {
24
25
26
27        hash.h0 = simd_xor(simd_xor(simd_xor(basis_bits.bit_2, basis_bits.bit_3), basis_bits.bit_4), basis_bits.bit_5);
28        hash.h1 = simd_xor(simd_xor(simd_xor(basis_bits.bit_0, basis_bits.bit_1), basis_bits.bit_6), basis_bits.bit_7);
29  }
30  void do_segment(Basis_bits basis_bits[], Hash hash[], int segment_blocks) {
31  int i;
32  for (i = 0; i < segment_blocks; i++)
33    do_block(basis_bits[i], hash[i]);
34  }
35 
36  };
37
38
39// GENERATED
40  Gen_hash_streams gen_hash_streams;
41
42
43static IDISA_ALWAYS_INLINE void hash_strms_do_block(Basis_bits & basis_bits, Hash & hash) {
44        // GENERATED
45       
46  gen_hash_streams.do_block(basis_bits, hash);
47}
48
49static IDISA_ALWAYS_INLINE void hash_strms_do_final_block(Basis_bits & basis_bits, Hash & hash, BitBlock & EOF_mask) {
50        // GENERATED
51       
52  gen_hash_streams.do_final_block(basis_bits, hash, EOF_mask);
53}
54
55#endif // HASH_STRMS_TEMPLATE_HPP
Note: See TracBrowser for help on using the repository browser.