freedreno/cffdec: Stop open-coding enum parsing

Now that rnndec_decode_enum() has been fixed, it does the same thing as
this function.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6140>
This commit is contained in:
Connor Abbott 2020-07-31 11:45:09 +02:00 committed by Marge Bot
parent 73241ca53e
commit 8d0e5e0626

View file

@ -143,19 +143,7 @@ struct rnndecaddrinfo *rnn_reginfo(struct rnn *rnn, uint32_t regbase)
const char *rnn_enumname(struct rnn *rnn, const char *name, uint32_t val)
{
struct rnndeccontext *ctx = rnn->vc;
struct rnnenum *en = rnn_findenum(ctx->db, name);
if (en) {
int i;
for (i = 0; i < en->valsnum; i++) {
struct rnnvalue *eval = en->vals[i];
if (eval->valvalid && eval->value == val &&
rnndec_varmatch(ctx, &eval->varinfo)) {
return en->vals[i]->name;
}
}
}
return NULL;
return rnndec_decode_enum(rnn->vc, name, val);
}
static struct rnndelem *regelem(struct rnndomain *domain, const char *name)