On 3/27/23 20:06, Song Gao wrote:
+static bool trans_vbsll_v(DisasContext *ctx, arg_vv_i *a)
+{
+    int ofs;
+    TCGv_i64 desthigh, destlow, high, low, t;
+
+    CHECK_SXE;
+
+    desthigh = tcg_temp_new_i64();
+    destlow = tcg_temp_new_i64();
+    high = tcg_temp_new_i64();
+    low = tcg_temp_new_i64();
+    t = tcg_constant_i64(0);
+
+    tcg_gen_ld_i64(high, cpu_env,
+                   offsetof(CPULoongArchState, fpr[a->vj].vreg.D(1)));
+    tcg_gen_ld_i64(low, cpu_env,
+                   offsetof(CPULoongArchState, fpr[a->vj].vreg.D(0)));
+
+    ofs = ((a->imm) & 0xf) * 8;
+    if (ofs < 64) {
+        tcg_gen_extract2_i64(desthigh, low, high, 64 -ofs);

high is only used here, therefore the load should be delayed.

+        tcg_gen_shli_i64(destlow, low, ofs);
+    } else {
+        tcg_gen_shli_i64(desthigh, low, ofs -64);
+        tcg_gen_mov_i64(destlow, t);

Delay the allocation of destlow into the < 64 block,
then simply assign destlow = tcg_constant_i64(0) here.

Watch the spacing: "ofs - 64".

Similarly for trans_vbsrl_v.

Otherwise,
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>


r~

Reply via email to