ppc/svp64: introduce svp64_assemble stub
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:13:46 +0000 (22:13 +0300)
gas/config/tc-ppc-svp64.c [new file with mode: 0644]
gas/config/tc-ppc.c

diff --git a/gas/config/tc-ppc-svp64.c b/gas/config/tc-ppc-svp64.c
new file mode 100644 (file)
index 0000000..f07115d
--- /dev/null
@@ -0,0 +1,28 @@
+/* tc-ppc-svp64.c -- Assemble for the PowerPC SVP64 extension.
+   Copyright (C) 2022 Free Software Foundation, Inc.
+   Written by Dmitry Selyutin aka ghostmansd.
+
+   This file is part of GAS, the GNU Assembler.
+
+   GAS is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GAS is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+static void
+svp64_assemble (char *str)
+{
+  as_warn (_("opcode ignored"));
+  memcpy (str, "nop", sizeof ("nop"));
+  md_assemble (str);
+}
index 80f01859379a9601ce2275bd9242c658d3cb8d6b..5386d2ed87133b95b8ece4b1cc57c70ce2bd6f54 100644 (file)
@@ -36,6 +36,8 @@
 #include "libxcoff.h"
 #endif
 
+#include "tc-ppc-svp64.c"
+
 /* This is the assembler for the PowerPC or POWER (RS/6000) chips.  */
 
 /* Tell the main code what the endianness is.  */
@@ -3300,6 +3302,13 @@ parse_tls_arg (char **str, const expressionS *exp, struct ppc_fixup *tls_fix)
 }
 #endif
 
+static inline bool
+is_svp64_insn (char *str)
+{
+  return (((ppc_cpu & PPC_OPCODE_SVP64) == PPC_OPCODE_SVP64) &&
+      (strncmp (str, "sv.", (sizeof ("sv.") - 1)) == 0));
+}
+
 /* This routine is called for each instruction to be assembled.  */
 
 void
@@ -3328,6 +3337,12 @@ md_assemble (char *str)
   opcode = (const struct powerpc_opcode *) str_hash_find (ppc_hash, str);
   if (opcode == (const struct powerpc_opcode *) NULL)
     {
+      if (is_svp64_insn (str))
+        {
+          svp64_assemble (str);
+          return;
+        }
+
       as_bad (_("unrecognized opcode: `%s'"), str);
       ppc_clear_labels ();
       return;
@@ -4148,6 +4163,7 @@ md_assemble (char *str)
       fixP->fx_pcrel_adjust = fixups[i].opindex;
     }
 }
+
 \f
 #ifdef OBJ_ELF
 /* For ELF, add support for SHT_ORDERED.  */