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

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

arch-riscv: Added the Zbc bitmanip instructions

Added clmul, clmulh, clmulr instructions.

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



diff --git a/src/arch/riscv/isa/decoder.isa b/src/arch/riscv/isa/decoder.isa
index 101e5c9..e1f540c 100644
--- a/src/arch/riscv/isa/decoder.isa
+++ b/src/arch/riscv/isa/decoder.isa
@@ -774,6 +774,14 @@
                         Rd = negate ? ~res + (Rs1_sd*Rs2_sd == 0 ? 1 : 0)
                                     : res;
                     }}, IntMultOp);
+                    0x5: clmul({{
+                        Rd = 0;
+                        for (int i = 0; i < 64; i++) {
+                            if ((Rs2 >> i) & 1) {
+                                Rd ^= Rs1 << i;
+                            }
+                        }
+                    }});
                     0x30: rol({{
                         int shamt = Rs2 & (64 - 1);
Rd = (Rs1 << shamt) | (Rs1 >> ((64 - shamt) & (64 - 1)));
@@ -803,6 +811,14 @@
                                        carry;
Rd = negate ? ~res + (Rs1_sd*Rs2 == 0 ? 1 : 0) : res;
                     }}, IntMultOp);
+                    0x5: clmulr({{
+                        Rd = 0;
+                        for (int i = 0; i < 64; i++) {
+                            if ((Rs2 >> i) & 1) {
+                                Rd ^= Rs1 >> (64-i-1);
+                            }
+                        }
+                    }});
                     0x10: sh1add({{
                         Rd = (Rs1 << 1) + Rs2;
                     }});
@@ -826,6 +842,14 @@

                         Rd = hi + (mid1 >> 32) + (mid2 >> 32) + carry;
                     }}, IntMultOp);
+                    0x5: clmulh({{
+                        Rd = 0;
+                        for (int i = 1; i < 64; i++) {
+                            if ((Rs2 >> i) & 1) {
+                                Rd ^= (Rs1 >> (64-i));
+                            }
+                        }
+                    }});
                 }
                 0x4: decode FUNCT7 {
                     0x0: xor({{

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58631
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: I98dc76ddde052f56e32eabed12af87039def665b
Gerrit-Change-Number: 58631
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