summaryrefslogtreecommitdiff
path: root/assembly
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2026-11-07 05:45:09 -0600
committercheapie <cheapiephp@gmail.com>2026-11-07 05:45:09 -0600
commitb6ecc5f2f1c6aa350b2fdb4d73b6bd410bdab951 (patch)
treedd1932a4c5c7e050d67697dbc0d1af077c136716 /assembly
parent69111aaf1a2b936bfa9d9ba53a4653f27c93312d (diff)
downloadrvcontroller-b6ecc5f2f1c6aa350b2fdb4d73b6bd410bdab951.tar
rvcontroller-b6ecc5f2f1c6aa350b2fdb4d73b6bd410bdab951.tar.gz
rvcontroller-b6ecc5f2f1c6aa350b2fdb4d73b6bd410bdab951.tar.bz2
rvcontroller-b6ecc5f2f1c6aa350b2fdb4d73b6bd410bdab951.tar.xz
rvcontroller-b6ecc5f2f1c6aa350b2fdb4d73b6bd410bdab951.zip
Add Zbc (and by extension, Zbkc)
Diffstat (limited to 'assembly')
-rw-r--r--assembly/clmultest/Makefile24
-rw-r--r--assembly/clmultest/clmultest.S14
l---------assembly/clmultest/rvcontroller.ld1
3 files changed, 39 insertions, 0 deletions
diff --git a/assembly/clmultest/Makefile b/assembly/clmultest/Makefile
new file mode 100644
index 0000000..c4e7727
--- /dev/null
+++ b/assembly/clmultest/Makefile
@@ -0,0 +1,24 @@
+MARCH ?= rv32imacbzicntr_zicond_zicsr_zifencei_zihintpause_zilsd_zclsd_zabha_zacas_zbkb_zbkx_zcb_zcmp_zcmt_zicboz_zbc
+
+.PHONY: all dump load clean
+
+all: clmultest.hex
+
+clmultest.o: clmultest.S
+ riscv32-none-elf-as -I../rvcontroller-libraries -march=${MARCH} -o clmultest.o clmultest.S
+
+clmultest.elf: clmultest.o
+ riscv32-none-elf-ld -T rvcontroller.ld --no-warn-rwx-segments -o clmultest.elf clmultest.o
+
+dump: clmultest.elf
+ riscv32-none-elf-objdump -d clmultest.elf
+
+clmultest.hex: clmultest.elf
+ riscv32-none-elf-objcopy -O ihex clmultest.elf clmultest.hex
+
+load: clmultest.hex
+ bash -c "wl-copy < clmultest.hex"
+
+clean:
+ rm -f clmultest.hex clmultest.elf clmultest.o
+
diff --git a/assembly/clmultest/clmultest.S b/assembly/clmultest/clmultest.S
new file mode 100644
index 0000000..397603f
--- /dev/null
+++ b/assembly/clmultest/clmultest.S
@@ -0,0 +1,14 @@
+li t0,0xaaaaaaab
+li t1,0x0002fe7d
+clmul s0,t0,t1
+clmulh s1,t0,t1
+clmulr s2,t0,t1
+
+li t0,0x7e00
+li t1,0xb6db6db7
+clmul s3,t0,t1
+clmulh s4,t0,t1
+clmulr s5,t0,t1
+
+li a7,10
+ecall
diff --git a/assembly/clmultest/rvcontroller.ld b/assembly/clmultest/rvcontroller.ld
new file mode 120000
index 0000000..bc01402
--- /dev/null
+++ b/assembly/clmultest/rvcontroller.ld
@@ -0,0 +1 @@
+../../rvcontroller.ld \ No newline at end of file