ppc/svp64: support mr/mrr modes
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 28 May 2023 22:04:56 +0000 (01:04 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 14 Nov 2023 19:53:34 +0000 (22:53 +0300)
gas/config/tc-ppc-svp64.c

index 0da55638c6af4141f959048e9c8966b945586cc0..2ee9dd5f9653e601ca8b75824ed976ee0617c382 100644 (file)
@@ -44,6 +44,8 @@ struct svp64_ctx {
   unsigned int dz : 1;
   unsigned int sz : 1;
   unsigned int ff : 3 + 2; /* 3-bit plus RC1 */
+  unsigned int mr : 1;
+  unsigned int RG : 1;
 };
 
 #define SVP64_RC1_ACTIVE (1U << 3U)
@@ -489,6 +491,39 @@ svp64_decode_ff (char *str, struct svp64_ctx *svp64)
   return iter;
 }
 
+static char *
+svp64_decode_mr (char *str, struct svp64_ctx *svp64)
+{
+  str += (sizeof ("mr") - 1);
+  if ( ! ISSPACE (*str) && *str != SVP64_SEP && *str != '\0')
+    return NULL;
+
+  svp64->sv_mode_explicit = 1;
+  svp64->sv_mode = 0;
+  svp64->mr = 1;
+
+  *str++ = '\0';
+
+  return str;
+}
+
+static char *
+svp64_decode_mrr (char *str, struct svp64_ctx *svp64)
+{
+  str += (sizeof ("mrr") - 1);
+  if ( ! ISSPACE (*str) && *str != SVP64_SEP && *str != '\0')
+    return NULL;
+
+  svp64->sv_mode_explicit = 1;
+  svp64->sv_mode = 0;
+  svp64->mr = 1;
+  svp64->RG = 1;
+
+  *str++ = '\0';
+
+  return str;
+}
+
 static char *
 svp64_decode_mode (char *str, struct svp64_ctx *svp64)
 {
@@ -511,6 +546,8 @@ svp64_decode_mode (char *str, struct svp64_ctx *svp64)
     SVP64_DECODER ("dz"  , svp64_decode_dz),
     SVP64_DECODER ("sz"  , svp64_decode_sz),
     SVP64_DECODER ("ff=" , svp64_decode_ff),
+    SVP64_DECODER ("mrr" , svp64_decode_mrr),
+    SVP64_DECODER ("mr"  , svp64_decode_mr),
   };
 
   for (i = 0; i < sizeof (table) / sizeof (table[0]); ++i)