Add cmake flag to control aot intrinsics (#3261)

Add cmake variable `-DWAMR_BUILD_AOT_INTRINSICS=1/0` to enable/disable
the aot intrinsic functions, which are normally used by AOT XIP feature, and
can be disabled to reduce the aot runtime binary size.

And refactor the code in aot_intrinsics.h/.c.
This commit is contained in:
Wenyong Huang
2024-04-01 11:26:05 +08:00
committed by GitHub
parent b9740beb31
commit 9c8551cf75
6 changed files with 116 additions and 84 deletions

View File

@ -62,6 +62,7 @@ typedef struct {
#define REG_AOT_TRACE_SYM()
#endif
#if WASM_ENABLE_AOT_INTRINSICS != 0
#define REG_INTRINSIC_SYM() \
REG_SYM(aot_intrinsic_fabs_f32), \
REG_SYM(aot_intrinsic_fabs_f64), \
@ -124,7 +125,10 @@ typedef struct {
REG_SYM(aot_intrinsic_i32_div_s), \
REG_SYM(aot_intrinsic_i32_div_u), \
REG_SYM(aot_intrinsic_i32_rem_s), \
REG_SYM(aot_intrinsic_i32_rem_u), \
REG_SYM(aot_intrinsic_i32_rem_u),
#else
#define REG_INTRINSIC_SYM()
#endif
#if WASM_ENABLE_STATIC_PGO != 0
#define REG_LLVM_PGO_SYM() \