Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions core/iwasm/aot/aot_intrinsic.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,10 +877,6 @@ aot_intrinsic_fill_capability_flags(AOTCompContext *comp_ctx)
add_f64_common_intrinsics(comp_ctx);
add_i64_common_intrinsics(comp_ctx);
add_common_float_integer_conversion(comp_ctx);
add_intrinsic_capability(comp_ctx, AOT_INTRINSIC_FLAG_F32_CONST);
add_intrinsic_capability(comp_ctx, AOT_INTRINSIC_FLAG_F64_CONST);
add_intrinsic_capability(comp_ctx, AOT_INTRINSIC_FLAG_I32_CONST);
add_intrinsic_capability(comp_ctx, AOT_INTRINSIC_FLAG_I64_CONST);
}
else {
/*
Expand Down
16 changes: 16 additions & 0 deletions core/iwasm/compilation/aot_emit_conversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ aot_compile_op_i32_trunc_f32(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,

POP_F32(value);

#if !defined(BUILD_TARGET_XTENSA)
if (!comp_ctx->is_indirect_mode) {
#endif
if (sign) {
min_value = F32_CONST(-2147483904.0f);
max_value = F32_CONST(2147483648.0f);
Expand All @@ -356,6 +358,7 @@ aot_compile_op_i32_trunc_f32(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
min_value = F32_CONST(-1.0f);
max_value = F32_CONST(4294967296.0f);
}
#if !defined(BUILD_TARGET_XTENSA)
}
else {
WASMValue wasm_value;
Expand All @@ -376,6 +379,7 @@ aot_compile_op_i32_trunc_f32(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
comp_ctx, func_ctx->native_symbol, &wasm_value, VALUE_TYPE_F32);
}
}
#endif
CHECK_LLVM_CONST(min_value);
CHECK_LLVM_CONST(max_value);

Expand All @@ -400,7 +404,9 @@ aot_compile_op_i32_trunc_f64(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,

POP_F64(value);

#if !defined(BUILD_TARGET_XTENSA)
if (!comp_ctx->is_indirect_mode) {
#endif
if (sign) {
min_value = F64_CONST(-2147483649.0);
max_value = F64_CONST(2147483648.0);
Expand All @@ -409,6 +415,7 @@ aot_compile_op_i32_trunc_f64(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
min_value = F64_CONST(-1.0);
max_value = F64_CONST(4294967296.0);
}
#if !defined(BUILD_TARGET_XTENSA)
}
else {
WASMValue wasm_value;
Expand All @@ -429,6 +436,7 @@ aot_compile_op_i32_trunc_f64(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
comp_ctx, func_ctx->native_symbol, &wasm_value, VALUE_TYPE_F64);
}
}
#endif
CHECK_LLVM_CONST(min_value);
CHECK_LLVM_CONST(max_value);

Expand Down Expand Up @@ -554,7 +562,9 @@ aot_compile_op_i64_trunc_f32(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,

POP_F32(value);

#if !defined(BUILD_TARGET_XTENSA)
if (!comp_ctx->is_indirect_mode) {
#endif
if (sign) {
min_value = F32_CONST(-9223373136366403584.0f);
max_value = F32_CONST(9223372036854775808.0f);
Expand All @@ -563,6 +573,7 @@ aot_compile_op_i64_trunc_f32(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
min_value = F32_CONST(-1.0f);
max_value = F32_CONST(18446744073709551616.0f);
}
#if !defined(BUILD_TARGET_XTENSA)
}
else {
WASMValue wasm_value;
Expand All @@ -583,6 +594,7 @@ aot_compile_op_i64_trunc_f32(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
comp_ctx, func_ctx->native_symbol, &wasm_value, VALUE_TYPE_F32);
}
}
#endif
CHECK_LLVM_CONST(min_value);
CHECK_LLVM_CONST(max_value);

Expand All @@ -607,7 +619,9 @@ aot_compile_op_i64_trunc_f64(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,

POP_F64(value);

#if !defined(BUILD_TARGET_XTENSA)
if (!comp_ctx->is_indirect_mode) {
#endif
if (sign) {
min_value = F64_CONST(-9223372036854777856.0);
max_value = F64_CONST(9223372036854775808.0);
Expand All @@ -616,6 +630,7 @@ aot_compile_op_i64_trunc_f64(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
min_value = F64_CONST(-1.0);
max_value = F64_CONST(18446744073709551616.0);
}
#if !defined(BUILD_TARGET_XTENSA)
}
else {
WASMValue wasm_value;
Expand All @@ -636,6 +651,7 @@ aot_compile_op_i64_trunc_f64(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
comp_ctx, func_ctx->native_symbol, &wasm_value, VALUE_TYPE_F64);
}
}
#endif
CHECK_LLVM_CONST(min_value);
CHECK_LLVM_CONST(max_value);

Expand Down
Loading