mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-14 13:41:31 +00:00
Correct confusing usage of intirnsic check (#707)
This commit is contained in:
parent
e80715f352
commit
6ef74778c7
|
@ -394,10 +394,11 @@ aot_intrinsic_fill_capability_flags(AOTCompContext *comp_ctx)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!strncmp(comp_ctx->target_arch, "thumb", 5)) {
|
if (!strncmp(comp_ctx->target_arch, "thumb", 5)) {
|
||||||
if (!strcmp(comp_ctx->target_cpu, "cortex-m4")) {
|
if (!strcmp(comp_ctx->target_cpu, "cortex-m7")) {}
|
||||||
add_f32_common_intrinsics_for_thumb2_fpu(comp_ctx);
|
else if (!strcmp(comp_ctx->target_cpu, "cortex-m4")) {
|
||||||
|
add_f64_common_intrinsics_for_thumb2_fpu(comp_ctx);
|
||||||
}
|
}
|
||||||
else if (!strcmp(comp_ctx->target_cpu, "cortex-m7")) {
|
else {
|
||||||
add_f32_common_intrinsics_for_thumb2_fpu(comp_ctx);
|
add_f32_common_intrinsics_for_thumb2_fpu(comp_ctx);
|
||||||
add_f64_common_intrinsics_for_thumb2_fpu(comp_ctx);
|
add_f64_common_intrinsics_for_thumb2_fpu(comp_ctx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,9 +147,10 @@ call_llvm_float_experimental_constrained_intrinsic(AOTCompContext *comp_ctx,
|
||||||
va_list param_value_list;
|
va_list param_value_list;
|
||||||
LLVMValueRef ret;
|
LLVMValueRef ret;
|
||||||
LLVMTypeRef param_types[4], ret_type = is_f32 ? F32_TYPE : F64_TYPE;
|
LLVMTypeRef param_types[4], ret_type = is_f32 ? F32_TYPE : F64_TYPE;
|
||||||
int param_count = ((comp_ctx->disable_llvm_intrinsics == false)
|
int param_count = (comp_ctx->disable_llvm_intrinsics
|
||||||
|| aot_intrinsic_check_capability(comp_ctx, intrinsic))
|
&& aot_intrinsic_check_capability(comp_ctx, intrinsic))
|
||||||
? 4 : 2;
|
? 2
|
||||||
|
: 4;
|
||||||
|
|
||||||
param_types[0] = param_types[1] = ret_type;
|
param_types[0] = param_types[1] = ret_type;
|
||||||
param_types[2] = param_types[3] = MD_TYPE;
|
param_types[2] = param_types[3] = MD_TYPE;
|
||||||
|
|
|
@ -2024,7 +2024,7 @@ __call_llvm_intrinsic(const AOTCompContext *comp_ctx,
|
||||||
int32 func_idx;
|
int32 func_idx;
|
||||||
|
|
||||||
if (comp_ctx->disable_llvm_intrinsics
|
if (comp_ctx->disable_llvm_intrinsics
|
||||||
&& (aot_intrinsic_check_capability(comp_ctx, name) == false)) {
|
&& aot_intrinsic_check_capability(comp_ctx, name)) {
|
||||||
if (func_ctx == NULL) {
|
if (func_ctx == NULL) {
|
||||||
aot_set_last_error_v("invalid func_ctx for intrinsic: %s", name);
|
aot_set_last_error_v("invalid func_ctx for intrinsic: %s", name);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user