about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2017-01-09 17:28:01 +0100
committerAjax <commial@gmail.com>2017-01-09 17:28:01 +0100
commitccf94648a6f8d3634b8fa707f01fa9e33ad5043b (patch)
treee49f319ca48901fe107c92308175397fcf3f9230
parent5a8bb06aa4f359b1091d0bc10e86524264b60c3d (diff)
downloadmiasm-ccf94648a6f8d3634b8fa707f01fa9e33ad5043b.tar.gz
miasm-ccf94648a6f8d3634b8fa707f01fa9e33ad5043b.zip
CC: declare parity as a macro to avoid function calls
-rw-r--r--miasm2/jitter/vm_mngr.c5
-rw-r--r--miasm2/jitter/vm_mngr.h3
2 files changed, 1 insertions, 7 deletions
diff --git a/miasm2/jitter/vm_mngr.c b/miasm2/jitter/vm_mngr.c
index 42f91f72..c48ba334 100644
--- a/miasm2/jitter/vm_mngr.c
+++ b/miasm2/jitter/vm_mngr.c
@@ -76,11 +76,6 @@ const uint8_t parity_table[256] = {
     0, CC_P, CC_P, 0, CC_P, 0, 0, CC_P,
 };
 
-uint8_t parity(uint64_t a) {
-	return parity_table[(a) & 0xFF];
-}
-
-
 // #define DEBUG_MIASM_AUTOMOD_CODE
 
 void memory_access_list_init(struct memory_access_list * access)
diff --git a/miasm2/jitter/vm_mngr.h b/miasm2/jitter/vm_mngr.h
index 88ecf34d..912b105e 100644
--- a/miasm2/jitter/vm_mngr.h
+++ b/miasm2/jitter/vm_mngr.h
@@ -193,8 +193,7 @@ int vm_write_mem(vm_mngr_t* vm_mngr, uint64_t addr, char *buffer, uint64_t size)
 #define CC_P 1
 
 extern const uint8_t parity_table[256];
-
-uint8_t parity(uint64_t a);
+#define parity(a) parity_table[(a) & 0xFF]
 
 unsigned int my_imul08(unsigned int a, unsigned int b);