@@ -21,6 +21,7 @@
&msa_elm_df df wd ws n
&msa_elm wd ws
+%lsa_sa 6:2 !function=plus_1
%elm_df 16:6 !function=elm_df
%elm_n 16:6 !function=elm_n
%bit_df 16:7 !function=bit_df
@@ -29,7 +30,7 @@
%3r_df_h 21:1 !function=plus_1
%3r_df_w 21:1 !function=plus_2
-@lsa ...... rs:5 rt:5 rd:5 ... sa:2 ...... &r
+@lsa ...... rs:5 rt:5 rd:5 ... .. ...... &r sa=%lsa_sa
@ldst ...... sa:s10 ws:5 wd:5 .... df:2 &msa_i
@bz_v ...... ... .. wt:5 sa:s16 &msa_bz df=3
@bz ...... ... df:2 wt:5 sa:s16 &msa_bz
@@ -16,7 +16,9 @@
&r rs rt rd sa
-@lsa ...... rs:5 rt:5 rd:5 ... sa:2 ...... &r
+%lsa_sa 6:2 !function=plus_1
+
+@lsa ...... rs:5 rt:5 rd:5 ... .. ...... &r sa=%lsa_sa
LSA 000000 ..... ..... ..... 000 .. 000101 @lsa
DLSA 000000 ..... ..... ..... 000 .. 010101 @lsa
@@ -780,7 +780,7 @@ TRANS_DF_iv(ST, trans_msa_ldst, gen_helper_msa_st);
static bool trans_LSA(DisasContext *ctx, arg_r *a)
{
- return gen_lsa(ctx, a->rd, a->rt, a->rs, a->sa + 1);
+ return gen_lsa(ctx, a->rd, a->rt, a->rs, a->sa);
}
static bool trans_DLSA(DisasContext *ctx, arg_r *a)
@@ -788,5 +788,5 @@ static bool trans_DLSA(DisasContext *ctx, arg_r *a)
if (TARGET_LONG_BITS != 64) {
return false;
}
- return gen_dlsa(ctx, a->rd, a->rt, a->rs, a->sa + 1);
+ return gen_dlsa(ctx, a->rd, a->rt, a->rs, a->sa);
}
@@ -11,6 +11,11 @@
#include "qemu/osdep.h"
#include "translate.h"
+static inline int plus_1(DisasContext *ctx, int x)
+{
+ return x + 1;
+}
+
/* Include the auto-generated decoders. */
#include "decode-rel6.c.inc"
@@ -23,7 +28,7 @@ bool trans_REMOVED(DisasContext *ctx, arg_REMOVED *a)
static bool trans_LSA(DisasContext *ctx, arg_r *a)
{
- return gen_lsa(ctx, a->rd, a->rt, a->rs, a->sa + 1);
+ return gen_lsa(ctx, a->rd, a->rt, a->rs, a->sa);
}
static bool trans_DLSA(DisasContext *ctx, arg_r *a)
@@ -31,5 +36,5 @@ static bool trans_DLSA(DisasContext *ctx, arg_r *a)
if (TARGET_LONG_BITS != 64) {
return false;
}
- return gen_dlsa(ctx, a->rd, a->rt, a->rs, a->sa + 1);
+ return gen_dlsa(ctx, a->rd, a->rt, a->rs, a->sa);
}