aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVed Shanbhogue <ved@rivosinc.com>2023-10-30 17:21:40 -0500
committerVed Shanbhogue <ved@rivosinc.com>2023-10-30 17:21:40 -0500
commit08bad17b04320631f2e60af8ea07e04e2af613ac (patch)
treed0847fe2270e283cf4d98125a4c51fb58269816b
parenteeef09ebb894c3bb7e42b7b47aae98792b8eef79 (diff)
downloadriscv-isa-sim-08bad17b04320631f2e60af8ea07e04e2af613ac.zip
riscv-isa-sim-08bad17b04320631f2e60af8ea07e04e2af613ac.tar.gz
riscv-isa-sim-08bad17b04320631f2e60af8ea07e04e2af613ac.tar.bz2
add byte width amo instructions
-rw-r--r--riscv/insns/amoadd_b.h3
-rw-r--r--riscv/insns/amoand_b.h3
-rw-r--r--riscv/insns/amocas_b.h4
-rw-r--r--riscv/insns/amomax_b.h3
-rw-r--r--riscv/insns/amomaxu_b.h3
-rw-r--r--riscv/insns/amomin_b.h3
-rw-r--r--riscv/insns/amominu_b.h3
-rw-r--r--riscv/insns/amoor_b.h3
-rw-r--r--riscv/insns/amoswap_b.h3
-rw-r--r--riscv/insns/amoxor_b.h3
10 files changed, 31 insertions, 0 deletions
diff --git a/riscv/insns/amoadd_b.h b/riscv/insns/amoadd_b.h
new file mode 100644
index 0000000..2138104
--- /dev/null
+++ b/riscv/insns/amoadd_b.h
@@ -0,0 +1,3 @@
+require_extension('A');
+require_extension(EXT_ZABHA);
+WRITE_RD((sreg_t)(int8_t)(MMU.amo<uint8_t>(RS1, [&](uint8_t lhs) { return lhs + RS2; })));
diff --git a/riscv/insns/amoand_b.h b/riscv/insns/amoand_b.h
new file mode 100644
index 0000000..f461c29
--- /dev/null
+++ b/riscv/insns/amoand_b.h
@@ -0,0 +1,3 @@
+require_extension('A');
+require_extension(EXT_ZABHA);
+WRITE_RD((sreg_t)(int8_t)(MMU.amo<uint8_t>(RS1, [&](uint8_t lhs) { return lhs & RS2; })));
diff --git a/riscv/insns/amocas_b.h b/riscv/insns/amocas_b.h
new file mode 100644
index 0000000..ca609c7
--- /dev/null
+++ b/riscv/insns/amocas_b.h
@@ -0,0 +1,4 @@
+require_extension('A');
+require_extension(EXT_ZACAS);
+require_extension(EXT_ZABHA);
+WRITE_RD((sreg_t)(int8_t)(MMU.amo_compare_and_swap<uint8_t>(RS1, RD, RS2)));
diff --git a/riscv/insns/amomax_b.h b/riscv/insns/amomax_b.h
new file mode 100644
index 0000000..8187a3c
--- /dev/null
+++ b/riscv/insns/amomax_b.h
@@ -0,0 +1,3 @@
+require_extension('A');
+require_extension(EXT_ZABHA);
+WRITE_RD((sreg_t)(int8_t)(MMU.amo<uint8_t>(RS1, [&](int8_t lhs) { return std::max(lhs, int8_t(RS2)); })));
diff --git a/riscv/insns/amomaxu_b.h b/riscv/insns/amomaxu_b.h
new file mode 100644
index 0000000..534b3ca
--- /dev/null
+++ b/riscv/insns/amomaxu_b.h
@@ -0,0 +1,3 @@
+require_extension('A');
+require_extension(EXT_ZABHA);
+WRITE_RD((sreg_t)(int8_t)(MMU.amo<uint8_t>(RS1, [&](uint8_t lhs) { return std::max(lhs, uint8_t(RS2)); })));
diff --git a/riscv/insns/amomin_b.h b/riscv/insns/amomin_b.h
new file mode 100644
index 0000000..c5e8cf9
--- /dev/null
+++ b/riscv/insns/amomin_b.h
@@ -0,0 +1,3 @@
+require_extension('A');
+require_extension(EXT_ZABHA);
+WRITE_RD((sreg_t)(int8_t)(MMU.amo<uint8_t>(RS1, [&](int8_t lhs) { return std::min(lhs, int8_t(RS2)); })));
diff --git a/riscv/insns/amominu_b.h b/riscv/insns/amominu_b.h
new file mode 100644
index 0000000..9bce0e7
--- /dev/null
+++ b/riscv/insns/amominu_b.h
@@ -0,0 +1,3 @@
+require_extension('A');
+require_extension(EXT_ZABHA);
+WRITE_RD((sreg_t)(int8_t)(MMU.amo<uint8_t>(RS1, [&](uint8_t lhs) { return std::min(lhs, uint8_t(RS2)); })));
diff --git a/riscv/insns/amoor_b.h b/riscv/insns/amoor_b.h
new file mode 100644
index 0000000..f96ff54
--- /dev/null
+++ b/riscv/insns/amoor_b.h
@@ -0,0 +1,3 @@
+require_extension('A');
+require_extension(EXT_ZABHA);
+WRITE_RD((sreg_t)(int8_t)(MMU.amo<uint8_t>(RS1, [&](uint8_t lhs) { return lhs | RS2; })));
diff --git a/riscv/insns/amoswap_b.h b/riscv/insns/amoswap_b.h
new file mode 100644
index 0000000..5ecbd26
--- /dev/null
+++ b/riscv/insns/amoswap_b.h
@@ -0,0 +1,3 @@
+require_extension('A');
+require_extension(EXT_ZABHA);
+WRITE_RD((sreg_t)(int8_t)(MMU.amo<uint8_t>(RS1, [&](uint8_t UNUSED lhs) { return RS2; })));
diff --git a/riscv/insns/amoxor_b.h b/riscv/insns/amoxor_b.h
new file mode 100644
index 0000000..1966bd4
--- /dev/null
+++ b/riscv/insns/amoxor_b.h
@@ -0,0 +1,3 @@
+require_extension('A');
+require_extension(EXT_ZABHA);
+WRITE_RD((sreg_t)(int8_t)(MMU.amo<uint8_t>(RS1, [&](uint8_t lhs) { return lhs ^ RS2; })));