Apply aot intrinsics to riscv

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Change-Id: If1e813f5f8ead2c0d9b640f8ea4e87e2155db534
This commit is contained in:
Huang Qi
2021-09-09 07:42:48 +00:00
parent 00663f0cd5
commit b31804b64e
2 changed files with 25 additions and 7 deletions

View File

@ -815,8 +815,17 @@ is_targeting_soft_float(AOTCompContext *comp_ctx, bool is_f32)
* so user must specify '--cpu-features=-fp' to wamrc if the target
* doesn't have or enable Floating-Point Coprocessor Option on xtensa. */
ret = (!is_f32 || strstr(feature_string, "-fp")) ? true : false;
else if (is_target_riscv(comp_ctx))
ret = !strstr(feature_string, "+d") ? true : false;
else if (is_target_riscv(comp_ctx)) {
/*
* Note: Use builtin intrinsics since hardware float operation
* will cause rodata relocation, this will try to use hardware
* float unit (by return false) but handled by software finally
*/
if (comp_ctx->disable_llvm_intrinsics)
ret = false;
else
ret = !strstr(feature_string, "+d") ? true : false;
}
else
ret = true;