mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-07-15 16:58:34 +00:00
Fix code guideline check issues
This commit is contained in:
parent
d225dca63d
commit
3da7289821
|
@ -5657,7 +5657,7 @@ lower_callbc(JitCompContext *cc, x86::Assembler &a, bh_list *jmp_info_list,
|
||||||
JitReg rdx_hreg = jit_reg_new(JIT_REG_KIND_I64, REG_RDX_IDX);
|
JitReg rdx_hreg = jit_reg_new(JIT_REG_KIND_I64, REG_RDX_IDX);
|
||||||
JitReg xmm0_f32_hreg = jit_reg_new(JIT_REG_KIND_F32, 0);
|
JitReg xmm0_f32_hreg = jit_reg_new(JIT_REG_KIND_F32, 0);
|
||||||
JitReg xmm0_f64_hreg = jit_reg_new(JIT_REG_KIND_F64, 0);
|
JitReg xmm0_f64_hreg = jit_reg_new(JIT_REG_KIND_F64, 0);
|
||||||
JitReg ret_reg = *(jit_insn_opnd (insn, 0));
|
JitReg ret_reg = *(jit_insn_opnd(insn, 0));
|
||||||
JitReg func_reg = *(jit_insn_opnd(insn, 2));
|
JitReg func_reg = *(jit_insn_opnd(insn, 2));
|
||||||
JitReg src_reg;
|
JitReg src_reg;
|
||||||
|
|
||||||
|
|
|
@ -338,8 +338,8 @@ copy_block_arities(JitCompContext *cc, JitReg dst_frame_sp, uint8 *dst_types,
|
||||||
if (i == 0 && p_first_res_reg)
|
if (i == 0 && p_first_res_reg)
|
||||||
*p_first_res_reg = value;
|
*p_first_res_reg = value;
|
||||||
else
|
else
|
||||||
GEN_INSN(STI32, value, dst_frame_sp,
|
GEN_INSN(STI32, value, dst_frame_sp,
|
||||||
NEW_CONST(I32, offset_dst * 4));
|
NEW_CONST(I32, offset_dst * 4));
|
||||||
offset_src++;
|
offset_src++;
|
||||||
offset_dst++;
|
offset_dst++;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -66,8 +66,7 @@ fail:
|
||||||
|
|
||||||
/* Push results */
|
/* Push results */
|
||||||
static bool
|
static bool
|
||||||
post_return(JitCompContext *cc, const WASMType *func_type,
|
post_return(JitCompContext *cc, const WASMType *func_type, JitReg first_res)
|
||||||
JitReg first_res)
|
|
||||||
{
|
{
|
||||||
uint32 i, n;
|
uint32 i, n;
|
||||||
JitReg value;
|
JitReg value;
|
||||||
|
@ -98,7 +97,7 @@ post_return(JitCompContext *cc, const WASMType *func_type,
|
||||||
value = first_res;
|
value = first_res;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = jit_cc_new_reg_I64(cc);
|
value = jit_cc_new_reg_I64(cc);
|
||||||
GEN_INSN(LDI64, value, cc->fp_reg,
|
GEN_INSN(LDI64, value, cc->fp_reg,
|
||||||
NEW_CONST(I32, offset_of_local(n)));
|
NEW_CONST(I32, offset_of_local(n)));
|
||||||
}
|
}
|
||||||
|
@ -124,7 +123,7 @@ post_return(JitCompContext *cc, const WASMType *func_type,
|
||||||
value = first_res;
|
value = first_res;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = jit_cc_new_reg_F64(cc);
|
value = jit_cc_new_reg_F64(cc);
|
||||||
GEN_INSN(LDF64, value, cc->fp_reg,
|
GEN_INSN(LDF64, value, cc->fp_reg,
|
||||||
NEW_CONST(I32, offset_of_local(n)));
|
NEW_CONST(I32, offset_of_local(n)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -3846,8 +3846,9 @@ wasm_interp_call_wasm(WASMModuleInstance *module_inst, WASMExecEnv *exec_env,
|
||||||
JitGlobals *jit_globals = jit_compiler_get_jit_globals();
|
JitGlobals *jit_globals = jit_compiler_get_jit_globals();
|
||||||
JitInterpSwitchInfo info;
|
JitInterpSwitchInfo info;
|
||||||
WASMType *func_type = function->u.func->func_type;
|
WASMType *func_type = function->u.func->func_type;
|
||||||
uint8 type = func_type->result_count ?
|
uint8 type = func_type->result_count
|
||||||
func_type->types[func_type->param_count] : VALUE_TYPE_VOID;
|
? func_type->types[func_type->param_count]
|
||||||
|
: VALUE_TYPE_VOID;
|
||||||
|
|
||||||
#if WASM_ENABLE_REF_TYPES != 0
|
#if WASM_ENABLE_REF_TYPES != 0
|
||||||
if (type == VALUE_TYPE_EXTERNREF || type == VALUE_TYPE_FUNCREF)
|
if (type == VALUE_TYPE_EXTERNREF || type == VALUE_TYPE_FUNCREF)
|
||||||
|
@ -3863,18 +3864,24 @@ wasm_interp_call_wasm(WASMModuleInstance *module_inst, WASMExecEnv *exec_env,
|
||||||
if (func_type->result_count) {
|
if (func_type->result_count) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case VALUE_TYPE_I32:
|
case VALUE_TYPE_I32:
|
||||||
*(frame->sp - function->ret_cell_num) = info.out.ret.ival[0];
|
*(frame->sp - function->ret_cell_num) =
|
||||||
|
info.out.ret.ival[0];
|
||||||
break;
|
break;
|
||||||
case VALUE_TYPE_I64:
|
case VALUE_TYPE_I64:
|
||||||
*(frame->sp - function->ret_cell_num) = info.out.ret.ival[0];
|
*(frame->sp - function->ret_cell_num) =
|
||||||
*(frame->sp - function->ret_cell_num + 1) = info.out.ret.ival[1];
|
info.out.ret.ival[0];
|
||||||
|
*(frame->sp - function->ret_cell_num + 1) =
|
||||||
|
info.out.ret.ival[1];
|
||||||
break;
|
break;
|
||||||
case VALUE_TYPE_F32:
|
case VALUE_TYPE_F32:
|
||||||
*(frame->sp - function->ret_cell_num) = info.out.ret.fval[0];
|
*(frame->sp - function->ret_cell_num) =
|
||||||
|
info.out.ret.fval[0];
|
||||||
break;
|
break;
|
||||||
case VALUE_TYPE_F64:
|
case VALUE_TYPE_F64:
|
||||||
*(frame->sp - function->ret_cell_num) = info.out.ret.fval[0];
|
*(frame->sp - function->ret_cell_num) =
|
||||||
*(frame->sp - function->ret_cell_num + 1) = info.out.ret.fval[1];
|
info.out.ret.fval[0];
|
||||||
|
*(frame->sp - function->ret_cell_num + 1) =
|
||||||
|
info.out.ret.fval[1];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
bh_assert(0);
|
bh_assert(0);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user