diff options
| author | Camille Mougey <commial@gmail.com> | 2016-05-10 14:42:31 +0200 |
|---|---|---|
| committer | Camille Mougey <commial@gmail.com> | 2016-05-10 14:42:31 +0200 |
| commit | f6aecc413205b49b8ff2cb4fa7b5b9c3cd11dad8 (patch) | |
| tree | 46cdb77f0d38af3005036d1ff7b8e4db05727159 /miasm2/jitter/vm_mngr.c | |
| parent | 8e41c7845c9164d94f12f7d73f12bb8804f3e196 (diff) | |
| parent | 02a8037102adc14c8d5409e27f635acfedad7546 (diff) | |
| download | miasm-f6aecc413205b49b8ff2cb4fa7b5b9c3cd11dad8.tar.gz miasm-f6aecc413205b49b8ff2cb4fa7b5b9c3cd11dad8.zip | |
Merge pull request #367 from serpilliere/jitter_cache_block
Jitter cache block
Diffstat (limited to 'miasm2/jitter/vm_mngr.c')
| -rw-r--r-- | miasm2/jitter/vm_mngr.c | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/miasm2/jitter/vm_mngr.c b/miasm2/jitter/vm_mngr.c index 1bb58a17..f5c83b8b 100644 --- a/miasm2/jitter/vm_mngr.c +++ b/miasm2/jitter/vm_mngr.c @@ -41,6 +41,41 @@ #define MAX(a,b) (((a)>(b))?(a):(b)) +const uint8_t parity_table[256] = { + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + CC_P, 0, 0, CC_P, 0, CC_P, CC_P, 0, + 0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P, +}; + //#define DEBUG_MIASM_AUTOMOD_CODE @@ -527,26 +562,6 @@ int is_mapped(vm_mngr_t* vm_mngr, uint64_t addr, uint64_t size) return 1; } - - -unsigned int parity(unsigned int a) -{ -#if defined(__builtin_parity) - return __builtin_parity(a); -#else - unsigned int tmp, cpt; - - tmp = a&0xFF; - cpt = 1; - while (tmp!=0){ - cpt^=tmp&1; - tmp>>=1; - } - return cpt; -#endif -} - - int shift_right_arith(unsigned int size, int a, unsigned int b) { int i32_a; |