From patchwork Sat Feb 25 09:13:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656510 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp1359205wrb; Sat, 25 Feb 2023 01:27:17 -0800 (PST) X-Google-Smtp-Source: AK7set+0773Wb3EmpCR8o2o5JKLKcL0FpSGscMmg48mQSQG7/B/y9ezktXGjZHmMoXBhesQM+FGc X-Received: by 2002:ac8:7e93:0:b0:3b8:6bab:1e4d with SMTP id w19-20020ac87e93000000b003b86bab1e4dmr35408341qtj.51.1677317237102; Sat, 25 Feb 2023 01:27:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677317237; cv=none; d=google.com; s=arc-20160816; b=iSSNoCb+JhtksrBotQHfTzxYD/UtTl5SuDAXQIHf6vz3JmW1EyjBGn+69Hqz456rRX MzPqvc3nLaDuLZUKS2+jo1TJM9bvYorShoX0ANwvJsznXL89YL8pRzkgNn32cp5pbFLt LyDTjbUQks8n2XYPW/Sljqn0dseoqdVCCZ88Bdqg6WO5nT0+rCyIw5snUOXki/sc5JLf ZY0KLldn+y6GO4qkmC5752hdtf46l0iWutSkPlMxA6sTopn/tmFXkIonHZhNyIbk11lf hU1/l3Qi4l2AaWcL/sPQkgm3GCCly05602Bh5slgRJtG04A5XchvvzvAw78CdArCnq/F Yg0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7rXk1sKSqinlJBrFL9P/VMnnxUDcgz/M8L7XKzjlIwM=; b=nBulKmvveorZLblpHjQj34/oHxlMqnpyj3K5Y2nomGTzvfVW8rjbBj78Mb2izwTnti p7Rr3b6haRqxTsdYt/QXj4U/2dben1RwfoT8SSsPb/TvKD1ZIQe483WR9XbqXALQe3Ml pUfZju1ky+YgrLvoRV+TKMaeAuyx/2CsPYhKV79S7/XLp9nNom5Z9sy2uWkSubnTDN9h TNjfnp8aGzoUzLwLJ1T1aJPUq4BwclpgvFaQE9GDPl9OK3JyqWtMC0mWPL1+91mnvhv0 kVZslMt8+1t3yfjD8ecwIWqBsSLIV1PQLkDQJRmorud8PclNxyMDuALXQXxbEtbxrIW6 ApBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KtrkV8Br; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j17-20020ac85f91000000b003a50cce8f82si1623158qta.299.2023.02.25.01.27.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Feb 2023 01:27:17 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KtrkV8Br; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVqdx-0004ru-C8; Sat, 25 Feb 2023 04:15:01 -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 1pVqdv-0004pm-Um for qemu-devel@nongnu.org; Sat, 25 Feb 2023 04:14:59 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVqds-0001Rc-EC for qemu-devel@nongnu.org; Sat, 25 Feb 2023 04:14:59 -0500 Received: by mail-pl1-x629.google.com with SMTP id n6so493416plf.5 for ; Sat, 25 Feb 2023 01:14:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7rXk1sKSqinlJBrFL9P/VMnnxUDcgz/M8L7XKzjlIwM=; b=KtrkV8BrlUDhgiWkKXhfJ+IjkikHl7XTjLl+UBKFkvKc7TaxwwJ9CvHBzhXE0wQB2m 2jEAG+sE2ysGeN9gL+BKh6+TyN7XOlIW09PacKbM4/NRgvUQ0QB5tbWx2ZoFs8qZVKKr dI0LKxHUqSBiZkyZF0NE7eLjX6htiHhOHdPVC/Qzx6ULqzpRLwUzX9ccYP0og8FTrU9+ Fv9SA5zWeL/VfCeY9Yx0av1rttXX49XOuIJyvN5XaYP2aUGRDpYAJoLO6jUfVHtW/vwc ES2VNyT1KV9SmJ0kOX8HR1vjDCLLhadyrZ578c2WsjQaLtiQcwKpcfOe5RMphXrxMaci tbGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7rXk1sKSqinlJBrFL9P/VMnnxUDcgz/M8L7XKzjlIwM=; b=duBxQfTIVZYWi6m1/HBituXLCU0bicEon2lvPmdcZO0a5Gae3spigLitP9JNhfBrUd e5cYBfA7tT6S9U17O+77b95WKGelmyLvffBpTwQ4nW6J2N12c/Zj8onZtXW9TcbVS4ed Bv+xf4tWWE1ycMJEJQtnDfkeNggXKH9HxnoBrerHfdSuZmv6jtfyoNBWSzlw83MQG3Nd POZBShdnafL1CSnno70y77hWk3pL+9dvjbIEHDTMqXnlUOnwSNr9K9V/cwZ8yHWeWlGj yw2yB7sYP1qfp5iW0ORcGmkkPk38AO+qUJ/GDUiNQTNj8TCRVn6clOWueCdH+hCs8LQ5 BFTg== X-Gm-Message-State: AO0yUKWC7wqoLYFegWzB/g/kIsP8Zxq2GuinJEaS9KPi13d2osYZ4DQ4 qESmxNIhi5eEpR7LZmSA+j/sYjxSCm08F/PiFEs= X-Received: by 2002:a17:903:2291:b0:19a:b427:2335 with SMTP id b17-20020a170903229100b0019ab4272335mr22851992plh.56.1677316495628; Sat, 25 Feb 2023 01:14:55 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id je12-20020a170903264c00b0019607aeda8bsm831101plb.73.2023.02.25.01.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 01:14:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, jcmvbkbc@gmail.com, kbastian@mail.uni-paderborn.de, ysato@users.sourceforge.jp, gaosong@loongson.cn, jiaxun.yang@flygoat.com, tsimpson@quicinc.com, ale@rev.ng, mrolnik@gmail.com, edgar.iglesias@gmail.com Subject: [PATCH 09/76] target/arm: Drop new_tmp_a64_zero Date: Fri, 24 Feb 2023 23:13:20 -1000 Message-Id: <20230225091427.1817156-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230225091427.1817156-1-richard.henderson@linaro.org> References: <20230225091427.1817156-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Only the use within cpu_reg requires a writable temp, so inline new_tmp_a64_zero there. All other uses are fine with a constant temp, so use tcg_constant_i64(0). Signed-off-by: Richard Henderson --- target/arm/translate-a64.h | 1 - target/arm/translate-a64.c | 41 +++++++++++++++++--------------------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h index 8ac126991f..0576c4ea12 100644 --- a/target/arm/translate-a64.h +++ b/target/arm/translate-a64.h @@ -18,7 +18,6 @@ #ifndef TARGET_ARM_TRANSLATE_A64_H #define TARGET_ARM_TRANSLATE_A64_H -TCGv_i64 new_tmp_a64_zero(DisasContext *s); TCGv_i64 cpu_reg(DisasContext *s, int reg); TCGv_i64 cpu_reg_sp(DisasContext *s, int reg); TCGv_i64 read_cpu_reg(DisasContext *s, int reg, int sf); diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 04872d9925..b5d6508cbc 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -408,13 +408,6 @@ static void gen_goto_tb(DisasContext *s, int n, int64_t diff) } } -TCGv_i64 new_tmp_a64_zero(DisasContext *s) -{ - TCGv_i64 t = tcg_temp_new_i64(); - tcg_gen_movi_i64(t, 0); - return t; -} - /* * Register access functions * @@ -433,7 +426,9 @@ TCGv_i64 new_tmp_a64_zero(DisasContext *s) TCGv_i64 cpu_reg(DisasContext *s, int reg) { if (reg == 31) { - return new_tmp_a64_zero(s); + TCGv_i64 t = tcg_temp_new_i64(); + tcg_gen_movi_i64(t, 0); + return t; } else { return cpu_X[reg]; } @@ -1532,7 +1527,7 @@ static void handle_hint(DisasContext *s, uint32_t insn, case 0b11000: /* PACIAZ */ if (s->pauth_active) { gen_helper_pacia(cpu_X[30], cpu_env, cpu_X[30], - new_tmp_a64_zero(s)); + tcg_constant_i64(0)); } break; case 0b11001: /* PACIASP */ @@ -1543,7 +1538,7 @@ static void handle_hint(DisasContext *s, uint32_t insn, case 0b11010: /* PACIBZ */ if (s->pauth_active) { gen_helper_pacib(cpu_X[30], cpu_env, cpu_X[30], - new_tmp_a64_zero(s)); + tcg_constant_i64(0)); } break; case 0b11011: /* PACIBSP */ @@ -1554,7 +1549,7 @@ static void handle_hint(DisasContext *s, uint32_t insn, case 0b11100: /* AUTIAZ */ if (s->pauth_active) { gen_helper_autia(cpu_X[30], cpu_env, cpu_X[30], - new_tmp_a64_zero(s)); + tcg_constant_i64(0)); } break; case 0b11101: /* AUTIASP */ @@ -1565,7 +1560,7 @@ static void handle_hint(DisasContext *s, uint32_t insn, case 0b11110: /* AUTIBZ */ if (s->pauth_active) { gen_helper_autib(cpu_X[30], cpu_env, cpu_X[30], - new_tmp_a64_zero(s)); + tcg_constant_i64(0)); } break; case 0b11111: /* AUTIBSP */ @@ -2285,7 +2280,7 @@ static void disas_uncond_b_reg(DisasContext *s, uint32_t insn) if (op4 != 0x1f) { goto do_unallocated; } - modifier = new_tmp_a64_zero(s); + modifier = tcg_constant_i64(0); } if (s->pauth_active) { dst = tcg_temp_new_i64(); @@ -3550,10 +3545,10 @@ static void disas_ldst_pac(DisasContext *s, uint32_t insn, if (s->pauth_active) { if (use_key_a) { gen_helper_autda(dirty_addr, cpu_env, dirty_addr, - new_tmp_a64_zero(s)); + tcg_constant_i64(0)); } else { gen_helper_autdb(dirty_addr, cpu_env, dirty_addr, - new_tmp_a64_zero(s)); + tcg_constant_i64(0)); } } @@ -5628,7 +5623,7 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) goto do_unallocated; } else if (s->pauth_active) { tcg_rd = cpu_reg(s, rd); - gen_helper_pacia(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + gen_helper_pacia(tcg_rd, cpu_env, tcg_rd, tcg_constant_i64(0)); } break; case MAP(1, 0x01, 0x09): /* PACIZB */ @@ -5636,7 +5631,7 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) goto do_unallocated; } else if (s->pauth_active) { tcg_rd = cpu_reg(s, rd); - gen_helper_pacib(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + gen_helper_pacib(tcg_rd, cpu_env, tcg_rd, tcg_constant_i64(0)); } break; case MAP(1, 0x01, 0x0a): /* PACDZA */ @@ -5644,7 +5639,7 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) goto do_unallocated; } else if (s->pauth_active) { tcg_rd = cpu_reg(s, rd); - gen_helper_pacda(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + gen_helper_pacda(tcg_rd, cpu_env, tcg_rd, tcg_constant_i64(0)); } break; case MAP(1, 0x01, 0x0b): /* PACDZB */ @@ -5652,7 +5647,7 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) goto do_unallocated; } else if (s->pauth_active) { tcg_rd = cpu_reg(s, rd); - gen_helper_pacdb(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + gen_helper_pacdb(tcg_rd, cpu_env, tcg_rd, tcg_constant_i64(0)); } break; case MAP(1, 0x01, 0x0c): /* AUTIZA */ @@ -5660,7 +5655,7 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) goto do_unallocated; } else if (s->pauth_active) { tcg_rd = cpu_reg(s, rd); - gen_helper_autia(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + gen_helper_autia(tcg_rd, cpu_env, tcg_rd, tcg_constant_i64(0)); } break; case MAP(1, 0x01, 0x0d): /* AUTIZB */ @@ -5668,7 +5663,7 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) goto do_unallocated; } else if (s->pauth_active) { tcg_rd = cpu_reg(s, rd); - gen_helper_autib(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + gen_helper_autib(tcg_rd, cpu_env, tcg_rd, tcg_constant_i64(0)); } break; case MAP(1, 0x01, 0x0e): /* AUTDZA */ @@ -5676,7 +5671,7 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) goto do_unallocated; } else if (s->pauth_active) { tcg_rd = cpu_reg(s, rd); - gen_helper_autda(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + gen_helper_autda(tcg_rd, cpu_env, tcg_rd, tcg_constant_i64(0)); } break; case MAP(1, 0x01, 0x0f): /* AUTDZB */ @@ -5684,7 +5679,7 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) goto do_unallocated; } else if (s->pauth_active) { tcg_rd = cpu_reg(s, rd); - gen_helper_autdb(tcg_rd, cpu_env, tcg_rd, new_tmp_a64_zero(s)); + gen_helper_autdb(tcg_rd, cpu_env, tcg_rd, tcg_constant_i64(0)); } break; case MAP(1, 0x01, 0x10): /* XPACI */