Backends/Kinc-HL/hl/src/jit.c
static preg *alloc_cpu8( jit_ctx *ctx, vreg *r, bool andLoad ) {
	preg *p = fetch(r);
	if( p->kind != RCPU ) {
		p = alloc_reg(ctx, RCPU_8BITS);
		load(ctx,p,r);
	} else if( !is_reg8(p) ) {
		preg *p2 = alloc_reg(ctx, RCPU_8BITS);
		op64(ctx,MOV,p2,p);
		scratch(p);
		reg_bind(r,p2);
		return p2;
	} else
		RLOCK(p);
	return p;
}
// make sure the register can be used with 8 bits access

make sure the register can be used with 8 bits access
make sure the register can be used with 8 bits access
static preg *alloc_cpu8( jit_ctx *ctx, vreg *r, bool andLoad ) {
	preg *p = fetch(r);
	if( p->kind != RCPU ) {
		p = alloc_reg(ctx, RCPU_8BITS);
		load(ctx,p,r);
	} else if( !is_reg8(p) ) {
		preg *p2 = alloc_reg(ctx, RCPU_8BITS);
		op64(ctx,MOV,p2,p);
		scratch(p);
		reg_bind(r,p2);
		return p2;
	} else
		RLOCK(p);
	return p;
}
static preg * alloc_cpu8 ( jit_ctx * ctx , vreg * r , bool andLoad ) { preg * p = fetch ( r ) ; if ( p -> kind != RCPU ) { p = alloc_reg ( ctx , RCPU_8BITS ) ; load ( ctx , p , r ) ; } else if ( ! is_reg8 ( p ) ) { preg * p2 = alloc_reg ( ctx , RCPU_8BITS ) ; op64 ( ctx , MOV , p2 , p ) ; scratch ( p ) ; reg_bind ( r , p2 ) ; return p2 ; } else RLOCK ( p ) ; return p ; }
make sure the register can be used with 8 bits access
make sure the register can be used with 8 bits access