source: trunk/symtab/library_conversion.h @ 1978

Last change on this file since 1978 was 1649, checked in by vla24, 8 years ago

SymbolTable?: Integrated symbol table with the new IDISA architecture

File size: 908 bytes
Line 
1#ifndef LIBRARY_CONVERSION_H
2#define LIBRARY_CONVERSION_H
3
4#define USE_SSE2
5#include <idisa.hpp>
6#include <stdio.h>
7#define SIMD_type BitBlock
8
9#define sisd_load_aligned(x) bitblock::load_aligned((SIMD_type*)x)
10#define simd_mask_eq_8(v1, v2, hex_mask) ((hsimd<8>::signmask(simd<8>::eq(v1, v2)) & hex_mask) == hex_mask)
11#define sisd_load_unaligned(x) bitblock::load_unaligned(x)
12#define simd_all_true(r) hsimd<8>::signmask(r) == 0xFFFF
13#define simd_all_eq_8(v1, v2) simd_all_true(simd<8>::eq(v1, v2))
14
15/* Prints the SIMD register representation of a SIMD value. */
16static void print_simd_register(const char * var_name, SIMD_type v) {
17  union {SIMD_type vec; unsigned char elems[sizeof(SIMD_type)];} x;
18  x.vec = v;
19  unsigned char c;
20  printf("%30s = ", var_name);
21  for(int i=sizeof(SIMD_type)-1; i>=0; i--) {
22    c = x.elems[i];
23    printf("%02X ", c);
24  }
25  printf("\n");
26}
27#endif // LIBRARY_CONVERSION_H
Note: See TracBrowser for help on using the repository browser.