Skip to content

Commit

Permalink
Return result directly if float cmp is called in AOT XIP (bytecodeall…
Browse files Browse the repository at this point in the history
  • Loading branch information
no1wudi authored Dec 30, 2022
1 parent d309091 commit d5aa354
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/iwasm/compilation/aot_emit_numberic.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@ compile_op_float_min_max(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
param_types, 2, left, right)))
return NULL;

/* The result of XIP intrinsic is 0 or 1, should return it directly */

if (comp_ctx->disable_llvm_intrinsics
&& aot_intrinsic_check_capability(comp_ctx,
is_f32 ? "f32_cmp" : "f64_cmp")) {
return cmp;
}

if (!(cmp = LLVMBuildSelect(comp_ctx->builder, is_eq, tmp, cmp, "cmp"))) {
aot_set_last_error("llvm build select fail.");
return NULL;
Expand Down

0 comments on commit d5aa354

Please sign in to comment.