Permalink
Browse files

Merge RISCV 32/64-bit configurations definition

(code refactoring of commit 4f7f0ee)

Issue #208 (bdwgc).

* include/private/gcconfig.h [__riscv && LINUX] (RISCV32, RISCV64):
Replace with RISCV.
* include/private/gcconfig.h [RISCV] (MACH_TYPE): Change to "RISC-V".
* include/private/gcconfig.h [RISCV] (CPP_WORDSZ, ALIGNMENT): Define
using __riscv_xlen.
  • Loading branch information...
shlevy authored and ivmai committed Feb 19, 2018
1 parent d8acb81 commit 3b008f79ee29dbd0d61cf163d20eee21412df95b
Showing with 7 additions and 25 deletions.
  1. +7 −25 include/private/gcconfig.h
View
@@ -651,13 +651,8 @@
# define mach_type_known
# endif
# if defined(__riscv) && defined(LINUX)
# if __riscv_xlen == 32
# define RISCV32
# define mach_type_known
# elif __riscv_xlen == 64
# define RISCV64
# define mach_type_known
# endif
# define RISCV
# define mach_type_known
# endif
# if defined(SN_TARGET_PSP2)
@@ -2979,31 +2974,18 @@
# endif
# endif
# ifdef RISCV32
# define CPP_WORDSZ 32
# define MACH_TYPE "RISC-V32"
# define ALIGNMENT 4
# ifdef LINUX
# define OS_TYPE "LINUX"
extern int __data_start[];
# define DATASTART ((ptr_t)__data_start)
# define LINUX_STACKBOTTOM
# define DYNAMIC_LOADING
# endif
# endif /* RISCV32 */
# ifdef RISCV64
# define CPP_WORDSZ 64
# define MACH_TYPE "RISC-V64"
# define ALIGNMENT 8
# ifdef RISCV
# define MACH_TYPE "RISC-V"
# define CPP_WORDSZ __riscv_xlen /* 32 or 64 */

This comment has been minimized.

Show comment
Hide comment
@shlevy

shlevy Feb 20, 2018

Contributor

The standard already supports a __riscv_xlen of 128 and I think some simulators might support it, do we want to hope that just works with this or fail early here?

@shlevy

shlevy Feb 20, 2018

Contributor

The standard already supports a __riscv_xlen of 128 and I think some simulators might support it, do we want to hope that just works with this or fail early here?

This comment has been minimized.

Show comment
Hide comment
@ivmai

ivmai Feb 20, 2018

Owner

Just submit a bug fix if the code does not work for a particular target. If you do not care or cannot test, just leave it as is.

@ivmai

ivmai Feb 20, 2018

Owner

Just submit a bug fix if the code does not work for a particular target. If you do not care or cannot test, just leave it as is.

# define ALIGNMENT (CPP_WORDSZ/8)
# ifdef LINUX
# define OS_TYPE "LINUX"
extern int __data_start[];
# define DATASTART ((ptr_t)__data_start)
# define LINUX_STACKBOTTOM
# define DYNAMIC_LOADING
# endif
# endif /* RISCV64 */
# endif /* RISCV */
#if defined(__GLIBC__) && !defined(DONT_USE_LIBC_PRIVATES)
/* Use glibc's stack-end marker. */

0 comments on commit 3b008f7

Please sign in to comment.