Skip to content

Commit

Permalink
Add riscv64 support
Browse files Browse the repository at this point in the history
'-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
  • Loading branch information
sunmin89 authored and gstrauss committed Apr 11, 2023
1 parent d130340 commit a07fcc0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions UnixBench/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,17 @@ else

## OS detection. Comment out if gmake syntax not supported by other 'make'.
OSNAME:=$(shell uname -s)
ARCH := $(shell uname -p)
ARCH := $(shell uname -m)
ifeq ($(OSNAME),Linux)
# Not all CPU architectures support "-march" or "-march=native".
# - Supported : x86, x86_64, ARM, AARCH64, etc..
# - Not Supported: RISC-V, IBM Power, etc...
ifneq ($(ARCH),$(filter $(ARCH),ppc64 ppc64le))
OPTON += -march=native -mtune=native
else
# - Supported : x86, x86_64, ARM, AARCH64, riscv64, etc..
# - Not Supported: IBM Power, etc...
ifeq ($(ARCH),$(filter $(ARCH),ppc64 ppc64le))
OPTON += -mcpu=native -mtune=native
else ifeq ($(ARCH),riscv64)
OPTON += -march=rv64g -mabi=lp64d
else
OPTON += -march=native -mtune=native
endif
endif

Expand Down

0 comments on commit a07fcc0

Please sign in to comment.