Jerin Joy has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/58632 )

Change subject: arch-riscv: Added the Zbs bitmanip instructions
......................................................................

arch-riscv: Added the Zbs bitmanip instructions

Added the bclr, bclri, bext, bexti, binv, binvi, bset, bseti
instructions.

Change-Id: I126d659d973b250b642bd56b3b149f0ee6a3323e
Signed-off-by: Jerin Joy <j...@rivosinc.com>
---
M src/arch/riscv/isa/decoder.isa
1 file changed, 50 insertions(+), 3 deletions(-)



diff --git a/src/arch/riscv/isa/decoder.isa b/src/arch/riscv/isa/decoder.isa
index e1f540c..17258d0 100644
--- a/src/arch/riscv/isa/decoder.isa
+++ b/src/arch/riscv/isa/decoder.isa
@@ -432,9 +432,23 @@

         0x04: decode FUNCT3 {
             0x1: decode FS3 {
-                0x00: IOp::slli({{
-                    Rd = Rs1 << imm;
-                }}, imm_type = uint64_t, imm_code = {{ imm = SHAMT6; }});
+                format IOp {
+                    0x00: slli({{
+                        Rd = Rs1 << imm;
+ }}, imm_type = uint64_t, imm_code = {{ imm = SHAMT6; }});
+                    0x05: bseti({{
+                        uint64_t index = imm & (64 - 1);
+                        Rd = Rs1 | (UINT64_C(1) << index);
+ }}, imm_type = uint64_t, imm_code = {{ imm = SHAMT6; }});
+                    0x09: bclri({{
+                        uint64_t index = imm & (64 - 1);
+                        Rd = Rs1 & (~(UINT64_C(1) << index));
+ }}, imm_type = uint64_t, imm_code = {{ imm = SHAMT6; }});
+                    0x0d: binvi({{
+                        uint64_t index = imm & (64 - 1);
+                        Rd = Rs1 ^ (UINT64_C(1) << index);
+ }}, imm_type = uint64_t, imm_code = {{ imm = SHAMT6; }});
+                }
                 format ROp {
                     0x0c: decode RS2 {
                         0x00: clz({{
@@ -487,6 +501,10 @@
                     0x8: srai({{
                         Rd_sd = Rs1_sd >> imm;
}}, imm_type = uint64_t, imm_code = {{ imm = SHAMT6; }});
+                    0x9: bexti({{
+                        uint64_t index = imm & (64 - 1);
+                        Rd = (Rs1 >> index) & 0x1;
+ }}, imm_type = uint64_t, imm_code = {{ imm = SHAMT6; }});
                     0xc: rori({{
Rd = (Rs1 >> imm) | (Rs1 << ((64 - imm) & (64 - 1))); }}, imm_type = uint64_t, imm_code = {{ imm = SHAMT6; }});
@@ -782,10 +800,22 @@
                             }
                         }
                     }});
+                    0x14: bset({{
+                        Rs2 &= (64 - 1);
+                        Rd = Rs1 | (UINT64_C(1) << Rs2);
+                    }});
+                    0x24: bclr({{
+                        Rs2 &= (64 - 1);
+                        Rd = Rs1 & (~(UINT64_C(1) << Rs2));
+                    }});
                     0x30: rol({{
                         int shamt = Rs2 & (64 - 1);
Rd = (Rs1 << shamt) | (Rs1 >> ((64 - shamt) & (64 - 1)));
                     }});
+                    0x34: binv({{
+                        Rs2 &= (64 - 1);
+                        Rd = Rs1 ^ (UINT64_C(1) << Rs2);
+                    }});
                 }
                 0x2: decode FUNCT7 {
                     0x0: slt({{
@@ -893,6 +923,10 @@
                     0x5: minu({{
                         Rd = Rs1 < Rs2 ? Rs1 : Rs2;
                     }});
+                    0x24: bext({{
+                        Rs2 &= (64 - 1);
+                        Rd = (Rs1 >> Rs2) & 0x1;
+                    }});
                     0x30: ror({{
                         int shamt = Rs2 & (64 - 1);
Rd = (Rs1 >> shamt) | (Rs1 << ((64 - shamt) & (64 - 1)));

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58632
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I126d659d973b250b642bd56b3b149f0ee6a3323e
Gerrit-Change-Number: 58632
Gerrit-PatchSet: 1
Gerrit-Owner: Jerin Joy <j...@rivosinc.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to