aboutsummaryrefslogtreecommitdiff
path: root/target/mips
diff options
context:
space:
mode:
authorNi Hui <shuizhuyuanluo@126.com>2022-05-03 21:07:06 +0800
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2022-06-11 11:34:12 +0200
commit7fc235c67f6c136ceba2305bcf2609c46a74620d (patch)
tree16e2ee5cd50500e7711dd4b90bb4f19a80c6d75d /target/mips
parent954d1658bde4e756e305334836fd86d398803242 (diff)
downloadqemu-7fc235c67f6c136ceba2305bcf2609c46a74620d.zip
qemu-7fc235c67f6c136ceba2305bcf2609c46a74620d.tar.gz
qemu-7fc235c67f6c136ceba2305bcf2609c46a74620d.tar.bz2
target/mips: Fix df_extract_val() and df_extract_df() dfe lookup
Actually look into dfe structure data so that df_extract_val() and df_extract_df() can return immediate and datafield other than BYTE. Fixes: 4701d23aef ("target/mips: Convert MSA BIT instruction format to decodetree") Signed-off-by: Ni Hui <shuizhuyuanluo@126.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20220503130708.272850-2-shuizhuyuanluo@126.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'target/mips')
-rw-r--r--target/mips/tcg/msa_translate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/target/mips/tcg/msa_translate.c b/target/mips/tcg/msa_translate.c
index 7630710..aa45bae 100644
--- a/target/mips/tcg/msa_translate.c
+++ b/target/mips/tcg/msa_translate.c
@@ -68,8 +68,8 @@ struct dfe {
static int df_extract_val(DisasContext *ctx, int x, const struct dfe *s)
{
for (unsigned i = 0; i < 4; i++) {
- if (extract32(x, s->start, s->length) == s->mask) {
- return extract32(x, 0, s->start);
+ if (extract32(x, s[i].start, s[i].length) == s[i].mask) {
+ return extract32(x, 0, s[i].start);
}
}
return -1;
@@ -82,7 +82,7 @@ static int df_extract_val(DisasContext *ctx, int x, const struct dfe *s)
static int df_extract_df(DisasContext *ctx, int x, const struct dfe *s)
{
for (unsigned i = 0; i < 4; i++) {
- if (extract32(x, s->start, s->length) == s->mask) {
+ if (extract32(x, s[i].start, s[i].length) == s[i].mask) {
return i;
}
}