@@ -228,6 +228,7 @@ compile_op_float_min_max(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
228
228
bool is_f32 , LLVMValueRef left , LLVMValueRef right ,
229
229
bool is_min )
230
230
{
231
+ LLVMTypeRef float_param_types [2 ];
231
232
LLVMTypeRef param_types [2 ], ret_type = is_f32 ? F32_TYPE : F64_TYPE ,
232
233
int_type = is_f32 ? I32_TYPE : I64_TYPE ;
233
234
LLVMValueRef cmp , is_eq , is_nan , ret , left_int , right_int , tmp ,
@@ -236,7 +237,9 @@ compile_op_float_min_max(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
236
237
: (is_f32 ? "llvm.maxnum.f32" : "llvm.maxnum.f64" );
237
238
CHECK_LLVM_CONST (nan );
238
239
239
- param_types [0 ] = param_types [1 ] = ret_type ;
240
+ /* Note: param_types is used by LLVM_BUILD_OP_OR_INTRINSIC */
241
+ param_types [0 ] = param_types [1 ] = int_type ;
242
+ float_param_types [0 ] = float_param_types [1 ] = ret_type ;
240
243
241
244
if (comp_ctx -> disable_llvm_intrinsics
242
245
&& aot_intrinsic_check_capability (comp_ctx ,
@@ -304,7 +307,7 @@ compile_op_float_min_max(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
304
307
}
305
308
306
309
if (!(cmp = aot_call_llvm_intrinsic (comp_ctx , func_ctx , intrinsic , ret_type ,
307
- param_types , 2 , left , right )))
310
+ float_param_types , 2 , left , right )))
308
311
return NULL ;
309
312
310
313
/* The result of XIP intrinsic is 0 or 1, should return it directly */
0 commit comments