[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 40/44] target/loongarch: Implement vreplve vpack vpick
From: |
Richard Henderson |
Subject: |
Re: [RFC PATCH v2 40/44] target/loongarch: Implement vreplve vpack vpick |
Date: |
Mon, 3 Apr 2023 18:17:56 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 |
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.henderson@linaro.org>
r~
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [RFC PATCH v2 40/44] target/loongarch: Implement vreplve vpack vpick,
Richard Henderson <=