ppc/svp64: support zz/dz/sz specifier
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 5a015a6810d6cc66ce5c6672343b5bc0c808c7df..ca635781861447592793ebc4ec4e8b083afcc803 100644 (file)
@@ -41,6 +41,8 @@ struct svp64_ctx {
   unsigned int els : 1;
   unsigned int sea : 1;
   unsigned int sat : 1;
+  unsigned int dz : 1;
+  unsigned int sz : 1;
 };
 
 static jmp_buf svp64_exception;
@@ -400,6 +402,49 @@ svp64_decode_sat (char *str, struct svp64_ctx *svp64)
   return str;
 }
 
+static char *
+svp64_decode_zz (char *str, struct svp64_ctx *svp64)
+{
+  str += (sizeof ("zz") - 1);
+  if ( ! ISSPACE (*str) && *str != SVP64_SEP && *str != '\0')
+    return NULL;
+
+  svp64->sz = 1;
+  svp64->dz = 1;
+
+  *str++ = '\0';
+
+  return str;
+}
+
+static char *
+svp64_decode_dz (char *str, struct svp64_ctx *svp64)
+{
+  str += (sizeof ("dz") - 1);
+  if ( ! ISSPACE (*str) && *str != SVP64_SEP && *str != '\0')
+    return NULL;
+
+  svp64->dz = 1;
+
+  *str++ = '\0';
+
+  return str;
+}
+
+static char *
+svp64_decode_sz (char *str, struct svp64_ctx *svp64)
+{
+  str += (sizeof ("sz") - 1);
+  if ( ! ISSPACE (*str) && *str != SVP64_SEP && *str != '\0')
+    return NULL;
+
+  svp64->sz = 1;
+
+  *str++ = '\0';
+
+  return str;
+}
+
 static char *
 svp64_decode_mode (char *str, struct svp64_ctx *svp64)
 {
@@ -418,6 +463,9 @@ svp64_decode_mode (char *str, struct svp64_ctx *svp64)
     SVP64_DECODER ("sea" , svp64_decode_sea),
     SVP64_DECODER ("sats", svp64_decode_sat),
     SVP64_DECODER ("satu", svp64_decode_sat),
+    SVP64_DECODER ("zz"  , svp64_decode_zz),
+    SVP64_DECODER ("dz"  , svp64_decode_dz),
+    SVP64_DECODER ("sz"  , svp64_decode_sz),
   };
 
   for (i = 0; i < sizeof (table) / sizeof (table[0]); ++i)