Skip to content

Commit 7de2a1f

Browse files
authored
Merge pull request #603 from riscv-software-src/bmark_compile
Compile non-vec benchmarks for rv64gc
2 parents 8bd4a74 + 216f4ff commit 7de2a1f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

benchmarks/Makefile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ instbasedir = $(UCB_VLSI_HOME)/install
2424
# Sources
2525
#--------------------------------------------------------------------
2626

27-
bmarks = \
27+
base_bmarks = \
2828
median \
2929
qsort \
3030
rsort \
@@ -39,32 +39,39 @@ bmarks = \
3939
mt-matmul \
4040
mt-memcpy \
4141
pmp \
42+
43+
vec_bmarks = \
4244
vec-memcpy \
4345
vec-daxpy \
4446
vec-sgemm \
4547
vec-strcmp \
4648

49+
bmarks = $(base_bmarks) $(vec_bmarks)
50+
4751
#--------------------------------------------------------------------
4852
# Build rules
4953
#--------------------------------------------------------------------
5054

5155
RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf-
5256
RISCV_GCC ?= $(RISCV_PREFIX)gcc
53-
RISCV_GCC_OPTS ?= -DPREALLOCATE=1 -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -fno-tree-loop-distribute-patterns -Wno-implicit-int -Wno-implicit-function-declaration -march=rv$(XLEN)gcv -mabi=$(ABI)
57+
RISCV_GCC_OPTS ?= -DPREALLOCATE=1 -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf -fno-tree-loop-distribute-patterns -Wno-implicit-int -Wno-implicit-function-declaration -mabi=$(ABI)
5458
RISCV_LINK ?= $(RISCV_GCC) -T $(src_dir)/common/test.ld $(incs)
5559
RISCV_LINK_OPTS ?= -static -nostdlib -nostartfiles -lm -lgcc -T $(src_dir)/common/test.ld
5660
RISCV_OBJDUMP ?= $(RISCV_PREFIX)objdump --disassemble-all --disassemble-zeroes --section=.text --section=.text.startup --section=.text.init --section=.data
61+
RISCV_MARCH ?= rv$(XLEN)gc
62+
RISCV_VMARCH ?= rv$(XLEN)gcv
5763
RISCV_SIM ?= spike --isa=rv$(XLEN)gcv
5864

5965
incs += -I$(src_dir)/../env -I$(src_dir)/common $(addprefix -I$(src_dir)/, $(bmarks))
6066
objs :=
6167

6268
define compile_template
6369
$(1).riscv: $(wildcard $(src_dir)/$(1)/*) $(wildcard $(src_dir)/common/*)
64-
$$(RISCV_GCC) $$(incs) $$(RISCV_GCC_OPTS) -o $$@ $(wildcard $(src_dir)/$(1)/*.c) $(wildcard $(src_dir)/$(1)/*.S) $(wildcard $(src_dir)/common/*.c) $(wildcard $(src_dir)/common/*.S) $$(RISCV_LINK_OPTS)
70+
$$(RISCV_GCC) $$(incs) $$(RISCV_GCC_OPTS) -march=$(2) -o $$@ $(wildcard $(src_dir)/$(1)/*.c) $(wildcard $(src_dir)/$(1)/*.S) $(wildcard $(src_dir)/common/*.c) $(wildcard $(src_dir)/common/*.S) $$(RISCV_LINK_OPTS)
6571
endef
6672

67-
$(foreach bmark,$(bmarks),$(eval $(call compile_template,$(bmark))))
73+
$(foreach bmark,$(base_bmarks),$(eval $(call compile_template,$(bmark),$(RISCV_MARCH))))
74+
$(foreach bmark,$(vec_bmarks),$(eval $(call compile_template,$(bmark),$(RISCV_VMARCH))))
6875

6976
#------------------------------------------------------------
7077
# Build and run benchmarks on riscv simulator

0 commit comments

Comments
 (0)