ppc/svp64: introduce alias for 1<<%r3 predicate
authorDmitry Selyutin <ghostmansd@gmail.com>
Tue, 11 Apr 2023 18:27:25 +0000 (21:27 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Wed, 26 Apr 2023 16:47:42 +0000 (19:47 +0300)
gas/config/tc-ppc-svp64.c

index 4e3a12918cb6eb64f5e85e5d5893dd66feaa58be..733c1f95cc925fff9161c1eb6a6218839c68273f 100644 (file)
@@ -91,6 +91,7 @@ enum svp64_predicate {
 static void
 svp64_operand (expressionS *exp)
 {
+  bool caret = false;
   bool vector = false;
   bool compat = false;
   char *origin = input_line_pointer;
@@ -106,6 +107,11 @@ svp64_operand (expressionS *exp)
       else
         ++input_line_pointer;
     }
+  else if (input_line_pointer[0] == '^')
+    {
+      caret = true;
+      ++input_line_pointer;
+    }
 
   if (!vector && !compat && !reg_names_p &&
       (input_line_pointer[0] != '%' || !ISALPHA (input_line_pointer[1])))
@@ -118,8 +124,22 @@ svp64_operand (expressionS *exp)
 
   if (exp->X_op == O_absent)
     input_line_pointer = origin;
-  else if (vector &&
-      ((exp->X_op == O_register) || (exp->X_op == O_constant)))
+  else if (exp->X_op == O_register)
+    {
+      if (caret)
+        {
+          if (exp->X_add_number == 3)
+            {
+              exp->X_op = O_predicate;
+              exp->X_add_number = SVP64_PREDICATE_1BIT_R3;
+            }
+          else
+            exp->X_op = O_illegal;
+        }
+      else if (vector)
+        exp->X_op = O_vector;
+    }
+  else if ((exp->X_op == O_constant) && vector)
     exp->X_op = O_vector;
 
   if (compat)