Skip to content

Commit 722fc66

Browse files
committed
some update
1 parent cfce0b7 commit 722fc66

2 files changed

Lines changed: 46 additions & 46 deletions

File tree

core/iwasm/interpreter/wasm_interp_classic.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -861,31 +861,31 @@ wasm_interp_get_frame_ref(WASMInterpFrame *frame)
861861
PUSH_##src_op_type(method(src_val)); \
862862
} while (0)
863863

864-
#define TRUNC_FUNCTION(func_name, src_type, dst_type, signed_type, isnan_op) \
865-
static dst_type func_name(src_type src_value, src_type src_min, \
866-
src_type src_max, dst_type dst_min, \
867-
dst_type dst_max, bool is_sign) \
868-
{ \
869-
dst_type dst_value = 0; \
870-
if (!isnan_op(src_value)) { \
871-
if (src_value <= src_min) \
872-
dst_value = dst_min; \
873-
else if (src_value >= src_max) \
874-
dst_value = dst_max; \
875-
else { \
876-
if (is_sign) \
877-
dst_value = (dst_type)(signed_type)src_value; \
878-
else \
879-
dst_value = (dst_type)src_value; \
880-
} \
881-
} \
882-
return dst_value; \
864+
#define TRUNC_FUNCTION(func_name, src_type, dst_type, signed_type) \
865+
static dst_type func_name(src_type src_value, src_type src_min, \
866+
src_type src_max, dst_type dst_min, \
867+
dst_type dst_max, bool is_sign) \
868+
{ \
869+
dst_type dst_value = 0; \
870+
if (!isnan(src_value)) { \
871+
if (src_value <= src_min) \
872+
dst_value = dst_min; \
873+
else if (src_value >= src_max) \
874+
dst_value = dst_max; \
875+
else { \
876+
if (is_sign) \
877+
dst_value = (dst_type)(signed_type)src_value; \
878+
else \
879+
dst_value = (dst_type)src_value; \
880+
} \
881+
} \
882+
return dst_value; \
883883
}
884884

885-
TRUNC_FUNCTION(trunc_f32_to_i32, float32, uint32, int32, isnan)
886-
TRUNC_FUNCTION(trunc_f32_to_i64, float32, uint64, int64, isnan)
887-
TRUNC_FUNCTION(trunc_f64_to_i32, float64, uint32, int32, isnan)
888-
TRUNC_FUNCTION(trunc_f64_to_i64, float64, uint64, int64, isnan)
885+
TRUNC_FUNCTION(trunc_f32_to_i32, float32, uint32, int32)
886+
TRUNC_FUNCTION(trunc_f32_to_i64, float32, uint64, int64)
887+
TRUNC_FUNCTION(trunc_f64_to_i32, float64, uint32, int32)
888+
TRUNC_FUNCTION(trunc_f64_to_i64, float64, uint64, int64)
889889

890890
static bool
891891
trunc_f32_to_int(WASMModuleInstance *module, uint32 *frame_sp, float32 src_min,

core/iwasm/interpreter/wasm_interp_fast.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -719,31 +719,31 @@ wasm_interp_get_frame_ref(WASMInterpFrame *frame)
719719
frame_ip += 4; \
720720
} while (0)
721721

722-
#define TRUNC_FUNCTION(func_name, src_type, dst_type, signed_type, isnan_op) \
723-
static dst_type func_name(src_type src_value, src_type src_min, \
724-
src_type src_max, dst_type dst_min, \
725-
dst_type dst_max, bool is_sign) \
726-
{ \
727-
dst_type dst_value = 0; \
728-
if (!isnan_op(src_value)) { \
729-
if (src_value <= src_min) \
730-
dst_value = dst_min; \
731-
else if (src_value >= src_max) \
732-
dst_value = dst_max; \
733-
else { \
734-
if (is_sign) \
735-
dst_value = (dst_type)(signed_type)src_value; \
736-
else \
737-
dst_value = (dst_type)src_value; \
738-
} \
739-
} \
740-
return dst_value; \
722+
#define TRUNC_FUNCTION(func_name, src_type, dst_type, signed_type) \
723+
static dst_type func_name(src_type src_value, src_type src_min, \
724+
src_type src_max, dst_type dst_min, \
725+
dst_type dst_max, bool is_sign) \
726+
{ \
727+
dst_type dst_value = 0; \
728+
if (!isnan(src_value)) { \
729+
if (src_value <= src_min) \
730+
dst_value = dst_min; \
731+
else if (src_value >= src_max) \
732+
dst_value = dst_max; \
733+
else { \
734+
if (is_sign) \
735+
dst_value = (dst_type)(signed_type)src_value; \
736+
else \
737+
dst_value = (dst_type)src_value; \
738+
} \
739+
} \
740+
return dst_value; \
741741
}
742742

743-
TRUNC_FUNCTION(trunc_f32_to_i32, float32, uint32, int32, isnan)
744-
TRUNC_FUNCTION(trunc_f32_to_i64, float32, uint64, int64, isnan)
745-
TRUNC_FUNCTION(trunc_f64_to_i32, float64, uint32, int32, isnan)
746-
TRUNC_FUNCTION(trunc_f64_to_i64, float64, uint64, int64, isnan)
743+
TRUNC_FUNCTION(trunc_f32_to_i32, float32, uint32, int32)
744+
TRUNC_FUNCTION(trunc_f32_to_i64, float32, uint64, int64)
745+
TRUNC_FUNCTION(trunc_f64_to_i32, float64, uint32, int32)
746+
TRUNC_FUNCTION(trunc_f64_to_i64, float64, uint64, int64)
747747

748748
static bool
749749
trunc_f32_to_int(WASMModuleInstance *module, uint8 *frame_ip, uint32 *frame_lp,

0 commit comments

Comments
 (0)