Skip to content

Commit

Permalink
Use upstream SoftFloat and unify build system
Browse files Browse the repository at this point in the history
Replace custom Berkeley SoftFloat 3 package in 'src/softfloat' with the
upstream one. It streamlines build system onfiguration for consistency.
  • Loading branch information
jserv committed Feb 11, 2025
1 parent aa7efae commit 3753bb6
Show file tree
Hide file tree
Showing 9 changed files with 360 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ jobs:
if: ${{ always() }}
- name: undefined behavior test
run: |
make clean && make ENABLE_UBSAN=1 check -j$(nproc)
make distclean && make ENABLE_UBSAN=1 check -j$(nproc)
make ENABLE_JIT=1 clean && make ENABLE_JIT=1 ENABLE_UBSAN=1 check -j$(nproc)
if: ${{ always() }}
- name: boot Linux kernel test
Expand Down Expand Up @@ -266,10 +266,11 @@ jobs:
with:
arch: aarch64
distro: ubuntu24.04
githubToken: ${{ github.token }}
# No 'sudo' is available
install: |
apt-get update -q=2
apt-get install -q=2 make git clang python3 python3-pip build-essential libsdl2-dev libsdl2-mixer-dev lsb-release wget software-properties-common gnupg bc
apt-get install -q=2 make git clang python3 python3-pip libsdl2-dev libsdl2-mixer-dev lsb-release wget software-properties-common gnupg bc
git config --global --add safe.directory ${{ github.workspace }}
git config --global --add safe.directory ${{ github.workspace }}/src/softfloat
git config --global --add safe.directory ${{ github.workspace }}/src/mini-gdbstub
Expand Down
3 changes: 1 addition & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
shallow = true
[submodule "softfloat"]
path = src/softfloat
url = https://github.com/sysprog21/berkeley-softfloat-3
branch = rv32emu
url = https://github.com/ucb-bar/berkeley-softfloat-3
shallow = true
[submodule "tests/ansibench"]
path = tests/ansibench
Expand Down
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,10 @@ AR := ar
ifeq ("$(CC_IS_EMCC)", "1")
AR = emar
endif
SOFTFLOAT_OUT = $(abspath $(OUT)/softfloat)
src/softfloat/build/Linux-RISCV-GCC/Makefile:
git submodule update --init src/softfloat/
SOFTFLOAT_LIB := $(SOFTFLOAT_OUT)/softfloat.a
$(SOFTFLOAT_LIB): src/softfloat/build/Linux-RISCV-GCC/Makefile
$(MAKE) -C $(dir $<) BUILD_DIR=$(SOFTFLOAT_OUT) CC=$(CC) AR=$(AR)

# Berkeley SoftFloat
include mk/softfloat.mk

ifeq ($(call has, SYSTEM), 1)
DEV_OUT := $(OUT)/devices
endif
Expand Down Expand Up @@ -415,12 +413,13 @@ endif

clean:
$(RM) $(BIN) $(OBJS) $(DEV_OBJS) $(BUILD_DTB) $(BUILD_DTB2C) $(HIST_BIN) $(HIST_OBJS) $(deps) $(WEB_FILES) $(CACHE_OUT) src/rv32_jit.c
-$(RM) $(SOFTFLOAT_LIB)
distclean: clean
$(RM) -r $(OUT)/id1
$(RM) -r $(DEMO_DIR)
$(RM) *.zip
$(RM) -r $(OUT)/mini-gdbstub
-$(RM) $(OUT)/.config
-$(RM) -r $(OUT)/softfloat
-$(RM) -r $(SOFTFLOAT_DUMMY_PLAT) $(OUT)/softfloat

-include $(deps)
Loading

1 comment on commit 3753bb6

@jserv
Copy link
Contributor Author

@jserv jserv commented on 3753bb6 Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmarks

Benchmark suite Current: 3753bb6 Previous: 4bf975e Ratio
Dhrystone 1311 Average DMIPS over 10 runs 1345 Average DMIPS over 10 runs 1.03
Coremark 975.001 Average iterations/sec over 10 runs 945.253 Average iterations/sec over 10 runs 0.97

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.