Skip to content

Commit

Permalink
[libc] Add fenv_t and signal macros in riscv
Browse files Browse the repository at this point in the history
This patch now enables full build.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D145594
  • Loading branch information
mikhailramalho committed Mar 8, 2023
1 parent 117db47 commit e9be85d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libc/include/llvm-libc-macros/linux/signal-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
#elif defined(__aarch64__)
#define MINSIGSTKSZ 5120
#define SIGSTKSZ 16384
#elif defined(__riscv)
#define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192
#else
#error "Signal stack sizes not defined for your platform."
#endif
Expand Down
2 changes: 2 additions & 0 deletions libc/include/llvm-libc-types/fenv_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ typedef struct {
typedef struct {
unsigned int __fpscr;
} fenv_t;
#elif defined(__riscv)
typedef unsigned int fenv_t;
#else
#error "fenv_t not defined for your platform"
#endif
Expand Down
4 changes: 4 additions & 0 deletions libc/src/__support/FPUtil/FEnvImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ LIBC_INLINE int set_except(int) { return 0; }

LIBC_INLINE int raise_except(int) { return 0; }

LIBC_INLINE int enable_except(int) { return 0; }

LIBC_INLINE int disable_except(int) { return 0; }

LIBC_INLINE int get_round() { return FE_TONEAREST; }

LIBC_INLINE int set_round(int) { return 0; }
Expand Down

0 comments on commit e9be85d

Please sign in to comment.