From nobody Wed Apr 24 10:15:48 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1674614660; cv=none; d=zohomail.com; s=zohoarc; b=LMN0OTj+P6EAIiA+bagqutMg5atC+ArTGwnRAIFNYeMD6hF97o9XzRHGHgGVeKIDTOiVfRBNXdoZdfrpoQvYhsA9OtDbADSsypBV6jTmCDAjgZPKML+evwRinKgjttKzNrXE0XbtQ7fNGTLtAiV80WeV4W3r2GT1sfXH+8+w1HU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674614660; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=33waTz+NxR8jiiDhemk6fVVjCrbgK2Q0fTeClZUOOrE=; b=a03fukI7unXaTKR4/z/V8ifdqjQEcatxCtM6Q/8zfOaIxHLw/NV749pcf63TByYeQDpfpj9VuJmQJ7Ob4/3pXGzG2A4B6KeL2EDDls+9JVlP65l6hXn+DcpaWAqPbQb8t7FGsInXQnTjnBK2serGirrNhoR7PoN7426E/dKGS9Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674614660614620.5172955920909; Tue, 24 Jan 2023 18:44:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKVkJ-0006n6-It; Tue, 24 Jan 2023 21:42:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKVkD-0006kw-70 for qemu-devel@nongnu.org; Tue, 24 Jan 2023 21:42:37 -0500 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKVk8-00079T-HE for qemu-devel@nongnu.org; Tue, 24 Jan 2023 21:42:36 -0500 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30P2MRS9004470; Wed, 25 Jan 2023 02:42:18 GMT Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3n89dr69ru-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Jan 2023 02:42:18 +0000 Received: from pps.filterd (NALASPPMTA01.qualcomm.com [127.0.0.1]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 30P2gHO8017556; Wed, 25 Jan 2023 02:42:17 GMT Received: from pps.reinject (localhost [127.0.0.1]) by NALASPPMTA01.qualcomm.com (PPS) with ESMTP id 3n894kg76r-1; Wed, 25 Jan 2023 02:42:17 +0000 Received: from NALASPPMTA01.qualcomm.com (NALASPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 30P2gH5w017542; Wed, 25 Jan 2023 02:42:17 GMT Received: from hu-devc-lv-u18-c.qualcomm.com (hu-tsimpson-lv.qualcomm.com [10.47.235.220]) by NALASPPMTA01.qualcomm.com (PPS) with ESMTP id 30P2gHDe017536; Wed, 25 Jan 2023 02:42:17 +0000 Received: by hu-devc-lv-u18-c.qualcomm.com (Postfix, from userid 47164) id 90044500118; Tue, 24 Jan 2023 18:42:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=qcppdkim1; bh=33waTz+NxR8jiiDhemk6fVVjCrbgK2Q0fTeClZUOOrE=; b=nMAxd4zj4SDcLFQGy3wPuo7XjEZGXERDUBOSE/LNGyCI5iOzbROlmgMhs9HglGWv6QAK K8NCG1gmZEMncNKiQnYpmaFM2UtR1vJgrLFGDGm7DCLppEhDRrFFK8YLGwAkPlDkStC4 ABgnc6TlXwwGQhg0VSiQklGQBAfKyfEHgJM/aHtm07TRNjRM6fbdP/vN170bs6uS6l0U mPidl9/qCNf2Rpssme/EkoUMe8W3LDUOyPL3b9BocgVZ4DLheF1svbsLlWu+APXRAZwX S1nKLJLl0WSRkEUaQzwOALyfhMYprkaOs5+J1HoVGdjEBP/7AvhtrOEAUgnKzM8ExQKf gw== From: Taylor Simpson To: qemu-devel@nongnu.org Cc: tsimpson@quicinc.com, richard.henderson@linaro.org, philmd@linaro.org, ale@rev.ng, anjo@rev.ng, bcain@quicinc.com, quic_mathbern@quicinc.com Subject: [PATCH v4 11/13] Hexagon (target/hexagon) Remove gen_log_predicated_reg_write[_pair] Date: Tue, 24 Jan 2023 18:42:13 -0800 Message-Id: <20230125024215.10430-12-tsimpson@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230125024215.10430-1-tsimpson@quicinc.com> References: <20230125024215.10430-1-tsimpson@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Y-p4ggGlZ6BZ7bIAQsk3g6OBurFui5fy X-Proofpoint-ORIG-GUID: Y-p4ggGlZ6BZ7bIAQsk3g6OBurFui5fy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-24_17,2023-01-24_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 suspectscore=0 spamscore=0 adultscore=0 bulkscore=0 mlxlogscore=962 phishscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301250020 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=tsimpson@qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @quicinc.com) X-ZM-MESSAGEID: 1674614661094100005 We assign the instruction destination register to hex_new_value[num] instead of a TCG temp that gets copied back to hex_new_value[num]. Since we preload hex_new_value for predicated instructions, we don't need the check for slot_cancelled. So, we call gen_log_reg_write instead. Here is a simple example of the differences in the TCG code generated: IN: 0x00400094: 0xf900c102 { if (P0) R2 =3D and(R0,R1) } BEFORE ---- 00400094 mov_i32 pkt_has_store_s1,$0x0 mov_i32 slot_cancelled,$0x0 mov_i32 new_r2,r2 mov_i32 loc2,$0x0 and_i32 tmp0,p0,$0x1 brcond_i32 tmp0,$0x0,eq,$L1 and_i32 tmp0,r0,r1 mov_i32 loc2,tmp0 br $L2 set_label $L1 or_i32 slot_cancelled,slot_cancelled,$0x8 set_label $L2 and_i32 tmp0,slot_cancelled,$0x8 movcond_i32 new_r2,tmp0,$0x0,loc2,new_r2,eq mov_i32 r2,new_r2 AFTER ---- 00400094 mov_i32 slot_cancelled,$0x0 mov_i32 new_r2,r2 and_i32 tmp0,p0,$0x1 brcond_i32 tmp0,$0x0,eq,$L1 and_i32 tmp0,r0,r1 mov_i32 new_r2,tmp0 br $L2 set_label $L1 or_i32 slot_cancelled,slot_cancelled,$0x8 set_label $L2 mov_i32 r2,new_r2 We'll remove the unnecessary manipulation of slot_cancelled in a subsequent patch. Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg.h | 3 +- target/hexagon/genptr.c | 120 ++++---------------- target/hexagon/idef-parser/parser-helpers.c | 4 +- target/hexagon/gen_tcg_funcs.py | 55 +++++---- 4 files changed, 52 insertions(+), 130 deletions(-) diff --git a/target/hexagon/gen_tcg.h b/target/hexagon/gen_tcg.h index 8282ff3fc5..63df79e006 100644 --- a/target/hexagon/gen_tcg.h +++ b/target/hexagon/gen_tcg.h @@ -521,10 +521,9 @@ */ #define fGEN_TCG_SL2_return(SHORTCODE) \ do { \ - TCGv_i64 RddV =3D tcg_temp_new_i64(); \ + TCGv_i64 RddV =3D get_result_gpr_pair(ctx, HEX_REG_FP); \ gen_return(ctx, RddV, hex_gpr[HEX_REG_FP]); \ gen_log_reg_write_pair(HEX_REG_FP, RddV); \ - tcg_temp_free_i64(RddV); \ } while (0) =20 /* diff --git a/target/hexagon/genptr.c b/target/hexagon/genptr.c index 67ec3ac551..f937a17b24 100644 --- a/target/hexagon/genptr.c +++ b/target/hexagon/genptr.c @@ -70,28 +70,17 @@ static inline void gen_masked_reg_write(TCGv new_val, T= CGv cur_val, } } =20 -static inline void gen_log_predicated_reg_write(int rnum, TCGv val, - uint32_t slot) +static TCGv get_result_gpr(DisasContext *ctx, int rnum) { - TCGv zero =3D tcg_constant_tl(0); - TCGv slot_mask =3D tcg_temp_new(); - - tcg_gen_andi_tl(slot_mask, hex_slot_cancelled, 1 << slot); - tcg_gen_movcond_tl(TCG_COND_EQ, hex_new_value[rnum], slot_mask, zero, - val, hex_new_value[rnum]); - if (HEX_DEBUG) { - /* - * Do this so HELPER(debug_commit_end) will know - * - * Note that slot_mask indicates the value is not written - * (i.e., slot was cancelled), so we create a true/false value bef= ore - * or'ing with hex_reg_written[rnum]. - */ - tcg_gen_setcond_tl(TCG_COND_EQ, slot_mask, slot_mask, zero); - tcg_gen_or_tl(hex_reg_written[rnum], hex_reg_written[rnum], slot_m= ask); - } + return hex_new_value[rnum]; +} =20 - tcg_temp_free(slot_mask); +static TCGv_i64 get_result_gpr_pair(DisasContext *ctx, int rnum) +{ + TCGv_i64 result =3D tcg_temp_local_new_i64(); + tcg_gen_concat_i32_i64(result, hex_new_value[rnum], + hex_new_value[rnum + 1]); + return result; } =20 void gen_log_reg_write(int rnum, TCGv val) @@ -106,42 +95,6 @@ void gen_log_reg_write(int rnum, TCGv val) } } =20 -static void gen_log_predicated_reg_write_pair(int rnum, TCGv_i64 val, - uint32_t slot) -{ - TCGv val32 =3D tcg_temp_new(); - TCGv zero =3D tcg_constant_tl(0); - TCGv slot_mask =3D tcg_temp_new(); - - tcg_gen_andi_tl(slot_mask, hex_slot_cancelled, 1 << slot); - /* Low word */ - tcg_gen_extrl_i64_i32(val32, val); - tcg_gen_movcond_tl(TCG_COND_EQ, hex_new_value[rnum], - slot_mask, zero, - val32, hex_new_value[rnum]); - /* High word */ - tcg_gen_extrh_i64_i32(val32, val); - tcg_gen_movcond_tl(TCG_COND_EQ, hex_new_value[rnum + 1], - slot_mask, zero, - val32, hex_new_value[rnum + 1]); - if (HEX_DEBUG) { - /* - * Do this so HELPER(debug_commit_end) will know - * - * Note that slot_mask indicates the value is not written - * (i.e., slot was cancelled), so we create a true/false value bef= ore - * or'ing with hex_reg_written[rnum]. - */ - tcg_gen_setcond_tl(TCG_COND_EQ, slot_mask, slot_mask, zero); - tcg_gen_or_tl(hex_reg_written[rnum], hex_reg_written[rnum], slot_m= ask); - tcg_gen_or_tl(hex_reg_written[rnum + 1], hex_reg_written[rnum + 1], - slot_mask); - } - - tcg_temp_free(val32); - tcg_temp_free(slot_mask); -} - static void gen_log_reg_write_pair(int rnum, TCGv_i64 val) { const target_ulong reg_mask_low =3D reg_immut_masks[rnum]; @@ -167,6 +120,7 @@ static void gen_log_reg_write_pair(int rnum, TCGv_i64 v= al) } =20 tcg_temp_free(val32); + tcg_temp_free_i64(val); } =20 void gen_log_pred_write(DisasContext *ctx, int pnum, TCGv val) @@ -306,12 +260,14 @@ static inline void gen_write_ctrl_reg_pair(DisasConte= xt *ctx, int reg_num, TCGv_i64 val) { if (reg_num =3D=3D HEX_REG_P3_0_ALIASED) { + TCGv result =3D get_result_gpr(ctx, reg_num + 1); TCGv val32 =3D tcg_temp_new(); tcg_gen_extrl_i64_i32(val32, val); gen_write_p3_0(ctx, val32); tcg_gen_extrh_i64_i32(val32, val); - gen_log_reg_write(reg_num + 1, val32); + tcg_gen_mov_tl(result, val32); tcg_temp_free(val32); + tcg_temp_free_i64(val); } else { gen_log_reg_write_pair(reg_num, val); if (reg_num =3D=3D HEX_REG_QEMU_PKT_CNT) { @@ -701,33 +657,29 @@ static void gen_jumpr(DisasContext *ctx, TCGv new_pc) =20 static void gen_call(DisasContext *ctx, int pc_off) { - TCGv next_PC =3D - tcg_constant_tl(ctx->pkt->pc + ctx->pkt->encod_pkt_size_in_bytes); - gen_log_reg_write(HEX_REG_LR, next_PC); + TCGv lr =3D get_result_gpr(ctx, HEX_REG_LR); + tcg_gen_movi_tl(lr, ctx->next_PC); gen_write_new_pc_pcrel(ctx, pc_off, TCG_COND_ALWAYS, NULL); } =20 static void gen_callr(DisasContext *ctx, TCGv new_pc) { - TCGv next_PC =3D - tcg_constant_tl(ctx->pkt->pc + ctx->pkt->encod_pkt_size_in_bytes); - gen_log_reg_write(HEX_REG_LR, next_PC); + TCGv lr =3D get_result_gpr(ctx, HEX_REG_LR); + tcg_gen_movi_tl(lr, ctx->next_PC); gen_write_new_pc_addr(ctx, new_pc, TCG_COND_ALWAYS, NULL); } =20 static void gen_cond_call(DisasContext *ctx, TCGv pred, TCGCond cond, int pc_off) { - TCGv next_PC; + TCGv lr =3D get_result_gpr(ctx, HEX_REG_LR); TCGv lsb =3D tcg_temp_local_new(); TCGLabel *skip =3D gen_new_label(); tcg_gen_andi_tl(lsb, pred, 1); gen_write_new_pc_pcrel(ctx, pc_off, cond, lsb); tcg_gen_brcondi_tl(cond, lsb, 0, skip); tcg_temp_free(lsb); - next_PC =3D - tcg_constant_tl(ctx->pkt->pc + ctx->pkt->encod_pkt_size_in_bytes); - gen_log_reg_write(HEX_REG_LR, next_PC); + tcg_gen_movi_tl(lr, ctx->next_PC); gen_set_label(skip); } =20 @@ -760,8 +712,7 @@ static void gen_load_frame(DisasContext *ctx, TCGv_i64 = frame, TCGv EA) tcg_gen_qemu_ld64(frame, EA, ctx->mem_idx); } =20 -static void gen_return_base(DisasContext *ctx, TCGv_i64 dst, TCGv src, - TCGv r29) +static void gen_return(DisasContext *ctx, TCGv_i64 dst, TCGv src) { /* * frame =3D *src @@ -771,6 +722,7 @@ static void gen_return_base(DisasContext *ctx, TCGv_i64= dst, TCGv src, */ TCGv_i64 frame =3D tcg_temp_new_i64(); TCGv r31 =3D tcg_temp_new(); + TCGv r29 =3D get_result_gpr(ctx, HEX_REG_SP); =20 gen_load_frame(ctx, frame, src); gen_frame_unscramble(frame); @@ -783,50 +735,26 @@ static void gen_return_base(DisasContext *ctx, TCGv_i= 64 dst, TCGv src, tcg_temp_free(r31); } =20 -static void gen_return(DisasContext *ctx, TCGv_i64 dst, TCGv src) -{ - TCGv r29 =3D tcg_temp_new(); - gen_return_base(ctx, dst, src, r29); - gen_log_reg_write(HEX_REG_SP, r29); - tcg_temp_free(r29); -} - /* if (pred) dst =3D dealloc_return(src):raw */ static void gen_cond_return(DisasContext *ctx, TCGv_i64 dst, TCGv src, TCGv pred, TCGCond cond) { TCGv LSB =3D tcg_temp_new(); - TCGv mask =3D tcg_temp_new(); - TCGv r29 =3D tcg_temp_local_new(); TCGLabel *skip =3D gen_new_label(); tcg_gen_andi_tl(LSB, pred, 1); =20 - /* Initialize the results in case the predicate is false */ - tcg_gen_movi_i64(dst, 0); - tcg_gen_movi_tl(r29, 0); - - /* Set the bit in hex_slot_cancelled if the predicate is flase */ - tcg_gen_movi_tl(mask, 1 << ctx->insn->slot); - tcg_gen_or_tl(mask, hex_slot_cancelled, mask); - tcg_gen_movcond_tl(cond, hex_slot_cancelled, LSB, tcg_constant_tl(0), - mask, hex_slot_cancelled); - tcg_temp_free(mask); - tcg_gen_brcondi_tl(cond, LSB, 0, skip); tcg_temp_free(LSB); - gen_return_base(ctx, dst, src, r29); + gen_return(ctx, dst, src); gen_set_label(skip); - gen_log_predicated_reg_write(HEX_REG_SP, r29, ctx->insn->slot); - tcg_temp_free(r29); } =20 /* sub-instruction version (no RddV, so handle it manually) */ static void gen_cond_return_subinsn(DisasContext *ctx, TCGCond cond, TCGv = pred) { - TCGv_i64 RddV =3D tcg_temp_local_new_i64(); + TCGv_i64 RddV =3D get_result_gpr_pair(ctx, HEX_REG_FP); gen_cond_return(ctx, RddV, hex_gpr[HEX_REG_FP], pred, cond); - gen_log_predicated_reg_write_pair(HEX_REG_FP, RddV, ctx->insn->slot); - tcg_temp_free_i64(RddV); + gen_log_reg_write_pair(HEX_REG_FP, RddV); } =20 static void gen_endloop0(DisasContext *ctx) diff --git a/target/hexagon/idef-parser/parser-helpers.c b/target/hexagon/i= def-parser/parser-helpers.c index de9838806b..eb652d6a7a 100644 --- a/target/hexagon/idef-parser/parser-helpers.c +++ b/target/hexagon/idef-parser/parser-helpers.c @@ -1836,9 +1836,7 @@ void gen_inst_init_args(Context *c, YYLTYPE *locp) for (unsigned i =3D 0; i < c->inst.init_list->len; i++) { HexValue *val =3D &g_array_index(c->inst.init_list, HexValue, i); if (val->type =3D=3D REGISTER_ARG) { - char reg_id[5]; - reg_compose(c, locp, &val->reg, reg_id); - EMIT_HEAD(c, "tcg_gen_movi_i%u(%s, 0);\n", val->bit_width, reg= _id); + /* Nothing to do here */ } else if (val->type =3D=3D PREDICATE) { char suffix =3D val->is_dotnew ? 'N' : 'V'; EMIT_HEAD(c, "tcg_gen_movi_i%u(P%c%c, 0);\n", val->bit_width, diff --git a/target/hexagon/gen_tcg_funcs.py b/target/hexagon/gen_tcg_funcs= .py index 3786ede44c..148e6401ff 100755 --- a/target/hexagon/gen_tcg_funcs.py +++ b/target/hexagon/gen_tcg_funcs.py @@ -37,23 +37,33 @@ def gen_free_ea_tcg(f): =20 def genptr_decl_pair_writable(f, tag, regtype, regid, regno): regN=3D"%s%sN" % (regtype,regid) - f.write(" TCGv_i64 %s%sV =3D tcg_temp_local_new_i64();\n" % \ - (regtype, regid)) - if (regtype =3D=3D "C"): + if (regtype =3D=3D "R"): + f.write(" const int %s =3D insn->regno[%d];\n" % (regN, regno)) + elif (regtype =3D=3D "C"): f.write(" const int %s =3D insn->regno[%d] + HEX_REG_SA0;\n" % \ (regN, regno)) else: - f.write(" const int %s =3D insn->regno[%d];\n" % (regN, regno)) + print("Bad register parse: ", regtype, regid) + f.write(" TCGv_i64 %s%sV =3D get_result_gpr_pair(ctx, %s);\n" % \ + (regtype, regid, regN)) =20 def genptr_decl_writable(f, tag, regtype, regid, regno): regN=3D"%s%sN" % (regtype,regid) - f.write(" TCGv %s%sV =3D tcg_temp_local_new();\n" % \ - (regtype, regid)) - if (regtype =3D=3D "C"): + if (regtype =3D=3D "R"): + f.write(" const int %s =3D insn->regno[%d];\n" % (regN, regno)) + f.write(" TCGv %s%sV =3D get_result_gpr(ctx, %s);\n" % \ + (regtype, regid, regN)) + elif (regtype =3D=3D "C"): f.write(" const int %s =3D insn->regno[%d] + HEX_REG_SA0;\n" % \ (regN, regno)) - else: + f.write(" TCGv %s%sV =3D get_result_gpr(ctx, %s);\n" % \ + (regtype, regid, regN)) + elif (regtype =3D=3D "P"): f.write(" const int %s =3D insn->regno[%d];\n" % (regN, regno)) + f.write(" TCGv %s%sV =3D tcg_temp_local_new();\n" % \ + (regtype, regid)) + else: + print("Bad register parse: ", regtype, regid) =20 def genptr_decl(f, tag, regtype, regid, regno): regN=3D"%s%sN" % (regtype,regid) @@ -250,11 +260,9 @@ def genptr_decl_imm(f,immlett): =20 def genptr_free(f, tag, regtype, regid, regno): if (regtype =3D=3D "R"): - if (regid in {"dd", "ss", "tt", "xx", "yy"}): + if (regid in {"ss", "tt"}): f.write(" tcg_temp_free_i64(%s%sV);\n" % (regtype, regid)) - elif (regid in {"d", "e", "x", "y"}): - f.write(" tcg_temp_free(%s%sV);\n" % (regtype, regid)) - elif (regid not in {"s", "t", "u", "v"}): + elif (regid not in {"dd", "xx", "yy", "d", "e", "x", "y", "s", "t"= , "u", "v"}): print("Bad register parse: ",regtype,regid) elif (regtype =3D=3D "P"): if (regid in {"d", "e", "x"}): @@ -262,11 +270,9 @@ def genptr_free(f, tag, regtype, regid, regno): elif (regid not in {"s", "t", "u", "v"}): print("Bad register parse: ",regtype,regid) elif (regtype =3D=3D "C"): - if (regid in {"dd", "ss"}): + if (regid in {"ss"}): f.write(" tcg_temp_free_i64(%s%sV);\n" % (regtype, regid)) - elif (regid in {"d", "s"}): - f.write(" tcg_temp_free(%s%sV);\n" % (regtype, regid)) - else: + elif (regid not in {"dd", "d", "s"}): print("Bad register parse: ",regtype,regid) elif (regtype =3D=3D "M"): if (regid !=3D "u"): @@ -434,25 +440,16 @@ def gen_helper_call_imm(f,immlett): f.write(", tcgv_%s" % hex_common.imm_name(immlett)) =20 def genptr_dst_write_pair(f, tag, regtype, regid): - if ('A_CONDEXEC' in hex_common.attribdict[tag]): - f.write(" gen_log_predicated_reg_write_pair(%s%sN, %s%sV, insn-= >slot);\n" % \ - (regtype, regid, regtype, regid)) - else: - f.write(" gen_log_reg_write_pair(%s%sN, %s%sV);\n" % \ - (regtype, regid, regtype, regid)) + f.write(" gen_log_reg_write_pair(%s%sN, %s%sV);\n" % \ + (regtype, regid, regtype, regid)) =20 def genptr_dst_write(f, tag, regtype, regid): if (regtype =3D=3D "R"): if (regid in {"dd", "xx", "yy"}): genptr_dst_write_pair(f, tag, regtype, regid) elif (regid in {"d", "e", "x", "y"}): - if ('A_CONDEXEC' in hex_common.attribdict[tag]): - f.write(" gen_log_predicated_reg_write(%s%sN, %s%sV,\n"= % \ - (regtype, regid, regtype, regid)) - f.write(" insn->slot);\n") - else: - f.write(" gen_log_reg_write(%s%sN, %s%sV);\n" % \ - (regtype, regid, regtype, regid)) + f.write(" gen_log_reg_write(%s%sN, %s%sV);\n" % \ + (regtype, regid, regtype, regid)) else: print("Bad register parse: ", regtype, regid) elif (regtype =3D=3D "P"): --=20 2.17.1