ppc/svp64: support vec2/vec3/vec4 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 46887d867393f627c8a23fc87a40135b527ff665..e9bcb4121eb718c0eb45f527480fa69af339e2c9 100644 (file)
@@ -210,6 +210,39 @@ svp64_decode_sm (char *str, struct svp64_ctx *svp64)
   return iter;
 }
 
+static char *
+svp64_decode_vec (char *str, struct svp64_ctx *svp64)
+{
+  char *subvl;
+
+  str += (sizeof ("vec") - 1);
+  if ( ISSPACE (*str) || *str == SVP64_SEP || *str == '\0')
+    return NULL;
+
+  subvl = str++;
+  if ( ! ISSPACE (*str) && *str != SVP64_SEP && *str != '\0')
+    return NULL;
+
+  switch (*subvl)
+    {
+    case '2':
+      svp64->subvl = 1;
+      break;
+    case '3':
+      svp64->subvl = 2;
+      break;
+    case '4':
+      svp64->subvl = 3;
+      break;
+    default:
+      return NULL;
+    }
+
+  *str++ = '\0';
+
+  return str;
+}
+
 static char *
 svp64_decode_mode (char *str, struct svp64_ctx *svp64)
 {
@@ -218,6 +251,9 @@ svp64_decode_mode (char *str, struct svp64_ctx *svp64)
     SVP64_DECODER ("m="  , svp64_decode_m),
     SVP64_DECODER ("dm=" , svp64_decode_dm),
     SVP64_DECODER ("sm=" , svp64_decode_sm),
+    SVP64_DECODER ("vec2", svp64_decode_vec),
+    SVP64_DECODER ("vec3", svp64_decode_vec),
+    SVP64_DECODER ("vec4", svp64_decode_vec),
   };
 
   for (i = 0; i < sizeof (table) / sizeof (table[0]); ++i)