Sandipan Das has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/40935 )

Change subject: arch-power: Fix move condition field instructions
......................................................................

arch-power: Fix move condition field instructions

This introduces the S field for X form instructions which
is used to specify signed versus unsigned comparison. The
Power ISA does not specify a formal name for the third
1-bit opcode field required for decoding XFX form move to
and from CR field instructions, the S field can be used
to achieve the same as it has the same span and position.
This fixes the following instructions.
  * Move To Condition Register Fields (mtcrf)
  * Move From Condition Register (mfcr)

Change-Id: I8d291f707cd063781f0497f7226bebfc47bd9e63
Signed-off-by: Sandipan Das <[email protected]>
---
M src/arch/power/isa/bitfields.isa
M src/arch/power/isa/decoder.isa
2 files changed, 14 insertions(+), 9 deletions(-)



diff --git a/src/arch/power/isa/bitfields.isa b/src/arch/power/isa/bitfields.isa
index 3bfea53..276242e 100644
--- a/src/arch/power/isa/bitfields.isa
+++ b/src/arch/power/isa/bitfields.isa
@@ -73,6 +73,7 @@

 // FXM field for mtcrf instruction
 def bitfield FXM           <19:12>;
+def bitfield S             <20>;

 // Branch fields
 def bitfield BO            <25:21>;
diff --git a/src/arch/power/isa/decoder.isa b/src/arch/power/isa/decoder.isa
index 5f95834..7f79d3c 100644
--- a/src/arch/power/isa/decoder.isa
+++ b/src/arch/power/isa/decoder.isa
@@ -972,17 +972,21 @@
                             0x1f9: mttar({{ TAR = Rs; }});
                         }

-                        144: mtcrf({{
-                            uint32_t mask = 0;
-                            for (int i = 0; i < 8; ++i) {
-                                if (((FXM >> i) & 0x1) == 0x1) {
-                                    mask |= 0xf << (4 * i);
+                        144: decode S {
+                            0: mtcrf({{
+                                uint32_t mask = 0;
+                                for (int i = 0; i < 8; ++i) {
+                                    if ((FXM >> i) & 0x1) {
+                                        mask |= 0xf << (4 * i);
+                                    }
                                 }
-                            }
-                            CR = (Rs & mask) | (CR & ~mask);
-                        }});
+                                CR = (Rs & mask) | (CR & ~mask);
+                            }});
+                        }

-                        19: mfcr({{ Rt = CR; }});
+                        19: decode S {
+                            0: mfcr({{ Rt = CR; }});
+                        }

                         512: mcrxr({{
                             CR = insertCRField(CR, BF, XER<31:28>);

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40935
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: I8d291f707cd063781f0497f7226bebfc47bd9e63
Gerrit-Change-Number: 40935
Gerrit-PatchSet: 1
Gerrit-Owner: Sandipan Das <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to