Skip to content

Commit

Permalink
riscv: disable FPU when using soft-float ABI (zherczeg#147)
Browse files Browse the repository at this point in the history
FPU support is optional and therefore is missing for ABI: ilp32 or lp64

The possibility of targeting a single float abi (ex: ilp32f) is punted
from the proposed logic as it is unlikely to be used outside of embedded
and will require further intrusive changes.

Changes to fully support soft-float also pending.
  • Loading branch information
carenas committed Dec 20, 2022
1 parent 3b89155 commit c2f9c13
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sljit_src/sljitNativeRISCV_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_has_cpu_feature(sljit_s32 feature_type)
{
switch (feature_type) {
case SLJIT_HAS_FPU:
#ifdef SLJIT_IS_FPU_AVAILABLE
return SLJIT_IS_FPU_AVAILABLE;
#elif defined(__riscv_float_abi_soft)
return 0;
#else
return 1;
#endif
case SLJIT_HAS_ZERO_REGISTER:
return 1;
default:
Expand Down

0 comments on commit c2f9c13

Please sign in to comment.