FreeBSD/sys/contrib/x86emu/x86emu.c
/*
 * REMARKS:
 * Implements the RCL instruction and side effects.
 */
Implements the RCL instruction and side effects.
Implements the RCL instruction and side effects .
static uint32_t 
rcl_long(struct x86emu *emu, uint32_t d, uint8_t s)
{
	uint32_t res, cnt, mask, cf;
	res = d;
	if ((cnt = s % 33) != 0) {
		cf = (d >> (32 - cnt)) & 0x1;
		res = (d << cnt) & 0xffffffff;
		mask = (1 << (cnt - 1)) - 1;
		res |= (d >> (33 - cnt)) & mask;
		if (ACCESS_FLAG(F_CF)) {	
			res |= 1 << (cnt - 1);
		}
		CONDITIONAL_SET_FLAG(cf, F_CF);
		CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 30) & 0x2)),
		    F_OF);
	}
	return res;
}
static uint32_t rcl_long ( struct x86emu * emu , uint32_t d , uint8_t s ) { uint32_t res , cnt , mask , cf ; res = d ; if ( ( cnt = s % 33 ) != 0 ) { cf = ( d >> ( 32 - cnt ) ) & 0x1 ; res = ( d << cnt ) & 0xffffffff ; mask = ( 1 << ( cnt - 1 ) ) - 1 ; res |= ( d >> ( 33 - cnt ) ) & mask ; if ( ACCESS_FLAG ( F_CF ) ) { res |= 1 << ( cnt - 1 ) ; } CONDITIONAL_SET_FLAG ( cf , F_CF ) ; CONDITIONAL_SET_FLAG ( cnt == 1 && XOR2 ( cf + ( ( res >> 30 ) & 0x2 ) ) , F_OF ) ; } return res ; }
REMARKS:
 Implements the RCL instruction and side effects.
REMARKS : Implements the RCL instruction and side effects .
/* carry flag is set */