Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ jobs:
target: riscv64-linux-user
name: qemu-riscv64
walrus: riscv64
- name: riscv32
toolchain:
url: https://toolchains.bootlin.com/downloads/releases/toolchains/riscv32-ilp32d/tarballs/riscv32-ilp32d--glibc--stable-2024.05-1.tar.xz
name: riscv32-ilp32d--glibc--stable-2024.05-1.tar.xz
CC: riscv32-buildroot-linux-gnu-gcc-13.3.0.br_real
CXX: riscv32-buildroot-linux-gnu-g++.br_real
CFLAGS: -march=rv32gv
CXXFLAGS: -march=rv32gv
qemu:
target: riscv32-linux-user
name: qemu-riscv32
walrus: riscv32

runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ IF (NOT DEFINED WALRUS_ARCH)
SET(WALRUS_ARCH "aarch64")
ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "riscv64")
SET(WALRUS_ARCH "riscv64")
ELSEIF (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "riscv32")
SET(WALRUS_ARCH "riscv32")
ENDIF()
ENDIF()

Expand Down
6 changes: 6 additions & 0 deletions build/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ IF (${WALRUS_HOST} STREQUAL "linux")
SET (WALRUS_BUILD_64BIT ON)
ELSEIF (${WALRUS_ARCH} STREQUAL "riscv64")
SET (WALRUS_BUILD_64BIT ON)
ELSEIF (${WALRUS_ARCH} STREQUAL "riscv32")
SET (WALRUS_BUILD_32BIT ON)
SET (WALRUS_LDFLAGS ${WALRUS_LDFLAGS} -latomic)
ELSE()
MESSAGE (FATAL_ERROR ${WALRUS_ARCH} " is unsupported")
ENDIF()
Expand All @@ -153,6 +156,9 @@ ELSEIF (${WALRUS_HOST} STREQUAL "tizen" OR ${WALRUS_HOST} STREQUAL "tizen_obs")
SET (WALRUS_BUILD_64BIT ON)
ELSEIF (${WALRUS_ARCH} STREQUAL "riscv64")
SET (WALRUS_BUILD_64BIT ON)
ELSEIF (${WALRUS_ARCH} STREQUAL "riscv32")
SET (WALRUS_BUILD_32BIT ON)
SET (WALRUS_LDFLAGS ${WALRUS_LDFLAGS} -latomic)
ELSE()
MESSAGE (FATAL_ERROR ${WALRUS_ARCH} " is unsupported")
ENDIF()
Expand Down
2 changes: 1 addition & 1 deletion src/jit/IntMath32Inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ static bool emitCompare(sljit_compiler* compiler, Instruction* instr)
sljit_set_current_flags(compiler, (signedCompare - SLJIT_SUB) | SLJIT_CURRENT_FLAGS_SUB);
} else {
ASSERT(type == SLJIT_CARRY || type == SLJIT_NOT_CARRY);
sljit_emit_op2u(compiler, SLJIT_SUB | SLJIT_SET_CARRY, params[0].arg2, params[0].arg2w, params[1].arg2, params[1].arg2w);
sljit_emit_op2u(compiler, SLJIT_SUB | SLJIT_SET_CARRY, params[0].arg1, params[0].arg1w, params[1].arg1, params[1].arg1w);
sljit_emit_op2u(compiler, SLJIT_SUBC | SLJIT_SET_CARRY, params[0].arg2, params[0].arg2w, params[1].arg2, params[1].arg2w);
}
#else
Expand Down
Loading