Skip to content

Commit

Permalink
Squashed 'thirdparty/sljit/' changes from c2e49625e4..f6326087b3
Browse files Browse the repository at this point in the history
f6326087b3 Improve op flags operation on x86
2a79c59737 Fix sign conversion warning on Windows arm64 (ares-emulator#270)
7a6ceb3e03 Fix examples (ares-emulator#269)
2c105e2461 Fixed a compare logical case on s390x
4c4802dd4c Emit brk #0xf000 for breakpoint opcode on arm64 (ares-emulator#267)
3b9c0c8925 Enable public usage of SLJIT_LOCALS_OFFSET (ares-emulator#264)
4dd388a736 loongarch: add memory fence & support tmp register for atomic (ares-emulator#263)
8c089bd584 Implement m,emory fence
d21a5448f6 Fix compiler warning
f9f512c080 Support tmp register for atomic
883118537c Add action (ares-emulator#259)
8099661b54 Add SLJIT_ATOMIC_USE_LS/CAS support to LoongArch (ares-emulator#261)
728db2007a riscv: only enable SIMD if supported by toolchain (ares-emulator#260)
8727735933 Bitmanipulation instructions on RISC-V (ares-emulator#258)
c85dd1dd97 Rework sljit_emit_enter argument passing
3e5568bfcc Add more tmp reg tests
bd056ab1df Add control flags to atomic operations
ee8861243f loongarch: Implement ll/sc support for atomic operations (ares-emulator#254)
d3a10d1986 x86: avoid SIGILL in CPUs with AVX but without AVX2 (ares-emulator#256)
460f02a1b8 x86: check for extended function availability before using (ares-emulator#255)
0a74f16bea x86: improve execute_cpuid() portability (ares-emulator#251)
7b0fd86bd5 test: avoid leaking compiler on early exit (ares-emulator#253)
31cfa2fef2 Add shuffle support for LoongArch (ares-emulator#252)
06a5bafd7c Initial implementation of riscv simd
5ad2541117 x86: improve execute_get_xcr0_low() portability (ares-emulator#250)
6128486813 Implement atomic store on ppc and mips
fcade55c27 Update atomic on s390x
8bcd711708 Rework atomic load/store
bd221f0e86 Support non-overlaping vector registers

git-subtree-dir: thirdparty/sljit
git-subtree-split: f6326087b3404efb07c6d3deed97b3c3b8098c0c
  • Loading branch information
LukeUsher committed Oct 5, 2024
1 parent edb88e2 commit 349f1d2
Show file tree
Hide file tree
Showing 33 changed files with 4,469 additions and 2,402 deletions.
279 changes: 279 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,279 @@
name: Actions

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-test-on-x86:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Packages
run: |
sudo apt update
sudo apt install -y gcc-multilib g++-multilib make
- name: Build x86
env:
CFLAGS: -m32
CXXFLAGS: -m32
run: |
make all
- name: Run Tests
run: |
./bin/sljit_test -v
build-test-on-x64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Packages
run: |
sudo apt update
sudo apt install -y gcc g++ make
- name: Build x64
run: |
make all
- name: Run Tests
run: |
./bin/sljit_test -v
build-test-on-armt2:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build in armt2 container
uses: uraimo/[email protected]
with:
arch: armv7
distro: ubuntu_latest

# Install deps into the container. With the token, the container will be cached
# The image is cached publically like a package
githubToken: ${{ github.token }}

install: |
apt-get update
apt-get install -y gcc g++ make
run: |
make all
./bin/sljit_test -v
build-test-on-arm32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build in arm32 container
uses: uraimo/[email protected]
with:
arch: armv7
distro: ubuntu_latest

# Install deps into the container. With the token, the container will be cached
# The image is cached publically like a package
githubToken: ${{ github.token }}
env: |
CFLAGS: -marm
CXXFLAGS: -marm
install: |
apt-get update
apt-get install -y gcc g++ make
run: |
make all
./bin/sljit_test -v
build-test-on-aarch64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build in arm64 container
uses: uraimo/[email protected]

with:
arch: aarch64
distro: ubuntu22.04

# Install deps into the container. With the token, the container will be cached
# The image is cached publically like a package
githubToken: ${{ github.token }}

install: |
apt-get update
apt-get install -y gcc g++ make
run: |
make all
./bin/sljit_test -v
build-test-on-riscv32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install compiler
run: |
sudo apt update
sudo apt install -y make wget ninja-build
wget https://toolchains.bootlin.com/downloads/releases/toolchains/riscv32-ilp32d/tarballs/riscv32-ilp32d--glibc--bleeding-edge-2024.02-1.tar.bz2
tar -xvf riscv32-ilp32d--glibc--bleeding-edge-2024.02-1.tar.bz2
- name: Install qemu
run: |
wget https://download.qemu.org/qemu-9.0.2.tar.xz
tar -xvf qemu-9.0.2.tar.xz
cd qemu-9.0.2
./configure --target-list="riscv32-linux-user"
make -j4
- name: Build and test in riscv32
env:
CROSS_COMPILER: ./riscv32-ilp32d--glibc--bleeding-edge-2024.02-1/bin/riscv32-buildroot-linux-gnu-gcc-13.2.0.br_real
CFLAGS: -march=rv32g
EXTRA_LDFLAGS: -static
run: |
make all
./qemu-9.0.2/build/qemu-riscv32 ./bin/sljit_test -v
build-test-on-riscv32-extensions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install compiler
run: |
sudo apt update
sudo apt install -y make wget ninja-build
wget https://toolchains.bootlin.com/downloads/releases/toolchains/riscv32-ilp32d/tarballs/riscv32-ilp32d--glibc--bleeding-edge-2024.02-1.tar.bz2
tar -xvf riscv32-ilp32d--glibc--bleeding-edge-2024.02-1.tar.bz2
- name: Install qemu
run: |
wget https://download.qemu.org/qemu-9.0.2.tar.xz
tar -xvf qemu-9.0.2.tar.xz
cd qemu-9.0.2
./configure --target-list="riscv32-linux-user"
make -j4
- name: Build and test
env:
CROSS_COMPILER: ./riscv32-ilp32d--glibc--bleeding-edge-2024.02-1/bin/riscv32-buildroot-linux-gnu-gcc-13.2.0.br_real
CFLAGS: -march=rv32gv_zba_zbb
EXTRA_LDFLAGS: -static
run: |
make all
./qemu-9.0.2/build/qemu-riscv32 ./bin/sljit_test -v
build-test-on-riscv64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install compiler
run: |
sudo apt update
sudo apt install -y make wget ninja-build
wget https://toolchains.bootlin.com/downloads/releases/toolchains/riscv64-lp64d/tarballs/riscv64-lp64d--glibc--stable-2024.02-1.tar.bz2
tar -xvf riscv64-lp64d--glibc--stable-2024.02-1.tar.bz2
- name: Install qemu
run: |
wget https://download.qemu.org/qemu-9.0.2.tar.xz
tar -xvf qemu-9.0.2.tar.xz
cd qemu-9.0.2
./configure --target-list="riscv64-linux-user"
make -j4
- name: Build and test
env:
CROSS_COMPILER: ./riscv64-lp64d--glibc--stable-2024.02-1/bin/riscv64-buildroot-linux-gnu-gcc-12.3.0.br_real
CFLAGS: -march=rv64g
EXTRA_LDFLAGS: -static
run: |
make all
./qemu-9.0.2/build/qemu-riscv64 ./bin/sljit_test -v
build-test-on-riscv64-extensions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install compiler
run: |
sudo apt update
sudo apt install -y make wget ninja-build
wget https://toolchains.bootlin.com/downloads/releases/toolchains/riscv64-lp64d/tarballs/riscv64-lp64d--glibc--stable-2024.02-1.tar.bz2
tar -xvf riscv64-lp64d--glibc--stable-2024.02-1.tar.bz2
- name: Install qemu
run: |
wget https://download.qemu.org/qemu-9.0.2.tar.xz
tar -xvf qemu-9.0.2.tar.xz
cd qemu-9.0.2
./configure --target-list="riscv64-linux-user"
make -j4
- name: Build and test
env:
CROSS_COMPILER: ./riscv64-lp64d--glibc--stable-2024.02-1/bin/riscv64-buildroot-linux-gnu-gcc-12.3.0.br_real
CFLAGS: -march=rv64gv_zba_zbb
EXTRA_LDFLAGS: -static
run: |
make all
./qemu-9.0.2/build/qemu-riscv64 ./bin/sljit_test -v
build-test-on-loongarch64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install compiler
run: |
sudo apt update
sudo apt install -y make wget ninja-build
wget https://github.com/loongson/build-tools/releases/download/2024.06.01/x86_64-cross-tools-loongarch64-binutils_2.42-gcc_14.1.0-glibc_2.39.tar.xz
tar -xvf x86_64-cross-tools-loongarch64-binutils_2.42-gcc_14.1.0-glibc_2.39.tar.xz
- name: Install qemu
run: |
wget https://download.qemu.org/qemu-9.0.2.tar.xz
tar -xvf qemu-9.0.2.tar.xz
cd qemu-9.0.2
./configure --target-list="loongarch64-linux-user"
make -j4
- name: Build and test
env:
CROSS_COMPILER: ./cross-tools/bin/loongarch64-unknown-linux-gnu-gcc-14.1.0
CFLAGS: -march=la464
EXTRA_LDFLAGS: -static
run: |
make all
./qemu-9.0.2/build/qemu-loongarch64 ./bin/sljit_test -v
build-test-on-s390x:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build in s390x container
uses: uraimo/[email protected]
with:
arch: s390x
distro: ubuntu_latest

# Install deps into the container. With the token, the container will be cached
# The image is cached publically like a package
githubToken: ${{ github.token }}

install: |
apt-get update
apt-get install -y gcc g++ make
run: |
make all
./bin/sljit_test -v
8 changes: 8 additions & 0 deletions API_CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
This file is the short summary of the API changes:

17.07.2024 - Non-backward compatible
Passing float scratch or saved register count
to emit_enter / set_context is reworked.

21.06.2024 - Non-backward compatible
Atomic instructions are reworked.
Different forms are optional now.

10.06.2024 - Non-backward compatible
The sljit_emit_simd_op2() has a generic
second operand.
Expand Down
17 changes: 9 additions & 8 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ endif
CPPFLAGS = $(EXTRA_CPPFLAGS) -Isljit_src
CFLAGS += $(COMPAT_FLAGS) $(OPT_FLAGS) $(WARN_FLAGS) $(WERROR)
REGEX_CFLAGS += $(CFLAGS) -fshort-wchar
EXAMPLE_CFLAGS += $(CFLAGS) -Wno-unused-but-set-variable
LDFLAGS = $(EXTRA_LDFLAGS)

BINDIR = bin
Expand Down Expand Up @@ -85,25 +86,25 @@ $(BINDIR)/regex_test: $(BINDIR)/.keep $(BINDIR)/regexMain.o $(BINDIR)/regexJIT.o
examples: $(EXAMPLE_TARGET)

$(BINDIR)/first_program: $(EXAMPLEDIR)/first_program.c $(BINDIR)/.keep $(BINDIR)/sljitLir.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/first_program.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)
$(CC) $(CPPFLAGS) $(EXAMPLE_CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/first_program.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)

$(BINDIR)/branch: $(EXAMPLEDIR)/branch.c $(BINDIR)/.keep $(BINDIR)/sljitLir.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/branch.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)
$(CC) $(CPPFLAGS) $(EXAMPLE_CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/branch.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)

$(BINDIR)/loop: $(EXAMPLEDIR)/loop.c $(BINDIR)/.keep $(BINDIR)/sljitLir.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/loop.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)
$(CC) $(CPPFLAGS) $(EXAMPLE_CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/loop.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)

$(BINDIR)/array_access: $(EXAMPLEDIR)/array_access.c $(BINDIR)/.keep $(BINDIR)/sljitLir.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/array_access.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)
$(CC) $(CPPFLAGS) $(EXAMPLE_CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/array_access.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)

$(BINDIR)/func_call: $(EXAMPLEDIR)/func_call.c $(BINDIR)/.keep $(BINDIR)/sljitLir.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/func_call.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)
$(CC) $(CPPFLAGS) $(EXAMPLE_CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/func_call.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)

$(BINDIR)/struct_access: $(EXAMPLEDIR)/struct_access.c $(BINDIR)/.keep $(BINDIR)/sljitLir.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/struct_access.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)
$(CC) $(CPPFLAGS) $(EXAMPLE_CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/struct_access.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)

$(BINDIR)/temp_var: $(EXAMPLEDIR)/temp_var.c $(BINDIR)/.keep $(BINDIR)/sljitLir.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/temp_var.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)
$(CC) $(CPPFLAGS) $(EXAMPLE_CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/temp_var.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)

$(BINDIR)/brainfuck: $(EXAMPLEDIR)/brainfuck.c $(BINDIR)/.keep $(BINDIR)/sljitLir.o
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/brainfuck.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)
$(CC) $(CPPFLAGS) $(EXAMPLE_CFLAGS) $(LDFLAGS) $(EXAMPLEDIR)/brainfuck.c $(BINDIR)/sljitLir.o -o $@ -lm -lpthread $(EXTRA_LIBS)
Loading

0 comments on commit 349f1d2

Please sign in to comment.