Skip to content

Commit a07fcc0

Browse files
sunmin89gstrauss
authored andcommitted
Add riscv64 support
'-mabi=lp64d’ means that ‘long’ and pointers are 64-bit (implicitly defining ‘int’ to be 32-bit), and that floating-point values up to 64 bits wide are passed in F registers. [1] https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html Co-authored-by: Glenn Strauss <[email protected]> github: closes #89
1 parent d130340 commit a07fcc0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

UnixBench/Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,17 @@ else
8989

9090
## OS detection. Comment out if gmake syntax not supported by other 'make'.
9191
OSNAME:=$(shell uname -s)
92-
ARCH := $(shell uname -p)
92+
ARCH := $(shell uname -m)
9393
ifeq ($(OSNAME),Linux)
9494
# Not all CPU architectures support "-march" or "-march=native".
95-
# - Supported : x86, x86_64, ARM, AARCH64, etc..
96-
# - Not Supported: RISC-V, IBM Power, etc...
97-
ifneq ($(ARCH),$(filter $(ARCH),ppc64 ppc64le))
98-
OPTON += -march=native -mtune=native
99-
else
95+
# - Supported : x86, x86_64, ARM, AARCH64, riscv64, etc..
96+
# - Not Supported: IBM Power, etc...
97+
ifeq ($(ARCH),$(filter $(ARCH),ppc64 ppc64le))
10098
OPTON += -mcpu=native -mtune=native
99+
else ifeq ($(ARCH),riscv64)
100+
OPTON += -march=rv64g -mabi=lp64d
101+
else
102+
OPTON += -march=native -mtune=native
101103
endif
102104
endif
103105

0 commit comments

Comments
 (0)