From db764793b939aab2fadddeb28f828dd8bbd6ad46 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Mon, 29 May 2023 01:04:56 +0300 Subject: [PATCH] ppc/svp64: introduce svp64_decode stub --- gas/config/tc-ppc-svp64.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/gas/config/tc-ppc-svp64.c b/gas/config/tc-ppc-svp64.c index 9436c79afa6..89d62c218a5 100644 --- a/gas/config/tc-ppc-svp64.c +++ b/gas/config/tc-ppc-svp64.c @@ -22,6 +22,7 @@ #include struct svp64_ctx { + const char *name; const struct svp64_desc *desc; }; @@ -60,15 +61,31 @@ svp64_setup_records (void) } } -static char * +#define SVP64_SEP '/' + +static void svp64_decode (char *str, struct svp64_ctx *svp64) { + char *opc; + const struct svp64_record *record; + str += (sizeof ("sv.") - 1); - svp64->desc = (const struct svp64_desc *) str_hash_find (svp64_hash, str); + if (! ISALPHA (*str)) + svp64_raise (_("unrecognized opcode: `%s'"), 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); - return str; + record = (const void *)((unsigned char *)svp64->desc - + offsetof (struct svp64_record, desc)); + svp64->name = record->name; } static void -- 2.30.2