From 1392771eb1d828f1b2eb44ec08c44e9d3e87d1d0 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Mon, 29 May 2023 01:04:56 +0300 Subject: [PATCH] ppc/svp64: support vec2/vec3/vec4 modes --- gas/config/tc-ppc-svp64.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/gas/config/tc-ppc-svp64.c b/gas/config/tc-ppc-svp64.c index 46887d86739..e9bcb4121eb 100644 --- a/gas/config/tc-ppc-svp64.c +++ b/gas/config/tc-ppc-svp64.c @@ -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) -- 2.30.2