Skip to content

Commit ac5b33b

Browse files
committed
Remove const intrinsics flags for xtensa instead of adding too much #ifdef
1 parent bb089c2 commit ac5b33b

File tree

3 files changed

+0
-18
lines changed

3 files changed

+0
-18
lines changed

core/iwasm/aot/aot_intrinsic.c

-4
Original file line numberDiff line numberDiff line change
@@ -877,10 +877,6 @@ aot_intrinsic_fill_capability_flags(AOTCompContext *comp_ctx)
877877
add_f64_common_intrinsics(comp_ctx);
878878
add_i64_common_intrinsics(comp_ctx);
879879
add_common_float_integer_conversion(comp_ctx);
880-
add_intrinsic_capability(comp_ctx, AOT_INTRINSIC_FLAG_F32_CONST);
881-
add_intrinsic_capability(comp_ctx, AOT_INTRINSIC_FLAG_F64_CONST);
882-
add_intrinsic_capability(comp_ctx, AOT_INTRINSIC_FLAG_I32_CONST);
883-
add_intrinsic_capability(comp_ctx, AOT_INTRINSIC_FLAG_I64_CONST);
884880
}
885881
else {
886882
/*

core/iwasm/compilation/aot_emit_const.c

-12
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ aot_compile_op_i32_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
1212
{
1313
LLVMValueRef value;
1414

15-
#if !defined(BUILD_TARGET_XTENSA)
1615
if (comp_ctx->is_indirect_mode
1716
&& aot_intrinsic_check_capability(comp_ctx, "i32.const")) {
1817
WASMValue wasm_value;
@@ -24,7 +23,6 @@ aot_compile_op_i32_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
2423
}
2524
}
2625
else
27-
#endif
2826
{
2927
value = I32_CONST((uint32)i32_const);
3028
CHECK_LLVM_CONST(value);
@@ -43,7 +41,6 @@ aot_compile_op_i64_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
4341
{
4442
LLVMValueRef value;
4543

46-
#if !defined(BUILD_TARGET_XTENSA)
4744
if (comp_ctx->is_indirect_mode
4845
&& aot_intrinsic_check_capability(comp_ctx, "i64.const")) {
4946
WASMValue wasm_value;
@@ -55,7 +52,6 @@ aot_compile_op_i64_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
5552
}
5653
}
5754
else
58-
#endif
5955
{
6056
value = I64_CONST((uint64)i64_const);
6157
CHECK_LLVM_CONST(value);
@@ -74,7 +70,6 @@ aot_compile_op_f32_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
7470
{
7571
LLVMValueRef alloca, value;
7672

77-
#if !defined(BUILD_TARGET_XTENSA)
7873
if (comp_ctx->is_indirect_mode
7974
&& aot_intrinsic_check_capability(comp_ctx, "f32.const")) {
8075
WASMValue wasm_value;
@@ -87,9 +82,6 @@ aot_compile_op_f32_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
8782
PUSH_F32(value);
8883
}
8984
else if (!isnan(f32_const)) {
90-
#else
91-
if (!isnan(f32_const)) {
92-
#endif
9385
value = F32_CONST(f32_const);
9486
CHECK_LLVM_CONST(value);
9587
PUSH_F32(value);
@@ -131,7 +123,6 @@ aot_compile_op_f64_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
131123
{
132124
LLVMValueRef alloca, value;
133125

134-
#if !defined(BUILD_TARGET_XTENSA)
135126
if (comp_ctx->is_indirect_mode
136127
&& aot_intrinsic_check_capability(comp_ctx, "f64.const")) {
137128
WASMValue wasm_value;
@@ -144,9 +135,6 @@ aot_compile_op_f64_const(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
144135
PUSH_F64(value);
145136
}
146137
else if (!isnan(f64_const)) {
147-
#else
148-
if (!isnan(f64_const)) {
149-
#endif
150138
value = F64_CONST(f64_const);
151139
CHECK_LLVM_CONST(value);
152140
PUSH_F64(value);

core/iwasm/compilation/aot_emit_memory.c

-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ aot_check_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
139139

140140
is_target_64bit = (comp_ctx->pointer_size == sizeof(uint64)) ? true : false;
141141

142-
#if !defined(BUILD_TARGET_XTENSA)
143142
if (comp_ctx->is_indirect_mode
144143
&& aot_intrinsic_check_capability(
145144
comp_ctx, MEMORY64_COND_VALUE("i64.const", "i32.const"))) {
@@ -149,7 +148,6 @@ aot_check_memory_overflow(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
149148
wasm_value.i64 = offset;
150149
}
151150
else
152-
#endif
153151
{
154152
wasm_value.i32 = (int32)offset;
155153
}

0 commit comments

Comments
 (0)