From ef6cbd849a31d713b3d99db541fa32c184b95a64 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sun, 19 Jun 2022 09:01:35 +0300 Subject: [PATCH] ppc/svp64: introduce svp64_decode stub --- gas/config/tc-ppc-svp64.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/gas/config/tc-ppc-svp64.c b/gas/config/tc-ppc-svp64.c index 9436c79afa6..0a61752ff26 100644 --- a/gas/config/tc-ppc-svp64.c +++ b/gas/config/tc-ppc-svp64.c @@ -60,15 +60,26 @@ svp64_setup_records (void) } } -static char * +#define SVP64_SEP '/' + +static void svp64_decode (char *str, struct svp64_ctx *svp64) { + char *opc; + str += (sizeof ("sv.") - 1); - svp64->desc = (const struct svp64_desc *) str_hash_find (svp64_hash, str); - if (!svp64->desc) + if (! ISALPHA (*str)) svp64_raise (_("unrecognized opcode: `%s'"), str); - return str; + opc = str; + for (; ! ISSPACE (*str) && *str != SVP64_SEP && *str != '\0'; ++str) + ; + if (*str != '\0') + *str++ = '\0'; + + svp64->desc = (const struct svp64_desc *) str_hash_find (svp64_hash, opc); + if (!svp64->desc) + svp64_raise (_("unrecognized opcode: `%s'"), str); } static void -- 2.30.2