Skip to content

Commit

Permalink
ARCv3: update capability check of sqrt and fma builtins
Browse files Browse the repository at this point in the history
Add check for ARCv3. The compiler for ARCv3 always provides sqrt and
fma hw fpu instructions for the hw fpu configuration.
  • Loading branch information
pavelvkozlov committed Aug 4, 2023
1 parent b2b7423 commit 8254f4c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
18 changes: 11 additions & 7 deletions sysdeps/arc/fpu/math-use-builtins-fma.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#if defined __ARC_FPU_DP_FMA__
#if defined __ARCV3__
# define USE_FMA_BUILTIN 1
#else
# define USE_FMA_BUILTIN 0
#endif

#if defined __ARC_FPU_SP_FMA__
# define USE_FMAF_BUILTIN 1
#else
# define USE_FMAF_BUILTIN 0
# if defined __ARC_FPU_DP_FMA__
# define USE_FMA_BUILTIN 1
# else
# define USE_FMA_BUILTIN 0
# endif
# if defined __ARC_FPU_SP_FMA__
# define USE_FMAF_BUILTIN 1
# else
# define USE_FMAF_BUILTIN 0
# endif
#endif

#define USE_FMAL_BUILTIN 0
Expand Down
18 changes: 11 additions & 7 deletions sysdeps/arc/fpu/math-use-builtins-sqrt.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#if defined __ARC_FPU_DP_DIV__
#if defined __ARCV3__
# define USE_SQRT_BUILTIN 1
#else
# define USE_SQRT_BUILTIN 0
#endif

#if defined __ARC_FPU_SP_DIV__
# define USE_SQRTF_BUILTIN 1
#else
# define USE_SQRTF_BUILTIN 0
# if defined __ARC_FPU_DP_DIV__
# define USE_SQRT_BUILTIN 1
# else
# define USE_SQRT_BUILTIN 0
# endif
# if defined __ARC_FPU_SP_DIV__
# define USE_SQRTF_BUILTIN 1
# else
# define USE_SQRTF_BUILTIN 0
# endif
#endif

#define USE_SQRTL_BUILTIN 0
Expand Down

0 comments on commit 8254f4c

Please sign in to comment.