From d6a6f4aaa661ee45232b9b985f7b59c516b8b6c4 Mon Sep 17 00:00:00 2001 From: Ajax Date: Fri, 13 Nov 2015 11:54:46 +0100 Subject: x86: >>>/<<< c_cf are no more needed: use c_rez with rotate-1 --- miasm2/jitter/vm_mngr.c | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) (limited to 'miasm2/jitter/vm_mngr.c') diff --git a/miasm2/jitter/vm_mngr.c b/miasm2/jitter/vm_mngr.c index 9ba3c227..ddcf86ca 100644 --- a/miasm2/jitter/vm_mngr.c +++ b/miasm2/jitter/vm_mngr.c @@ -847,7 +847,7 @@ uint64_t rot_right(uint64_t size, uint64_t a, uint64_t b) } -int rcl_rez_op(unsigned int size, unsigned int a, unsigned int b, unsigned int cf) +unsigned int rcl_rez_op(unsigned int size, unsigned int a, unsigned int b, unsigned int cf) { uint64_t tmp; @@ -887,43 +887,12 @@ int rcl_rez_op(unsigned int size, unsigned int a, unsigned int b, unsigned int c } } -int rcr_rez_op(unsigned int size, unsigned int a, unsigned int b, unsigned int cf) +unsigned int rcr_rez_op(unsigned int size, unsigned int a, unsigned int b, unsigned int cf) { return rcl_rez_op(size, a, size+1-b, cf); } - -int rcl_cf_op(unsigned int size, unsigned int a, unsigned int b, unsigned int cf) -{ - uint64_t tmp; - - tmp = (cf<< size) | a; - - size++; - b %= size; - - switch(size){ - case 8+1: - tmp = (tmp << b) | ((tmp&0x1FF) >> (size-b)); - return (tmp>>8)&1; - case 16+1: - tmp = (tmp << b) | ((tmp&0x1FFFF) >> (size-b)); - return (tmp>>16)&1; - case 32+1: - tmp = (tmp << b) | ((tmp&0x1FFFFFFFFULL) >> (size-b)); - return (tmp>>32)&1; - default: - fprintf(stderr, "inv size in rclleft %d\n", size); - exit(0); - } -} - -int rcr_cf_op(unsigned int size, unsigned int a, unsigned int b, unsigned int cf) -{ - return rcl_cf_op(size, a, size+1-b, cf); -} - unsigned int x86_bsr(uint64_t src, unsigned int size) { int i; -- cgit 1.4.1