Skip to content

Commit d5aa354

Browse files
authored
Return result directly if float cmp is called in AOT XIP (#1851)
1 parent d309091 commit d5aa354

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

core/iwasm/compilation/aot_emit_numberic.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,14 @@ compile_op_float_min_max(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
307307
param_types, 2, left, right)))
308308
return NULL;
309309

310+
/* The result of XIP intrinsic is 0 or 1, should return it directly */
311+
312+
if (comp_ctx->disable_llvm_intrinsics
313+
&& aot_intrinsic_check_capability(comp_ctx,
314+
is_f32 ? "f32_cmp" : "f64_cmp")) {
315+
return cmp;
316+
}
317+
310318
if (!(cmp = LLVMBuildSelect(comp_ctx->builder, is_eq, tmp, cmp, "cmp"))) {
311319
aot_set_last_error("llvm build select fail.");
312320
return NULL;

0 commit comments

Comments
 (0)