xip: Lookup float constants from table to reduce relocations (#894)

Lookup float/double constants from exec_env->native_symbol table
but not construct them with LLVMBuildConst if XIP mode is enabled,
these constants are introduced by f32/f64.const opcodes and some
float/double conversion opcodes, and make wamrc generate some
relocations in text section of AOT XIP file. This patch eliminates such
relocations when "--enable-indirect-mode" is added to wamrc.
This commit is contained in:
Wenyong Huang
2021-12-16 21:39:23 +08:00
committed by GitHub
parent f2d87ec02e
commit 5be427bfa2
6 changed files with 287 additions and 45 deletions

View File

@ -442,6 +442,10 @@ LLVMValueRef
aot_get_func_from_table(const AOTCompContext *comp_ctx, LLVMValueRef base,
LLVMTypeRef func_type, int32 index);
LLVMValueRef
aot_load_const_from_table(AOTCompContext *comp_ctx, LLVMValueRef base,
const WASMValue *value, uint8 value_type);
bool
aot_check_simd_compatibility(const char *arch_c_str, const char *cpu_c_str);