From b7ed1f5b6193af9603a74842f8495ba7175db915 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sun, 10 Jul 2022 09:30:03 +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 b83dbc881f8..cae359f1f00 100644 --- a/gas/config/tc-ppc-svp64.c +++ b/gas/config/tc-ppc-svp64.c @@ -209,6 +209,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) { @@ -217,6 +250,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