From patchwork Mon Feb 27 05:41:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656920 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2230447wrb; Mon, 27 Feb 2023 00:20:40 -0800 (PST) X-Google-Smtp-Source: AK7set9Zmbtf7UERgvOv4RMi1Oqp5aRPkyuJkG4DcK6lCDaXaoKnjzw+gHCEwS3eUrLPXJ6gca0N X-Received: by 2002:a05:6214:2021:b0:570:bf43:47a with SMTP id 1-20020a056214202100b00570bf43047amr43108084qvf.1.1677486040525; Mon, 27 Feb 2023 00:20:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486040; cv=none; d=google.com; s=arc-20160816; b=IQG/aHAOJqicX7fnULJtbFbF7T/CibpDvs621zvdMsDo64HI5sgFzjFCARKb5kQWLM nODkCYff5Y8nAGRe22tBImYxLiJzNTHErd+9a3WaxPJ5LCl3udutxw/rRT0FQXKnSAoD KEqTwoTCifOYCO3hBnvxUCLRyMBhIQg61b9TTMAO81Igyg+YpNndJxjuI99rUDxJZ4B4 2zJKhXhW6MWPod29FowKyMCn+w7H5THNihMZTGDwHblOc+VqcS+BEmHHBa8pD5DUYg55 oa8k1M6N/29pYoU3qdu8Fz3eUeZr7p/KtUIHtoihpxAJLwtwDV6Iga97TcfcUbsiQycu QHmg== 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=Q/8HAAeS3hT4Bnex7q2APNTWH9x2zw557quwYCEIRaQ=; b=BoYMBmgvOlF1ZH0wWLDV/93CV3ge3b1nMOPh2tuvrS3+kLQWxwamfBh8tAy1awnuJt TL4f4kGaLrNqfL7WMKxwHYdJxNVb2WnRrh5wJ3DVOXkhqnM2BUL0YultRVXHypKfjsQo cLnboszKVq+kIkwVg6uJJJXtKKDSbXiQKEzyWfVr0+KB5j385IAe+O58a31ZVGNaNm0O or+79PK3AnJiTV0fcEI8+vzGzSudvr2cDfN3hxWQaG5+iVNMstbwaCC8gHAvZRGKhYwo XZVWiwkp6Fp+p/sMchNYJeSWK7NdI4298SIRfXLhUCeBbS7x1WhXLvOjJmKSyOYU8xKu r8OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u0+BkiBZ; 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 az31-20020a05620a171f00b00708fd79fac9si6356745qkb.122.2023.02.27.00.20.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:20:40 -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=u0+BkiBZ; 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 1pWWHl-0001eF-8U; Mon, 27 Feb 2023 00:42:53 -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 1pWWHi-0001Rz-4a for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:42:50 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWHg-0004k5-4i for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:42:49 -0500 Received: by mail-pg1-x535.google.com with SMTP id bn17so2832660pgb.10 for ; Sun, 26 Feb 2023 21:42:47 -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=Q/8HAAeS3hT4Bnex7q2APNTWH9x2zw557quwYCEIRaQ=; b=u0+BkiBZnKnGpUKZF44x1IuFytXnJ2DS20SB/3twp2hCMgwTQZDXltpCSdmHvd2Kmq 5u87pXXVvDU7RKFCGW2amrGmPB9Le+yT4mXoUk0a5rksZfSlTU50OMOGvkh+c+kyVtgj 5G/PTATXtWEZhRmxU3RrdOVMWfBRcxg7/+UGo6vSNqo6PudCmvlgz7Yt8gMxpCYAyWN4 UPvJNO6oSxEu6XNI6A/5ZTJAKu0xm/5QxAwBg4oXQCbgOf/fPvqL0M0C3cyDXNoGp5X6 4mecqsfzDG1ApX5fuuZfad+RdNMP++jCXx872rPiG3scYHcWD+NRZr1vR8Fb6t8REvt8 foUA== 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=Q/8HAAeS3hT4Bnex7q2APNTWH9x2zw557quwYCEIRaQ=; b=0sox44JS1jgu6SgX3mYrFfYienCTsNADEi5BXYRMEkiL3VLgt+CAlZN43STBDMtAfp 0OJUUXScI9b64sgUAbnq8a5vJXWSoy1UcINeRZk8MwbeG2NUmNWtv0qKazAlUDiqlGQZ UG92Mn1DV0C7NrhHmE59kBU7gp1JcQlN30S2ekUa9EJ9ywY7ktnTOqjFCMQdMyr1oZ/v pz1PEG84n2964V09vTqvtWbqx0CxPJebxbX3iGpqAhq3nKFuntexaYYDjqGJ+7QmT0Ww wb4bRkLOOjYcHlhzznvGWXMHR2QWga3mUdM/my1ASrmNp+Eht+2/7imVq0/usDHh9Z/3 0i+w== X-Gm-Message-State: AO0yUKW1FDtBBbDAxJPKvoywokTb0E3JVkVQunjDSdp/Y6KlPHNU1asw dC+w+YOkwNZJK0wRCtuC6LoeQ2YRD8vUBvb6qGs= X-Received: by 2002:a62:1bd2:0:b0:5ab:bf5d:a0d1 with SMTP id b201-20020a621bd2000000b005abbf5da0d1mr22325289pfb.7.1677476566772; Sun, 26 Feb 2023 21:42:46 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.42.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:42:46 -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 01/70] target/arm: Use rmode >= 0 for need_rmode Date: Sun, 26 Feb 2023 19:41:24 -1000 Message-Id: <20230227054233.390271-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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 Initialize rmode to -1 instead of keeping two variables. This is already used elsewhere in translate-a64.c. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/translate-a64.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index b1fa210d64..1c575de3e0 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -12133,7 +12133,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) int rn = extract32(insn, 5, 5); int rd = extract32(insn, 0, 5); bool need_fpstatus = false; - bool need_rmode = false; int rmode = -1; TCGv_i32 tcg_rmode; TCGv_ptr tcg_fpstatus; @@ -12283,7 +12282,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x7a: /* FCVTPU */ case 0x7b: /* FCVTZU */ need_fpstatus = true; - need_rmode = true; rmode = extract32(opcode, 5, 1) | (extract32(opcode, 0, 1) << 1); if (size == 3 && !is_q) { unallocated_encoding(s); @@ -12293,7 +12291,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x5c: /* FCVTAU */ case 0x1c: /* FCVTAS */ need_fpstatus = true; - need_rmode = true; rmode = FPROUNDING_TIEAWAY; if (size == 3 && !is_q) { unallocated_encoding(s); @@ -12352,7 +12349,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) case 0x19: /* FRINTM */ case 0x38: /* FRINTP */ case 0x39: /* FRINTZ */ - need_rmode = true; rmode = extract32(opcode, 5, 1) | (extract32(opcode, 0, 1) << 1); /* fall through */ case 0x59: /* FRINTX */ @@ -12364,7 +12360,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } break; case 0x58: /* FRINTA */ - need_rmode = true; rmode = FPROUNDING_TIEAWAY; need_fpstatus = true; if (size == 3 && !is_q) { @@ -12380,7 +12375,6 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) break; case 0x1e: /* FRINT32Z */ case 0x1f: /* FRINT64Z */ - need_rmode = true; rmode = FPROUNDING_ZERO; /* fall through */ case 0x5e: /* FRINT32X */ @@ -12406,12 +12400,12 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) return; } - if (need_fpstatus || need_rmode) { + if (need_fpstatus || rmode >= 0) { tcg_fpstatus = fpstatus_ptr(FPST_FPCR); } else { tcg_fpstatus = NULL; } - if (need_rmode) { + if (rmode >= 0) { tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); } else { @@ -12595,7 +12589,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } clear_vec_high(s, is_q, rd); - if (need_rmode) { + if (tcg_rmode) { gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); } } @@ -12625,9 +12619,8 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) int pass; TCGv_i32 tcg_rmode = NULL; TCGv_ptr tcg_fpstatus = NULL; - bool need_rmode = false; bool need_fpst = true; - int rmode; + int rmode = -1; if (!dc_isar_feature(aa64_fp16, s)) { unallocated_encoding(s); @@ -12676,27 +12669,22 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) case 0x3f: /* FRECPX */ break; case 0x18: /* FRINTN */ - need_rmode = true; only_in_vector = true; rmode = FPROUNDING_TIEEVEN; break; case 0x19: /* FRINTM */ - need_rmode = true; only_in_vector = true; rmode = FPROUNDING_NEGINF; break; case 0x38: /* FRINTP */ - need_rmode = true; only_in_vector = true; rmode = FPROUNDING_POSINF; break; case 0x39: /* FRINTZ */ - need_rmode = true; only_in_vector = true; rmode = FPROUNDING_ZERO; break; case 0x58: /* FRINTA */ - need_rmode = true; only_in_vector = true; rmode = FPROUNDING_TIEAWAY; break; @@ -12706,43 +12694,33 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) /* current rounding mode */ break; case 0x1a: /* FCVTNS */ - need_rmode = true; rmode = FPROUNDING_TIEEVEN; break; case 0x1b: /* FCVTMS */ - need_rmode = true; rmode = FPROUNDING_NEGINF; break; case 0x1c: /* FCVTAS */ - need_rmode = true; rmode = FPROUNDING_TIEAWAY; break; case 0x3a: /* FCVTPS */ - need_rmode = true; rmode = FPROUNDING_POSINF; break; case 0x3b: /* FCVTZS */ - need_rmode = true; rmode = FPROUNDING_ZERO; break; case 0x5a: /* FCVTNU */ - need_rmode = true; rmode = FPROUNDING_TIEEVEN; break; case 0x5b: /* FCVTMU */ - need_rmode = true; rmode = FPROUNDING_NEGINF; break; case 0x5c: /* FCVTAU */ - need_rmode = true; rmode = FPROUNDING_TIEAWAY; break; case 0x7a: /* FCVTPU */ - need_rmode = true; rmode = FPROUNDING_POSINF; break; case 0x7b: /* FCVTZU */ - need_rmode = true; rmode = FPROUNDING_ZERO; break; case 0x2f: /* FABS */ @@ -12775,11 +12753,11 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) return; } - if (need_rmode || need_fpst) { + if (rmode >= 0 || need_fpst) { tcg_fpstatus = fpstatus_ptr(FPST_FPCR_F16); } - if (need_rmode) { + if (rmode >= 0) { tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); } From patchwork Mon Feb 27 05:41:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656840 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2183895wrb; Sun, 26 Feb 2023 21:47:58 -0800 (PST) X-Google-Smtp-Source: AK7set9wv981byHObvpKQmu8bL5rP8VIVF82vGJ7xVSZul9oXtHo+XoSiVcbUZ1imLgnzXlojVBc X-Received: by 2002:a05:622a:306:b0:3bf:cae4:296c with SMTP id q6-20020a05622a030600b003bfcae4296cmr11912578qtw.65.1677476878699; Sun, 26 Feb 2023 21:47:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677476878; cv=none; d=google.com; s=arc-20160816; b=vVLanRmJHXgENR+ddnsZntNoJwkba4WhlIoOPq6btsYjfpR1MlnDhNa20WmJQJPfTj /Miqdv7BK6050FVbkXYXMhu3n4mul7BP9LSppZP3vHKM5KQp+xTzlL+wqR6+sR++dNJt qPEtsN7MSy2cwO0KZb4Lm5UybE6VrlMm5tKnPe8hGysgoXzkD15e15/Zh/khKpJpzXdE qTDNgtX8YbMBunCn9rW/wMl1vrd2MtXxVWsxlm6TGcz80OefmOvDYw8fWx+8cR9vVyP3 /dVboG9vLNaD/hUhk4ZmVFlwMJbBNJvz2TvquxPB3zf0FK0+AixhdQnfQ1lfltIJ2hr6 VEbQ== 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=0pAAJQpTXusO2gtYYECFwL93OVrfV+/mCd8k9ZuweJc=; b=fW/S88dH6o+HcpUZPTHcEF1Wb+yLswYOe3nC2lbsFcFF4trMKSmFjVREi5wgGrt6kl 8KHFf3NfHyVXC8mTdJxgB3XwWLRcRKzm7o2K/gLU9fhV4Pno6/cHJmHnDKqWO+TWrEZ8 i0Gvd3T+y8axyzNH5X7+X5iylKzxHICcoV0O7IDK4wDcbkAOEBpG2+ifjt7q/HqpmBWG QeuUn2YCm4AyLL+A3MRa5dZLNQ4yr0nvRlPidTZsJY52kYLTQBBAL0l88R3yBVzGsxQ+ kGWjtxRF6Yq0vfT0TZh41mcOY8Thx1GcD7bCaDiTpujNOn4T8IwDzjmgfs8UpPvRu+B0 ZeYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l72pf3K+; 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 f8-20020ac840c8000000b003bfa6729633si5057118qtm.316.2023.02.26.21.47.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:47:58 -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=l72pf3K+; 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 1pWWHn-0001kj-9a; Mon, 27 Feb 2023 00:42:55 -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 1pWWHk-0001ax-9R for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:42:52 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWHi-0004lT-OK for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:42:51 -0500 Received: by mail-pf1-x429.google.com with SMTP id c10so2154809pfv.13 for ; Sun, 26 Feb 2023 21:42:50 -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=0pAAJQpTXusO2gtYYECFwL93OVrfV+/mCd8k9ZuweJc=; b=l72pf3K+0P8HFUOJ3ikYaBCT7Py0e11WlKG6xrkJG3v1JAzC3zgQzGJ1uFLmLbzS1t VMZ+OnN0z4/Kt/qAvaIzPAwO6KA171Vh92VeXvE3SnxkuJ1hs5SJE27Bd45iVvmkBd8A MpNYeT6vcBrKVnRFVcFAsRlPvwPsTGXo2FIsaFADpUT0qNCMQ5IL35VZS0hVw34A7Tv3 PonTlT9Y+z/yNlsMvKtddu38aeD0BV1A2xPYUPJtvxus2nxkkL3MZr24k6tjeLQKnDN5 H3CCJgas6M0gtNl3Ephmirh0w93IcxcxIoQ0VMn8I2KbngVQakjVdtZiiIEOCMrJHiav 3M/Q== 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=0pAAJQpTXusO2gtYYECFwL93OVrfV+/mCd8k9ZuweJc=; b=T1568r9mTxfpRgIfvm+2seYdd4nxRfO2x4jGOX6n+grlA+ud1xvxMDXwkLC5xvdHCI Hn5rzz4GY4VLvj9Bd50fWGnuu/StHiEl9jekrRr/ye1V5vesIz6Lobqv5fZha6fVfqQn myJCjni8oyTAcddKV2kn/BVG/MpZVyVeXqy/rW7ZndW7RtG4D54EsQvtY5UYTVdbaeD9 EdR9ilumm4SCc1RwS5OJWMFUWBsLNUFWRbjiSbgniJmCQcgJ7Yiaiy/AsxXg/7VRBJY7 YdewKfAokDUBF6X9LDNx6CO+XfajmvHjTR6RSel2VMnIMXpx9+vjXAcTlglF2GjtbnnF uIow== X-Gm-Message-State: AO0yUKU4PgCa5xHvikZNnHlvLYJh/Ubq3awb+72C8rGBUUjDUKoYgiYA /U3shudKp4AuYpAi41x4tlP96wLJCj7WbcQ1o8Q= X-Received: by 2002:a62:19cc:0:b0:5e2:434d:116b with SMTP id 195-20020a6219cc000000b005e2434d116bmr9630626pfz.23.1677476569461; Sun, 26 Feb 2023 21:42:49 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:42:49 -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 02/70] target/arm: Handle FPROUNDING_ODD in arm_rmode_to_sf Date: Sun, 26 Feb 2023 19:41:25 -1000 Message-Id: <20230227054233.390271-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org While this enumerator has been present since the first commit, it isn't ever used. The first actual use of round-to-odd came with SVE, which currently uses float_round_to_odd instead of the arm-specific enumerator. Amusingly, the comment about unhandled TIEAWAY has been out of date since the initial commit of translate-a64.c. Signed-off-by: Richard Henderson --- target/arm/vfp_helper.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c index 24e3d820a5..90cc324f71 100644 --- a/target/arm/vfp_helper.c +++ b/target/arm/vfp_helper.c @@ -1111,10 +1111,8 @@ int arm_rmode_to_sf(int rmode) rmode = float_round_ties_away; break; case FPROUNDING_ODD: - /* FIXME: add support for TIEAWAY and ODD */ - qemu_log_mask(LOG_UNIMP, "arm: unimplemented rounding mode: %d\n", - rmode); - /* fall through for now */ + rmode = float_round_to_odd; + break; case FPROUNDING_TIEEVEN: default: rmode = float_round_nearest_even; From patchwork Mon Feb 27 05:41:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656852 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2184601wrb; Sun, 26 Feb 2023 21:50:34 -0800 (PST) X-Google-Smtp-Source: AK7set8fn8h8Scd+95MzMbfQbvN/sh9WhsUdNGDJaSRQ3NNfybYCyqn5u2SvmeQP7zQGCga1KjLE X-Received: by 2002:ac8:7c50:0:b0:3bf:c5d8:d94 with SMTP id o16-20020ac87c50000000b003bfc5d80d94mr10763031qtv.2.1677477034627; Sun, 26 Feb 2023 21:50:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477034; cv=none; d=google.com; s=arc-20160816; b=ytZ9tEZIFV8qSkunil4frfvxzLmKH9DzYv0/UsoBZemVJQ75Y5Xwl/imXyuOHAJsno 4YqlNe1cmWiZ4nleb9cGX2jMeVz7iAaqAB7QOKQ6IGoNSfqo5tb5wcwaTN5f8VF7qgD0 D8b+MMDOpe616DJ6pW26v5j+6+Ub8nXVNuJ180cYHydtVtcDaJwVe+xoSNuy/ddq7dmt 9GIwZrPYUtng7/muOpyvxfddQGRN5+hZIKAcilqXjwbvpbFCqmCoKJA0BsSZ9WXoMTQZ +Bih3kidB88OUtJF5EY70m+3GBIsBZhAHyhQUeIoiEK7bZZ2Wo1bZkCbVbI19PIIjZR1 aySg== 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=0WSSf76yO4ky84ChGadZWB86T9ItD/RboRX03rlB3p8=; b=CrEbzO7ufZ8iizW5DCvI58XhbYaYOdbZV2nYpN9bbT2sI0+FwUqVxvzEQVjSCaDd6e jKagbobJu6iOeG81KHK5M4ZOfkrozjyAjWhtQh4m0MKC4QmMRyPfeVM+HCW7T0DEN6KQ 0/hf3R/OMMm5CnfNI/ZrHwt9Ksam1kDApcab39+ValwpZc5Z2+l1Zk931jSCui2t2CTj o4n1fjguzBwCQ9jrOVkJQxmTYz+OmlICklwCCge5D7bhFLr7/hAEs78Kn/zLgRinvKn7 l6B/jwcIJil0wZu0QpYQ2DHuw1/sFX+iSLU22mFML2/7+Uy7jvS/SqlgGN5pAeU+jnCV LfCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="W/MAG9BR"; 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 h16-20020ac85850000000b003bfc352677esi6274915qth.472.2023.02.26.21.50.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:50:34 -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="W/MAG9BR"; 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 1pWWHq-00023D-70; Mon, 27 Feb 2023 00:42:58 -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 1pWWHo-0001um-Ea for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:42:56 -0500 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWHl-0004nL-Pg for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:42:56 -0500 Received: by mail-pg1-x529.google.com with SMTP id q23so2845501pgt.7 for ; Sun, 26 Feb 2023 21:42:53 -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=0WSSf76yO4ky84ChGadZWB86T9ItD/RboRX03rlB3p8=; b=W/MAG9BRHJ/aNWhr0Ig2EdraVGHK4+Q4hMBfcKI8k/KX+Hy7UGUpxkVnaBKCwmJ8Br fxeiysALdypYmh8E0V1Z53PYkHJQ0sMTKiS+JxgCP2z++ZNou1dDC1SCTrSOYd4no8BO pmDz6VVmghL+XJrSwvIscP0x9iJyGW1pel6gKZdYTRbmERavBLwaJR3rounfc4/VYgZ3 ZSaMURboA3lgJfx2bCpZWKEzyBwbhZmXN3/K+XMCVNCLxa83vuIGEmH0tAGBa/J2wERF 3Iu1VtJct1IUzKBlc0BysouKk2EfzKlKPwNvlqjftetNCL456gQjXxB4Mm/qnVBDo5df gcBg== 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=0WSSf76yO4ky84ChGadZWB86T9ItD/RboRX03rlB3p8=; b=uQEimJwpjMRvKnj9drU82dQMGLHWE1XyaLM269YVhyIle8G7Enwc9UUg3VkUZIptNB cAfZ3ILS0R9644pYsWO49SqxqsrYb5/hIL3udRpbpBoM+fRRJsx4z4wIkbj3h9yZz0gS bI4zGzKFy+hBu29wZZj6+LfEj408OrEKGAPnXTodP9IYs5StgvHQV0Dtc8qaKjs7nPIb GA65TooytKoaOiHlDI53qS5SiiHUrguODMshhO8NJO/bN75hSrCJ8LhDVIPw+IQ7vH5n D6pcTKkXbucXoLQzIswdz3LqG9c6ZLJNOVxrLU3pvbOgJbj309BIP4NCvCL3CT9e1T26 Q91g== X-Gm-Message-State: AO0yUKUfiPUAkKNrDcI61GOb36NZSFMC7t3DNpdz6OgyfVbicQBzrde8 giqgeAUN1QYD49utUVt0wpOx/7IpI30AB6O1LHE= X-Received: by 2002:a62:1a49:0:b0:5a8:ae60:eb4a with SMTP id a70-20020a621a49000000b005a8ae60eb4amr19138845pfa.28.1677476572237; Sun, 26 Feb 2023 21:42:52 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:42:51 -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 03/70] target/arm: Improve arm_rmode_to_sf Date: Sun, 26 Feb 2023 19:41:26 -1000 Message-Id: <20230227054233.390271-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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 Use proper enumeration types for input and output. Use a const array to perform the mapping, with an assert that the input is valid. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/internals.h | 12 +++++++++--- target/arm/translate-mve.c | 2 +- target/arm/vfp_helper.c | 33 ++++++++------------------------- 3 files changed, 18 insertions(+), 29 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index 759b70c646..47d3c32825 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -193,16 +193,22 @@ void arm_restore_state_to_opc(CPUState *cs, void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb); #endif /* CONFIG_TCG */ -enum arm_fprounding { +typedef enum ARMFPRounding { FPROUNDING_TIEEVEN, FPROUNDING_POSINF, FPROUNDING_NEGINF, FPROUNDING_ZERO, FPROUNDING_TIEAWAY, FPROUNDING_ODD -}; +} ARMFPRounding; -int arm_rmode_to_sf(int rmode); +extern const FloatRoundMode arm_rmode_to_sf_map[6]; + +static inline FloatRoundMode arm_rmode_to_sf(ARMFPRounding rmode) +{ + assert((unsigned)rmode < ARRAY_SIZE(arm_rmode_to_sf_map)); + return arm_rmode_to_sf_map[rmode]; +} static inline void aarch64_save_sp(CPUARMState *env, int el) { diff --git a/target/arm/translate-mve.c b/target/arm/translate-mve.c index 798b4fddfe..9744bf3de0 100644 --- a/target/arm/translate-mve.c +++ b/target/arm/translate-mve.c @@ -588,7 +588,7 @@ DO_VCVT(VCVT_FS, vcvt_hs, vcvt_fs) DO_VCVT(VCVT_FU, vcvt_hu, vcvt_fu) static bool do_vcvt_rmode(DisasContext *s, arg_1op *a, - enum arm_fprounding rmode, bool u) + ARMFPRounding rmode, bool u) { /* * Handle VCVT fp to int with specified rounding mode. diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c index 90cc324f71..36906db8e0 100644 --- a/target/arm/vfp_helper.c +++ b/target/arm/vfp_helper.c @@ -1104,31 +1104,14 @@ float64 HELPER(rintd)(float64 x, void *fp_status) } /* Convert ARM rounding mode to softfloat */ -int arm_rmode_to_sf(int rmode) -{ - switch (rmode) { - case FPROUNDING_TIEAWAY: - rmode = float_round_ties_away; - break; - case FPROUNDING_ODD: - rmode = float_round_to_odd; - break; - case FPROUNDING_TIEEVEN: - default: - rmode = float_round_nearest_even; - break; - case FPROUNDING_POSINF: - rmode = float_round_up; - break; - case FPROUNDING_NEGINF: - rmode = float_round_down; - break; - case FPROUNDING_ZERO: - rmode = float_round_to_zero; - break; - } - return rmode; -} +const FloatRoundMode arm_rmode_to_sf_map[] = { + [FPROUNDING_TIEEVEN] = float_round_nearest_even, + [FPROUNDING_POSINF] = float_round_up, + [FPROUNDING_NEGINF] = float_round_down, + [FPROUNDING_ZERO] = float_round_to_zero, + [FPROUNDING_TIEAWAY] = float_round_ties_away, + [FPROUNDING_ODD] = float_round_to_odd, +}; /* * Implement float64 to int32_t conversion without saturation; From patchwork Mon Feb 27 05:41:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656906 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2229492wrb; Mon, 27 Feb 2023 00:17:35 -0800 (PST) X-Google-Smtp-Source: AK7set/LW3T/jkU7O3Krlr9ozLrLDIg2VmeHaF8HZSNbYrWboXF60eniZlzKdptX+VQ/e2ZJP4NV X-Received: by 2002:a05:6214:f2e:b0:56f:9d:1e29 with SMTP id iw14-20020a0562140f2e00b0056f009d1e29mr48504360qvb.21.1677485855507; Mon, 27 Feb 2023 00:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485855; cv=none; d=google.com; s=arc-20160816; b=hEBM5c0IHGRqSAsNGiE/FWIJZR+xfy3NQ50xy5PCdOs1AblzbEPH6he3RDCFXSfmzi 5Qnuffc0NK4eu71V8phlonzVGaIJhqL97adVR9tlIRDQzVb5SldZ7uuPFmTJd+JzTgaT a2tDA3oSfGHnv0zjviUDkBz4sGPiS9asuN/wy/9UHA33mqMDIHib04uIcx2Tk+BSUsRJ dFJMxQqQEug2G1DWZrdHz6ctP6eHO8JN+X02xD+26q7G74DZwpG63JuTyYrChJOYelZq ng9CUeZioUtls6HHaVP80+7uP3bALnxYYWb4o7/OPJTtWvTp0GgFY3HnlFancq8IpI7V 1Ytw== 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=dS1IiMxvN3PN6cOLh1bTyXU8CtedsGRsJAlzWKhUz38=; b=bdQk3ixMt+udTPxFRqg5M1St29OfIqVqXXIHZERbgLv40YIUTcn94pDozFuiKpxCA3 XvsKBMgbyw0jilf2gTQgxEApXCiaPyk4WpYrs77BQRjkpehVxYzx2dRzNGSgaukOC52B LgFIHmerKso9PmRyszOwg8t9p9byX++Erl10NeTaWyKP2ObH/WlsLzUPH2PE7G3sh6QP t1A7aU+XafjO9fW+IUJN2SKoYiFHxwrQg1qCS4AKxiyPYrI4C1A3d+kembkkAc1JmXwB I8SezCGuupxnIk3zgjoG6kE2xGGV5zeRNlMn6myBJoDnAsy2DzooCg8/pmMuIt8PPyRs 19XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PxM5EFzy; 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 k5-20020a0cf585000000b0053b81ec39f4si6008399qvm.462.2023.02.27.00.17.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:17:35 -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=PxM5EFzy; 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 1pWWHt-0002KB-2l; Mon, 27 Feb 2023 00:43: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 1pWWHr-00028S-0Q for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:42:59 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWHo-0004oV-GN for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:42:58 -0500 Received: by mail-pf1-x42a.google.com with SMTP id bd34so2807445pfb.3 for ; Sun, 26 Feb 2023 21:42:55 -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=dS1IiMxvN3PN6cOLh1bTyXU8CtedsGRsJAlzWKhUz38=; b=PxM5EFzydZoVsO47nVeNlB6okP5U3NE3ZqJDgRf4iUKYTc39XcEuxWN86DTGAn2Pg5 bcaaBzcSjYrT5tSjocGZXV2KYFFpOehbMGKO9zNO0mCGIYBEke92s+ablInOles2KqRf LPqZYQAxgdfJBWTUpyJUf1/7NL3R2Bm2pVW5CX8CGwTV94vJkYUGIFWzBzCJf/UMKBm4 JoJN7DMvGh79lmWx1lpC39P86YTr5QoPVyKACHNJEQFl/MAuaz3RfrnUFGlQ0/eix0AX Ak3W4gIcRck+4EFdtPIoZmPxUvbExaIcsJ3A72g6e0x+N9PAqNfG74Vk6on5O0mQvGRB uI8w== 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=dS1IiMxvN3PN6cOLh1bTyXU8CtedsGRsJAlzWKhUz38=; b=ttEgP9zuudihlHF1yK3t8x5LvPVt3xb2hFFOWGQb3J+H7wWayZiHygzdZYn+w0ARPG aaaz+kTThLpm7gI/857LZTB6NFzbvgGCUWtBIRvJzz6kEE7+MF63XTjAORblvCCeZEbq S3aSiXbzgb4/xhh2USZ0V9GiRxyLuC+FdNKEl4gOdBjtLY6ALnJ1J1hG/04Co8ZrOZQs IRhoQFujEhEk2Kmb548I0sXLXwepXELOFL7U0jJh7JHx9p3eZUbYtznz6cXPvCYUv2Uv ysdPmF7H1lTSi+G6qAnNQpQ19VZ0GaE2FRBPQ44DMD0J/q8LSbBJzZ3fLC3sFaw0Y+7e 7m6A== X-Gm-Message-State: AO0yUKU1qEu29/itVYXuNqIEPXQQIKcf1W+6c6hL7Us6uqiqcTiCOhSR G94loqPJuPOv1xGICQXrn5HDywmzZI6F9kTVndw= X-Received: by 2002:a05:6a00:47:b0:5cd:d766:8a2b with SMTP id i7-20020a056a00004700b005cdd7668a2bmr18698810pfk.6.1677476574927; Sun, 26 Feb 2023 21:42:54 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.42.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:42:54 -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 04/70] target/arm: Consistently use ARMFPRounding during translation Date: Sun, 26 Feb 2023 19:41:27 -1000 Message-Id: <20230227054233.390271-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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 In preparation for extracting new helpers, ensure that the rounding mode is represented as ARMFPRounding and not FloatRoundMode. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/translate-a64.c | 16 ++++++++-------- target/arm/translate-sve.c | 18 +++++++++--------- target/arm/translate-vfp.c | 6 +++--- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 1c575de3e0..3c0462a9c1 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -6202,7 +6202,7 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) case 0xa: /* FRINTM */ case 0xb: /* FRINTZ */ case 0xc: /* FRINTA */ - rmode = arm_rmode_to_sf(opcode & 7); + rmode = opcode & 7; gen_fpst = gen_helper_rints; break; case 0xe: /* FRINTX */ @@ -6212,14 +6212,14 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) gen_fpst = gen_helper_rints; break; case 0x10: /* FRINT32Z */ - rmode = float_round_to_zero; + rmode = FPROUNDING_ZERO; gen_fpst = gen_helper_frint32_s; break; case 0x11: /* FRINT32X */ gen_fpst = gen_helper_frint32_s; break; case 0x12: /* FRINT64Z */ - rmode = float_round_to_zero; + rmode = FPROUNDING_ZERO; gen_fpst = gen_helper_frint64_s; break; case 0x13: /* FRINT64X */ @@ -6231,7 +6231,7 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) fpst = fpstatus_ptr(FPST_FPCR); if (rmode >= 0) { - TCGv_i32 tcg_rmode = tcg_const_i32(rmode); + TCGv_i32 tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); gen_fpst(tcg_res, tcg_op, fpst); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); @@ -6275,7 +6275,7 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) case 0xa: /* FRINTM */ case 0xb: /* FRINTZ */ case 0xc: /* FRINTA */ - rmode = arm_rmode_to_sf(opcode & 7); + rmode = opcode & 7; gen_fpst = gen_helper_rintd; break; case 0xe: /* FRINTX */ @@ -6285,14 +6285,14 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) gen_fpst = gen_helper_rintd; break; case 0x10: /* FRINT32Z */ - rmode = float_round_to_zero; + rmode = FPROUNDING_ZERO; gen_fpst = gen_helper_frint32_d; break; case 0x11: /* FRINT32X */ gen_fpst = gen_helper_frint32_d; break; case 0x12: /* FRINT64Z */ - rmode = float_round_to_zero; + rmode = FPROUNDING_ZERO; gen_fpst = gen_helper_frint64_d; break; case 0x13: /* FRINT64X */ @@ -6304,7 +6304,7 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) fpst = fpstatus_ptr(FPST_FPCR); if (rmode >= 0) { - TCGv_i32 tcg_rmode = tcg_const_i32(rmode); + TCGv_i32 tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); gen_fpst(tcg_res, tcg_op, fpst); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 5bf80b22d7..3c65dd1ff2 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4082,7 +4082,7 @@ TRANS_FEAT(FRINTX, aa64_sve, gen_gvec_fpst_arg_zpz, frintx_fns[a->esz], a, 0, a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, - int mode, gen_helper_gvec_3_ptr *fn) + ARMFPRounding mode, gen_helper_gvec_3_ptr *fn) { unsigned vsz; TCGv_i32 tmode; @@ -4096,7 +4096,7 @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, } vsz = vec_full_reg_size(s); - tmode = tcg_const_i32(mode); + tmode = tcg_const_i32(arm_rmode_to_sf(mode)); status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); gen_helper_set_rmode(tmode, tmode, status); @@ -4111,15 +4111,15 @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, } TRANS_FEAT(FRINTN, aa64_sve, do_frint_mode, a, - float_round_nearest_even, frint_fns[a->esz]) + FPROUNDING_TIEEVEN, frint_fns[a->esz]) TRANS_FEAT(FRINTP, aa64_sve, do_frint_mode, a, - float_round_up, frint_fns[a->esz]) + FPROUNDING_POSINF, frint_fns[a->esz]) TRANS_FEAT(FRINTM, aa64_sve, do_frint_mode, a, - float_round_down, frint_fns[a->esz]) + FPROUNDING_NEGINF, frint_fns[a->esz]) TRANS_FEAT(FRINTZ, aa64_sve, do_frint_mode, a, - float_round_to_zero, frint_fns[a->esz]) + FPROUNDING_ZERO, frint_fns[a->esz]) TRANS_FEAT(FRINTA, aa64_sve, do_frint_mode, a, - float_round_ties_away, frint_fns[a->esz]) + FPROUNDING_TIEAWAY, frint_fns[a->esz]) static gen_helper_gvec_3_ptr * const frecpx_fns[] = { NULL, gen_helper_sve_frecpx_h, @@ -7145,9 +7145,9 @@ TRANS_FEAT(FCVTLT_sd, aa64_sve2, gen_gvec_fpst_arg_zpz, gen_helper_sve2_fcvtlt_sd, a, 0, FPST_FPCR) TRANS_FEAT(FCVTX_ds, aa64_sve2, do_frint_mode, a, - float_round_to_odd, gen_helper_sve_fcvt_ds) + FPROUNDING_ODD, gen_helper_sve_fcvt_ds) TRANS_FEAT(FCVTXNT_ds, aa64_sve2, do_frint_mode, a, - float_round_to_odd, gen_helper_sve2_fcvtnt_ds) + FPROUNDING_ODD, gen_helper_sve2_fcvtnt_ds) static gen_helper_gvec_3_ptr * const flogb_fns[] = { NULL, gen_helper_flogb_h, diff --git a/target/arm/translate-vfp.c b/target/arm/translate-vfp.c index 757a2bf7d9..e7acfb3338 100644 --- a/target/arm/translate-vfp.c +++ b/target/arm/translate-vfp.c @@ -2783,7 +2783,7 @@ static bool trans_VRINTZ_hp(DisasContext *s, arg_VRINTZ_sp *a) tmp = tcg_temp_new_i32(); vfp_load_reg32(tmp, a->vm); fpst = fpstatus_ptr(FPST_FPCR_F16); - tcg_rmode = tcg_const_i32(float_round_to_zero); + tcg_rmode = tcg_const_i32(arm_rmode_to_sf(FPROUNDING_ZERO)); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); gen_helper_rinth(tmp, tmp, fpst); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); @@ -2808,7 +2808,7 @@ static bool trans_VRINTZ_sp(DisasContext *s, arg_VRINTZ_sp *a) tmp = tcg_temp_new_i32(); vfp_load_reg32(tmp, a->vm); fpst = fpstatus_ptr(FPST_FPCR); - tcg_rmode = tcg_const_i32(float_round_to_zero); + tcg_rmode = tcg_const_i32(arm_rmode_to_sf(FPROUNDING_ZERO)); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); gen_helper_rints(tmp, tmp, fpst); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); @@ -2842,7 +2842,7 @@ static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) tmp = tcg_temp_new_i64(); vfp_load_reg64(tmp, a->vm); fpst = fpstatus_ptr(FPST_FPCR); - tcg_rmode = tcg_const_i32(float_round_to_zero); + tcg_rmode = tcg_const_i32(arm_rmode_to_sf(FPROUNDING_ZERO)); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); gen_helper_rintd(tmp, tmp, fpst); gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); From patchwork Mon Feb 27 05:41:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656916 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2230197wrb; Mon, 27 Feb 2023 00:19:52 -0800 (PST) X-Google-Smtp-Source: AK7set+D70IGam4D2wCYYjBZWchaS52EBVYTpDF5BfWjdXv4UEzu2Y/b+eMZ+7gKyreGfve/cGH3 X-Received: by 2002:ac8:5f86:0:b0:3bf:c5ab:a0db with SMTP id j6-20020ac85f86000000b003bfc5aba0dbmr12668134qta.41.1677485992075; Mon, 27 Feb 2023 00:19:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485992; cv=none; d=google.com; s=arc-20160816; b=HoM17IPsiaEEUwklYwCloNJ5O8zJqSSeF2bpuIdsI/v0uoW5kltYu8Xc+pmOB9wyrF wbyrVadgDY+PKYtTfUgcnroMr7Bw0+EPmpgpKiyWBImKi/WoxGnbBc2j+juZNxS2DKZO AQ76VLKgIdE9tOqdWUJRtNeUjPY1etSFb607Dptc0R/C2xwPzN2zrwdZDUZ1lx3Z8hWp EFWgRlokZVVj5eLYCZbNTrMnHjqqeCAE6Q15jUGU8o3zVuPBz8c6jLkGaxeRzSdjgCI6 I69ifZzXlPKH1a1pl2QYzGzvjzg1RX72TFUnguU1MXlvy1zbx+PNeRflCnGDpyqu5p53 MkvA== 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=J6bFQbr4bFP1rh4Nb5AKcYb/yq2BEfgRK7JPoiaNmaA=; b=wrqrKCVl8JlF8aQ1orE9EXkHMGtGPilb4g1RwFt0dCWZqsc8E27xy0dS6gYF2oxfWT 8tp+g4T9LAUT5w587i9A8WlyDors7eMFSLwVNIUmrQXwlD8p7k6XgGIOnP2pQWJAvghN FfhPk4mdQ8pFmEv/k1PwpV8aJyfYgrG0gsVaV09Vj5kn3pF7sKKxGxETWF7mLbq8nvLI jNAlQ3ybEoIDLPW2GdN/fy+yJ5xc8/WU8DlpryCrzWTDz8L08ldzcjNeRr/90Fz4EzHz w4PjECfPSVSnK1wHj7AykOnFrZguoUukfxFgJ1Mo0L5uR6Pj79dJnImZ2pD36tanPdnl zV3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CdPLsiuQ; 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 x11-20020a05620a448b00b0073ba0c2d2fbsi6729520qkp.404.2023.02.27.00.19.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:19:52 -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=CdPLsiuQ; 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 1pWWHx-0002X1-SJ; Mon, 27 Feb 2023 00:43:05 -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 1pWWHs-0002I6-Ey for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:00 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWHq-0004k1-8q for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:00 -0500 Received: by mail-pf1-x429.google.com with SMTP id ay18so2815085pfb.2 for ; Sun, 26 Feb 2023 21:42:57 -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=J6bFQbr4bFP1rh4Nb5AKcYb/yq2BEfgRK7JPoiaNmaA=; b=CdPLsiuQ19juWpyq14r/MO76tXcmg+ScjE9v9VqqyD6flMQpnFswRfylRCqikQCApK i5VKVDzGOrtUFcDBiRQmDS1Dq6/yi9fgyWzbu6B/xgk+aUqLjgb3ZkDizuDUYFSipyOp CC2d3IUMQlxf6rdHD7iitQiIWH95SeCYIfer/Y0yXnWiUd6k4Rt3IYQZIoxWqzR9dy8z 3aO8+mkwGrUNl8fiySV19x5ulWOytqCNoD9rO3Ws9sxGs3/iOridir+dcNQuQJ61LmPs CPIrWo2bHogZNJOOFjUhtuBr4UvP3HLgT0d3qoF5e6HoLOtUrWH/Sw80o0hNtkU2NRYZ Xb0Q== 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=J6bFQbr4bFP1rh4Nb5AKcYb/yq2BEfgRK7JPoiaNmaA=; b=oBNnGqqi5Xq2vcFNZgbaLuL09q7wgajW/q/KB6Z9RiPmdrMJPXItOuvnjBgKnndIz1 XP0P5rUwv2QImB9cQpDhFMprTm+EFy11bFmcTkt+pAvF72Pt+6tnseDSHN6aM+p8P3RH 3q1Sz+yWC5C2DuYAcyDIU2RuZa9qzQiDwFzQPCQu1nBlYjBRUuKNaBowCuyvVypG1SN0 3YMjKm6Pw1IUsP5WfExmxWCQ4kzpcK9FCQZWtEN3hAD8WBjBqKUohR7Z30JoZnREZqPT +B0mY29bIyACCaHYS9uAL54oLFSBScEbL6UqQy+OFdEgPVdyeIxybxyaucfGQa3gpHlH 7T7w== X-Gm-Message-State: AO0yUKUc6zIfqhOPFfpajm10aKgKiTbYPOet53NQAua4PAYr6eXDVnNC 4uzu+FduFpwrb2l54Tq0jiBrv/+oRIuGe60vwQU= X-Received: by 2002:aa7:958a:0:b0:5e1:f54e:8074 with SMTP id z10-20020aa7958a000000b005e1f54e8074mr10046437pfj.21.1677476577405; Sun, 26 Feb 2023 21:42:57 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.42.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:42:56 -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 05/70] target/arm: Create gen_set_rmode, gen_restore_rmode Date: Sun, 26 Feb 2023 19:41:28 -1000 Message-Id: <20230227054233.390271-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Split out common subroutines for handing rounding mode changes during translation. Use tcg_constant_i32 and tcg_temp_new_i32 instead of tcg_const_i32. Signed-off-by: Richard Henderson --- target/arm/translate.h | 17 ++++++++++++++ target/arm/translate-a64.c | 47 +++++++++++++++----------------------- target/arm/translate-sve.c | 6 ++--- target/arm/translate-vfp.c | 26 ++++++++------------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/target/arm/translate.h b/target/arm/translate.h index 3dbff87349..062f91de54 100644 --- a/target/arm/translate.h +++ b/target/arm/translate.h @@ -616,6 +616,23 @@ static inline TCGv_ptr gen_lookup_cp_reg(uint32_t key) return ret; } +/* + * Set and reset rounding mode around another operation. + */ +static inline TCGv_i32 gen_set_rmode(ARMFPRounding rmode, TCGv_ptr fpst) +{ + TCGv_i32 new = tcg_constant_i32(arm_rmode_to_sf(rmode)); + TCGv_i32 old = tcg_temp_new_i32(); + + gen_helper_set_rmode(old, new, fpst); + return old; +} + +static inline void gen_restore_rmode(TCGv_i32 old, TCGv_ptr fpst) +{ + gen_helper_set_rmode(old, old, fpst); +} + /* * Helpers for implementing sets of trans_* functions. * Defer the implementation of NAME to FUNC, with optional extra arguments. diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 3c0462a9c1..9e682f36c9 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -6146,13 +6146,12 @@ static void handle_fp_1src_half(DisasContext *s, int opcode, int rd, int rn) case 0xb: /* FRINTZ */ case 0xc: /* FRINTA */ { - TCGv_i32 tcg_rmode = tcg_const_i32(arm_rmode_to_sf(opcode & 7)); + TCGv_i32 tcg_rmode; + fpst = fpstatus_ptr(FPST_FPCR_F16); - - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + tcg_rmode = gen_set_rmode(opcode & 7, fpst); gen_helper_advsimd_rinth(tcg_res, tcg_op, fpst); - - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + gen_restore_rmode(tcg_rmode, fpst); break; } case 0xe: /* FRINTX */ @@ -6231,10 +6230,9 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) fpst = fpstatus_ptr(FPST_FPCR); if (rmode >= 0) { - TCGv_i32 tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + TCGv_i32 tcg_rmode = gen_set_rmode(rmode, fpst); gen_fpst(tcg_res, tcg_op, fpst); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + gen_restore_rmode(tcg_rmode, fpst); } else { gen_fpst(tcg_res, tcg_op, fpst); } @@ -6304,10 +6302,9 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) fpst = fpstatus_ptr(FPST_FPCR); if (rmode >= 0) { - TCGv_i32 tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + TCGv_i32 tcg_rmode = gen_set_rmode(rmode, fpst); gen_fpst(tcg_res, tcg_op, fpst); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + gen_restore_rmode(tcg_rmode, fpst); } else { gen_fpst(tcg_res, tcg_op, fpst); } @@ -6944,9 +6941,7 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode, rmode = FPROUNDING_TIEAWAY; } - tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); - - gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); + tcg_rmode = gen_set_rmode(rmode, tcg_fpstatus); switch (type) { case 1: /* float64 */ @@ -7023,7 +7018,7 @@ static void handle_fpfpcvt(DisasContext *s, int rd, int rn, int opcode, g_assert_not_reached(); } - gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); + gen_restore_rmode(tcg_rmode, tcg_fpstatus); } } @@ -8771,9 +8766,8 @@ static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar, assert(!(is_scalar && is_q)); - tcg_rmode = tcg_const_i32(arm_rmode_to_sf(FPROUNDING_ZERO)); tcg_fpstatus = fpstatus_ptr(size == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); + tcg_rmode = gen_set_rmode(FPROUNDING_ZERO, tcg_fpstatus); fracbits = (16 << size) - immhb; tcg_shift = tcg_constant_i32(fracbits); @@ -8831,7 +8825,7 @@ static void handle_simd_shift_fpint_conv(DisasContext *s, bool is_scalar, } } - gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); + gen_restore_rmode(tcg_rmode, tcg_fpstatus); } /* AdvSIMD scalar shift by immediate @@ -10219,12 +10213,11 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) } if (is_fcvt) { - tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); tcg_fpstatus = fpstatus_ptr(FPST_FPCR); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); + tcg_rmode = gen_set_rmode(rmode, tcg_fpstatus); } else { - tcg_rmode = NULL; tcg_fpstatus = NULL; + tcg_rmode = NULL; } if (size == 3) { @@ -10276,7 +10269,7 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn) } if (is_fcvt) { - gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); + gen_restore_rmode(tcg_rmode, tcg_fpstatus); } } @@ -12406,8 +12399,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) tcg_fpstatus = NULL; } if (rmode >= 0) { - tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); + tcg_rmode = gen_set_rmode(rmode, tcg_fpstatus); } else { tcg_rmode = NULL; } @@ -12590,7 +12582,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) clear_vec_high(s, is_q, rd); if (tcg_rmode) { - gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); + gen_restore_rmode(tcg_rmode, tcg_fpstatus); } } @@ -12758,8 +12750,7 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) } if (rmode >= 0) { - tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); + tcg_rmode = gen_set_rmode(rmode, tcg_fpstatus); } if (is_scalar) { @@ -12859,7 +12850,7 @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) } if (tcg_rmode) { - gen_helper_set_rmode(tcg_rmode, tcg_rmode, tcg_fpstatus); + gen_restore_rmode(tcg_rmode, tcg_fpstatus); } } diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 3c65dd1ff2..3ca60fb36b 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4096,17 +4096,15 @@ static bool do_frint_mode(DisasContext *s, arg_rpr_esz *a, } vsz = vec_full_reg_size(s); - tmode = tcg_const_i32(arm_rmode_to_sf(mode)); status = fpstatus_ptr(a->esz == MO_16 ? FPST_FPCR_F16 : FPST_FPCR); - - gen_helper_set_rmode(tmode, tmode, status); + tmode = gen_set_rmode(mode, status); tcg_gen_gvec_3_ptr(vec_full_reg_offset(s, a->rd), vec_full_reg_offset(s, a->rn), pred_full_reg_offset(s, a->pg), status, vsz, vsz, 0, fn); - gen_helper_set_rmode(tmode, tmode, status); + gen_restore_rmode(tmode, status); return true; } diff --git a/target/arm/translate-vfp.c b/target/arm/translate-vfp.c index e7acfb3338..dd782aacf4 100644 --- a/target/arm/translate-vfp.c +++ b/target/arm/translate-vfp.c @@ -464,8 +464,7 @@ static bool trans_VRINT(DisasContext *s, arg_VRINT *a) fpst = fpstatus_ptr(FPST_FPCR); } - tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rounding)); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + tcg_rmode = gen_set_rmode(rounding, fpst); if (sz == 3) { TCGv_i64 tcg_op; @@ -489,7 +488,7 @@ static bool trans_VRINT(DisasContext *s, arg_VRINT *a) vfp_store_reg32(tcg_res, rd); } - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + gen_restore_rmode(tcg_rmode, fpst); return true; } @@ -533,9 +532,7 @@ static bool trans_VCVT(DisasContext *s, arg_VCVT *a) } tcg_shift = tcg_constant_i32(0); - - tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rounding)); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + tcg_rmode = gen_set_rmode(rounding, fpst); if (sz == 3) { TCGv_i64 tcg_double, tcg_res; @@ -572,7 +569,7 @@ static bool trans_VCVT(DisasContext *s, arg_VCVT *a) vfp_store_reg32(tcg_res, rd); } - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + gen_restore_rmode(tcg_rmode, fpst); return true; } @@ -2783,10 +2780,9 @@ static bool trans_VRINTZ_hp(DisasContext *s, arg_VRINTZ_sp *a) tmp = tcg_temp_new_i32(); vfp_load_reg32(tmp, a->vm); fpst = fpstatus_ptr(FPST_FPCR_F16); - tcg_rmode = tcg_const_i32(arm_rmode_to_sf(FPROUNDING_ZERO)); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + tcg_rmode = gen_set_rmode(FPROUNDING_ZERO, fpst); gen_helper_rinth(tmp, tmp, fpst); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + gen_restore_rmode(tcg_rmode, fpst); vfp_store_reg32(tmp, a->vd); return true; } @@ -2808,10 +2804,9 @@ static bool trans_VRINTZ_sp(DisasContext *s, arg_VRINTZ_sp *a) tmp = tcg_temp_new_i32(); vfp_load_reg32(tmp, a->vm); fpst = fpstatus_ptr(FPST_FPCR); - tcg_rmode = tcg_const_i32(arm_rmode_to_sf(FPROUNDING_ZERO)); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + tcg_rmode = gen_set_rmode(FPROUNDING_ZERO, fpst); gen_helper_rints(tmp, tmp, fpst); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + gen_restore_rmode(tcg_rmode, fpst); vfp_store_reg32(tmp, a->vd); return true; } @@ -2842,10 +2837,9 @@ static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) tmp = tcg_temp_new_i64(); vfp_load_reg64(tmp, a->vm); fpst = fpstatus_ptr(FPST_FPCR); - tcg_rmode = tcg_const_i32(arm_rmode_to_sf(FPROUNDING_ZERO)); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + tcg_rmode = gen_set_rmode(FPROUNDING_ZERO, fpst); gen_helper_rintd(tmp, tmp, fpst); - gen_helper_set_rmode(tcg_rmode, tcg_rmode, fpst); + gen_restore_rmode(tcg_rmode, fpst); vfp_store_reg64(tmp, a->vd); return true; } From patchwork Mon Feb 27 05:41:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656890 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2227191wrb; Mon, 27 Feb 2023 00:10:03 -0800 (PST) X-Google-Smtp-Source: AK7set9UMzOUKrfItrhgbb2E3GLw+G7yZ4SQxddEDJHo3SLQqqOp6CjbKsFv/pLrGwReS+bakIGc X-Received: by 2002:a05:6214:d83:b0:56b:7ec7:b158 with SMTP id e3-20020a0562140d8300b0056b7ec7b158mr38300541qve.36.1677485403268; Mon, 27 Feb 2023 00:10:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485403; cv=none; d=google.com; s=arc-20160816; b=C89rljQBKhY2bmbYD593sEAoLAstzNiEbL40wxTpT0et7GtsPMgfiDzoCdzaG0SpVT fNXH3dNjBYkHap3QpyYOGeBy6ylDAb9JxYR74QOpK4gpWAE/GHR+ZvEboun3cKlHM2HU GH9A2u2sl3PJH1+P/6bBXhH8BLHjKaJOdx/u5AXHEMAV5dImEyk71TsYUhWdY/YffPun eedEzG+frfd7kLsTOqcW7e1VeVbnqKOQePK3QKHpsCadZhlZ9rwBsrdQMDQHM+89Mvwx j8vKFYbqMkT85Olm+sqskT5wn+zhzt+4Zwswc6+uBbRIC6a6rnn7N8xB0rdRk93j4fve RPBA== 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=0+GeilfFKKsm5WnLXBFyBAbE/3JXPiOJcMvh7tD7SqM=; b=YYFuUca5NeOPO+LaZkfAsZTBR8RoApIddlHuJTBt4y/li45lR/7lc5Ap3YCneR8c6T T1nVga4SXQlNYg3r10Mm62/Y7wbs7PrF9kjzgmW7UQZDM99woy1vOJ+Q42TJYh0cXZPT 9jkdaEVchBdR6oyY1789N5BKqlAnLR6TYntZ096qvxGc4wE2tVPwIdsjkbkbjW84JHRe UMVPrZ6hb/3DSbQFOKCBabmlhoMWpobKkHgZO+g4nlXkrHBauPXMfHEPrUOvENbtlLQg hffZJJRPKj3XXnKZxOFJS3H0mNm961wW35Elxwx/cRDJGbe33x4Rj+as+Z6ZJM/mXPB8 su2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JlLJq81a; 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 h18-20020a0cf452000000b00571ae4ba7absi5838312qvm.475.2023.02.27.00.10.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:10:03 -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=JlLJq81a; 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 1pWWI4-0002xW-Hs; Mon, 27 Feb 2023 00:43:12 -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 1pWWI1-0002qj-Im for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:10 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWHx-0004rO-51 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:09 -0500 Received: by mail-pl1-x62e.google.com with SMTP id bh1so5529596plb.11 for ; Sun, 26 Feb 2023 21:43:01 -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=0+GeilfFKKsm5WnLXBFyBAbE/3JXPiOJcMvh7tD7SqM=; b=JlLJq81aoJ9CD+Zkbg5co07+b8fAknE/f6ncCgivhmkFSxUjQnUvtOwD9lqcz8IuOl UjBHcAoYAyQYWXStHCAmdq32rZAsclOWVSRkgghz5N/u18Vf6UlXEyBD2sYq2DV62YvF 5JKHbo/VDUfWkWCfsCqJt2iygTUBhA6Ru9bWu7OmknGxAuT+J5K7lM19QJ9v4u+op4wT kC6XV9EAzvinaTE0y9tuEoBvSYMiZiUuH1enZtfS4fwhZ1isAtcgl912HcArXhXNzTO/ 0CtJA1UR2RhtpolyJzxKq6DFB7gPkXIGjZQ2QwB0g3NAYZJLAAo9/iDqqJipnpSHKEDo mnIQ== 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=0+GeilfFKKsm5WnLXBFyBAbE/3JXPiOJcMvh7tD7SqM=; b=KhvAOAT4AiGKASZpWYGiejGDdoAr0FmEh8V86ADhb3JLutGr3Yiuahk/br+HeFFuMq 0Jz/Pz+8t7ErhUdDiqxmDt3EnAHML9iCLiDIqdDr/Yr/OtXCaUblvlCILAD2BOQZTeGh ixWRDMAoLTzmtOfP226SmPUC68kAo2IRxwMZIDcN2ZLo1+0eh7whWMdLT0mp7ZG27Vy9 +Sq9MYSlf7ndQmKK+dhIJXHnN2WG/4r2Ns51IvBMdQyd4OaJL2i3rgFGZ1XH8pQllfkP YLqgHvo6pv+MtmcHA1ZLQ5VIfTFuGNuspKUWW/fBsD/RJUwVQ3b6BJTQq7I6IfJRnVXk hcfQ== X-Gm-Message-State: AO0yUKXJARrUtn2Fj5gfOOa1NMktQnwuvrifMg00ePpbm1GEaXrB/w+r Yplox6PcRgr73ElPJmkkuD0Lw9CJz5QdbziYTUU= X-Received: by 2002:a05:6a20:1443:b0:c3:cc65:165c with SMTP id a3-20020a056a20144300b000c3cc65165cmr18810060pzi.61.1677476579990; Sun, 26 Feb 2023 21:42:59 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:42:59 -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 06/70] target/arm: Improve trans_BFCI Date: Sun, 26 Feb 2023 19:41:29 -1000 Message-Id: <20230227054233.390271-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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 Reorg temporary usage so that we can use tcg_constant_i32. tcg_gen_deposit_i32 already has a width == 32 special case, so remove the check here. Signed-off-by: Richard Henderson --- target/arm/translate.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 645bcf8d0a..644a3257a2 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -7261,8 +7261,8 @@ static bool trans_UBFX(DisasContext *s, arg_UBFX *a) static bool trans_BFCI(DisasContext *s, arg_BFCI *a) { - TCGv_i32 tmp; int msb = a->msb, lsb = a->lsb; + TCGv_i32 t_in, t_rd; int width; if (!ENABLE_ARCH_6T2) { @@ -7277,16 +7277,13 @@ static bool trans_BFCI(DisasContext *s, arg_BFCI *a) width = msb + 1 - lsb; if (a->rn == 15) { /* BFC */ - tmp = tcg_const_i32(0); + t_in = tcg_constant_i32(0); } else { /* BFI */ - tmp = load_reg(s, a->rn); + t_in = load_reg(s, a->rn); } - if (width != 32) { - TCGv_i32 tmp2 = load_reg(s, a->rd); - tcg_gen_deposit_i32(tmp, tmp2, tmp, lsb, width); - } - store_reg(s, a->rd, tmp); + t_rd = load_reg(s, a->rd); + tcg_gen_deposit_i32(t_rd, t_rd, t_in, lsb, width); return true; } From patchwork Mon Feb 27 05:41:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656836 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2183730wrb; Sun, 26 Feb 2023 21:47:24 -0800 (PST) X-Google-Smtp-Source: AK7set8eMKW35sjy2N7gJ6PhKT/d4+pdkFsm6V4nljs1bC/zdpWt3f698T2f/7IXjN0cpC6ZRfxG X-Received: by 2002:ac8:5895:0:b0:3b9:bd05:bde1 with SMTP id t21-20020ac85895000000b003b9bd05bde1mr25847400qta.8.1677476844137; Sun, 26 Feb 2023 21:47:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677476844; cv=none; d=google.com; s=arc-20160816; b=WdxA55HuvX0w8T5JooX62OhqQ7aJAdY72+gsRtk1ioy6dXN+h2smi19gOmrWVZNhXf jJu8F4VqYt7Kq+D12nRknUDX1H52sVtGDqHyDbmkAYYI9B/Yp+jxfnqSNorimUX8eFMz 0VOOH03b25Qnl7KTfBtElg97K95YTzISJiKXdoSLKOnrXgTWZU95AxqWfe8nbTmm1xoe wNr8/cs3si5XlU8Yx8RK/Lt2MVtt8AJFK0KzE4Q9ZykKuH1AZbQI51S9p3q2/cal1hMn m/bGnBmIp1O2r3SgxP6wLNjRZUlHkEitt2M70IyxkejbfJ88oHQq4vr59ecEvJal+U9y IrTw== 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=dD1wamCoNKZFIfQmB4g+Cu58J9uOq8aDnkIyPrSbVuM=; b=k5jOKa2AF5Dlcnv+JSqE2qlMPmGggCjukQynWIiSGKuJCBfLcY+7cVz8AmheVaVXGW US8IoeFfxwrowMLoi5u0ww2o9useUy9m2ikPl057sTJ0m0nJgDpY9dO9TugnmWg3YJcL lfJevrFzozG7xggH1Ko0A13iSqcg26qdTwsLsbfD0EOd0mwG2OK02FN3DaTUaz0xoVPC lBTkL7Pup0PcaiEfY+3D5lTYwZfclt5TA8suewcnHagA7PCmIkm0jSpthljf/tw5y9zC aISBn//ssQ1h4YqMO7KQPK9gruKpcnTaOFPumV4DIAGb1pjMcozUyAvRL1Cf3Km4Ra0g ANaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="eVymLw/j"; 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 u4-20020a05620a430400b007252e186662si5778026qko.449.2023.02.26.21.47.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:47:24 -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="eVymLw/j"; 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 1pWWI2-0002rP-IK; Mon, 27 Feb 2023 00:43:10 -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 1pWWI0-0002mH-2W for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:08 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWHx-0004sG-1D for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:07 -0500 Received: by mail-pf1-x431.google.com with SMTP id a7so2783355pfx.10 for ; Sun, 26 Feb 2023 21:43:03 -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=dD1wamCoNKZFIfQmB4g+Cu58J9uOq8aDnkIyPrSbVuM=; b=eVymLw/jK+sSGk4aIbnExUx9TvZm0bM3vrf64rar+J3dm/GQxf77RGiOJ+CTdg5ovh 7zwh/AJcYtfuQNcUzTCCrpj+0ucjBC+N7dMoZkGnBCdlJyxe0KmO+zQ59Mw565yfd1DM DCxuRkcDPXdPczjlN2RBDyLFBuWeF5FOq+xJkdzMs/OwcPMCm+/0xJWbuGbwf2a5k1BM +4pSR1isgEnR57qrWxCzv13KQwcxD7stjRM8jgxgBzonkgRdNCyIFMQ1cD7qh3LokyOZ LInpfJspBe9qZncTchZ/Zq3ura8l3eTS4b/b0QfXZJVV62G7SWdlMkvg+KXrmKY8+kIT b1wQ== 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=dD1wamCoNKZFIfQmB4g+Cu58J9uOq8aDnkIyPrSbVuM=; b=yAUgEHaudFjL4dmWu06Kft+S4pHfpQcnf6TyCJfJS3i1NzQ3qQ5G+xeL0ZBw2UlzD2 4+UvYMeHqBCkt6jNVbcMR7S5djJDAe2gBvfZYgGhci95dAroWvRqwDQj7FNkP/Npjzgi ty3RudnnwJsTmzmv3YgBmp/7jzTs1ZFriPHqVOmh7JD7N4Xs7WdlX7Dsmx8KqcPuIsWW 8Hv4c9A7H1JpCkZ2a/RIU/Jbx/lTO9GhQUndYOMW2MXMA1ZiOskQ4fPRTBs2s9pGUw94 hDdygwsXKVazeht7/vZfhxmLlGJfHpB01WEk4B/k3TymcwGi7592sGCyFDBUKmDgEqb3 6QWQ== X-Gm-Message-State: AO0yUKVW6t1+UfVIC8wKu3DKsV6mIfDJBoE54nO5rYjUsypL4PbH2Dco YRRkTT/pVNTwmgpcA/3AGIWIHDPHybAo21uYdcY= X-Received: by 2002:aa7:9604:0:b0:5e0:1073:1f25 with SMTP id q4-20020aa79604000000b005e010731f25mr10677648pfg.7.1677476582559; Sun, 26 Feb 2023 21:43:02 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:02 -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 07/70] target/arm: Avoid tcg_const_ptr in gen_sve_{ldr,str} Date: Sun, 26 Feb 2023 19:41:30 -1000 Message-Id: <20230227054233.390271-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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 This hides the implicit initialization of a variable. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/translate-sve.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index 3ca60fb36b..92ab290106 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -4206,8 +4206,9 @@ void gen_sve_ldr(DisasContext *s, TCGv_ptr base, int vofs, } } else { TCGLabel *loop = gen_new_label(); - TCGv_ptr tp, i = tcg_const_ptr(0); + TCGv_ptr tp, i = tcg_temp_new_ptr(); + tcg_gen_movi_ptr(i, 0); gen_set_label(loop); t0 = tcg_temp_new_i64(); @@ -4284,8 +4285,9 @@ void gen_sve_str(DisasContext *s, TCGv_ptr base, int vofs, } } else { TCGLabel *loop = gen_new_label(); - TCGv_ptr tp, i = tcg_const_ptr(0); + TCGv_ptr tp, i = tcg_temp_new_ptr(); + tcg_gen_movi_ptr(i, 0); gen_set_label(loop); t0 = tcg_temp_new_i64(); From patchwork Mon Feb 27 05:41:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656937 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2232802wrb; Mon, 27 Feb 2023 00:29:39 -0800 (PST) X-Google-Smtp-Source: AK7set+1dQKPjQd18+jBqUSVogPhGixR5eQWtNlYYMtt1Zlw1Ti3YTYh7q0Le1VufZta/rpZ1Rf2 X-Received: by 2002:ad4:5aeb:0:b0:56e:964d:3662 with SMTP id c11-20020ad45aeb000000b0056e964d3662mr47044324qvh.13.1677486579654; Mon, 27 Feb 2023 00:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486579; cv=none; d=google.com; s=arc-20160816; b=hxMF4CyTmfqS9xx9Ew8GCKG14d8LIhLweMLiK7AnIyGihogfwvPy0U7FgmsAxq03Zj eS6QGfmK98Ef4+hwYDTzQ0IJ5gfLvNm7ZsJj4QpLoU1aHN2HEvIEo85qnhHRgPA1VOE8 Awk2D0rcZCDZbgcOthbg//NFYPhnRI8vWv/kR0GeymN9zpqjNWByzaWR0UUojeEaCF2G IiuqmI1wqgbCDJgbXMhxwveJxe0DOzaZVxDdeBwp0+GPhV2Ivo9FrIARR3x7RLxeWAm2 jessFr7GDE3M+OnGwB4uUnV7yxHgyPFYoP/bnsL5sbhGbafGNgcvBQAFcIMJqSaBbeEx 7dOQ== 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=0nmZI0+w1F7+8GnTL6IOgNGmXVjRV/sPnzdawMkimPw=; b=DpwrL2ZrUHbOmVJeEFlU+ejR67Nx8ljZo6OLFVUFp0zYWOOTaWPgQwwmZBJEJeuyuR xFb4+FdjaiigRHyluLf+x9P7sLfhV0vLUwqLwQ09rkNPjJMmatvxj+gpQ8WCuahzgpf4 kaXFv3rm1ol2Xh9AZxjyJrUcIH8qjcDNMyq/eBByl/mKvVqMoNUONFQnuKiMa2r7gLyT A/1rqKOz5sJQPR059+6CZcQfa8Jzn4UH5jXZUdK0zyIJKHBnKww9wgtJ00r5tLMzAxKe CJyIuWHM3DxaJ6OafYdS2a1JVW3CYUpiUV3wkW+reJufjicpqtdVOqFtrs3SjeP7srDh Y9hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="K8J/HxW0"; 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 i18-20020a0cf112000000b0056ed5c40fb6si5878273qvl.400.2023.02.27.00.29.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:29:39 -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="K8J/HxW0"; 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 1pWWI6-00030d-09; Mon, 27 Feb 2023 00:43:14 -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 1pWWI3-0002uQ-82 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:11 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWHy-0004tO-FB for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:10 -0500 Received: by mail-pf1-x434.google.com with SMTP id n5so2778999pfv.11 for ; Sun, 26 Feb 2023 21:43:05 -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=0nmZI0+w1F7+8GnTL6IOgNGmXVjRV/sPnzdawMkimPw=; b=K8J/HxW0kYm5MJYbIN1+NHclfSdEHUG7kRD5dK3ljLUzPY/O/eS3zPjZU+6C1MksUe jZXDFI76tpfAUMvXWXMBcmY7+9ZYWk55GyUsveT5VUhhl8MxDy7BkSafu0jgsVH7ytwS A29yeGul3VsuxaAg4Sc8Ng+tkVqjgKDH3HOHx/fQBK6IIFaPRpunAnngWTIH9TtEsc6T t2AxIQoXlQk5I93wYlyXRqyC7HhwPw9MUQHDk4JWgsmYI64owIOpubEgVmKO6y4qQrhe Mbsv9Z7exMhrsI3MLdVRgMKjPG9OdgYTpocZiVrhDqesaU/CEUStYA6urFMfQ7dobHfi i/lQ== 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=0nmZI0+w1F7+8GnTL6IOgNGmXVjRV/sPnzdawMkimPw=; b=SxbLKGSwsWdbYDByznvdpDcSykRnH84vL54NFNsTqnwAaXtj9uS82mnHkfjSfSZLrf aFYRyD9tF5RUM9YIGem7i82hvQ3r+zibd0RT53X8hV9b7b2vAFrm2KlXugBWSeoPv76U 1JRpPWaPASwfJ9tQXZfVonhaoUhg5dFbHKGhUu/lE6jNmjajLZS/MWQ6UuUEX6AxNP7B gCElYQtuRZu5joEtoJhPSfZY9AQojwY9R8l5YPN8ObKb+dNd4zCmNkLBrf/r6gV0VFTV XnZC3TlyRbDcrrk7a/NezLOr1b6sceOSBWsZVGxcWGoSp/YsgE+EbFmtevD2SdA8F+XR 5lNQ== X-Gm-Message-State: AO0yUKUGZ5ks3xZedSkxssEmiF5XQiwIOHNJx7uOs5z28dABjcR5jF3B v/oQVyd4K2D2egXfsYHVkjt8i1cz6nr01p0KAEs= X-Received: by 2002:aa7:96a1:0:b0:5f1:468b:c88 with SMTP id g1-20020aa796a1000000b005f1468b0c88mr3280250pfk.27.1677476585074; Sun, 26 Feb 2023 21:43:05 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:04 -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 08/70] target/arm: Avoid tcg_const_* in translate-mve.c Date: Sun, 26 Feb 2023 19:41:31 -1000 Message-Id: <20230227054233.390271-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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 All uses are in the context of an accumulator conditionally having a zero input. Split the rda variable to rda_{i,o}, and set rda_i to tcg_constant_foo(0) when required. Signed-off-by: Richard Henderson --- target/arm/translate-mve.c | 54 ++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/target/arm/translate-mve.c b/target/arm/translate-mve.c index 9744bf3de0..31fb2110f1 100644 --- a/target/arm/translate-mve.c +++ b/target/arm/translate-mve.c @@ -1150,7 +1150,7 @@ static bool do_long_dual_acc(DisasContext *s, arg_vmlaldav *a, MVEGenLongDualAccOpFn *fn) { TCGv_ptr qn, qm; - TCGv_i64 rda; + TCGv_i64 rda_i, rda_o; TCGv_i32 rdalo, rdahi; if (!dc_isar_feature(aa32_mve, s) || @@ -1177,21 +1177,22 @@ static bool do_long_dual_acc(DisasContext *s, arg_vmlaldav *a, * of an A=0 (no-accumulate) insn which does not execute the first * beat must start with the current rda value, not 0. */ + rda_o = tcg_temp_new_i64(); if (a->a || mve_skip_first_beat(s)) { - rda = tcg_temp_new_i64(); + rda_i = rda_o; rdalo = load_reg(s, a->rdalo); rdahi = load_reg(s, a->rdahi); - tcg_gen_concat_i32_i64(rda, rdalo, rdahi); + tcg_gen_concat_i32_i64(rda_i, rdalo, rdahi); } else { - rda = tcg_const_i64(0); + rda_i = tcg_constant_i64(0); } - fn(rda, cpu_env, qn, qm, rda); + fn(rda_o, cpu_env, qn, qm, rda_i); rdalo = tcg_temp_new_i32(); rdahi = tcg_temp_new_i32(); - tcg_gen_extrl_i64_i32(rdalo, rda); - tcg_gen_extrh_i64_i32(rdahi, rda); + tcg_gen_extrl_i64_i32(rdalo, rda_o); + tcg_gen_extrh_i64_i32(rdahi, rda_o); store_reg(s, a->rdalo, rdalo); store_reg(s, a->rdahi, rdahi); mve_update_eci(s); @@ -1258,7 +1259,7 @@ static bool trans_VRMLSLDAVH(DisasContext *s, arg_vmlaldav *a) static bool do_dual_acc(DisasContext *s, arg_vmladav *a, MVEGenDualAccOpFn *fn) { TCGv_ptr qn, qm; - TCGv_i32 rda; + TCGv_i32 rda_i, rda_o; if (!dc_isar_feature(aa32_mve, s) || !mve_check_qreg_bank(s, a->qn) || @@ -1278,13 +1279,14 @@ static bool do_dual_acc(DisasContext *s, arg_vmladav *a, MVEGenDualAccOpFn *fn) * beat must start with the current rda value, not 0. */ if (a->a || mve_skip_first_beat(s)) { - rda = load_reg(s, a->rda); + rda_o = rda_i = load_reg(s, a->rda); } else { - rda = tcg_const_i32(0); + rda_i = tcg_constant_i32(0); + rda_o = tcg_temp_new_i32(); } - fn(rda, cpu_env, qn, qm, rda); - store_reg(s, a->rda, rda); + fn(rda_o, cpu_env, qn, qm, rda_i); + store_reg(s, a->rda, rda_o); mve_update_eci(s); return true; @@ -1396,7 +1398,7 @@ static bool trans_VADDV(DisasContext *s, arg_VADDV *a) { NULL, NULL } }; TCGv_ptr qm; - TCGv_i32 rda; + TCGv_i32 rda_i, rda_o; if (!dc_isar_feature(aa32_mve, s) || a->size == 3) { @@ -1413,15 +1415,16 @@ static bool trans_VADDV(DisasContext *s, arg_VADDV *a) */ if (a->a || mve_skip_first_beat(s)) { /* Accumulate input from Rda */ - rda = load_reg(s, a->rda); + rda_o = rda_i = load_reg(s, a->rda); } else { /* Accumulate starting at zero */ - rda = tcg_const_i32(0); + rda_i = tcg_constant_i32(0); + rda_o = tcg_temp_new_i32(); } qm = mve_qreg_ptr(a->qm); - fns[a->size][a->u](rda, cpu_env, qm, rda); - store_reg(s, a->rda, rda); + fns[a->size][a->u](rda_o, cpu_env, qm, rda_i); + store_reg(s, a->rda, rda_o); mve_update_eci(s); return true; @@ -1436,7 +1439,7 @@ static bool trans_VADDLV(DisasContext *s, arg_VADDLV *a) * No need to check Qm's bank: it is only 3 bits in decode. */ TCGv_ptr qm; - TCGv_i64 rda; + TCGv_i64 rda_i, rda_o; TCGv_i32 rdalo, rdahi; if (!dc_isar_feature(aa32_mve, s)) { @@ -1458,28 +1461,29 @@ static bool trans_VADDLV(DisasContext *s, arg_VADDLV *a) * of an A=0 (no-accumulate) insn which does not execute the first * beat must start with the current value of RdaHi:RdaLo, not zero. */ + rda_o = tcg_temp_new_i64(); if (a->a || mve_skip_first_beat(s)) { /* Accumulate input from RdaHi:RdaLo */ - rda = tcg_temp_new_i64(); + rda_i = rda_o; rdalo = load_reg(s, a->rdalo); rdahi = load_reg(s, a->rdahi); - tcg_gen_concat_i32_i64(rda, rdalo, rdahi); + tcg_gen_concat_i32_i64(rda_i, rdalo, rdahi); } else { /* Accumulate starting at zero */ - rda = tcg_const_i64(0); + rda_i = tcg_constant_i64(0); } qm = mve_qreg_ptr(a->qm); if (a->u) { - gen_helper_mve_vaddlv_u(rda, cpu_env, qm, rda); + gen_helper_mve_vaddlv_u(rda_o, cpu_env, qm, rda_i); } else { - gen_helper_mve_vaddlv_s(rda, cpu_env, qm, rda); + gen_helper_mve_vaddlv_s(rda_o, cpu_env, qm, rda_i); } rdalo = tcg_temp_new_i32(); rdahi = tcg_temp_new_i32(); - tcg_gen_extrl_i64_i32(rdalo, rda); - tcg_gen_extrh_i64_i32(rdahi, rda); + tcg_gen_extrl_i64_i32(rdalo, rda_o); + tcg_gen_extrh_i64_i32(rdahi, rda_o); store_reg(s, a->rdalo, rdalo); store_reg(s, a->rdahi, rdahi); mve_update_eci(s); From patchwork Mon Feb 27 05:41:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656854 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2184769wrb; Sun, 26 Feb 2023 21:51:09 -0800 (PST) X-Google-Smtp-Source: AK7set9akEmN2uqDb3ZwFPjPuStagcCf2XbRd7m5uzKFHUn2RbiMci8z6iAZbCGpXz5Xj3Fc3dQ0 X-Received: by 2002:a05:6214:5010:b0:56e:a3bd:15f2 with SMTP id jo16-20020a056214501000b0056ea3bd15f2mr43684639qvb.2.1677477069763; Sun, 26 Feb 2023 21:51:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477069; cv=none; d=google.com; s=arc-20160816; b=n/gSl61Yzns3RCD87DleGUjzGQUhUuZf/VWHT5tSu9MF8HF3+hXVSWYn3xYtxQDvwY TUFGB2ga3tXcywtYSRBIl/8YGqohKC3qgOuKhk74I0/FDQRHrJ85eUaswOHQjSYM2dya vpl7RVCEuiUAjAAT4ebcCTeucbygoRpmNSY6K5za5wUeVwlxY88mKjczlyHGD0fE55H0 9n+0N1id5S5tcmEr8wzmMpXZKXQM6oFRfiiw8vrhpfgfxvXstUcGWm5xLmym4c3d7un5 0QTevXjIuMcNL80Fq493RKML5bUgd2R+pXNFMpIDOBJM0Zy0M03wzv4LY5WzMhbgLuwi QYYA== 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=0YfgyBDnj6MuT0mZO5HljNGb2RUFRCLedXFv4M1Hnp4=; b=cJzpr7VMh/RGeMQs+h/qL7Vsefv1DCOo+oYBcok8ijoxnAI72YW0i21CJS3l3ejgOU Fd/Z7b+A1txCtWxLERPcFb+gEG0HEitLzT7paUlpYTl6ButZIYQ4hZW/N3uGDy6Hedn+ ShRhuILtgwPH19h9nj+qlpYQd7HZLfCPjh7/xya962j/6t2yOd4Tz3eROduK87G7gTmk mjv7L2G7YIXX8Jr08bQC9FOhfJllkX84/xlNGwDE0lWOx9wqUOestl+GNX0DKTliXslu QuO1ZOZmBPraknPqCOurr298n8SZTD8f7CZtnnjxa4FsPcB6eul7jg0ueotUrDOBt+Vu FOrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L8G4jfDc; 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 b83-20020ae9eb56000000b0073b447266b6si5329292qkg.185.2023.02.26.21.51.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:51:09 -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=L8G4jfDc; 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 1pWWIC-0003H8-Dx; Mon, 27 Feb 2023 00:43:20 -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 1pWWI4-0002yr-TV for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:12 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWI1-0004vw-JI for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:12 -0500 Received: by mail-pf1-x42e.google.com with SMTP id z11so2805973pfh.4 for ; Sun, 26 Feb 2023 21:43:08 -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=0YfgyBDnj6MuT0mZO5HljNGb2RUFRCLedXFv4M1Hnp4=; b=L8G4jfDc6o4KyBdmekotOmWnM1ZTwjSatdHUehx/ZdAs1Trennd6J4cZ/0XVkvUO1T d0KZcSgLsSPvhhiosnKRbcyas8bWpID+PjtvIEhMAKCyiRr9L4MevsTQDFk17GIr+1BQ 1C7T0rEugSGiVnXYFjQy3/Y9xRGwXSeoRsQ29KIeqqZzGkSinmK2OMnl0YCYCxLrdmIH O9LFA/BDA8VM9eB+czoIQe216OuV+iCx9RD5I2mLgrNMFttmzvWET4BGxUe9FS5rB03b MLJRxhU2DZ0XmI0/yXAbkaiZPCE/j89/aqTuKa+Csu8Fin96Wt/iqjJfe+Ou3oJGgCzY fbJg== 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=0YfgyBDnj6MuT0mZO5HljNGb2RUFRCLedXFv4M1Hnp4=; b=DmmvOjUk55gZXhYQlx7hBJmEv8x+g6+j2P0LA1vSs6oY3BTmucSgByle95vmIgTb8V 4+6aJ4CM6a40+N/wSu5joX+1EEDMaFl1e90w65oSLG/4hchsPf7talGIODSTfXdJbcxk nl0JxVUvo2zsnHgUa6qCjCcaqM0ldc4CkQd6r0smjSrDlCnpICvfjh6LsuNq5RiLi6Hb 0QUkEhffNYgxHCmUOPg4MBrsUIV6bZ0tKGZ/jcCv69Rm6hZqv+W0CePB1KoMDphlr5fc DW4BkHE3zTtHdF3SU0lTEs6FzeG3suSZpziSxO2FjWEO0pEyCupXNZfVCyICN4ysz+Qh SlLw== X-Gm-Message-State: AO0yUKVCDeKpnHIlLrUaBN8BhYzbxl8J20edJC1E4VU6s3lgJRx9WGRJ MOW0jcw7/M25843IguPWL5nHyo75HNYAJ7+V3Mk= X-Received: by 2002:aa7:9466:0:b0:5dc:e57:e0e7 with SMTP id t6-20020aa79466000000b005dc0e57e0e7mr11674590pfq.22.1677476588020; Sun, 26 Feb 2023 21:43:08 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:07 -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/70] target/arm: Avoid tcg_const_ptr in disas_simd_zip_trn Date: Sun, 26 Feb 2023 19:41:32 -1000 Message-Id: <20230227054233.390271-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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 It is easy enough to use mov instead of or-with-zero and relying on the optimizer to fold away the or. Use an array for the output, rather than separate tcg_res{l,h} variables. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 41 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 9e682f36c9..1726ec622d 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -7442,10 +7442,10 @@ static void disas_simd_zip_trn(DisasContext *s, uint32_t insn) bool part = extract32(insn, 14, 1); bool is_q = extract32(insn, 30, 1); int esize = 8 << size; - int i, ofs; + int i; int datasize = is_q ? 128 : 64; int elements = datasize / esize; - TCGv_i64 tcg_res, tcg_resl, tcg_resh; + TCGv_i64 tcg_res[2], tcg_ele; if (opcode == 0 || (size == 3 && !is_q)) { unallocated_encoding(s); @@ -7456,37 +7456,39 @@ static void disas_simd_zip_trn(DisasContext *s, uint32_t insn) return; } - tcg_resl = tcg_const_i64(0); - tcg_resh = is_q ? tcg_const_i64(0) : NULL; - tcg_res = tcg_temp_new_i64(); + tcg_res[0] = tcg_temp_new_i64(); + tcg_res[1] = is_q ? tcg_temp_new_i64() : NULL; + tcg_ele = tcg_temp_new_i64(); for (i = 0; i < elements; i++) { + int o, w; + switch (opcode) { case 1: /* UZP1/2 */ { int midpoint = elements / 2; if (i < midpoint) { - read_vec_element(s, tcg_res, rn, 2 * i + part, size); + read_vec_element(s, tcg_ele, rn, 2 * i + part, size); } else { - read_vec_element(s, tcg_res, rm, + read_vec_element(s, tcg_ele, rm, 2 * (i - midpoint) + part, size); } break; } case 2: /* TRN1/2 */ if (i & 1) { - read_vec_element(s, tcg_res, rm, (i & ~1) + part, size); + read_vec_element(s, tcg_ele, rm, (i & ~1) + part, size); } else { - read_vec_element(s, tcg_res, rn, (i & ~1) + part, size); + read_vec_element(s, tcg_ele, rn, (i & ~1) + part, size); } break; case 3: /* ZIP1/2 */ { int base = part * elements / 2; if (i & 1) { - read_vec_element(s, tcg_res, rm, base + (i >> 1), size); + read_vec_element(s, tcg_ele, rm, base + (i >> 1), size); } else { - read_vec_element(s, tcg_res, rn, base + (i >> 1), size); + read_vec_element(s, tcg_ele, rn, base + (i >> 1), size); } break; } @@ -7494,19 +7496,18 @@ static void disas_simd_zip_trn(DisasContext *s, uint32_t insn) g_assert_not_reached(); } - ofs = i * esize; - if (ofs < 64) { - tcg_gen_shli_i64(tcg_res, tcg_res, ofs); - tcg_gen_or_i64(tcg_resl, tcg_resl, tcg_res); + w = (i * esize) / 64; + o = (i * esize) % 64; + if (o == 0) { + tcg_gen_mov_i64(tcg_res[w], tcg_ele); } else { - tcg_gen_shli_i64(tcg_res, tcg_res, ofs - 64); - tcg_gen_or_i64(tcg_resh, tcg_resh, tcg_res); + tcg_gen_shli_i64(tcg_ele, tcg_ele, o); + tcg_gen_or_i64(tcg_res[w], tcg_res[w], tcg_ele); } } - write_vec_element(s, tcg_resl, rd, 0, MO_64); - if (is_q) { - write_vec_element(s, tcg_resh, rd, 1, MO_64); + for (i = 0; i <= is_q; ++i) { + write_vec_element(s, tcg_res[i], rd, i, MO_64); } clear_vec_high(s, is_q, rd); } From patchwork Mon Feb 27 05:41:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656868 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2185395wrb; Sun, 26 Feb 2023 21:54:03 -0800 (PST) X-Google-Smtp-Source: AK7set+nCfnQ9KwUw6w2AEjYzSY4CZHL+9c0k7S8WEgCOflKdqbFQi6dhLpAo4BYG6S0qMKRXc2g X-Received: by 2002:ac8:5713:0:b0:3b8:6b1b:e378 with SMTP id 19-20020ac85713000000b003b86b1be378mr15648997qtw.8.1677477243493; Sun, 26 Feb 2023 21:54:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477243; cv=none; d=google.com; s=arc-20160816; b=Qn8680gVc+veO/o4S8wjhP14onyuFMuTZ2LT3hbFc5Qoe3FMbrO1hdqrb1dzj2ZAfT 6n9gZblxyKvbVN4RsypkLnSxmRfcUJyTcrF10flqIkZjeMZe9NqR5Y+RNE29txZx50lC KA+24FPh57ygP71OMrG82Nkth2A+idxAxk+SgH5ZsyHRlEPd9YOK1qGBqT1Qh1gW4y0f u5aiKH+7RxTV0nUqkzfD0+PwCeGXxS4Q3NFGSlAa6yOz8gQBo5tc8U+kUMO5eM1Wh8cT CTDsraii4JTcMYkRkBwtFVw94sAGuK8AfjgXMSVd0W0VZgQq28smw8gD8sdL/ZFek7Ie sz5w== 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=mERf7MKXZT5xGumbcdn7TizHZXgv59+znRwTwlxucPE=; b=PB5YgI7ayJEya9syqEZ+lGwoi5ZkNsWXJRc2W0pNSR7fRZO8I9JiEFYClU/p7X2D80 Juk9rcp/fLOI1GMpChpSMS24VSubRWXdSF+Ud4giqlZBP5SLkQ2vdnpT08H3XQttnQ0F SmDwl98bBuTXwQ/K16V1Fy4PdyKCoOCkRGt1w7Fc6ZyoYTmXo5yko/cKqdIxff/BFsM1 YXTKrDPxhrkQArwXIu+ov2PD1OQ3iddUTxOBeg326+almaVm5727I6+e2f2Z++MTh0va rByhPCXa1DJAXt4e4jqPv2AkZFuweuMf+hD8abbJiSOIBQ8lPUT03roFa4GjVjK2san5 4O4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r1ifEh3K; 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 w2-20020a05622a190200b003bfc30cf24bsi5791212qtc.135.2023.02.26.21.54.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:54:03 -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=r1ifEh3K; 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 1pWWIC-0003Lg-PO; Mon, 27 Feb 2023 00:43:20 -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 1pWWI6-00030f-04 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:14 -0500 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWI3-0004sI-K1 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:13 -0500 Received: by mail-pg1-x529.google.com with SMTP id d10so2827469pgt.12 for ; Sun, 26 Feb 2023 21:43:10 -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=mERf7MKXZT5xGumbcdn7TizHZXgv59+znRwTwlxucPE=; b=r1ifEh3KG71FigZ6/loi9WkzqdcvRgmE61jOctOKVy8A5w+JKHw7b0eqUCiv//lp2y 2rFR8qU8Pce4JOQ8cSHmnmfMN1BPSmd+zI3yBnwBCXa4X43lVb41DaX/+cGh+EQ95aFZ LVqwhRKPmxjwKsq+gGyNtReCyri2Q0SNufabTbE29MzEmX7jwMYserDDeFpJ4tv5/u2d cEdUD0fi8IEAY27iLAWQZJjxbo3l0PKX2iO/GN+maKfPzL7qrsO0VmPENsprYE46HWHz 1Vkpnxvvvsx32aHP9sHMa9IK3B3/s9i2eTcxyIW83BJ2WrCK3xS7+X/1N6UhQbacG4pE CHdg== 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=mERf7MKXZT5xGumbcdn7TizHZXgv59+znRwTwlxucPE=; b=koZC3siXEivj2DyJIROFL/Img4jqdYLJlCaTHmjDUG5L3E7yty7g6EPjogBcArv+DG 7qsv+piLJo8JGvZ+TWKeuBfD6Eb9tw0BBBB+4xFq94AwftfRBlIVjBHlx9tWLZnuuccM Oe8JA5hK9S0DXzYT39y7HVhkuar3MrPqI7PIdjlf9aVw1pXPqcTXNmykUx4/Itff4Rnl YUhBl97HGisG3vxBV8pxVSU7QOxQVxzXUeEp+r+Lw4iX/CKH6EE1t2kSm5rbRk/BteQp EJjyl/KAwpcwBwG8IQo+n43ZHmVTE2sBVzSM2v1n7lvKqOAvMyyr3NZ9hyaXpbQ6z6Kd VH3w== X-Gm-Message-State: AO0yUKV5w4CujiuFZHEJapaOg5/zrSEInlVjWaj+9IdtcDZL551N17jB t4f78CwqfKA3o3MIjHtAiZgQGBv05U4xW+ovPIw= X-Received: by 2002:a05:6a00:15cc:b0:5a8:51a3:7f69 with SMTP id o12-20020a056a0015cc00b005a851a37f69mr8331100pfu.2.1677476590507; Sun, 26 Feb 2023 21:43:10 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:10 -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 10/70] target/arm: Avoid tcg_const_ptr in handle_vec_simd_sqshrn Date: Sun, 26 Feb 2023 19:41:33 -1000 Message-Id: <20230227054233.390271-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org It is easy enough to use mov instead of or-with-zero and relying on the optimizer to fold away the or. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/translate-a64.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 1726ec622d..16aa71451c 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -8459,7 +8459,7 @@ static void handle_vec_simd_sqshrn(DisasContext *s, bool is_scalar, bool is_q, tcg_rn = tcg_temp_new_i64(); tcg_rd = tcg_temp_new_i64(); tcg_rd_narrowed = tcg_temp_new_i32(); - tcg_final = tcg_const_i64(0); + tcg_final = tcg_temp_new_i64(); if (round) { tcg_round = tcg_constant_i64(1ULL << (shift - 1)); @@ -8473,7 +8473,11 @@ static void handle_vec_simd_sqshrn(DisasContext *s, bool is_scalar, bool is_q, false, is_u_shift, size+1, shift); narrowfn(tcg_rd_narrowed, cpu_env, tcg_rd); tcg_gen_extu_i32_i64(tcg_rd, tcg_rd_narrowed); - tcg_gen_deposit_i64(tcg_final, tcg_final, tcg_rd, esize * i, esize); + if (i == 0) { + tcg_gen_mov_i64(tcg_final, tcg_rd); + } else { + tcg_gen_deposit_i64(tcg_final, tcg_final, tcg_rd, esize * i, esize); + } } if (!is_q) { From patchwork Mon Feb 27 05:41:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656901 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2228157wrb; Mon, 27 Feb 2023 00:13:05 -0800 (PST) X-Google-Smtp-Source: AK7set/WEx466PvZuOloyKsZ5iSoN2ykzk2BXNnh7lVLy+3ik3WjuoRN2JlZCWDVLO2XXlD6b4dS X-Received: by 2002:ac8:58c3:0:b0:3bf:d1ba:daec with SMTP id u3-20020ac858c3000000b003bfd1badaecmr7667350qta.16.1677485585730; Mon, 27 Feb 2023 00:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485585; cv=none; d=google.com; s=arc-20160816; b=Px+5ziLWrSCfWCWHRI2Ee+tUS7poUoOSKMgOMJBxWqaWryAMmCCiOLIUb4x8S86zqt R3dlHYUxtCZDH24pIsz2owIGz2VCllQByF0g5Ei3wjvGe3rWKTs/r3x+3DHApE4WkxRP TIbSvlcbhzTyr1ceW+8ptr62vVAiYgO143hrre1VhACw0biMi2py4uymMI1RSWr8/sjN Janig4gghB5y6RVnUoeFPs/lRiJuNYQEr2XZTP4gr2TA8OHrINWE6N6jFPiRyb5/GWCY 2iWTxSg57QH09grFsMQFbgPot8VdE0INkw+Z4yoHjqSMqe4a30O17X9BKtCIZXrcTXVD TVxA== 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=Ko5d2/IanWd/pjymt4+iUKkd751sWBMgapBL5xX0YbQ=; b=wPJ6xVj/7SjJ1V7S71VdBDtXsiM46/Q2x2Yj/7gAZZ8MytzHYBj+6lhNpVna4SckrQ yjLkxHAzRxE6JIU6Rn/Df37EcCggRIYn73A+4CNMSJRnNMGNjeNWZQjScNbo9O3mgZ6l troA4Z1KdF4Vkhmy6BvOkG7mXFvkSyFiGUKI30aj4N5d14NxTPwCGBPz6rYFD0wZATDJ KBr7LqzXdtDnzaeDC2o00pgYUG86lJx/VcxiELaiXDSM5OdS2+bnLy/3AnMQ2q7UH0dH 9sRi9q9KjxKkk2nlTT70Ijbv4GwBFrIgiBDDxq/eUqha8aGYxvOj6K9WrfSYrXWSSRox z8XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q1OkCNSX; 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 h9-20020a05620a400900b0070fe8de6d50si6481412qko.386.2023.02.27.00.13.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:13:05 -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=Q1OkCNSX; 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 1pWWIF-0003eF-W7; Mon, 27 Feb 2023 00:43:24 -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 1pWWIC-0003Jo-Ez for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:20 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWI6-0004yk-Ib for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:16 -0500 Received: by mail-pl1-x633.google.com with SMTP id ky4so5580795plb.3 for ; Sun, 26 Feb 2023 21:43:14 -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=Ko5d2/IanWd/pjymt4+iUKkd751sWBMgapBL5xX0YbQ=; b=Q1OkCNSXNxA92Cxl2bJxiDCZpgHHttWBi2+te6jFAEBClAAXaIfO53F5DQdCzk05VG LVycgjrjLleVGptjoHlY5gyYSYeW3byqnv46H+2cy4SRF0NU+16utvs85JjEPcXiOeXt KTH/gTtF1piO7PT8DfMO0Lf92o9i5a3hbsSBo46YKhqHg7joqvVgQip7vA4NSkvJbix9 OFP0RX7UOt/yY011YJvvCVpStPJCn68vgK8GxXLGrC7xX2Ts+BYdB7RwCTjLae5Bw/Cw DfmXiKNljpnJ9TNaGgDCqiK9EBYxt0ZGIdZdMwnUtu4QGARhDWm5LZmtxStjcf0ocjqg HdlA== 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=Ko5d2/IanWd/pjymt4+iUKkd751sWBMgapBL5xX0YbQ=; b=seGibdmAZAP1EM6Xc7eaLTUZXmiHub6cPwsycgBY20k7/VbVzQAqBz961J+4Lus1l1 HnVaSgnDJGg8sog/BTV9Au5RaY3e2eR+GIS1a6vzpi1+d7baJN7rWrR3u6OlEm4Fx3V4 HMK7hCCKqrdKH3uuhreNohyp3iYK04uTIOjZyuCCskAZlOYub3yd4Uy6RIH05ynW13Tr ilNe2OTqnwMTqSEUNirVnove7yhkAMkBfoslvPBHKw8QLbMScKdL9eEM6o8nmIidiyaw 75XeSta67Q9tazoR5dhZoXflRPxOv19R/nkgSDZ3z5mEpo05n6J39p2rPQ4ri6cLMw8t y+Iw== X-Gm-Message-State: AO0yUKX8EjtN/wEz750/UIHAABMpLIBCnuTmKiR4EJVEbkkx9aSDwach gfEu6a0JaKXPEab2Grd9bbBnjpUxgNudevrhiIs= X-Received: by 2002:a05:6a20:548e:b0:bc:a257:5b2a with SMTP id i14-20020a056a20548e00b000bca2575b2amr27799341pzk.31.1677476593203; Sun, 26 Feb 2023 21:43:13 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:12 -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 11/70] target/arm: Avoid tcg_const_ptr in handle_rev Date: Sun, 26 Feb 2023 19:41:34 -1000 Message-Id: <20230227054233.390271-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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 Here it is not trivial to notice first initialization, so explicitly zero the temps. Use an array for the output, rather than separate tcg_rd/tcg_rd_hi variables. Fixes a bug by adding a missing clear_vec_high. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/translate-a64.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 16aa71451c..02a61aa8b7 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -12003,22 +12003,26 @@ static void handle_rev(DisasContext *s, int opcode, bool u, int esize = 8 << size; int elements = dsize / esize; TCGv_i64 tcg_rn = tcg_temp_new_i64(); - TCGv_i64 tcg_rd = tcg_const_i64(0); - TCGv_i64 tcg_rd_hi = tcg_const_i64(0); + TCGv_i64 tcg_rd[2]; + + for (i = 0; i < 2; i++) { + tcg_rd[i] = tcg_temp_new_i64(); + tcg_gen_movi_i64(tcg_rd[i], 0); + } for (i = 0; i < elements; i++) { int e_rev = (i & 0xf) ^ revmask; - int off = e_rev * esize; + int w = (e_rev * esize) / 64; + int o = (e_rev * esize) % 64; + read_vec_element(s, tcg_rn, rn, i, size); - if (off >= 64) { - tcg_gen_deposit_i64(tcg_rd_hi, tcg_rd_hi, - tcg_rn, off - 64, esize); - } else { - tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_rn, off, esize); - } + tcg_gen_deposit_i64(tcg_rd[w], tcg_rd[w], tcg_rn, o, esize); } - write_vec_element(s, tcg_rd, rd, 0, MO_64); - write_vec_element(s, tcg_rd_hi, rd, 1, MO_64); + + for (i = 0; i < 2; i++) { + write_vec_element(s, tcg_rd[i], rd, i, MO_64); + } + clear_vec_high(s, true, rd); } } From patchwork Mon Feb 27 05:41:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656859 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2184951wrb; Sun, 26 Feb 2023 21:52:02 -0800 (PST) X-Google-Smtp-Source: AK7set/FbKX0uDUxZOzDb6VGIo7Tg7DG5N3IHhDvLIvSt5ObH5jeeADEQmHDAwjnsL5haCvqJplf X-Received: by 2002:ad4:5946:0:b0:56c:37d:51e with SMTP id eo6-20020ad45946000000b0056c037d051emr36598263qvb.22.1677477122116; Sun, 26 Feb 2023 21:52:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477122; cv=none; d=google.com; s=arc-20160816; b=nh4T8hwj6ZbVUGYApG7h+xanh0FjwNBvICeG/Yap4zo+qJ89FG8SuXDXZ6B98ijMct 1L17FeXO0Z+sDO2n2zsGrslFMdUHcZ2Zrp2fZKr2571lXr0v7nx9uG1huaX0q4+Ld8ra +0jIFruFqxgNjzW3GbDw3kMUH9EZPwovThLW93ilAR/+Te3DuRtyw6MfOFRjbRF3UPeG agsKP0jRn3yibXQddGHTJE+DBdaP6oajh48u8YHPRFkSAXVwPb86DLGhsjrQCL2nzBC9 Cku+y7gdSLaQfBdvjbAyvRv4EqhlwPkO5cCmgL0aRlpKCctD2w4Bh1oQBAFlZeItigiU mBaQ== 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=TREbAd+70LxESacRUJBX2SCfwkFxNEG89YG9D3Coqs4=; b=O9251QI10rLOADI92mnIvku80FHti8T+uc+HGkwOv7oPNTryZGC9h76id2svTTbUNy ZCg23l4h69TusoDgDpr1l3yXRHKJ2arz/o6KlZeBINX1U26P2JoZE9k5HF4F3p0Xv4jY x2b3tGaywISr2JwLCbtJgKSvitXdbxLXXjGdlzQS/VEy17E0zf4KSJ2ReNg1j/eSIPnT vk/fmw5I7sS+wSWwBADXDE+lM7U4WDej6YjoG+yzl5Pdnl8Oh0BdQPI7jBySoisgNdO2 I7EpmjvREc3cJmidvpO1vBV3NhhEaCYYBe1i0anVaHGG85qEJXQrt5dzt2yREqtSV25z wo+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=u91QM0vZ; 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 e3-20020a0cf343000000b0056ea9a9a806si5566057qvm.13.2023.02.26.21.52.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:52:02 -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=u91QM0vZ; 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 1pWWIG-0003kA-SU; Mon, 27 Feb 2023 00:43:24 -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 1pWWID-0003Ro-Pw for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:21 -0500 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIB-0004nL-Uj for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:21 -0500 Received: by mail-pg1-x529.google.com with SMTP id q23so2845803pgt.7 for ; Sun, 26 Feb 2023 21:43:16 -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=TREbAd+70LxESacRUJBX2SCfwkFxNEG89YG9D3Coqs4=; b=u91QM0vZV0sU5gQYlowKL8wPNntK0dCJfYlWxQ4bex6qA+S09hppHLJiHNq4bzb6gt Evaa81Qm76aMzImAZxxHVah3f6S/2jz6TPsWogQDTYz8xoJ9ReGhXTmhlh0ORLHF70FS 1HSIkdl5R1SvWxPF55/FvuzSTgE8IyMMHNf6cYdC97eiBklGsbfhb+a+m9d1UZuknd61 qN5Rz1FAaNLGKVlDT78kdy3KKEK1xdsjkrPYnf57l5VdABuJTu4w/6Yykjo/oEKHFdBD O7/MK0RpUPTnocvKnmCGKde82kuCxRNvFn9MZPP0ojO63kTGhlvXTmtT/Xkg8dMlKKtt etoA== 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=TREbAd+70LxESacRUJBX2SCfwkFxNEG89YG9D3Coqs4=; b=kPZxococgII3IVIMrUqU18qqF/SP46y0Lq3EJRxCC+u7AopOsp+TDqVGihn5zCYZqO 9i2CCADib7mrQxgFylNdvkKw2Z9z7SIxu/RKic8SCk0DsbPYTMH6E6zvqxh0GCv4JhNH BXfVDjs0wZNrkmXAFDnHh+B3iHT3tVNg+q0KqvSWPitGCzwYarJlrCjnHqPR5m+jyeCQ OwxYXohU7UdTfWfV+1A7s/7mhqZjTFlf8Jt3DNySnLpgqtQRoL8blnwxRSJC4Do9ohSK QUgycQGqMZCvtMyZEacsZsfjujPoFfuvb2bJ2AkIn0x020l5OdidanZkaLlQ/zr0W4lU /SMw== X-Gm-Message-State: AO0yUKXRgFZLzWTrCfCUJuvoTVFFXVthagVt2Att5y20SF3Lpj1ubMcd zy+7Gbtp21OvAeIuHCTwkjvKq5rvZKz/uyEL4WI= X-Received: by 2002:a62:1946:0:b0:5a8:bd6e:90fb with SMTP id 67-20020a621946000000b005a8bd6e90fbmr17879877pfz.19.1677476596145; Sun, 26 Feb 2023 21:43:16 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:15 -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 12/70] target/avr: Avoid use of tcg_const_i32 in SBIC, SBIS Date: Sun, 26 Feb 2023 19:41:35 -1000 Message-Id: <20230227054233.390271-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The use of separate data/port variables is existing practice elsewhere, e.g. SBI, CBI. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/avr/translate.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c index b9506a8d86..190d0c3f97 100644 --- a/target/avr/translate.c +++ b/target/avr/translate.c @@ -1288,12 +1288,13 @@ static bool trans_SBRS(DisasContext *ctx, arg_SBRS *a) */ static bool trans_SBIC(DisasContext *ctx, arg_SBIC *a) { - TCGv temp = tcg_const_i32(a->reg); + TCGv data = tcg_temp_new_i32(); + TCGv port = tcg_constant_i32(a->reg); - gen_helper_inb(temp, cpu_env, temp); - tcg_gen_andi_tl(temp, temp, 1 << a->bit); + gen_helper_inb(data, cpu_env, port); + tcg_gen_andi_tl(data, data, 1 << a->bit); ctx->skip_cond = TCG_COND_EQ; - ctx->skip_var0 = temp; + ctx->skip_var0 = data; return true; } @@ -1305,12 +1306,13 @@ static bool trans_SBIC(DisasContext *ctx, arg_SBIC *a) */ static bool trans_SBIS(DisasContext *ctx, arg_SBIS *a) { - TCGv temp = tcg_const_i32(a->reg); + TCGv data = tcg_temp_new_i32(); + TCGv port = tcg_constant_i32(a->reg); - gen_helper_inb(temp, cpu_env, temp); - tcg_gen_andi_tl(temp, temp, 1 << a->bit); + gen_helper_inb(data, cpu_env, port); + tcg_gen_andi_tl(data, data, 1 << a->bit); ctx->skip_cond = TCG_COND_NE; - ctx->skip_var0 = temp; + ctx->skip_var0 = data; return true; } From patchwork Mon Feb 27 05:41:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656837 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2183761wrb; Sun, 26 Feb 2023 21:47:29 -0800 (PST) X-Google-Smtp-Source: AK7set9rp7NsVO+w7shcc5hOr//7kCDhBy36elodPMirZbdCKDfqHmM/VpRMN5nI/E1z/Zpww03t X-Received: by 2002:a05:6214:2469:b0:56e:f4e0:a4e0 with SMTP id im9-20020a056214246900b0056ef4e0a4e0mr44726140qvb.12.1677476848992; Sun, 26 Feb 2023 21:47:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677476848; cv=none; d=google.com; s=arc-20160816; b=BFqjpWHqLe17e5/rnAbLheDuvA763MaU1aAy/KzrosmNZ9dxT0R0mV5HpH18gmNcee LUzHWhYLyP5S1DkSVtxvA4WHefMzyHsFtv5/lZ37hE7Fv5HNGCUV5K3xwKo7BFq9saFR jn5/X+qUMFpcZWSa/NZ6Q6XyH1cqcp6HE69TcBTxUYS9kV4JYRbs12IlL04Ws45xQt3W non5MCXddYLOuBKf3ANJWkYeSBEBUrShD09gheLbZCui8GETHXnlFgEhGpABepCrtXWk lewLJKO6mrTOdFy5JNwfDyT1RkcBmgWr4Xpf+bMoheKqtVUBJzdGLIXSyqyyI8E2W6H0 CP+Q== 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=IK5cdibGrlxCvWnzF9s1ITVzwrnk5CQSmad2m4SDXHo=; b=VBtk/vLbvaSAz5mwoP4Xd5JSplO48/dzH0XSqdmoRDIFqvB/csd8C5WyQuiGjZs5WH jmxcy1AaOX3EQ9cVu/sBuCrM+zdPKSW2k6pn439SOUCRYEVEe02nEE0Mgs9bNralVz+B d/xOWCBuHJx64LKOvkDP3bxRb8pV+bj+KdeXfcKbpZLSJpN5mYwktibckwcJxeg2Eyao /NrFjuDbkYPVUVOttym6F4PWIKlb3FAzewmHG52GsUJBnY+PdezyOap7BJCZdijJ/uPh VFEi6dKMrPVz4zdZNpntmDtI+cX5gZ1GJ8vd5DGdedPJRvS199Ib4vSJ4PmlfO/N+Uy0 Z3/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hL6eJN8Q; 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 a127-20020a379885000000b0073bac9e25e9si985929qke.749.2023.02.26.21.47.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:47:28 -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=hL6eJN8Q; 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 1pWWIJ-0003yZ-GJ; Mon, 27 Feb 2023 00:43:27 -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 1pWWIH-0003la-6M for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:25 -0500 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIC-0004k3-7P for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:24 -0500 Received: by mail-pf1-x42c.google.com with SMTP id cp12so2045614pfb.5 for ; Sun, 26 Feb 2023 21:43:19 -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=IK5cdibGrlxCvWnzF9s1ITVzwrnk5CQSmad2m4SDXHo=; b=hL6eJN8QUq0KkvG1eM6hrYIoztabAEq8R30mW6QVaNAgX3AlMNZ88MK07ILpsmnXgU 5rAk3Bz3n/4d4AWylAqEtqGYCutrrdyM8QfXanJpsdiHv/6YbgASRajmbRRvvCa7fX+J MgWZ4SyinnXLKdL61DZn7OxOr3jiUiUpcHs9j7kTMI44DDijClkadAgjpHuDiRC5Fjc2 EfXHt+QqFJ+N8LkXaywzV7ULNXwuapmspaB8ZN6bbK6s/0htk1exyK9Met/Yum2EqqUJ ynnecKAqvyyFFQk6AIno74u6UIYNh5h7yBIOuAdyfg9QVgqdIk3pxGHUgPT2cm9eTye1 AXtQ== 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=IK5cdibGrlxCvWnzF9s1ITVzwrnk5CQSmad2m4SDXHo=; b=Uy7ZPYOHHZOtiGElFeirBN7bzE3wF/ZxXwDyKVg8eBi8bBvnFBoHYkGK9KiM804EbK cqxAi1QoP50EBXsnqGNqfyQlY9CB8kWAdBuVfvuk3MmTZK5fB3c43zB+y7RiFmypINjV NfGJBlG/Z5tQ4HKzvD4K6xp08gkgLOZTwkW1/md3DURF7k/aLvnOMRSFYwAhGwg5yo5R +01U5k37Ho22z9KnVdxivw9zbBv/qRuZaxvIngJHWRVGRDrWv8hYsNbssfTLqz5Qq7Xe hqQysEplk6EWmtZ74ooRc0F777d4aeveNqghvlwoIUmW+YbVWjF7unDQwb3v5de7B/Vy QcCA== X-Gm-Message-State: AO0yUKVKw+J+PyVywiszvBdo1K4SuNSNjP6oPlCN8C/WvHARj7thOCgh uciVrrenUjx3TknnHhUQjoyjJrTtyJEbdoQPmKo= X-Received: by 2002:a62:1b4a:0:b0:5a8:acd9:765b with SMTP id b71-20020a621b4a000000b005a8acd9765bmr20858357pfb.16.1677476598819; Sun, 26 Feb 2023 21:43:18 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:18 -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 13/70] target/avr: Avoid use of tcg_const_i32 throughout Date: Sun, 26 Feb 2023 19:41:36 -1000 Message-Id: <20230227054233.390271-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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 All remaining uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/avr/translate.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/target/avr/translate.c b/target/avr/translate.c index 190d0c3f97..a6aeae6dfa 100644 --- a/target/avr/translate.c +++ b/target/avr/translate.c @@ -400,7 +400,7 @@ static bool trans_SUB(DisasContext *ctx, arg_SUB *a) static bool trans_SUBI(DisasContext *ctx, arg_SUBI *a) { TCGv Rd = cpu_r[a->rd]; - TCGv Rr = tcg_const_i32(a->imm); + TCGv Rr = tcg_constant_i32(a->imm); TCGv R = tcg_temp_new_i32(); tcg_gen_sub_tl(R, Rd, Rr); /* R = Rd - Imm */ @@ -425,7 +425,7 @@ static bool trans_SBC(DisasContext *ctx, arg_SBC *a) TCGv Rd = cpu_r[a->rd]; TCGv Rr = cpu_r[a->rr]; TCGv R = tcg_temp_new_i32(); - TCGv zero = tcg_const_i32(0); + TCGv zero = tcg_constant_i32(0); tcg_gen_sub_tl(R, Rd, Rr); /* R = Rd - Rr - Cf */ tcg_gen_sub_tl(R, R, cpu_Cf); @@ -453,9 +453,9 @@ static bool trans_SBC(DisasContext *ctx, arg_SBC *a) static bool trans_SBCI(DisasContext *ctx, arg_SBCI *a) { TCGv Rd = cpu_r[a->rd]; - TCGv Rr = tcg_const_i32(a->imm); + TCGv Rr = tcg_constant_i32(a->imm); TCGv R = tcg_temp_new_i32(); - TCGv zero = tcg_const_i32(0); + TCGv zero = tcg_constant_i32(0); tcg_gen_sub_tl(R, Rd, Rr); /* R = Rd - Rr - Cf */ tcg_gen_sub_tl(R, R, cpu_Cf); @@ -637,7 +637,7 @@ static bool trans_COM(DisasContext *ctx, arg_COM *a) static bool trans_NEG(DisasContext *ctx, arg_NEG *a) { TCGv Rd = cpu_r[a->rd]; - TCGv t0 = tcg_const_i32(0); + TCGv t0 = tcg_constant_i32(0); TCGv R = tcg_temp_new_i32(); tcg_gen_sub_tl(R, t0, Rd); /* R = 0 - Rd */ @@ -930,19 +930,19 @@ static void gen_jmp_z(DisasContext *ctx) static void gen_push_ret(DisasContext *ctx, int ret) { if (avr_feature(ctx->env, AVR_FEATURE_1_BYTE_PC)) { - TCGv t0 = tcg_const_i32((ret & 0x0000ff)); + TCGv t0 = tcg_constant_i32(ret & 0x0000ff); tcg_gen_qemu_st_tl(t0, cpu_sp, MMU_DATA_IDX, MO_UB); tcg_gen_subi_tl(cpu_sp, cpu_sp, 1); } else if (avr_feature(ctx->env, AVR_FEATURE_2_BYTE_PC)) { - TCGv t0 = tcg_const_i32((ret & 0x00ffff)); + TCGv t0 = tcg_constant_i32(ret & 0x00ffff); tcg_gen_subi_tl(cpu_sp, cpu_sp, 1); tcg_gen_qemu_st_tl(t0, cpu_sp, MMU_DATA_IDX, MO_BEUW); tcg_gen_subi_tl(cpu_sp, cpu_sp, 1); } else if (avr_feature(ctx->env, AVR_FEATURE_3_BYTE_PC)) { - TCGv lo = tcg_const_i32((ret & 0x0000ff)); - TCGv hi = tcg_const_i32((ret & 0xffff00) >> 8); + TCGv lo = tcg_constant_i32(ret & 0x0000ff); + TCGv hi = tcg_constant_i32((ret & 0xffff00) >> 8); tcg_gen_qemu_st_tl(lo, cpu_sp, MMU_DATA_IDX, MO_UB); tcg_gen_subi_tl(cpu_sp, cpu_sp, 2); @@ -1211,7 +1211,7 @@ static bool trans_CPC(DisasContext *ctx, arg_CPC *a) TCGv Rd = cpu_r[a->rd]; TCGv Rr = cpu_r[a->rr]; TCGv R = tcg_temp_new_i32(); - TCGv zero = tcg_const_i32(0); + TCGv zero = tcg_constant_i32(0); tcg_gen_sub_tl(R, Rd, Rr); /* R = Rd - Rr - Cf */ tcg_gen_sub_tl(R, R, cpu_Cf); @@ -1238,7 +1238,7 @@ static bool trans_CPI(DisasContext *ctx, arg_CPI *a) { TCGv Rd = cpu_r[a->rd]; int Imm = a->imm; - TCGv Rr = tcg_const_i32(Imm); + TCGv Rr = tcg_constant_i32(Imm); TCGv R = tcg_temp_new_i32(); tcg_gen_sub_tl(R, Rd, Rr); /* R = Rd - Rr */ @@ -2124,7 +2124,7 @@ static bool trans_SPMX(DisasContext *ctx, arg_SPMX *a) static bool trans_IN(DisasContext *ctx, arg_IN *a) { TCGv Rd = cpu_r[a->rd]; - TCGv port = tcg_const_i32(a->imm); + TCGv port = tcg_constant_i32(a->imm); gen_helper_inb(Rd, cpu_env, port); return true; @@ -2137,7 +2137,7 @@ static bool trans_IN(DisasContext *ctx, arg_IN *a) static bool trans_OUT(DisasContext *ctx, arg_OUT *a) { TCGv Rd = cpu_r[a->rd]; - TCGv port = tcg_const_i32(a->imm); + TCGv port = tcg_constant_i32(a->imm); gen_helper_outb(cpu_env, port, Rd); return true; @@ -2405,7 +2405,7 @@ static bool trans_SWAP(DisasContext *ctx, arg_SWAP *a) static bool trans_SBI(DisasContext *ctx, arg_SBI *a) { TCGv data = tcg_temp_new_i32(); - TCGv port = tcg_const_i32(a->reg); + TCGv port = tcg_constant_i32(a->reg); gen_helper_inb(data, cpu_env, port); tcg_gen_ori_tl(data, data, 1 << a->bit); @@ -2420,7 +2420,7 @@ static bool trans_SBI(DisasContext *ctx, arg_SBI *a) static bool trans_CBI(DisasContext *ctx, arg_CBI *a) { TCGv data = tcg_temp_new_i32(); - TCGv port = tcg_const_i32(a->reg); + TCGv port = tcg_constant_i32(a->reg); gen_helper_inb(data, cpu_env, port); tcg_gen_andi_tl(data, data, ~(1 << a->bit)); From patchwork Mon Feb 27 05:41:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656921 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2230486wrb; Mon, 27 Feb 2023 00:20:49 -0800 (PST) X-Google-Smtp-Source: AK7set+dZAyzb9ztRnkV5Mcg68+Lw2qjve+3jMdRcjRa1xuG7WWPBlyzcqKFEujKn9hcuPGZuret X-Received: by 2002:a05:622a:180b:b0:3bf:a461:e6f0 with SMTP id t11-20020a05622a180b00b003bfa461e6f0mr37448364qtc.31.1677486049502; Mon, 27 Feb 2023 00:20:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486049; cv=none; d=google.com; s=arc-20160816; b=K/afjD5t+AyH7bwACLJ5xNGJ7xBnqoaatSSDhHU+Wr0jyNGWXRmndB0WFMFsKyLISt 59DqP7bpWDLhlQkacoqYpNKj+ucFyIj0fTiS8iTMcEAAffzzNlOOF0jUiTEiFNF1TFDn Kkp3kh4bedvZIM/437ishiEKxXP48Gn2CPhiEKYzd1Y9dmKcJcDVFsQVjDPNgEEY7snV 0ZgOG/YYO7t/PtUxyd9+jSSqGCgyl///fxwquXVCO1kenz1Zivvj064pwwEDlt094+A1 Di46XXg2g8uZVeyRCHF3zNzU8Icz0KC3nblGYyrDd/HrwqWtI6uyMAct13ULDUEgYED0 q0Aw== 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=p/rZ/DyGgynMZU546Lqp6jnTq4/tIVARLLq76v1rsPU=; b=MdgfAalcBpyA+zhIwCzw9nPO4I0J4RUpLKzxSv2dCbb9VdHdrfL2Up+1z0O4WaCQWf o/6YyuzhwsTYG8YFCwJXF03auHwJoVPDZC2vZH6mFId1O8PO7Lkeq+P5Et4ZfJCHqsLY beoZLWgYix3JZq9cXKyT555y07I7VoBIWkJ2S6tkeVLpUMVUUYDqWyoxndmridxZUcO9 OsT6MuWZ+e5p+JwcJbqccQTWSZaWqHqzhegbDjXXTdTSaiEMNssx9flSnc0/SokQmVRU qpFb33Dx3mOpiKidQrO5+kcyuVOQBKWiC9f9mCRylGtXyqghUCv5xrTST4diFmtPJFtY tqhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x83E9l3X; 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 z8-20020ac87f88000000b003b84b93117csi5687434qtj.554.2023.02.27.00.20.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:20:49 -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=x83E9l3X; 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 1pWWIN-0004Nr-19; Mon, 27 Feb 2023 00:43:31 -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 1pWWIJ-0003zo-Gr for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:27 -0500 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIF-000524-Er for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:27 -0500 Received: by mail-pg1-x544.google.com with SMTP id d10so2827637pgt.12 for ; Sun, 26 Feb 2023 21:43:22 -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=p/rZ/DyGgynMZU546Lqp6jnTq4/tIVARLLq76v1rsPU=; b=x83E9l3XOELkrYKgysmQqckKsO1McvluHMzKrSV2eF5PkLVhGuVSjJ3vq/NB7sNDjL OF16qdE/jDlO+nOTWbMKTuIZMdBbDYILqDNfIKs/+7bk2O7AqM1oDRnSoDmLXhsyYuqk QGWLI7rTKxwX6VZX1W2007CYevgEGGg7DphfKomtVXqr1CVFJzDH4tCMXauFSnHOcnvV 8EplC69TTO3nv5NmvlAQ39E+uPjeKpK7Da4uqDnevffzKxqRBxQ1eKUEviKQVNs0to6J L4YS1G4jBdk1mnA+A2B4nk2QeW5WjHQdm/lJu17OinqR8Qg6DH7fRkJ3a3SrCKGjvVrR tdBw== 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=p/rZ/DyGgynMZU546Lqp6jnTq4/tIVARLLq76v1rsPU=; b=dJg0iqdSAwVeVQlpk/8nqJDiwh/mS0o6kGNWxxsAqRbju/xAB89SRtxAFbxBGk1Hxz aUpw1h3nOq5bIkJr69/7ixdwTishUzcnOqTeYeZ8mDZYp/1rwVxXWi9YODUxQWItSzkk Zu6yPvpH6yLNE6N/7Hn1ZgnkwcXaQNS/WGaWTQqSayAYeUAsV0Z1W8SVXXQIhq9PiP4O ZDairjvkXXOW3keOspcwp9ZBbk9FEtqUaY7p/Fj8ahn4Xz4N3Z30JRwx5MpgeZs1w4a6 zYHomDCeJKmsu6pvKgPzHEm1+BpUMdGBHHnjftpi7NciGPf1OG4r3towR7tLN1zsDRRq 1mSQ== X-Gm-Message-State: AO0yUKXlpWzo0sR5rdxyAFqyHKPrUCz7yfRsO0iOHrQr/iNAcLfth7oL Vifj9I0JMLRNtTNqF3XeDQiuTdOEeHriuZErooogOA== X-Received: by 2002:aa7:9d8d:0:b0:5d6:3d96:4777 with SMTP id f13-20020aa79d8d000000b005d63d964777mr16570985pfq.24.1677476601608; Sun, 26 Feb 2023 21:43:21 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:21 -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 14/70] target/cris: Avoid use of tcg_const_i32 throughout Date: Sun, 26 Feb 2023 19:41:37 -1000 Message-Id: <20230227054233.390271-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::544; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x544.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 All remaining uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/cris/translate.c | 46 +++++++++++++++------------------ target/cris/translate_v10.c.inc | 26 +++++++++---------- 2 files changed, 34 insertions(+), 38 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 5172c9b9b2..b2beb9964d 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -175,10 +175,7 @@ static const int preg_sizes[] = { #define t_gen_mov_env_TN(member, tn) \ tcg_gen_st_tl(tn, cpu_env, offsetof(CPUCRISState, member)) #define t_gen_movi_env_TN(member, c) \ - do { \ - TCGv tc = tcg_const_tl(c); \ - t_gen_mov_env_TN(member, tc); \ - } while (0) + t_gen_mov_env_TN(member, tcg_constant_tl(c)) static inline void t_gen_mov_TN_preg(TCGv tn, int r) { @@ -268,8 +265,7 @@ static void cris_lock_irq(DisasContext *dc) static inline void t_gen_raise_exception(uint32_t index) { - TCGv_i32 tmp = tcg_const_i32(index); - gen_helper_raise_exception(cpu_env, tmp); + gen_helper_raise_exception(cpu_env, tcg_constant_i32(index)); } static void t_gen_lsl(TCGv d, TCGv a, TCGv b) @@ -277,7 +273,7 @@ static void t_gen_lsl(TCGv d, TCGv a, TCGv b) TCGv t0, t_31; t0 = tcg_temp_new(); - t_31 = tcg_const_tl(31); + t_31 = tcg_constant_tl(31); tcg_gen_shl_tl(d, a, b); tcg_gen_sub_tl(t0, t_31, b); @@ -1250,7 +1246,7 @@ static int dec_addq(CPUCRISState *env, DisasContext *dc) cris_cc_mask(dc, CC_MASK_NZVC); - c = tcg_const_tl(dc->op1); + c = tcg_constant_tl(dc->op1); cris_alu(dc, CC_OP_ADD, cpu_R[dc->op2], cpu_R[dc->op2], c, 4); return 2; @@ -1274,7 +1270,7 @@ static int dec_subq(CPUCRISState *env, DisasContext *dc) LOG_DIS("subq %u, $r%u\n", dc->op1, dc->op2); cris_cc_mask(dc, CC_MASK_NZVC); - c = tcg_const_tl(dc->op1); + c = tcg_constant_tl(dc->op1); cris_alu(dc, CC_OP_SUB, cpu_R[dc->op2], cpu_R[dc->op2], c, 4); return 2; @@ -1289,7 +1285,7 @@ static int dec_cmpq(CPUCRISState *env, DisasContext *dc) LOG_DIS("cmpq %d, $r%d\n", imm, dc->op2); cris_cc_mask(dc, CC_MASK_NZVC); - c = tcg_const_tl(imm); + c = tcg_constant_tl(imm); cris_alu(dc, CC_OP_CMP, cpu_R[dc->op2], cpu_R[dc->op2], c, 4); return 2; @@ -1304,7 +1300,7 @@ static int dec_andq(CPUCRISState *env, DisasContext *dc) LOG_DIS("andq %d, $r%d\n", imm, dc->op2); cris_cc_mask(dc, CC_MASK_NZ); - c = tcg_const_tl(imm); + c = tcg_constant_tl(imm); cris_alu(dc, CC_OP_AND, cpu_R[dc->op2], cpu_R[dc->op2], c, 4); return 2; @@ -1318,7 +1314,7 @@ static int dec_orq(CPUCRISState *env, DisasContext *dc) LOG_DIS("orq %d, $r%d\n", imm, dc->op2); cris_cc_mask(dc, CC_MASK_NZ); - c = tcg_const_tl(imm); + c = tcg_constant_tl(imm); cris_alu(dc, CC_OP_OR, cpu_R[dc->op2], cpu_R[dc->op2], c, 4); return 2; @@ -1330,7 +1326,7 @@ static int dec_btstq(CPUCRISState *env, DisasContext *dc) LOG_DIS("btstq %u, $r%d\n", dc->op1, dc->op2); cris_cc_mask(dc, CC_MASK_NZ); - c = tcg_const_tl(dc->op1); + c = tcg_constant_tl(dc->op1); cris_evaluate_flags(dc); gen_helper_btst(cpu_PR[PR_CCS], cpu_env, cpu_R[dc->op2], c, cpu_PR[PR_CCS]); @@ -1945,8 +1941,8 @@ static int dec_move_rs(CPUCRISState *env, DisasContext *dc) { TCGv c2, c1; LOG_DIS("move $r%u, $s%u\n", dc->op1, dc->op2); - c1 = tcg_const_tl(dc->op1); - c2 = tcg_const_tl(dc->op2); + c1 = tcg_constant_tl(dc->op1); + c2 = tcg_constant_tl(dc->op2); cris_cc_mask(dc, 0); gen_helper_movl_sreg_reg(cpu_env, c2, c1); return 2; @@ -1955,8 +1951,8 @@ static int dec_move_sr(CPUCRISState *env, DisasContext *dc) { TCGv c2, c1; LOG_DIS("move $s%u, $r%u\n", dc->op2, dc->op1); - c1 = tcg_const_tl(dc->op1); - c2 = tcg_const_tl(dc->op2); + c1 = tcg_constant_tl(dc->op1); + c2 = tcg_constant_tl(dc->op2); cris_cc_mask(dc, 0); gen_helper_movl_reg_sreg(cpu_env, c1, c2); return 2; @@ -2237,7 +2233,7 @@ static int dec_test_m(CPUCRISState *env, DisasContext *dc) cris_cc_mask(dc, CC_MASK_NZ); tcg_gen_andi_tl(cpu_PR[PR_CCS], cpu_PR[PR_CCS], ~3); - c = tcg_const_tl(0); + c = tcg_constant_tl(0); cris_alu(dc, CC_OP_CMP, cpu_R[dc->op2], t[1], c, memsize_zz(dc)); do_postinc(dc, memsize); @@ -2582,7 +2578,7 @@ static int dec_jas_r(CPUCRISState *env, DisasContext *dc) if (dc->op2 > 15) { abort(); } - c = tcg_const_tl(dc->pc + 4); + c = tcg_constant_tl(dc->pc + 4); t_gen_mov_preg_TN(dc, dc->op2, c); cris_prepare_jmp(dc, JMP_INDIRECT); @@ -2598,7 +2594,7 @@ static int dec_jas_im(CPUCRISState *env, DisasContext *dc) LOG_DIS("jas 0x%x\n", imm); cris_cc_mask(dc, 0); - c = tcg_const_tl(dc->pc + 8); + c = tcg_constant_tl(dc->pc + 8); /* Store the return address in Pd. */ t_gen_mov_preg_TN(dc, dc->op2, c); @@ -2616,7 +2612,7 @@ static int dec_jasc_im(CPUCRISState *env, DisasContext *dc) LOG_DIS("jasc 0x%x\n", imm); cris_cc_mask(dc, 0); - c = tcg_const_tl(dc->pc + 8 + 4); + c = tcg_constant_tl(dc->pc + 8 + 4); /* Store the return address in Pd. */ t_gen_mov_preg_TN(dc, dc->op2, c); @@ -2632,7 +2628,7 @@ static int dec_jasc_r(CPUCRISState *env, DisasContext *dc) cris_cc_mask(dc, 0); /* Store the return address in Pd. */ tcg_gen_mov_tl(env_btarget, cpu_R[dc->op1]); - c = tcg_const_tl(dc->pc + 4 + 4); + c = tcg_constant_tl(dc->pc + 4 + 4); t_gen_mov_preg_TN(dc, dc->op2, c); cris_prepare_jmp(dc, JMP_INDIRECT); return 2; @@ -2664,7 +2660,7 @@ static int dec_bas_im(CPUCRISState *env, DisasContext *dc) LOG_DIS("bas 0x%x, $p%u\n", dc->pc + simm, dc->op2); cris_cc_mask(dc, 0); - c = tcg_const_tl(dc->pc + 8); + c = tcg_constant_tl(dc->pc + 8); /* Store the return address in Pd. */ t_gen_mov_preg_TN(dc, dc->op2, c); @@ -2681,7 +2677,7 @@ static int dec_basc_im(CPUCRISState *env, DisasContext *dc) LOG_DIS("basc 0x%x, $p%u\n", dc->pc + simm, dc->op2); cris_cc_mask(dc, 0); - c = tcg_const_tl(dc->pc + 12); + c = tcg_constant_tl(dc->pc + 12); /* Store the return address in Pd. */ t_gen_mov_preg_TN(dc, dc->op2, c); @@ -2695,7 +2691,7 @@ static int dec_rfe_etc(CPUCRISState *env, DisasContext *dc) cris_cc_mask(dc, 0); if (dc->op2 == 15) { - tcg_gen_st_i32(tcg_const_i32(1), cpu_env, + tcg_gen_st_i32(tcg_constant_i32(1), cpu_env, -offsetof(CRISCPU, env) + offsetof(CPUState, halted)); tcg_gen_movi_tl(env_pc, dc->pc + 2); t_gen_raise_exception(EXCP_HLT); diff --git a/target/cris/translate_v10.c.inc b/target/cris/translate_v10.c.inc index b03b2ef746..32338bb69b 100644 --- a/target/cris/translate_v10.c.inc +++ b/target/cris/translate_v10.c.inc @@ -251,7 +251,7 @@ static unsigned int dec10_quick_imm(DisasContext *dc) LOG_DIS("moveq %d, $r%d\n", simm, dc->dst); cris_cc_mask(dc, CC_MASK_NZVC); - c = tcg_const_tl(simm); + c = tcg_constant_tl(simm); cris_alu(dc, CC_OP_MOVE, cpu_R[dc->dst], cpu_R[dc->dst], c, 4); break; @@ -259,7 +259,7 @@ static unsigned int dec10_quick_imm(DisasContext *dc) LOG_DIS("cmpq %d, $r%d\n", simm, dc->dst); cris_cc_mask(dc, CC_MASK_NZVC); - c = tcg_const_tl(simm); + c = tcg_constant_tl(simm); cris_alu(dc, CC_OP_CMP, cpu_R[dc->dst], cpu_R[dc->dst], c, 4); break; @@ -267,7 +267,7 @@ static unsigned int dec10_quick_imm(DisasContext *dc) LOG_DIS("addq %d, $r%d\n", imm, dc->dst); cris_cc_mask(dc, CC_MASK_NZVC); - c = tcg_const_tl(imm); + c = tcg_constant_tl(imm); cris_alu(dc, CC_OP_ADD, cpu_R[dc->dst], cpu_R[dc->dst], c, 4); break; @@ -275,7 +275,7 @@ static unsigned int dec10_quick_imm(DisasContext *dc) LOG_DIS("andq %d, $r%d\n", simm, dc->dst); cris_cc_mask(dc, CC_MASK_NZVC); - c = tcg_const_tl(simm); + c = tcg_constant_tl(simm); cris_alu(dc, CC_OP_AND, cpu_R[dc->dst], cpu_R[dc->dst], c, 4); break; @@ -285,7 +285,7 @@ static unsigned int dec10_quick_imm(DisasContext *dc) cris_cc_mask(dc, CC_MASK_NZVC); op = imm & (1 << 5); imm &= 0x1f; - c = tcg_const_tl(imm); + c = tcg_constant_tl(imm); if (op) { cris_alu(dc, CC_OP_ASR, cpu_R[dc->dst], cpu_R[dc->dst], c, 4); @@ -305,7 +305,7 @@ static unsigned int dec10_quick_imm(DisasContext *dc) } imm &= 0x1f; cris_cc_mask(dc, CC_MASK_NZVC); - c = tcg_const_tl(imm); + c = tcg_constant_tl(imm); cris_alu(dc, op, cpu_R[dc->dst], cpu_R[dc->dst], c, 4); break; @@ -313,7 +313,7 @@ static unsigned int dec10_quick_imm(DisasContext *dc) LOG_DIS("subq %d, $r%d\n", imm, dc->dst); cris_cc_mask(dc, CC_MASK_NZVC); - c = tcg_const_tl(imm); + c = tcg_constant_tl(imm); cris_alu(dc, CC_OP_SUB, cpu_R[dc->dst], cpu_R[dc->dst], c, 4); break; @@ -321,7 +321,7 @@ static unsigned int dec10_quick_imm(DisasContext *dc) LOG_DIS("andq %d, $r%d\n", simm, dc->dst); cris_cc_mask(dc, CC_MASK_NZVC); - c = tcg_const_tl(simm); + c = tcg_constant_tl(simm); cris_alu(dc, CC_OP_OR, cpu_R[dc->dst], cpu_R[dc->dst], c, 4); break; @@ -1014,7 +1014,7 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc) cris_alu_m_alloc_temps(t); insn_len += dec10_prep_move_m(env, dc, 0, size, t[0]); tcg_gen_andi_tl(cpu_PR[PR_CCS], cpu_PR[PR_CCS], ~3); - c = tcg_const_tl(0); + c = tcg_constant_tl(0); cris_alu(dc, CC_OP_CMP, cpu_R[dc->dst], t[0], c, size); break; @@ -1111,7 +1111,7 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc) if (dc->mode == CRISV10_MODE_AUTOINC) insn_len += size; - c = tcg_const_tl(dc->pc + insn_len); + c = tcg_constant_tl(dc->pc + insn_len); t_gen_mov_preg_TN(dc, dc->dst, c); dc->jmp_pc = imm; cris_prepare_jmp(dc, JMP_DIRECT); @@ -1121,7 +1121,7 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc) LOG_DIS("break %d\n", dc->src); cris_evaluate_flags(dc); tcg_gen_movi_tl(env_pc, dc->pc + 2); - c = tcg_const_tl(dc->src + 2); + c = tcg_constant_tl(dc->src + 2); t_gen_mov_env_TN(trap_vector, c); t_gen_raise_exception(EXCP_BREAK); dc->base.is_jmp = DISAS_NORETURN; @@ -1130,7 +1130,7 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc) LOG_DIS("%d: jump.%d %d r%d r%d\n", __LINE__, size, dc->opcode, dc->src, dc->dst); t[0] = tcg_temp_new(); - c = tcg_const_tl(dc->pc + insn_len); + c = tcg_constant_tl(dc->pc + insn_len); t_gen_mov_preg_TN(dc, dc->dst, c); crisv10_prepare_memaddr(dc, t[0], size); gen_load(dc, env_btarget, t[0], 4, 0); @@ -1153,7 +1153,7 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc) LOG_DIS("jmp pc=%x opcode=%d r%d r%d\n", dc->pc, dc->opcode, dc->dst, dc->src); tcg_gen_mov_tl(env_btarget, cpu_R[dc->src]); - c = tcg_const_tl(dc->pc + insn_len); + c = tcg_constant_tl(dc->pc + insn_len); t_gen_mov_preg_TN(dc, dc->dst, c); cris_prepare_jmp(dc, JMP_INDIRECT); dc->delayed_branch--; /* v10 has no dslot here. */ From patchwork Mon Feb 27 05:41:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656896 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2227905wrb; Mon, 27 Feb 2023 00:12:23 -0800 (PST) X-Google-Smtp-Source: AK7set+7c8eWmDgw8D+coP6E8b019CKOvSxferwRZ6FQmC1qtXAJqIhMp2xSFy0nyhhCoayPYwIj X-Received: by 2002:a05:622a:8f:b0:3bf:c474:df98 with SMTP id o15-20020a05622a008f00b003bfc474df98mr13666712qtw.56.1677485543009; Mon, 27 Feb 2023 00:12:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485542; cv=none; d=google.com; s=arc-20160816; b=t1adpbXkQc+Ui7elvIwiJVwMJB9lGSAcZCuNjo193c30pculPAUGtJ/fFkaREo6kwp 2uyECdC78CbIPWU4uE5o2TLRfHCKJzqcFekXkUgvKodfkj2zpwOwYroGiCJNV30T621h PNydZjCM5MwYiCBiWjt7k1kgBjjk5a/KH2Bd5qpGhEQknTSsimLunGymvmk8o0YWuVhM jXNQEqNtfZK0pJEOUqqMEFQN3sVFTExZ13/Z674ZYeH9fk30XCsfA08sRLvKcxOnePjo 5bEllVgIDLn9IKqg+596eO1v2QZBdh1XniDoe6MpFyDHwpbaquvHNdCtbW66QmDQnS9I qdBw== 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=IEezoZfJQNe6XCATjLvrmBK8hrTlzOfAXX1KwxpEYxg=; b=t0aKjXE7rZVCDwvargOrpSkDk4wLwhJUjuxz1VUijNnLVwOgauz3ZXdJzT0V8dgpjc TLRTG/UPGWBWlFHvOd4YYVBGQywQTf+/8ITHYKEsHPQyl+nL2vKP+7eV9ACCEdfuPlCH 3+79I+lyyL3r5zfNY54CStqxIGuyNmVkVnrXcC90CtjIVV3U4NvNGF2D1uwXc+xtQM9W cGHbPwHP6vfebHOV6s+5FKhzCpLNnWt2UwC8WTY/ULt869hFS4r3usfb3G18oAOmnc1w hm0cKthF7uxQzIVmlJ8AYhrNjXy4ix7rFm9WSulHxCb4wVP04Mrx0WFRV638CTwYrn0m DtbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cueij7K9; 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 p15-20020a05622a048f00b003bd0048709asi6213988qtx.631.2023.02.27.00.12.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:12:22 -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=Cueij7K9; 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 1pWWIM-0004M4-Ox; Mon, 27 Feb 2023 00:43:30 -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 1pWWIK-00046N-8a for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:28 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWII-00053X-7P for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:27 -0500 Received: by mail-pl1-x643.google.com with SMTP id bh1so5530322plb.11 for ; Sun, 26 Feb 2023 21:43:25 -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=IEezoZfJQNe6XCATjLvrmBK8hrTlzOfAXX1KwxpEYxg=; b=Cueij7K9HsNdTRop7fJC2iIMDj8bivUR5bAl9bPPYLMpN8X4bsvwzsWVThQF4iRxcj mSVPcp1QDxEapnVUJPZOIblxOphQEeCJTz97oiQpK3XlEDxE3Q1IlVLGL3jpsbCBQHU1 kmwcB1sSpTL/+9H6DWth6N9QAp//aw/8owPgmfXvVh+2pDBKyecY6Luz+bdzQSQHMEuI fgqzofG29GgUfasCdV9ezH97tGhlAO8A/nFUR0WUhWQ/8JMGzaZJp/sjpc9TYhLixrc4 hekJLs67AfiTz7VgJF4ov5k/n5XjfLtQ6cQcEi4yCAryD2pQ86QpVy/ZCQd3FxmF/Spc TSug== 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=IEezoZfJQNe6XCATjLvrmBK8hrTlzOfAXX1KwxpEYxg=; b=jmunqOdRR6m3RtAzPI1Trtug1sRJu1EWQmoDAPClctdM+keO/QQPBPxzRLdrHApkes 8iZyDIuiSSa57hn4NlEICzEso/ABhPdyMwDnLvURb47eKqsVu/pOZpTqx0YKFaBhKzyC JQJ6FC6ajYN6nFZktS5PUkqvAgtUPZjEd7tKmF4nbmh/RchcJjOKCSGZZiCEIZEhEcb8 q266ArXKWBhQYY2ru88tN6eoOzOhioaxhdijUzyY0O7CIS4Vh4+B7BWz+KnKnRKeH7RV 0hC+/jW2jYAt07gZ48ex0ZpbTOCRWtUuzddaJA2sJoSY90BezL6EQIPTJ6tTvuP08YRk pw1w== X-Gm-Message-State: AO0yUKVMVXe199fTfL6coXSunDSLcrVtdP/kLKvDSm2EWEGvnEm9ts2I TpuowWXjmvzZy8svWwgXDi/n3H4h4zlWxMsoHvvWMQ== X-Received: by 2002:a05:6a20:258d:b0:cc:88af:12ab with SMTP id k13-20020a056a20258d00b000cc88af12abmr10407124pzd.28.1677476604528; Sun, 26 Feb 2023 21:43:24 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:24 -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 15/70] target/hexagon: Use tcg_constant_* for gen_constant_from_imm Date: Sun, 26 Feb 2023 19:41:38 -1000 Message-Id: <20230227054233.390271-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x643.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Rename from gen_tmp_value_from_imm to match gen_constant vs gen_tmp. Signed-off-by: Richard Henderson Reviewed-by: Taylor Simpson --- target/hexagon/idef-parser/parser-helpers.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/target/hexagon/idef-parser/parser-helpers.c b/target/hexagon/idef-parser/parser-helpers.c index 0b401f7dbe..6fb5f31cf7 100644 --- a/target/hexagon/idef-parser/parser-helpers.c +++ b/target/hexagon/idef-parser/parser-helpers.c @@ -325,9 +325,9 @@ HexValue gen_tmp_value(Context *c, return rvalue; } -static HexValue gen_tmp_value_from_imm(Context *c, - YYLTYPE *locp, - HexValue *value) +static HexValue gen_constant_from_imm(Context *c, + YYLTYPE *locp, + HexValue *value) { HexValue rvalue; assert(value->type == IMMEDIATE); @@ -338,11 +338,11 @@ static HexValue gen_tmp_value_from_imm(Context *c, rvalue.is_dotnew = false; rvalue.tmp.index = c->inst.tmp_count; /* - * Here we output the call to `tcg_const_i` in + * Here we output the call to `tcg_constant_i` in * order to create the temporary value. Note, that we * add a cast * - * `tcg_const_i`((int_t) ...)` + * `tcg_constant_i`((int_t) ...)` * * This cast is required to avoid implicit integer * conversion warnings since all immediates are @@ -350,7 +350,7 @@ static HexValue gen_tmp_value_from_imm(Context *c, * integer is 32-bit. */ OUT(c, locp, "TCGv_i", &rvalue.bit_width, " tmp_", &c->inst.tmp_count); - OUT(c, locp, " = tcg_const_i", &rvalue.bit_width, + OUT(c, locp, " = tcg_constant_i", &rvalue.bit_width, "((int", &rvalue.bit_width, "_t) (", value, "));\n"); c->inst.tmp_count++; @@ -395,8 +395,7 @@ HexValue gen_imm_qemu_tmp(Context *c, YYLTYPE *locp, unsigned bit_width, HexValue rvalue_materialize(Context *c, YYLTYPE *locp, HexValue *rvalue) { if (rvalue->type == IMMEDIATE) { - HexValue res = gen_tmp_value_from_imm(c, locp, rvalue); - return res; + return gen_constant_from_imm(c, locp, rvalue); } return *rvalue; } From patchwork Mon Feb 27 05:41:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656911 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2229805wrb; Mon, 27 Feb 2023 00:18:33 -0800 (PST) X-Google-Smtp-Source: AK7set9IMLexYnfsaIWfDdwJZYPFExA0XwAWUOBJXzG7rnirbtCd2O5VMgt+LtCC7PtOiL3Y41wk X-Received: by 2002:ac8:5fd0:0:b0:3bf:c29b:678b with SMTP id k16-20020ac85fd0000000b003bfc29b678bmr15748445qta.50.1677485913502; Mon, 27 Feb 2023 00:18:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485913; cv=none; d=google.com; s=arc-20160816; b=CCc5j3iDWPmQmcLo4Qi4ZcxV5/06xaZFTbiyOez5x8NJeOxupagcMfi3a4wW090/yM OERH7s9T5xL81dOJP4zJdDPIIyGfzhzs+v1tnUY/jAfnnzIQXtf9uFMg5N2Ao916FYQq 4ILo0nrGdloNfL4Apv378eJsuHOJWDep4urz0IUA8XZ3PXBgnrXeti+3y7bq8AZrKoeU TdUZQ5tQx9/gWf+0QmslfhYpCR1tKwoRA5YZBpZHhwvq2KLgeqFyu3p3c5HDRZx+kgzC iR7z18cv8mx2sC1qdHGcL1w3K75fTrj+WIKx0lZgH4g5h4dhQHmZyk5vtJmyLJFt414e O8XQ== 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=ayfqorD9uX7/Vi+5yV/fsV6QKxxs5QiH623wECf/tb4=; b=Qq/rz9DUCrWx5mmzCEcj0/Wm/8dE7ulBJU6HhA7b8VRu7o92VNPmT9e15D5Gaa/kqo VyO9DeTf/VzFR2i9q/JcA3WnybUTUSpV9Xpn/IzAwy+2sC/x4DjOFPX9avNcPkPha/i9 WYLWehG5uBRPrMEi3TZPl5nC/TePPhlX/ywTQpqWcmbTVfViDpFckJSKBHPtKLPkz/g1 nUh20aYs4QxD6L5iMCbuihiEnzn+g3QYHtatb7ty2/l+0q3F1EReQUlY/R7KDFtVLrnC Dp6uBlNDFV0FQiXvMohnUvtLUzHVK0bf1XkVJxmx7iOwo0nGiLevvadZfuiGFyOT/mK2 JMDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dVxpBUlM; 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 n8-20020a05622a11c800b003b9bfdf0cc9si6319321qtk.389.2023.02.27.00.18.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:18:33 -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=dVxpBUlM; 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 1pWWIf-0004w5-T0; Mon, 27 Feb 2023 00:43:50 -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 1pWWIM-0004LZ-Gv for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:30 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIK-000504-Ih for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:30 -0500 Received: by mail-pg1-x535.google.com with SMTP id p6so2883157pga.0 for ; Sun, 26 Feb 2023 21:43:27 -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=ayfqorD9uX7/Vi+5yV/fsV6QKxxs5QiH623wECf/tb4=; b=dVxpBUlM768pnD18AqVBmiwPTby3CHGQ7bD6WZ9QbnuRlNs1V+WfpQHcEYNtGBBAoM XoF6lRZ0qQgrjyowHaAM5oO1OEb4/4UA5Fnf4EkEoJ0LwIDSa0kzz5nHGQ9VRrCxgByd gtgcAABUlf+XZvvSzyrOa2xX3Og6evcgTx50F+eqHL97b6jtG70d/lj76wXepkO19FWP P49nKe2+9tFNJffo56BEn4krwxlyMh+cI5WLJaoBCUTNpx+IO5Uk0gPGH0M1Ntl/lxgm gTi/yObaJG5w5oMErv431mh1/8jIZ51xNYGDLnESLdv0PzBRgMWzyUD2LWoLGQPD9zQQ SOMg== 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=ayfqorD9uX7/Vi+5yV/fsV6QKxxs5QiH623wECf/tb4=; b=oP0fL24p8AcKigCbdnuHEkCL21wnT+TIQy/KZ+wkHG6XKO7y6wC2CSLErgd3atYYgr N28MLItM9jZHpp9/KQ9WsRuyXonb9ZENyKpYc4iXM+1lEP2TigJKb64xaH248saaGKGs 5vasKfYOq4ixhetgSpYCLDV+lJpiCeOdQwU9+A+Wqs5jaOhaMtSpjlF/LCMeYhr/Nd2H XB37jXtVE9/waaecvtDcvlGXr5kP4qnO2x1IbpsCGllEnC1OH3wjkojsVYc23XX0SgcU TFIvRazySsrKkp37IVhORCxq4qOXBfoVuL5ld2O2plzs1IkK8lC+pVTSS6ghJuPqydJO 3gHg== X-Gm-Message-State: AO0yUKU/+1pD9ISWip3L+gA32NYZ9UtNiTCkC6vdUGUrqVjmkpRx59Rj 8bOmPeMF3DD4MRv0iYBNmJLoqlZ95fJiYe+XAME= X-Received: by 2002:a62:17ce:0:b0:5a8:abd2:2beb with SMTP id 197-20020a6217ce000000b005a8abd22bebmr19633529pfx.30.1677476607602; Sun, 26 Feb 2023 21:43:27 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:27 -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 16/70] target/hexagon/idef-parser: Use gen_tmp for LPCFG Date: Sun, 26 Feb 2023 19:41:39 -1000 Message-Id: <20230227054233.390271-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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 The GET_USR_FIELD macro initializes the output, so the initial assignment of zero is discarded. This is the only use of get_tmp_value outside of parser-helper.c, so make it static. Signed-off-by: Richard Henderson Reviewed-by: Taylor Simpson --- target/hexagon/idef-parser/parser-helpers.h | 6 ------ target/hexagon/idef-parser/parser-helpers.c | 2 +- target/hexagon/idef-parser/idef-parser.y | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/target/hexagon/idef-parser/parser-helpers.h b/target/hexagon/idef-parser/parser-helpers.h index 4c89498f5b..1239d23a6a 100644 --- a/target/hexagon/idef-parser/parser-helpers.h +++ b/target/hexagon/idef-parser/parser-helpers.h @@ -154,12 +154,6 @@ HexValue gen_tmp(Context *c, unsigned bit_width, HexSignedness signedness); -HexValue gen_tmp_value(Context *c, - YYLTYPE *locp, - const char *value, - unsigned bit_width, - HexSignedness signedness); - HexValue gen_imm_value(Context *c __attribute__((unused)), YYLTYPE *locp, int value, diff --git a/target/hexagon/idef-parser/parser-helpers.c b/target/hexagon/idef-parser/parser-helpers.c index 6fb5f31cf7..be979dac86 100644 --- a/target/hexagon/idef-parser/parser-helpers.c +++ b/target/hexagon/idef-parser/parser-helpers.c @@ -305,7 +305,7 @@ HexValue gen_tmp(Context *c, return rvalue; } -HexValue gen_tmp_value(Context *c, +static HexValue gen_tmp_value(Context *c, YYLTYPE *locp, const char *value, unsigned bit_width, diff --git a/target/hexagon/idef-parser/idef-parser.y b/target/hexagon/idef-parser/idef-parser.y index fae291e5f8..c784726d41 100644 --- a/target/hexagon/idef-parser/idef-parser.y +++ b/target/hexagon/idef-parser/idef-parser.y @@ -783,7 +783,7 @@ rvalue : FAIL } | LPCFG { - $$ = gen_tmp_value(c, &@1, "0", 32, UNSIGNED); + $$ = gen_tmp(c, &@1, 32, UNSIGNED); OUT(c, &@1, "GET_USR_FIELD(USR_LPCFG, ", &$$, ");\n"); } | EXTRACT '(' rvalue ',' rvalue ')' From patchwork Mon Feb 27 05:41:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656864 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2185147wrb; Sun, 26 Feb 2023 21:52:48 -0800 (PST) X-Google-Smtp-Source: AK7set/AHcucteYbNUOzFbqBOyul70PXnyIvvCZSMXxSlfXR/Q03foUnGrYThVx6uu+9hn0RwSRi X-Received: by 2002:ac8:5b4d:0:b0:3bf:b08f:1dcd with SMTP id n13-20020ac85b4d000000b003bfb08f1dcdmr27091410qtw.38.1677477168212; Sun, 26 Feb 2023 21:52:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477168; cv=none; d=google.com; s=arc-20160816; b=goc0svMAdbHMoWRfoeclfbTJkXCsHJydYqn14MxD+O1bYSpFvI6kSENppNn/TwWMUd qFyjovu1CTU7c3/kxiByzFiONWtg5IHBi8DONxJrjFJ9Y7WKtcQZia+xJa/7rLkc6WRb c6A692BaXOujt6xk213FqwFH2GYWXNrQh9RdfWQtLTCswKPVoXCiEnPiLW7IN8Zy0vlX Qneyl5QsTd1+Xw2mo5MfFhZf0DWy83j8oOIZK4xtq1HNf0czHdDItF2tIe/y7BiZqt0C ZJUpPhKuXpr6P0cVe82/y9ovDdrCzOB+1VZy6Su2B44uC7xuT4CbUjV/10Dp97Bls+Qo 21+Q== 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=YWyB6GQNgVYVxuAOGEyoKh6Pcm1Ty+r0BVfYb9qxS/M=; b=Gkgvaq9635cWH+XRewJ1ov0QEW5yfMTByOaUJu9rN8hcxULH3sK+sTigXKpH7fstUA Lq2WEK0KM5dmsYq0KrfLhw9/W8XTu7N2CTiwiwB+WHUYXD0mKpc/m56IV7BuQGMuc9s4 I7/mjiFCdOZFLE4XHjznrE1gBXlRxj8FMheyex0RTHLcBLYmlc5PmnntBDeSAYwvL4e9 e4Jf6V6OKvqhYtBI6pI/8/JIhN4/QwpH52G+Va1PyYBNmdMIV8ZzufElDE66+IxH9/Ir pVUV8NWSl5E99639H1DZeUDqcXCZ6rGTxqMDognuw3y32cLGGTDvI8tHlQbeu/UFZstI 6nbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EukppHBP; 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 y10-20020a05622a120a00b003b637dccb14si5949462qtx.350.2023.02.26.21.52.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:52:48 -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=EukppHBP; 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 1pWWIg-00051H-G6; Mon, 27 Feb 2023 00:43:50 -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 1pWWIS-0004TF-19 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:36 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIM-0004rQ-S5 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:32 -0500 Received: by mail-pl1-x631.google.com with SMTP id z2so5528949plf.12 for ; Sun, 26 Feb 2023 21:43:30 -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=YWyB6GQNgVYVxuAOGEyoKh6Pcm1Ty+r0BVfYb9qxS/M=; b=EukppHBPd8MCw6RtCfNX3p1XFndx5p1rr2qQ9UOXDXvnMBdEtqWyW/5tTegUSwh6FR utONsUUC1TVC70DZDHmIAYYDE6Gb6PoePLCZ+4BKfqmI/Fe4ne6UqzdP+WHjeCXKfM2Q jWohcY0kBUSl0RgSedpz5PjIw8cyVCBstkSrr+r8Q6Zm8XRZj6v/6VPswbVYLu7bb5Zo ++1hOM8yOxfmdbDCT5sBOR8UZDnVVZNVa7qnNImiIpCLFr1+ydkLaUnmR1shnsy2e1p6 Gi62FtzXacX+3vkBlAS5CPklZCFUEQCByOCNIbykTXLykIe3Kps8b8wRjfF8IFRpy51l xaMQ== 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=YWyB6GQNgVYVxuAOGEyoKh6Pcm1Ty+r0BVfYb9qxS/M=; b=vdLE9b18RSYtook3ISQS+EjnP7VFYDwD0mz7gqI+Fc7lbMkAhmE2Fey6Dw2AgbAICG OoEzbsTV3h6pidMBIGhNvaG8NPeJQXdSaU+7e5KYzH5KjA0hqvSMtIVxMjH3KiNjCQCI uH6iNGR6sA0jf+d54Buh6UCSrfYxXc5jke9Z2ajW9dUqPNzIh1zMOs+Hm4wYZep+aW2i jldP2Q/R9JRivHgAvP+bpFUUnf6NroYmY6B+rEX4/ZfqaPoYIm4KLEmwKpfiDnPvOnpT V2osVzjBZBYqGAzp6zgN6kNsyQBlWoY80/cKOVdhTWCXIy3I+yp+YZs1mHzLP5GiGr01 fhVA== X-Gm-Message-State: AO0yUKVRq9n+44MYmzQTpjAGzU4Wn4LTgVYvaym3eV9h2Wped907ujqV 15lCweZewVl7ddDnqmrpGekFCXesq/1SNXTKLuA= X-Received: by 2002:a05:6a20:938d:b0:cc:d20c:434f with SMTP id x13-20020a056a20938d00b000ccd20c434fmr7510407pzh.59.1677476610033; Sun, 26 Feb 2023 21:43:30 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:29 -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 17/70] target/hexagon/idef-parser: Use gen_tmp for gen_pred_assign Date: Sun, 26 Feb 2023 19:41:40 -1000 Message-Id: <20230227054233.390271-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The allocation is immediately followed by tcg_gen_mov_i32, so the initial assignment of zero is discarded. Signed-off-by: Richard Henderson Reviewed-by: Taylor Simpson --- target/hexagon/idef-parser/parser-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hexagon/idef-parser/parser-helpers.c b/target/hexagon/idef-parser/parser-helpers.c index be979dac86..760e499149 100644 --- a/target/hexagon/idef-parser/parser-helpers.c +++ b/target/hexagon/idef-parser/parser-helpers.c @@ -1743,7 +1743,7 @@ void gen_pred_assign(Context *c, YYLTYPE *locp, HexValue *left_pred, "Predicate assign not allowed in ternary!"); /* Extract predicate TCGv */ if (is_direct) { - *left_pred = gen_tmp_value(c, locp, "0", 32, UNSIGNED); + *left_pred = gen_tmp(c, locp, 32, UNSIGNED); } /* Extract first 8 bits, and store new predicate value */ OUT(c, locp, "tcg_gen_mov_i32(", left_pred, ", ", &r, ");\n"); From patchwork Mon Feb 27 05:41:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656925 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2230858wrb; Mon, 27 Feb 2023 00:22:13 -0800 (PST) X-Google-Smtp-Source: AK7set+z4fbAXXeiiNL2CPx494InEb2DrUgBFu7EnrtnuhQ2FAr3HsBKKN7ydpVbrTpga6wb7ryA X-Received: by 2002:a05:6214:3017:b0:56e:bc57:d646 with SMTP id ke23-20020a056214301700b0056ebc57d646mr49718503qvb.43.1677486133717; Mon, 27 Feb 2023 00:22:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486133; cv=none; d=google.com; s=arc-20160816; b=WhRcyyYULq7KuVAq7HWysbxlcL0yMlat99QGF0Hk6bTlKb2EyuhuqdUOtqui5GOLX+ Gdq3mREB4kxjFlLmPTdfTdRPAsWachv+nj7gDw+cOieaa0wGxek/3RRa2dBM/N/Lp1TE bh83JwQ0mB+wCmy1GgaYwFbb9XiFMaieXSaeGSMDyNXd2K4wlb2jEFSmzbYvvvP1+lhm yIDxc1h5seCiwuEHQ5sta1GGp6vkLjAmlaBhO8j+CIqEs8Gfyg2bJHaMX9uNUMPyw+Jp apCAPMXbQ1mOc5e/lFHK0a6kMAHEr12ICdGxRyroVThcn2mfDy+1bP30RYnKFJomiNFk bYiw== 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=zRx1sxGC/BHAlSf9HxSK6Ts5KBIPD3Nvcak977lbrlU=; b=bhn5tl/BVfwBiF8I05RSHJpfLZxJBEUmGkFE4/FvA3bL57WRWwV83l6j0staBTfOzJ //YKoTq0NMfqW6B3Ur9TXBvflePtsmJ8GdrpvFFlM4lNx/9UXxgOLXxkNTmkpbHxpLFX u6Y6eChmSSDw2JSDGEzXMnf3rmlDvGh9BONRJQZVFlUrRGyMEXDnmwkqRLB/eo8dBoZ/ hF7rCslrUi8oInubdOGmW7NpBnMGQoK0a/NK+9SuPRm8oZRL4ZhI7FzfZBVsKRxjoWGU DVIhOtl4Redq5Lwl4mGOAOOWiluqfTWR2SlXUl7jTNdjsXuMpacPRx+ovRJOKVXYS9ge 6IwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bSky75kQ; 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 29-20020a05620a049d00b00742702e2d44si5390408qkr.111.2023.02.27.00.22.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:22:13 -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=bSky75kQ; 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 1pWWIl-0005KZ-34; Mon, 27 Feb 2023 00:43:55 -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 1pWWIU-0004Zb-DN for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:40 -0500 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIR-00056u-JZ for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:38 -0500 Received: by mail-pj1-x1044.google.com with SMTP id h17-20020a17090aea9100b0023739b10792so5082880pjz.1 for ; Sun, 26 Feb 2023 21:43:33 -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=zRx1sxGC/BHAlSf9HxSK6Ts5KBIPD3Nvcak977lbrlU=; b=bSky75kQNaokGkldwx9WxvHXxWcYAfLjGMAg8TIokjVgCOZfI+i0Zl1NjRRHy1Qfjf dIvY3HBlE/GwPhvXZXbZjfFpIgeIkRECH5l9Fnm8Pvtx8QZEeF9WdsEM3QUNGNdpYUhH 80eGDpo2PZd2Q9m4jAmzxolaXBakM4raYLpmH4a4Az4eo3hQxFlsS6XeIxurRP4HtL0F 40bTr/RbWi7wnpwEE9jLGxq+h2biZA0vcUkNTdCPfbR+YIBP5gPMmcOdoZDBKtLgywvc +PXGbNpXarxhDGMfcZCbMmsTHIybdqmubWbvavzexbCY7rkGvl5ZqfJDR5F3RG3Y45uK zGFg== 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=zRx1sxGC/BHAlSf9HxSK6Ts5KBIPD3Nvcak977lbrlU=; b=gmPr9+DUrLAxtpGzPbQG+dPvmq0vMuQx84a8tzzLpDb0QAIFMSscf91dcfgrbaiEUy aGnwcW2WMERyvhE3ClCU7SLRdSoND+3LLzqfIQWBW3MAv+1DGOxxkupTTWXy+7fNlbSz ErauUfYGiNLqC0vkwZ1MlmqZdmrJME/UlGo75jCRLxMN3O/9MgvB4UjlkAjwNyG3sHlp TtO5KvlOnftsmO/NsITbk/04GJlnaotWOieNVSdmfO4CtjwDZfKyWNFh2Y6VBWgZS7sP u4iYT8FVzDgAUeXG6X25tx8LM0+g2JOZtrC5RrU9/fCJ7sHxL8A8odZ4ow52mEAEEbfR rAwg== X-Gm-Message-State: AO0yUKWC34LJD3QslizQiZuKmhHTki+KvBcsFQXQQvOH/FM9vg8X6vjJ gJWXIC30gyOQi37NBnmBxtOpAnb9nxz7ucg6R0+Tag== X-Received: by 2002:a05:6a20:72a1:b0:cc:f47b:9e with SMTP id o33-20020a056a2072a100b000ccf47b009emr5782642pzk.10.1677476612483; Sun, 26 Feb 2023 21:43:32 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:32 -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 18/70] target/hexagon/idef-parser: Use gen_tmp for gen_rvalue_pred Date: Sun, 26 Feb 2023 19:41:41 -1000 Message-Id: <20230227054233.390271-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1044.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 The allocation is immediately followed by either tcg_gen_mov_i32 or gen_read_preg (which contains tcg_gen_mov_i32), so the zero initialization is immediately discarded. Signed-off-by: Richard Henderson Reviewed-by: Taylor Simpson --- target/hexagon/idef-parser/parser-helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hexagon/idef-parser/parser-helpers.c b/target/hexagon/idef-parser/parser-helpers.c index 760e499149..c0e6f2190c 100644 --- a/target/hexagon/idef-parser/parser-helpers.c +++ b/target/hexagon/idef-parser/parser-helpers.c @@ -1889,7 +1889,7 @@ HexValue gen_rvalue_pred(Context *c, YYLTYPE *locp, HexValue *pred) bool is_dotnew = pred->is_dotnew; char predicate_id[2] = { pred->pred.id, '\0' }; char *pred_str = (char *) &predicate_id; - *pred = gen_tmp_value(c, locp, "0", 32, UNSIGNED); + *pred = gen_tmp(c, locp, 32, UNSIGNED); if (is_dotnew) { OUT(c, locp, "tcg_gen_mov_i32(", pred, ", hex_new_pred_value["); From patchwork Mon Feb 27 05:41:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656931 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2231906wrb; Mon, 27 Feb 2023 00:26:05 -0800 (PST) X-Google-Smtp-Source: AK7set+1efT0iN6ZaX6PTm6d+kGyWZDRJYemBky/frFxo5f5AEM5LxtUhXr3e+as1SI7GQRmwSNr X-Received: by 2002:a05:6214:da4:b0:56c:659d:435c with SMTP id h4-20020a0562140da400b0056c659d435cmr42438851qvh.24.1677486365174; Mon, 27 Feb 2023 00:26:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486365; cv=none; d=google.com; s=arc-20160816; b=b0mkzaJ4wOBaTG7HkiZjcH7BcCjTVRXf58gclM+h7cZ17xOfbU5XQfXTZDlmmEHN7l 712cK8CbcbAqSJiv00MI4WmUBH3UNyw8h+xIzt6h4xe0/hChTOPwdPRh2MhKBTD37FYN g+DkR33awrOjZOIJjLjeGPbXOuhLm/s/SWgXNtejdAz7/GnMjgVkoeqA7DYTiu0uxfCp vkA3XR1VUD3vBaA7O5RsZiw9rukrI572hZQg3HqKRT7xlkUy+5Oo1rTG/O//ks/GEWtS 7NRhL2E5BZD36mVTmWwea16QfnEneE923sfMYsnhnFIOYuj/paFD4UTxfVE+s3BxTb6/ XGsA== 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=dFwp7rJLT3ezFoTtdpkm7g7WVshe2Fl4tPXf7GfT8CY=; b=hT64QL/2pfaOvqxp+U6MD3yH+VUhUYfTKX5o8MJqisd4gc4A712bM1eN1XpO7gyUHX 3BRTsJ9bku39FJ/UfqPoIr6ql66EVkzLG0odQOn7PkLFzSO/mMyLHS4DExJTcH2s3ryy 8iyzKOvMEGLgJiPlvgjKnRHZfBVfW7BraNvJO3O1brBHY1+TfptW8FVNRr0itdZgQvRU +JzavqyNW9qglR2WhRj/sv5S5CTpxiD7O4NXP0eZ0omLvDF4LTTxYd2ji+B2H3i1Lc24 BRAIHnRXRc/uMGOWSnwMZ5+vIy7LubQJWusLXh4pP7scgeoI6Nxl28vhoRQ9JIIfuVMN j+Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Xys5m/Bh"; 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 s18-20020a0c9d92000000b0056ee5ebb3c5si5984720qvd.284.2023.02.27.00.26.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:26:05 -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="Xys5m/Bh"; 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 1pWWIm-0005OF-8r; Mon, 27 Feb 2023 00:43:56 -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 1pWWIU-0004bO-UT for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:40 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIS-00057x-W2 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:38 -0500 Received: by mail-pf1-x441.google.com with SMTP id b20so2798531pfo.6 for ; Sun, 26 Feb 2023 21:43:36 -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=dFwp7rJLT3ezFoTtdpkm7g7WVshe2Fl4tPXf7GfT8CY=; b=Xys5m/BhbJaiCezwG82ZLYx/sXlKRyOWp1V43O+ESWxJ3q7z7L/1IWSXsz/lgCVpB2 I8KNFl3Fu088dUar4wziVBNBRYCKoU3hQV5TH+h90k7dGz6S/tMJLB3XJqDSv8qh/E4f ghr49G7CYMIg+goESjyPWoDAbhfvQq4mCgU1R9EPILtsWX/UcB3oBtFaILFttPoHz+sY TMEHDTSYROdZv8CIOiqtdgN0wOHReaW9Y+WFNprr4rrDSCnOV9CTtkKDMxTEfvM45a89 97D1MlecNJU0s/ZlDE8qVbvid6Z0MBRFJLDXUN7k5m586rIVYX1dkRRjtf2eryG8N77y QxLg== 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=dFwp7rJLT3ezFoTtdpkm7g7WVshe2Fl4tPXf7GfT8CY=; b=EM3/9tv95qWClcOTubnWKgNRRS6q5QyiSmWdpdlDMfz9YQtm19oUaqRJhdGCla98v0 1S+tnqnzqBCWOLYUSfxVBPtle9UUIX5gkvQR0G6gaRdapeLXMPEoZevCbT+NmepdqzAi ilatXD4qD9uaoOv0N2ng6bvO4qwOfd8Ujl3Ia2qknf2r3X6qdFd74CDjjKu3hcGkfupV /j+PwKxXY088hIHNeYMP3HulTcEvFZvh5HWO0bwSvE3nKmaEKUxGUeGfNUnyA0SSGJIK 6iOOJbm+QDVFzeQiWIEEJmqaGvhpjzQE9ZPw7Uy+YiLsXX8/dKIp5laZQ/4WpBAbUcQO Lh/w== X-Gm-Message-State: AO0yUKW9reZRk+YR/ucdlLq98M++vNRgyKgW0Ql48TNGK+uDcsJc5heU 9maRcHT14790rvmFcUF39fy8ZMOfgBxyjTPpVCmxCA== X-Received: by 2002:aa7:9a1b:0:b0:590:921d:5740 with SMTP id w27-20020aa79a1b000000b00590921d5740mr20538709pfj.13.1677476615305; Sun, 26 Feb 2023 21:43:35 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:34 -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 19/70] target/hexagon/idef-parser: Use gen_constant for gen_extend_tcg_width_op Date: Sun, 26 Feb 2023 19:41:42 -1000 Message-Id: <20230227054233.390271-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x441.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 We already have a temporary, res, which we can use for the intermediate shift result. Simplify the constant to -1 instead of 0xf*f. This was the last use of gen_tmp_value, so remove it. Signed-off-by: Richard Henderson Reviewed-by: Taylor Simpson --- target/hexagon/idef-parser/parser-helpers.c | 30 +++------------------ 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/target/hexagon/idef-parser/parser-helpers.c b/target/hexagon/idef-parser/parser-helpers.c index c0e6f2190c..e1a55412c8 100644 --- a/target/hexagon/idef-parser/parser-helpers.c +++ b/target/hexagon/idef-parser/parser-helpers.c @@ -305,26 +305,6 @@ HexValue gen_tmp(Context *c, return rvalue; } -static HexValue gen_tmp_value(Context *c, - YYLTYPE *locp, - const char *value, - unsigned bit_width, - HexSignedness signedness) -{ - HexValue rvalue; - assert(bit_width == 32 || bit_width == 64); - memset(&rvalue, 0, sizeof(HexValue)); - rvalue.type = TEMP; - rvalue.bit_width = bit_width; - rvalue.signedness = signedness; - rvalue.is_dotnew = false; - rvalue.tmp.index = c->inst.tmp_count; - OUT(c, locp, "TCGv_i", &bit_width, " tmp_", &c->inst.tmp_count, - " = tcg_const_i", &bit_width, "(", value, ");\n"); - c->inst.tmp_count++; - return rvalue; -} - static HexValue gen_constant_from_imm(Context *c, YYLTYPE *locp, HexValue *value) @@ -1120,15 +1100,11 @@ static HexValue gen_extend_tcg_width_op(Context *c, OUT(c, locp, "tcg_gen_subfi_i", &dst_width); OUT(c, locp, "(", &shift, ", ", &dst_width, ", ", &src_width_m, ");\n"); if (signedness == UNSIGNED) { - const char *mask_str = (dst_width == 32) - ? "0xffffffff" - : "0xffffffffffffffff"; - HexValue mask = gen_tmp_value(c, locp, mask_str, - dst_width, UNSIGNED); + HexValue mask = gen_constant(c, locp, "-1", dst_width, UNSIGNED); OUT(c, locp, "tcg_gen_shr_i", &dst_width, "(", - &mask, ", ", &mask, ", ", &shift, ");\n"); + &res, ", ", &mask, ", ", &shift, ");\n"); OUT(c, locp, "tcg_gen_and_i", &dst_width, "(", - &res, ", ", value, ", ", &mask, ");\n"); + &res, ", ", &res, ", ", value, ");\n"); } else { OUT(c, locp, "tcg_gen_shl_i", &dst_width, "(", &res, ", ", value, ", ", &shift, ");\n"); From patchwork Mon Feb 27 05:41:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656848 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2184460wrb; Sun, 26 Feb 2023 21:50:05 -0800 (PST) X-Google-Smtp-Source: AK7set9CUdTaJn17lHkA3jGsV2j/yfZzgCb1sYoHJTUlumyYt3FlsllxwaibuFttMHf7ss6yfMvf X-Received: by 2002:a05:6214:20e7:b0:534:86f1:bcb5 with SMTP id 7-20020a05621420e700b0053486f1bcb5mr41892659qvk.41.1677477005074; Sun, 26 Feb 2023 21:50:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477005; cv=none; d=google.com; s=arc-20160816; b=IhQvoiRp5IqqWbnZEXzrVDrsmwEBu+kioHHtOUJ8LteYHz2qg5r7Q33ybvVTj/k9P+ AFAq6xUst6QgDDPe1+dL3KnPyPdN5QCQFyMydwWpFaLxrht1Azxa069hluCDCaZs99wc sDxrxltMXy7LepsZIzav9cWeGUZ+ce2dEC0rJS7FEN8Bs5S3IeRGnZ1ZJtgKMc9uJxVn jOoDyLZ879P5Lxq7J7xMvb5UavgsxyKmJAMU1n2zR/o4QRQX+ZJCp03+z3VuC45arS59 EaXxaGiKo/WTxVxf8Cf4nw6TIC+IHsWGqQ6ub66SBBx+Zmw1tJMKotjqGdIOGc+i0zzn WZew== 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=bCx3V9E9EGBx0xOadAkXFFn5kP53awpB2DH7f1fkm6M=; b=DYMBsjG9XbvzVx5f0ly6c3tEN1jslyqEZqEOM6fgRxKzwuf5qvA9ziuxNNams5sf54 dZhcV4Jf92iInRCodM49czGwDqigC37bNrj9tGjobQhxBFABY/sO3SkxCLkI4dv8vVkn 7zk1LTPxWvgUcYEKIs5cLJ5aGLjM6ipgT4sVwxok9UeDbJbRJWZTJFRgt7hqCn4i/x46 LS+AWiW4F6o9aKKbaIB+v7BHcaIdq54bgVrRxyLFkvTFBBvf4ygk/KDTJ0k0m8MRljcP /yI+oEthtmEecN26NaQ0pREX9zaozwejvgsFw/Ju9/VlCplYfp4NsYJ+7tCpdgNzB/ZF cZyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=o6xly6XM; 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 z2-20020a0cda82000000b0056eafd69749si6244400qvj.247.2023.02.26.21.50.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:50:05 -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=o6xly6XM; 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 1pWWIk-0005Io-HV; Mon, 27 Feb 2023 00:43:54 -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 1pWWIX-0004dD-J4 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:47 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIV-00059b-MQ for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:41 -0500 Received: by mail-pj1-x1031.google.com with SMTP id nw10-20020a17090b254a00b00233d7314c1cso8866553pjb.5 for ; Sun, 26 Feb 2023 21:43:39 -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=bCx3V9E9EGBx0xOadAkXFFn5kP53awpB2DH7f1fkm6M=; b=o6xly6XMScfYjIqZw7WagdWsOewMn5SLZnFg2CKnYAuyzbr25ryXyoVQfP0eqAA6XU BMRefkjgAe04OwNdZePMap/WEXkSsaZcCL3G08hZdM0CzvOe3fMJktuvvF2v568bQYkt Dz1/bMCcLoVaTsnDVJO82BDLdUrsye8Fn633SVTbFhWhEIvu8OvYJ1Eg11Zd52qq7iKZ DpsoKivez69WGEzl1CJVqtTL2KvPS0175Y/Mhelgd3x5+eKdYTsrViYuJPvvCPn3NFPD 7/SbOOJ2UTHLZYokvyvDOFP0WDGhCvjUBFSf2heGD9X3ohDiC4r68wDd3jecvA8OAnep HzAQ== 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=bCx3V9E9EGBx0xOadAkXFFn5kP53awpB2DH7f1fkm6M=; b=2RwlzMO6nSiPBgmQJWBU0dX1T/0LEVSIhc77kM4KhhC8qeX3lNvN498QjULkMPFO2k eTLgAxRn4vqTNER0JMuc+SomYMvWALjNWErVjneNSmEbPTLT7fs2pYeGWvnPBjk0bIDu 2zaXihWHbnAT5URyLhT+XAVs7T+qdIds6rhKq/eExFxDCPh47sdNCFILsjlnLSVy8BTN eQD9BjS0M+QlrmSC6omYlZ9qQEn0g30k/Z0JaZaih7LdSkFW1/1kw8m1FKiRnq7ytAKh u9YY3L8Tq+9TElmN41S5Oc4ne39bvWc0DSDZzFcpJHD5uY9tA44uOUB+qjxAn6by8btb l0zA== X-Gm-Message-State: AO0yUKW5vL8gb+UBkXGpFPSa8m2AtasWllQ5pu7WeXjdwJa8Gj8/C6Z0 AmAZRjle4e/Vw0CUF1unIPhMGjcTHTGO6jrJMwY= X-Received: by 2002:a05:6a20:2d9a:b0:cb:77f0:9a27 with SMTP id bf26-20020a056a202d9a00b000cb77f09a27mr19496594pzb.24.1677476618083; Sun, 26 Feb 2023 21:43:38 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:37 -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 20/70] target/hppa: Avoid tcg_const_i64 in trans_fid_f Date: Sun, 26 Feb 2023 19:41:43 -1000 Message-Id: <20230227054233.390271-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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 Use a C test instead of a pre-processor test for the id. Use tcg_constant_i64 instead of tcg_const_i64. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/hppa/translate.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index cb4fd1fd62..3ea50d0cec 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -3547,12 +3547,16 @@ static void gen_fcpy_f(TCGv_i32 dst, TCGv_env unused, TCGv_i32 src) static bool trans_fid_f(DisasContext *ctx, arg_fid_f *a) { + uint64_t ret; + + if (TARGET_REGISTER_BITS == 64) { + ret = 0x13080000000000ULL; /* PA8700 (PCX-W2) */ + } else { + ret = 0x0f080000000000ULL; /* PA7300LC (PCX-L2) */ + } + nullify_over(ctx); -#if TARGET_REGISTER_BITS == 64 - save_frd(0, tcg_const_i64(0x13080000000000ULL)); /* PA8700 (PCX-W2) */ -#else - save_frd(0, tcg_const_i64(0x0f080000000000ULL)); /* PA7300LC (PCX-L2) */ -#endif + save_frd(0, tcg_constant_i64(ret)); return nullify_end(ctx); } From patchwork Mon Feb 27 05:41:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656891 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2227237wrb; Mon, 27 Feb 2023 00:10:16 -0800 (PST) X-Google-Smtp-Source: AK7set+CgTR2BnjZmcXsuACf7wjFCO2H+sL4ckA91w6oPgjUxOadkBtUjnRSwb18MOtDHTsHRXlI X-Received: by 2002:a05:6214:5289:b0:56c:4c11:553 with SMTP id kj9-20020a056214528900b0056c4c110553mr12982804qvb.19.1677485416808; Mon, 27 Feb 2023 00:10:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485416; cv=none; d=google.com; s=arc-20160816; b=fFKkW54YOo0B4BEUK/tnjUrFM99rdr4dwtI/YFulE3YKEbjENu2QFyLGO623TKJaek SsDdcA/xBYDkWum9c4PCbfLVxFO5iE52YIEweJlK0OIfA6BW2WsFGKlK3B5GnaaU+Vtf pXMvgORSTlWjXgg7Z8R57c2VJs3V0niU30+hNFmcjhY9unjSvjMr22rGUfQG7sc1yDgs kYhr1MvqONIjc/69mJM1LhFEo0IHIns96rvyPipPNKdnRBSDU4NEdUj8/y8b/tv4WYPZ A1z1DYIrH8232q72gqcqaRhfi1QAWAAfwJm9bj9sfXmFVu6R2BxzIHZknvrKaUHIhBYa jabw== 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=jyCeX4bwIEzy4e7YtKlgTxEYjmitvX4LaioZWsLyP/4=; b=D4ajA4jZvZOyf81Jwjo+ny9BTOo/JeHiENQSTGdU//Ke0qrUZl0BAwadbuYNHocUHe s6oTvlaUBKedOX/lTTBDUPEH+Rz16M8LqbLHy4bwQB70s/XaCXAQ15d5uVA6hFOkvKzK DXIpBGouVbyWqUf7b0oTnEca+oG/Sg9+CuMBpE1GIAS3ku6/SpiCyqCI1MwXuL73EfP2 867hUkURulZHah50+A3wOXYIlDTNig/19Ox2bX3W2DEs3p0CFRJzpueUM9UPcgJa0zWB 5l1ttzruBPiGh+7UKpcurLkmAurr6r2GF07h9Ye0ZzrNlfz0iyCbpriwe7EQAn8QYyUe /R/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rNZ0GH8a; 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 r21-20020a05620a299500b007280c696c9fsi2220230qkp.517.2023.02.27.00.10.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:10:16 -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=rNZ0GH8a; 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 1pWWIn-0005Pb-4c; Mon, 27 Feb 2023 00:43:57 -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 1pWWIg-000525-FA for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:50 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIZ-0005Ai-TO for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:50 -0500 Received: by mail-pf1-x42f.google.com with SMTP id c10so2155588pfv.13 for ; Sun, 26 Feb 2023 21:43:41 -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=jyCeX4bwIEzy4e7YtKlgTxEYjmitvX4LaioZWsLyP/4=; b=rNZ0GH8aMlSI7aKARZKSb/9/XbQu4UwWzNY6VQUM5Fb8LSaBKB6+kAH5GNH53hPLn7 nHDB+SLwrkBLuKxOEzK+aVwp9RdXAvQDh7OfnPBxWOMiMvQAfsrvuabzIANAMTzWd+E4 RlkvKlN9F0ql/zT8Q+Ti1fSZ95s//C73M/GLa1o4Dy08zHBLYINFDaSvPaRVxSY1knhA tuZ8BYNqAFEHqBXfoSkc8ko1lg3EYT4E2qlmN7laK12TnGSpRmzs61HAcv8y9gBLSxfa h04HLteuy5uMoWTGedFtgiLRk0iCR4s98BmOU1hAckoH3RQVh2ubH/Gr4N8BFZZ1qlXf QgqA== 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=jyCeX4bwIEzy4e7YtKlgTxEYjmitvX4LaioZWsLyP/4=; b=mYbaoF5RM8HeErfgs/HaxGMY4MpffkGVK4xOcuRIrvrqYLJTY+w9X/JclkNvnDsPz+ V4iauBcItFv68zXTpTqHQRWmjB3M6s1TKdA9Npg/9i4oY3JlPfyiI2HmAEcXMOqzuJls tB2CW1v9TH+ZvyneRP2uGCoMrmw1rzRVxluxuoBZEHUO4vUvlhsyaiX+H6aenVy1J45g NSAi4ULgP35trqWojmYy0AfMCB3G0NHkaQ/F0Rm9Xi6a+WX4loqiYhR4BXRChU/UCtm0 LxdFOIGThX9Qt2T2MgX46htheAVTfd/obltguoBesHEI/MLVbZZh12I06s0jtsRQgIqt CoPA== X-Gm-Message-State: AO0yUKUJYWLZbgCoAMlElfcZWZ++2+lE9XoutV0bvmXCVL5ULVSGAQna 7e0hltSmT3jKf/jkV1ZJ6giN01Wie9yZvBOh7oQ= X-Received: by 2002:a05:6a00:f95:b0:5a8:d3d9:e03a with SMTP id ct21-20020a056a000f9500b005a8d3d9e03amr7973139pfb.0.1677476620649; Sun, 26 Feb 2023 21:43:40 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:40 -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 21/70] target/hppa: Avoid use of tcg_const_i32 throughout Date: Sun, 26 Feb 2023 19:41:44 -1000 Message-Id: <20230227054233.390271-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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 All uses were read-write, so replace with a new allocation and initialization. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/hppa/translate.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 3ea50d0cec..6a3154ebc6 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -135,8 +135,6 @@ #define tcg_gen_extract_reg tcg_gen_extract_i64 #define tcg_gen_sextract_reg tcg_gen_sextract_i64 #define tcg_gen_extract2_reg tcg_gen_extract2_i64 -#define tcg_const_reg tcg_const_i64 -#define tcg_const_local_reg tcg_const_local_i64 #define tcg_constant_reg tcg_constant_i64 #define tcg_gen_movcond_reg tcg_gen_movcond_i64 #define tcg_gen_add2_reg tcg_gen_add2_i64 @@ -228,8 +226,6 @@ #define tcg_gen_extract_reg tcg_gen_extract_i32 #define tcg_gen_sextract_reg tcg_gen_sextract_i32 #define tcg_gen_extract2_reg tcg_gen_extract2_i32 -#define tcg_const_reg tcg_const_i32 -#define tcg_const_local_reg tcg_const_local_i32 #define tcg_constant_reg tcg_constant_i32 #define tcg_gen_movcond_reg tcg_gen_movcond_i32 #define tcg_gen_add2_reg tcg_gen_add2_i32 @@ -574,7 +570,9 @@ static TCGv_i32 load_frw_i32(unsigned rt) static TCGv_i32 load_frw0_i32(unsigned rt) { if (rt == 0) { - return tcg_const_i32(0); + TCGv_i32 ret = tcg_temp_new_i32(); + tcg_gen_movi_i32(ret, 0); + return ret; } else { return load_frw_i32(rt); } @@ -582,15 +580,15 @@ static TCGv_i32 load_frw0_i32(unsigned rt) static TCGv_i64 load_frw0_i64(unsigned rt) { + TCGv_i64 ret = tcg_temp_new_i64(); if (rt == 0) { - return tcg_const_i64(0); + tcg_gen_movi_i64(ret, 0); } else { - TCGv_i64 ret = tcg_temp_new_i64(); tcg_gen_ld32u_i64(ret, cpu_env, offsetof(CPUHPPAState, fr[rt & 31]) + (rt & 32 ? LO_OFS : HI_OFS)); - return ret; } + return ret; } static void save_frw_i32(unsigned rt, TCGv_i32 val) @@ -613,7 +611,9 @@ static TCGv_i64 load_frd(unsigned rt) static TCGv_i64 load_frd0(unsigned rt) { if (rt == 0) { - return tcg_const_i64(0); + TCGv_i64 ret = tcg_temp_new_i64(); + tcg_gen_movi_i64(ret, 0); + return ret; } else { return load_frd(rt); } @@ -3330,7 +3330,8 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt, unsigned c, /* Convert big-endian bit numbering in SAR to left-shift. */ tcg_gen_xori_reg(shift, cpu_sar, TARGET_REGISTER_BITS - 1); - mask = tcg_const_reg(msb + (msb - 1)); + mask = tcg_temp_new(); + tcg_gen_movi_reg(mask, msb + (msb - 1)); tcg_gen_and_reg(tmp, val, mask); if (rs) { tcg_gen_shl_reg(mask, mask, shift); From patchwork Mon Feb 27 05:41:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656935 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2232355wrb; Mon, 27 Feb 2023 00:28:00 -0800 (PST) X-Google-Smtp-Source: AK7set/O8fQcRw2ABz96jx3KsfNY7cmeHpTXkILUdgHqWJ6sFIRlUHWaHXMM9mCWGwCcDY0YNJU0 X-Received: by 2002:a05:622a:46:b0:3a8:1677:bc39 with SMTP id y6-20020a05622a004600b003a81677bc39mr42192179qtw.52.1677486480414; Mon, 27 Feb 2023 00:28:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486480; cv=none; d=google.com; s=arc-20160816; b=UGGJnT9IzLTyEzOukm6ZTrLDd2P9knkWR1zlM5sTcu2Jn/WUlLZS6t4CBwU7cRhyjp b4uG5CTmtYvPjD7OFPK7Ei3v0PWVIPL7pEWVeQAyOmkNYbSTFA/9LzaXiGffrR28BCNe 2sW+mtUwzpZNfB1YYjcAFI3+ZgHQI0pwu8kPmKX1zLbLs6lzRZyF0XCx5WsEanJUQGPG bskjuwObXm+HBVjpflWQr4w4ZAIUFk0X6dmD9Rrggwd6IIqd/tr4gCCgrAQ05ftAKaom r2W6WTG1WpSW4fCM6w/1U+oIBzR7hm9lEC2HUUrsd9AZtPlH0NkU3v5va07w8nCPPmCw tFbQ== 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=8OtbuoqOQ8NxPiPIk6/AH0BDSmN9UcvckTcgcCxtjS0=; b=T1N/MH4zq+PssCz2lsdd1M+yRo1cQk0bjNPeoD8chyczOdA8rFjhBze7NQ5zyBOjLf 6OMeAXIOGVflavhjC2WuV0HcaVxtbEt/1pXQfAV3/A24lFfo3lY6ke9jzWkLOpgyadie Q6m88qZ13kysOLUL7MA8YKlvcesD1URdAPRH0DUP8biDrjtx/x7gxkFWsMz4sLTbIpj6 YvDQiUFhkm2s8r0kjfKD/MWAbh1uI8YLBrDQF3JHev/LQlv9dT6X0QXaK9feIMNfl+It HXATBr0oAX5GvVGvRkIsiaHkxHZ4epJgHrHv9+Y2ZEJh7dj4uJ0l6bmAsD+65eRZn3a/ Rafw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZNCFj5Uw; 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 v20-20020a05620a441400b0073bb5996ed8si6334173qkp.684.2023.02.27.00.28.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:28:00 -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=ZNCFj5Uw; 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 1pWWJ8-000664-9Q; Mon, 27 Feb 2023 00:44:18 -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 1pWWIg-000537-PU for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:50 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWId-00059b-FF for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:50 -0500 Received: by mail-pj1-x1031.google.com with SMTP id nw10-20020a17090b254a00b00233d7314c1cso8866692pjb.5 for ; Sun, 26 Feb 2023 21:43:43 -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=8OtbuoqOQ8NxPiPIk6/AH0BDSmN9UcvckTcgcCxtjS0=; b=ZNCFj5UwFDFpOW28acWfYsKaWRMDl7NQoNlJYpDJiDbDKKB7EIrsasA0AaOm4S7iU4 f/PSYVL2G5Jxxxj01iRT7DYQRp+imf1rzIap68eNwadN6YWpBpFlEwb0thOOz91MTpGj EtdQfu63SUvUvl0TK+JxzZrIlGVZ08cJFW3h+zsy8mw0P9ggavpIjd/ceTv/ofGVDjfa GMvNS/+GpaFk4pWMj2MRdam9aueMW4BVRW/ZsT4Baz9xJOwkdbDh9wVoc3fnm7Jplp51 MlWm50H9Ojz02Gp8HNUieQDFbbDSZW49tOd7zzXCFXqBhl27s3e/QB3cssTuK5t0li+6 Xzsg== 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=8OtbuoqOQ8NxPiPIk6/AH0BDSmN9UcvckTcgcCxtjS0=; b=MHt5eEzmgrQ85ELqVOHRbejCBypx6/ZPih7oH0jinXzB46HGTaNLscF2oVYJtAIESS 4WyBxqPtv2vFWyPjVf5JL0OfzcJ+UZ3cZXniZ5xtGuplMzx/6nBLT55vmBOPeR7GMmrq Pig84kEhXoVMdDCPViOkp6XzBX741YTtRJseDPVlnnj4AA02Qdr1c3ST/9x0cwol8TF9 MWvo2K9a7JXHo0XMBPN6AEWDgR+89idUKZNJvTmc2HOoAWdDUiuXQmpwI010udlYVLmT c5XdlfiBJrsp35+sUtIUVDbSyU3FOGPKBc7S6j3X84mKulwmaO/CmkAuPzH2bZspHCrS OOpA== X-Gm-Message-State: AO0yUKXFalPWhhZ7MMGbbtfo13F2IP5RbHsjbYQQPSVIoP0lrIcFJuwf CtTwcgknw7BVNvV9mCbNo0HLRpFRYPWi1zWnf+4= X-Received: by 2002:a05:6a20:918a:b0:cc:85ff:1810 with SMTP id v10-20020a056a20918a00b000cc85ff1810mr10207651pzd.60.1677476623072; Sun, 26 Feb 2023 21:43:43 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:42 -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 22/70] target/i386: Simplify POPF Date: Sun, 26 Feb 2023 19:41:45 -1000 Message-Id: <20230227054233.390271-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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 Compute the eflags write mask separately, leaving one call to the helper. Use tcg_constant_i32. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/i386/tcg/translate.c | 55 ++++++++----------------------------- 1 file changed, 11 insertions(+), 44 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 692f0c63a8..5d1fcc4b15 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -5226,52 +5226,19 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) case 0x9d: /* popf */ gen_svm_check_intercept(s, SVM_EXIT_POPF); if (check_vm86_iopl(s)) { - ot = gen_pop_T0(s); + int mask = TF_MASK | AC_MASK | ID_MASK | NT_MASK; + if (CPL(s) == 0) { - if (dflag != MO_16) { - gen_helper_write_eflags(cpu_env, s->T0, - tcg_const_i32((TF_MASK | AC_MASK | - ID_MASK | NT_MASK | - IF_MASK | - IOPL_MASK))); - } else { - gen_helper_write_eflags(cpu_env, s->T0, - tcg_const_i32((TF_MASK | AC_MASK | - ID_MASK | NT_MASK | - IF_MASK | IOPL_MASK) - & 0xffff)); - } - } else { - if (CPL(s) <= IOPL(s)) { - if (dflag != MO_16) { - gen_helper_write_eflags(cpu_env, s->T0, - tcg_const_i32((TF_MASK | - AC_MASK | - ID_MASK | - NT_MASK | - IF_MASK))); - } else { - gen_helper_write_eflags(cpu_env, s->T0, - tcg_const_i32((TF_MASK | - AC_MASK | - ID_MASK | - NT_MASK | - IF_MASK) - & 0xffff)); - } - } else { - if (dflag != MO_16) { - gen_helper_write_eflags(cpu_env, s->T0, - tcg_const_i32((TF_MASK | AC_MASK | - ID_MASK | NT_MASK))); - } else { - gen_helper_write_eflags(cpu_env, s->T0, - tcg_const_i32((TF_MASK | AC_MASK | - ID_MASK | NT_MASK) - & 0xffff)); - } - } + mask |= IF_MASK | IOPL_MASK; + } else if (CPL(s) <= IOPL(s)) { + mask |= IF_MASK; } + if (dflag == MO_16) { + mask &= 0xffff; + } + + ot = gen_pop_T0(s); + gen_helper_write_eflags(cpu_env, s->T0, tcg_constant_i32(mask)); gen_pop_update(s, ot); set_cc_op(s, CC_OP_EFLAGS); /* abort translation because TF/AC flag may change */ From patchwork Mon Feb 27 05:41:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656936 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2232687wrb; Mon, 27 Feb 2023 00:29:14 -0800 (PST) X-Google-Smtp-Source: AK7set/9vtjf4tophrkMYlh0EVIgOM6ZYkdtTzYY9Xdfgbl0p6lcEjNk6ec1oBfHR0v70Z/SbGIu X-Received: by 2002:ac8:4e55:0:b0:3b6:2bb3:fb53 with SMTP id e21-20020ac84e55000000b003b62bb3fb53mr29275980qtw.16.1677486554818; Mon, 27 Feb 2023 00:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486554; cv=none; d=google.com; s=arc-20160816; b=RnWiuNBEh1p3HupwH/XHRVAdOeVEDILM90BZ34y+RsD4Yz+aSG/A+0bxVZErLlHIgh 31FNoFq1PvjJNWOl6ySWL8KG529XIQFNKFjHjXRhmpqz4mqT6pDRrvuqlY7xBZjKO519 AlK0+aRLLtgsJoXbVhEovCy2XA6DB2ruieiu5J30ZBfSWKvW0hZQxYEud9P8R+Upzrw3 WD1n1rX8PGvnYQiYuyxGMUlLk1eNVnJ2aru2+0MZHDRBxnV6YYiq6wyINlVuxzxv0fi4 M0lCyXcnZ1c3lVkllX33+49Z79trV3CyXTK0RTpp8FmuKDegZU4SnO+YPSH43OcB8CpN VQvQ== 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=s92vh4bFckyTMyQbiUhADFe9ox2+gImdRExBNoOqH5c=; b=IlOWWu+o9luOx5kNnJt1MUxxCtp1+7lqmFpatDiVnXKFohSNQWBwB+4Egg6a/c24fj r3E3JdPTsV3Ck5uz8Tnd5xTMRicK+y7vjnytvKE2ANhIXxs5VPjURamHTooJX8c+yiXB Podewoy4k/pfDf//pYvTXbiPcaoWNJIRcF53hH7OW2eFlGTJH5J4DV/Jh5EdhoTH4FrU /8Gk1FMYbxkFqLoKegUOrkiaxygvdxj6awUPRKnQTTIV+gOI5McBKFKkQGLi2cxcE/BP Vw/v7tG85KoZF+HkdnAjpqqqFbXaA4+hthyvPZ783LWX2sbQvg3lUb135iTzP0Vr4MNU JrPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ay3d++0a; 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 ez13-20020a05622a4c8d00b003bfc37f6c5asi5824640qtb.189.2023.02.27.00.29.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:29:14 -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=Ay3d++0a; 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 1pWWIp-0005TW-Ah; Mon, 27 Feb 2023 00:43:59 -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 1pWWIj-0005EN-3K for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:53 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWId-0005CK-HV for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:52 -0500 Received: by mail-pf1-x442.google.com with SMTP id y10so2790287pfi.8 for ; Sun, 26 Feb 2023 21:43:46 -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=s92vh4bFckyTMyQbiUhADFe9ox2+gImdRExBNoOqH5c=; b=Ay3d++0ae+zDfgJMIm6kYkQiRPGlSwoJbdMiTFZj/MzC5DqpBJjdvmY5oRZIqu/Y0c 43AIQ7ALmYRtWgTxpee7sEpeiMW0pwn28BCJf3W4PAnHFPs4X0Wvx5ei8iQQaIObGzSN edeVw3XXzTzfIHmiktdrEqsPRCA6lSHf+shHWRmGRbWJMpJ1pkFDRyrFypMejqUG7+Gf vv154xH/LRge/HjUdclQ3e1MnDLHxoIIgRyU3Wu70DvT9YmenWEwPhvnwaqurCxQeVSk ZbtVRKaVsS94WWB+/NkCTLDOukq1btvv/TNeZCxHAtJ/EvsCO7HiSiAe1vXkQcRfeR6x Lbmw== 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=s92vh4bFckyTMyQbiUhADFe9ox2+gImdRExBNoOqH5c=; b=oeJWe5PUQUIZAiaKouRyRIAiBG+A5JPtkD34JVtrMzRasamdjx6gIFZeiuVC3RPmv8 YBzBJJbNy8Od/dfk04D3VhP0K55SvLJ8BxvWwJM5jR/2WfilgXzBlCkwEZZUkF2BnyZI ReBVgCGpWefkWutQJy7W3HSoWQYPksdspURGVbYbjp+a/2nVbdOxxHa4e5KTnmP7nPW4 kJyWSPS8RvdxldHVw+kRDC9OUuhX7nbCVRLWabNq5bqbgwLIFsPpnd1qeuZul5d5jjix 5qQYHGp5a6PQvAbDBXjAOK2nub6o4aJfcTDNqDA7WoFVaUXBdR5ORtMcpo8sfuEsGwr+ MgLg== X-Gm-Message-State: AO0yUKWy+P2TzJX/b8konrERqlizeY4DB6zMa6Wzch7JRhrYjD+/YQn0 HYNsiDupNmk+8YsY20mZ7I4FNhymCiNKKm4F7ZyMyw== X-Received: by 2002:aa7:96a3:0:b0:5d4:e4c8:23ac with SMTP id g3-20020aa796a3000000b005d4e4c823acmr14979027pfk.21.1677476625834; Sun, 26 Feb 2023 21:43:45 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:45 -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 23/70] target/i386: Avoid use of tcg_const_* throughout Date: Sun, 26 Feb 2023 19:41:46 -1000 Message-Id: <20230227054233.390271-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::442; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x442.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 All uses are strictly read-only. Most of the obviously so, as direct arguments to gen_helper_*. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/i386/tcg/translate.c | 83 +++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 5d1fcc4b15..4d2a3349ec 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -884,7 +884,7 @@ static void gen_compute_eflags(DisasContext *s) live = cc_op_live[s->cc_op] & ~USES_CC_SRCT; dead = live ^ (USES_CC_DST | USES_CC_SRC | USES_CC_SRC2); if (dead) { - zero = tcg_const_tl(0); + zero = tcg_constant_tl(0); if (dead & USES_CC_DST) { dst = zero; } @@ -1412,7 +1412,7 @@ static void gen_helper_fp_arith_ST0_FT0(int op) /* NOTE the exception in "r" op ordering */ static void gen_helper_fp_arith_STN_ST0(int op, int opreg) { - TCGv_i32 tmp = tcg_const_i32(opreg); + TCGv_i32 tmp = tcg_constant_i32(opreg); switch (op) { case 0: gen_helper_fadd_STN_ST0(cpu_env, tmp); @@ -1439,7 +1439,7 @@ static void gen_exception(DisasContext *s, int trapno) { gen_update_cc_op(s); gen_update_eip_cur(s); - gen_helper_raise_exception(cpu_env, tcg_const_i32(trapno)); + gen_helper_raise_exception(cpu_env, tcg_constant_i32(trapno)); s->base.is_jmp = DISAS_NORETURN; } @@ -1633,7 +1633,7 @@ static void gen_shift_flags(DisasContext *s, MemOp ot, TCGv result, /* Store the results into the CC variables. If we know that the variable must be dead, store unconditionally. Otherwise we'll need to not disrupt the current contents. */ - z_tl = tcg_const_tl(0); + z_tl = tcg_constant_tl(0); if (cc_op_live[s->cc_op] & USES_CC_DST) { tcg_gen_movcond_tl(TCG_COND_NE, cpu_cc_dst, count, z_tl, result, cpu_cc_dst); @@ -1657,7 +1657,7 @@ static void gen_shift_flags(DisasContext *s, MemOp ot, TCGv result, } /* Conditionally store the CC_OP value. */ - z32 = tcg_const_i32(0); + z32 = tcg_constant_i32(0); s32 = tcg_temp_new_i32(); tcg_gen_trunc_tl_i32(s32, count); tcg_gen_movcond_i32(TCG_COND_NE, cpu_cc_op, s32, z32, s->tmp2_i32, oldop); @@ -1813,7 +1813,7 @@ static void gen_rot_rm_T1(DisasContext *s, MemOp ot, int op1, int is_right) is 0 we keep the CC_OP_EFLAGS setting so that only CC_SRC is live. Otherwise reuse CC_OP_ADCOX which have the C and O flags split out exactly as we computed above. */ - t0 = tcg_const_i32(0); + t0 = tcg_constant_i32(0); t1 = tcg_temp_new_i32(); tcg_gen_trunc_tl_i32(t1, s->T1); tcg_gen_movi_i32(s->tmp2_i32, CC_OP_ADCOX); @@ -2497,7 +2497,7 @@ static void gen_cmovcc1(CPUX86State *env, DisasContext *s, MemOp ot, int b, cc.reg = t0; } if (!cc.use_reg2) { - cc.reg2 = tcg_const_tl(cc.imm); + cc.reg2 = tcg_constant_tl(cc.imm); } tcg_gen_movcond_tl(cc.cond, s->T0, cc.reg, cc.reg2, @@ -2525,7 +2525,7 @@ static void gen_movl_seg_T0(DisasContext *s, X86Seg seg_reg) { if (PE(s) && !VM86(s)) { tcg_gen_trunc_tl_i32(s->tmp2_i32, s->T0); - gen_helper_load_seg(cpu_env, tcg_const_i32(seg_reg), s->tmp2_i32); + gen_helper_load_seg(cpu_env, tcg_constant_i32(seg_reg), s->tmp2_i32); /* abort translation because the addseg value may change or because ss32 may change. For R_SS, translation must always stop as a special handling must be done to disable hardware @@ -4344,7 +4344,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) gen_op_mov_v_reg(s, ot, s->T1, reg); if (shift) { - TCGv imm = tcg_const_tl(x86_ldub_code(env, s)); + TCGv imm = tcg_constant_tl(x86_ldub_code(env, s)); gen_shiftd_rm_T1(s, ot, opreg, op, imm); } else { gen_shiftd_rm_T1(s, ot, opreg, op, cpu_regs[R_ECX]); @@ -4503,7 +4503,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) break; case 0x0c: /* fldenv mem */ gen_helper_fldenv(cpu_env, s->A0, - tcg_const_i32(dflag - 1)); + tcg_constant_i32(dflag - 1)); update_fip = update_fdp = false; break; case 0x0d: /* fldcw mem */ @@ -4514,7 +4514,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) break; case 0x0e: /* fnstenv mem */ gen_helper_fstenv(cpu_env, s->A0, - tcg_const_i32(dflag - 1)); + tcg_constant_i32(dflag - 1)); update_fip = update_fdp = false; break; case 0x0f: /* fnstcw mem */ @@ -4532,12 +4532,12 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) break; case 0x2c: /* frstor mem */ gen_helper_frstor(cpu_env, s->A0, - tcg_const_i32(dflag - 1)); + tcg_constant_i32(dflag - 1)); update_fip = update_fdp = false; break; case 0x2e: /* fnsave mem */ gen_helper_fsave(cpu_env, s->A0, - tcg_const_i32(dflag - 1)); + tcg_constant_i32(dflag - 1)); update_fip = update_fdp = false; break; case 0x2f: /* fnstsw mem */ @@ -4587,12 +4587,12 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) case 0x08: /* fld sti */ gen_helper_fpush(cpu_env); gen_helper_fmov_ST0_STN(cpu_env, - tcg_const_i32((opreg + 1) & 7)); + tcg_constant_i32((opreg + 1) & 7)); break; case 0x09: /* fxchg sti */ case 0x29: /* fxchg4 sti, undocumented op */ case 0x39: /* fxchg7 sti, undocumented op */ - gen_helper_fxchg_ST0_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_fxchg_ST0_STN(cpu_env, tcg_constant_i32(opreg)); break; case 0x0a: /* grp d9/2 */ switch (rm) { @@ -4732,27 +4732,27 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) } } else { gen_helper_fmov_FT0_STN(cpu_env, - tcg_const_i32(opreg)); + tcg_constant_i32(opreg)); gen_helper_fp_arith_ST0_FT0(op1); } } break; case 0x02: /* fcom */ case 0x22: /* fcom2, undocumented op */ - gen_helper_fmov_FT0_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_fmov_FT0_STN(cpu_env, tcg_constant_i32(opreg)); gen_helper_fcom_ST0_FT0(cpu_env); break; case 0x03: /* fcomp */ case 0x23: /* fcomp3, undocumented op */ case 0x32: /* fcomp5, undocumented op */ - gen_helper_fmov_FT0_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_fmov_FT0_STN(cpu_env, tcg_constant_i32(opreg)); gen_helper_fcom_ST0_FT0(cpu_env); gen_helper_fpop(cpu_env); break; case 0x15: /* da/5 */ switch (rm) { case 1: /* fucompp */ - gen_helper_fmov_FT0_STN(cpu_env, tcg_const_i32(1)); + gen_helper_fmov_FT0_STN(cpu_env, tcg_constant_i32(1)); gen_helper_fucom_ST0_FT0(cpu_env); gen_helper_fpop(cpu_env); gen_helper_fpop(cpu_env); @@ -4786,7 +4786,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } gen_update_cc_op(s); - gen_helper_fmov_FT0_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_fmov_FT0_STN(cpu_env, tcg_constant_i32(opreg)); gen_helper_fucomi_ST0_FT0(cpu_env); set_cc_op(s, CC_OP_EFLAGS); break; @@ -4795,36 +4795,36 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } gen_update_cc_op(s); - gen_helper_fmov_FT0_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_fmov_FT0_STN(cpu_env, tcg_constant_i32(opreg)); gen_helper_fcomi_ST0_FT0(cpu_env); set_cc_op(s, CC_OP_EFLAGS); break; case 0x28: /* ffree sti */ - gen_helper_ffree_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_ffree_STN(cpu_env, tcg_constant_i32(opreg)); break; case 0x2a: /* fst sti */ - gen_helper_fmov_STN_ST0(cpu_env, tcg_const_i32(opreg)); + gen_helper_fmov_STN_ST0(cpu_env, tcg_constant_i32(opreg)); break; case 0x2b: /* fstp sti */ case 0x0b: /* fstp1 sti, undocumented op */ case 0x3a: /* fstp8 sti, undocumented op */ case 0x3b: /* fstp9 sti, undocumented op */ - gen_helper_fmov_STN_ST0(cpu_env, tcg_const_i32(opreg)); + gen_helper_fmov_STN_ST0(cpu_env, tcg_constant_i32(opreg)); gen_helper_fpop(cpu_env); break; case 0x2c: /* fucom st(i) */ - gen_helper_fmov_FT0_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_fmov_FT0_STN(cpu_env, tcg_constant_i32(opreg)); gen_helper_fucom_ST0_FT0(cpu_env); break; case 0x2d: /* fucomp st(i) */ - gen_helper_fmov_FT0_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_fmov_FT0_STN(cpu_env, tcg_constant_i32(opreg)); gen_helper_fucom_ST0_FT0(cpu_env); gen_helper_fpop(cpu_env); break; case 0x33: /* de/3 */ switch (rm) { case 1: /* fcompp */ - gen_helper_fmov_FT0_STN(cpu_env, tcg_const_i32(1)); + gen_helper_fmov_FT0_STN(cpu_env, tcg_constant_i32(1)); gen_helper_fcom_ST0_FT0(cpu_env); gen_helper_fpop(cpu_env); gen_helper_fpop(cpu_env); @@ -4834,7 +4834,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) } break; case 0x38: /* ffreep sti, undocumented op */ - gen_helper_ffree_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_ffree_STN(cpu_env, tcg_constant_i32(opreg)); gen_helper_fpop(cpu_env); break; case 0x3c: /* df/4 */ @@ -4853,7 +4853,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } gen_update_cc_op(s); - gen_helper_fmov_FT0_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_fmov_FT0_STN(cpu_env, tcg_constant_i32(opreg)); gen_helper_fucomi_ST0_FT0(cpu_env); gen_helper_fpop(cpu_env); set_cc_op(s, CC_OP_EFLAGS); @@ -4863,7 +4863,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) goto illegal_op; } gen_update_cc_op(s); - gen_helper_fmov_FT0_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_fmov_FT0_STN(cpu_env, tcg_constant_i32(opreg)); gen_helper_fcomi_ST0_FT0(cpu_env); gen_helper_fpop(cpu_env); set_cc_op(s, CC_OP_EFLAGS); @@ -4886,7 +4886,8 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) op1 = fcmov_cc[op & 3] | (((op >> 3) & 1) ^ 1); l1 = gen_new_label(); gen_jcc1_noeob(s, op1, l1); - gen_helper_fmov_ST0_STN(cpu_env, tcg_const_i32(opreg)); + gen_helper_fmov_ST0_STN(cpu_env, + tcg_constant_i32(opreg)); gen_set_label(l1); } break; @@ -5092,8 +5093,8 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) if (PE(s) && !VM86(s)) { gen_update_cc_op(s); gen_update_eip_cur(s); - gen_helper_lret_protected(cpu_env, tcg_const_i32(dflag - 1), - tcg_const_i32(val)); + gen_helper_lret_protected(cpu_env, tcg_constant_i32(dflag - 1), + tcg_constant_i32(val)); } else { gen_stack_A0(s); /* pop offset */ @@ -5120,7 +5121,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) if (!check_vm86_iopl(s)) { break; } - gen_helper_iret_real(cpu_env, tcg_const_i32(dflag - 1)); + gen_helper_iret_real(cpu_env, tcg_constant_i32(dflag - 1)); } else { gen_helper_iret_protected(cpu_env, tcg_constant_i32(dflag - 1), eip_next_i32(s)); @@ -5509,7 +5510,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) if (val == 0) { gen_exception(s, EXCP00_DIVZ); } else { - gen_helper_aam(cpu_env, tcg_const_i32(val)); + gen_helper_aam(cpu_env, tcg_constant_i32(val)); set_cc_op(s, CC_OP_LOGICB); } break; @@ -5517,7 +5518,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) if (CODE64(s)) goto illegal_op; val = x86_ldub_code(env, s); - gen_helper_aad(cpu_env, tcg_const_i32(val)); + gen_helper_aad(cpu_env, tcg_constant_i32(val)); set_cc_op(s, CC_OP_LOGICB); break; /************************/ @@ -5698,7 +5699,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) if (!PE(s)) { gen_exception_gpf(s); } else { - gen_helper_sysexit(cpu_env, tcg_const_i32(dflag - 1)); + gen_helper_sysexit(cpu_env, tcg_constant_i32(dflag - 1)); s->base.is_jmp = DISAS_EOB_ONLY; } break; @@ -5717,7 +5718,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) if (!PE(s)) { gen_exception_gpf(s); } else { - gen_helper_sysret(cpu_env, tcg_const_i32(dflag - 1)); + gen_helper_sysret(cpu_env, tcg_constant_i32(dflag - 1)); /* condition codes are modified only in long mode */ if (LMA(s)) { set_cc_op(s, CC_OP_EFLAGS); @@ -5923,7 +5924,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) } gen_update_cc_op(s); gen_update_eip_cur(s); - gen_helper_vmrun(cpu_env, tcg_const_i32(s->aflag - 1), + gen_helper_vmrun(cpu_env, tcg_constant_i32(s->aflag - 1), cur_insn_len_i32(s)); tcg_gen_exit_tb(NULL, 0); s->base.is_jmp = DISAS_NORETURN; @@ -5947,7 +5948,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) } gen_update_cc_op(s); gen_update_eip_cur(s); - gen_helper_vmload(cpu_env, tcg_const_i32(s->aflag - 1)); + gen_helper_vmload(cpu_env, tcg_constant_i32(s->aflag - 1)); break; case 0xdb: /* VMSAVE */ @@ -5959,7 +5960,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) } gen_update_cc_op(s); gen_update_eip_cur(s); - gen_helper_vmsave(cpu_env, tcg_const_i32(s->aflag - 1)); + gen_helper_vmsave(cpu_env, tcg_constant_i32(s->aflag - 1)); break; case 0xdc: /* STGI */ From patchwork Mon Feb 27 05:41:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656927 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2231283wrb; Mon, 27 Feb 2023 00:23:44 -0800 (PST) X-Google-Smtp-Source: AK7set+tOyj+2PhlE6fPNouV3Mve4RIJwmuxjCRke9SKbFwIe8UpvusMvdKfHMSC4GIUMoB0UoB3 X-Received: by 2002:a05:6214:d6c:b0:56c:240d:3015 with SMTP id 12-20020a0562140d6c00b0056c240d3015mr49806690qvs.32.1677486224649; Mon, 27 Feb 2023 00:23:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486224; cv=none; d=google.com; s=arc-20160816; b=OvIpAcQc4+nhVi02UCDGrssVQyvwOwm67aNjXy4dTOLgxh/GEwnpTwbxqdPImRRtIh kvbBdEnIR+3qew+YSadydsn30bvKRLUvoFbKNb3kDNU9ScJDV2qnJVVD1DFDn5VJ+uFl yAuxWwYyjgMhfDiiLVEryPl9Y67d8MQpGNbLvHmPvGgCHMEII9gy7J7SoDDEsp379GcH DuAceYv8g9J72muGXPAQYO01XqAmgKKReUdDMuOEhdJBWT1hTO+7DirdWDSXWb8GOpOs r1BMUJWcpuTd4JOldN9t0bvICpUZ8HcyuFw0u/xqyxC1GjCfxp/f+vPsetUCNtfqzMrL C2XA== 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=KtD3E7GYpMHpgVn/sQN45x11Mj52FNGcI7jXV5OHaxI=; b=uNexcL9fXwKTtn2D056YJoJg9In1P+oceQhbGJ0bapC3+EilILAmBcBKKwyirtPddT waK7+NYR5exXjBcC/Z/L/dydCk0XTZtIrsrEFtADsUn80kWG37ofVClPXP2MUEhITVV+ Z7NJ9e5yw5LD6F9auUtWpxvQmCWs+QM/l0BLCurMSmn543n9g3nnPOHswiZKpeEOStih qfWIa8Z/y6VYU3dYbwsS44UO0aUXnBjBmFcMRwkAYbxg7ORHQNlIk29ft2C4hWMnUVb5 Yg1sCh121mDlxFGosS35P2qkJe/oVdK7m+o4qvnmp5xVfcL3l5KsfoLBoDHvVxQHvKcn KMkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OXGh4XO9; 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 v12-20020a0cdd8c000000b0056e9493e972si6100531qvk.441.2023.02.27.00.23.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:23:44 -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=OXGh4XO9; 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 1pWWJ7-0005zh-Bc; Mon, 27 Feb 2023 00:44:17 -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 1pWWIk-0005Jb-Lm for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:54 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIf-00054w-Me for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:54 -0500 Received: by mail-pf1-x436.google.com with SMTP id g12so2838708pfi.0 for ; Sun, 26 Feb 2023 21:43:48 -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=KtD3E7GYpMHpgVn/sQN45x11Mj52FNGcI7jXV5OHaxI=; b=OXGh4XO9ASMmA35vl6614q15GWSHMtNrCkPiRg3XCkVWivLYERYGzQ9BcTLMFLf/aw rZxVh5JqhY8JTth3zO++JQeoESb+pd++emcGDjtK4V/rZjv2bdkJx2gXCeRQ/EaWqEGQ hO1gJ9dPNUseUH0WD+8XTQhap6Zr2lCMeACEekbmJq8i3pXjuU66EQByAtdQkq+Wcp1l X5EMXo1PRYO87hr80c2b5g59MoLfX4P/SQQ8uvxqirtGbxigcSrhkWo46uuuB1GdWFeY sqybBcEAZiSw3WsXGRg2N5sADtfJhMJ6uueYxpPSWPoqn8J3X0uG2Vf66fQnucsoes0V tl7Q== 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=KtD3E7GYpMHpgVn/sQN45x11Mj52FNGcI7jXV5OHaxI=; b=D0xqdcsVIEfkjYe0bhD/Uq1URXvz3XvJL7GcSovnpAELbGKd2gShEEJdOD7JMwXaAz +aLJPLANbwTX/fTDruxoHv0qeEYC2wY1SCTAUuUPPsoO/6yzMb/7gED32kskDGxvAvvt 8i4gqG4yeGigtgNsfEBbaZr160ZlpNpA6ZFr8n9vfCQq0ko1V0c7plE3RpqofNO3ODmc 3HifbKE5LsUQacvQtDJXKx7rQx4aV/PcQZGM0l+tSqOTWXXk9LsILo5m+jMKKdJ0boAW BwAcuSrIbEWLBGe67lWvK4gaFepcNFDWbIzwOcnnchcwPWQbuZgrCfQKVYUgQHZx17JP E56A== X-Gm-Message-State: AO0yUKUJNhXujWXJI0H+aVo/vHsu4Thm5FY8pYDDSqz5emxLyx507jf8 OUWA4B4zGolZ5TMKiMjxfPGmyBiUIF/TLlD92LY= X-Received: by 2002:aa7:9d8d:0:b0:5d6:3d96:4777 with SMTP id f13-20020aa79d8d000000b005d63d964777mr16571712pfq.24.1677476628378; Sun, 26 Feb 2023 21:43:48 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:47 -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 24/70] target/m68k: Reject immediate as destination in gen_ea_mode Date: Sun, 26 Feb 2023 19:41:47 -1000 Message-Id: <20230227054233.390271-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In theory this should never happen, as all such instructions are illegal. This is checked in e.g. gen_lea_mode and gen_ea_mode_fp but not here. In case something higher up isn't checking modes properly, return NULL_QREG. This will result in an illegal instruction exception being raised. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 3055d2d246..7a87811427 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -898,6 +898,10 @@ static TCGv gen_ea_mode(CPUM68KState *env, DisasContext *s, int mode, int reg0, case 3: /* pc index+displacement. */ goto do_indirect; case 4: /* Immediate. */ + /* Should never be used for an output or RMW input. */ + if (what == EA_STORE || addrp) { + return NULL_QREG; + } /* Sign extend values for consistency. */ switch (opsize) { case OS_BYTE: From patchwork Mon Feb 27 05:41:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656850 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2184593wrb; Sun, 26 Feb 2023 21:50:31 -0800 (PST) X-Google-Smtp-Source: AK7set9xkXnupvEvRdxvP1WuXaift8XlbcyM19Gh9j1K+a9SDfTNXiEsHsr1Eps/rkkCuSdLYV3x X-Received: by 2002:a05:6214:1947:b0:56e:c09e:7d6b with SMTP id q7-20020a056214194700b0056ec09e7d6bmr51210806qvk.43.1677477031752; Sun, 26 Feb 2023 21:50:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477031; cv=none; d=google.com; s=arc-20160816; b=dHYHa8bgq2A1koYGh7ad5rRJtI+lcHokJHy/MFnWYQx7+52NU7KxQmHRSi2bqvOcD4 LEmOnGDMiGD0K6LGjz6VAyLlqL/snVRUwWHLBikwy4G1xPVHGjj5vHk0r4A75hM145Qk t2poLYg+z30E6TlUtJqpdhuIqNM56BkM/ZUrgH0ChjuoTeH2fXl3tb2JqsMJ22UdcQcw 92gGUAbG5VRd6koM1jR9s9JQ9yFFhDsgUFlnTg/q0AX4W43Hy8VV7+Zojy3jLyvo+sll Dw1jJXMQnyDDiAEj4hJdraa3t/MDANBSKUjIiWhzoc5HohT30aRsiXi5IwRnJYchdJnG a3AQ== 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=RCxesrIpTbTxRzaqZYaMu9uuGA6eHqItNDhI0BRycuU=; b=RCdQPImgr0gtNzKkS6on1Hjp26ZZwTv29FmJmDhhvdwpz0vGzg+REXsQqFwP/2Dxw8 BcWzocvHCIY6RzIRX8FdCSI6VBgxxHzVs5mLhs8JsHiKylpTIqH1pAcfXmkA/WuyNiPj H1QMSfEMxoS+uaBS6NmfDbwQcgDrHWICBpMrMxWGTiNkPUPn5NyHX7UlHmIc3/eMI8zm s+BBO3nlasM/YjPk9lg8X4L6+VWoZKXDi3sIQ+eQDOMFSWr5BxC+57rv+uEFcInh54d7 CaTGm5YY2A49AdkgC3ISJ51aFWwOb86vLepNPou6WgrHcVV4UttYPsV0jezbo393zH9e jSpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l+cUrSbu; 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 l6-20020a05620a28c600b007423359f0c3si6204718qkp.306.2023.02.26.21.50.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:50:31 -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=l+cUrSbu; 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 1pWWJA-0006J7-BQ; Mon, 27 Feb 2023 00:44:20 -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 1pWWIm-0005Nl-0R for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:56 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIh-0005Ai-Th for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:55 -0500 Received: by mail-pf1-x42f.google.com with SMTP id c10so2155752pfv.13 for ; Sun, 26 Feb 2023 21:43:51 -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=RCxesrIpTbTxRzaqZYaMu9uuGA6eHqItNDhI0BRycuU=; b=l+cUrSbutYZtb1yNDz9VpYy+7RnrJuM779Qjay6GlDr4fZ1CmFmafG/8/twcwjxgQ5 pPc3dgCBdBKqGj5JiD1fTt7FOdcr7S2PPEAt3AC2wxv2SCMNU1iIpe6QQ9fi44Sww/ZD J4l5QpO4BFCEdO5aXCbeCvIsFSvZ+uA0MT1wkSutLw9qkkBKH2eO8cgfo/Sm101iYJZ9 CQuvC/6/+sz5GYzmgqikvLP451k9fXCbYBLoeUWJIdAW9U6Cx3AQwn99Hz/Fwr/STElX n3VlQmBBGlPPFl7SdnJwuCxG7Bb8oP0ePJCQL+ityr3u5T/lMD7FOZ565hKDgXp17pdu R1Dg== 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=RCxesrIpTbTxRzaqZYaMu9uuGA6eHqItNDhI0BRycuU=; b=OAcac11YXEFHUFH/OkCsS+EzN6xPOkyeQn3wU1/gC8lRWRxo8FKLGRw7V+UpMatvxk 9WqBV+etysSETny/GrWCFwWogqP5EU6/nOBc5f82+nNWYnQyy7VBdALNGKL/Ihize3ug /1H7dtCEZAcKFNUVo/XHZ8X7cu7tyxpBZEqqaSWks0PtSB4IxcUFV3DmGX8sUzCsQAPd +Km3UgDLN3X6FvUuoWV8l7OzfD0aw7xauPlZANefJnrfELkkXTc2WUtHvrrmYeI37M0g udNDg7VkuIu9LB0f1h598gCqJkf7thjVuW/hH8Vw92cbLz7hjmS99Qs189JS7qMQYszY xFUQ== X-Gm-Message-State: AO0yUKVkT2jA9u4RM/NbsWPRdCKy5meuQwUlusVdnylevHM4/dQyaGdh qOFZqabgLiRJGgG3scKGSBqOSyR00pmGWtSukt4= X-Received: by 2002:a05:6a00:47:b0:5cd:d766:8a2b with SMTP id i7-20020a056a00004700b005cdd7668a2bmr18700523pfk.6.1677476630933; Sun, 26 Feb 2023 21:43:50 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:50 -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 25/70] target/m68k: Use tcg_constant_i32 in gen_ea_mode Date: Sun, 26 Feb 2023 19:41:48 -1000 Message-Id: <20230227054233.390271-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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 Return a constant for an immediate input. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/m68k/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 7a87811427..7435e51acc 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -924,7 +924,7 @@ static TCGv gen_ea_mode(CPUM68KState *env, DisasContext *s, int mode, int reg0, default: g_assert_not_reached(); } - return tcg_const_i32(offset); + return tcg_constant_i32(offset); default: return NULL_QREG; } From patchwork Mon Feb 27 05:41:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656933 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2232264wrb; Mon, 27 Feb 2023 00:27:33 -0800 (PST) X-Google-Smtp-Source: AK7set/DMnpbNeNcnm3UcV52qf+ksmCSOe8md1x7BgT48KbZN2vaIfg2TheBPCNC25gyxcBNrtFP X-Received: by 2002:a05:622a:24b:b0:3b9:ca95:da6e with SMTP id c11-20020a05622a024b00b003b9ca95da6emr40288682qtx.44.1677486453074; Mon, 27 Feb 2023 00:27:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486453; cv=none; d=google.com; s=arc-20160816; b=w93XKmx4mk0v1M3BPbf/oFBxZteIN/vUm/hRDligGxmPdwVhaQQprt/tvyf/1mfITQ DC4JRl4EffJ2pxvRdv+2OtqciQx3WSWDxHsnUAwPEywb8JaV9DXl1cl1gbKBWOeJ7QZ8 NHXOQpXhYfXfC9rTqNSAJTJYq57YCj7Ejp06jqPRD3bVG1HYFBkWPYeM2CkDU9OlJcG3 1Rau/8flmgmM/h3IEv8ZG2HMnmUIcfAcp3HOPmMQfzgdkv0FaCO9cJTCxTKhHbkxI6wz 1ZVftR4l/JwPY+8L0zps9VPVmkjIOjLd+4DnUhBkFJwlK2Wtzxncvdll3BoOQ0eJ/kYH /LOA== 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=NAVl1NdCqRWIlN6uf74urduxnE/s5f/Fs3hV/YcJ1uk=; b=IXgTHaRrL49mYe2gFx+AN0M+JJv0F+smx25EJ6Vxxo6TOVQffv8IJlC95fjOkSF/BY +A4su6xI7smNt/eUjgjZnCmR6HyPSvFWEvRz8q6kzjOiHPy8Ob0eGusn+PSuxuYTsxeT 8izUSDERC/9U9YMMhtFdef/KGw11jCMGTyl6LWoVAjQdQDHTwjmLngj4lzn5GVt5Jje5 ElL8bSZWqLo/+Wn3BZSng+l52LiGK357foLRRNkLcauOGLMLq5/kqOzejLXhlLoJxtwk Rs1iGz8NoCIJb3+kpUQckc35bILyrJ02KSHeVBV12bMgR0sngoE9xAVMObSEQiLksjCQ ztrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RQJ2hbpV; 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 j19-20020ac85f93000000b003bfb62587f1si6042745qta.453.2023.02.27.00.27.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:27:33 -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=RQJ2hbpV; 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 1pWWIp-0005Tk-Cr; Mon, 27 Feb 2023 00:43:59 -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 1pWWIn-0005QV-Vr for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:58 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIl-0005J0-3J for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:57 -0500 Received: by mail-pg1-x530.google.com with SMTP id bn17so2833553pgb.10 for ; Sun, 26 Feb 2023 21:43:54 -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=NAVl1NdCqRWIlN6uf74urduxnE/s5f/Fs3hV/YcJ1uk=; b=RQJ2hbpV4GjOQNJfrQacOq4JBUbi8db4HMc8Py3z0F0ISLheChkiibLG66G6H2vj70 Kc8onJhCJ5dZ0rGE0SqGi4g2tY7+AdUsFUBRyyMKTWcLnBBtMHzCzFXHAlNwY5OmAgpe NivarQRkeMsxgQjT/ku0sqFaH7C7rlH4Q/UMiYl5db5MGdgiElpjGucDXlwjXy6kP4hC dmuDZtO1WI7ZCiywaZlN7kBw1NosU1NwQlp9HWeVk7V5V928hB6jK3MbaDQ5nL8zzieo wuBFvqcNmNFV98dXEw8opubduS9DC+2uyg8V/DdFgY5oswKe59ERCncZY4dk3Wlfcngr 56sw== 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=NAVl1NdCqRWIlN6uf74urduxnE/s5f/Fs3hV/YcJ1uk=; b=sf5SzP0s7fBN+94yCpi+nTPCRdI9kcoOYGptlV5bFJN0W/CysFkHmzdH+1D40IysbR isOJR2HwENq32NYWlB8GETXH2ktcrSdF5vWKZizvjaBMX5ojq/LGmVy3Gp3dYZKQVkAJ zRp94D5xSzBKUw4Fcvvu3UTOXtoRMCGvikzmC2VxNiXHYJ8iW3S2iFSKGer4cLPG1tw9 j32IZftTuZ6l1sXOXTdFDsRBTp5WDU3TaMHcu5TKfOV6xFvjn4XCydHCbSikXzY4IVpV JSMOOEBh09LBsGP488rTLPSwKlvXrTZwxJoMU3kQ4wpq9AjRF2plbkG/2r7rwSDhCWPj r+nA== X-Gm-Message-State: AO0yUKXhBToSgfsioFyUBzirhcHhTN8+d4TBIg/iSErYP4c5QKuZUUdi P2FCDCDU4wdz4ejF8GlfnKh4Fw86vEqoRtGTEFg= X-Received: by 2002:aa7:955c:0:b0:5a8:b6f3:a2a7 with SMTP id w28-20020aa7955c000000b005a8b6f3a2a7mr19755521pfq.11.1677476633504; Sun, 26 Feb 2023 21:43:53 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:53 -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 26/70] target/m68k: Avoid tcg_const_i32 when modified Date: Sun, 26 Feb 2023 19:41:49 -1000 Message-Id: <20230227054233.390271-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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 In several instances, a temp is initialized with a for use as a constant, and then subsequently used as an unrelated temp. Split them. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/m68k/translate.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 7435e51acc..6f4151232f 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -1635,8 +1635,8 @@ static void bcd_add(TCGv dest, TCGv src) * = result with some possible exceeding 0x6 */ - t0 = tcg_const_i32(0x066); - tcg_gen_add_i32(t0, t0, src); + t0 = tcg_temp_new(); + tcg_gen_addi_i32(t0, src, 0x066); t1 = tcg_temp_new(); tcg_gen_add_i32(t1, t0, dest); @@ -1822,7 +1822,8 @@ DISAS_INSN(nbcd) SRC_EA(env, src, OS_BYTE, 0, &addr); - dest = tcg_const_i32(0); + dest = tcg_temp_new(); + tcg_gen_movi_i32(dest, 0); bcd_sub(dest, src); DEST_EA(env, insn, OS_BYTE, dest, &addr); @@ -1900,8 +1901,8 @@ DISAS_INSN(bitop_reg) else tcg_gen_andi_i32(src2, DREG(insn, 9), 31); - tmp = tcg_const_i32(1); - tcg_gen_shl_i32(tmp, tmp, src2); + tmp = tcg_temp_new(); + tcg_gen_shl_i32(tmp, tcg_constant_i32(1), src2); tcg_gen_and_i32(QREG_CC_Z, src1, tmp); @@ -3080,7 +3081,7 @@ DISAS_INSN(suba) static inline void gen_subx(DisasContext *s, TCGv src, TCGv dest, int opsize) { - TCGv tmp; + TCGv tmp, zero; gen_flush_flags(s); /* compute old Z */ @@ -3089,14 +3090,15 @@ static inline void gen_subx(DisasContext *s, TCGv src, TCGv dest, int opsize) * (X, N) = dest - (src + X); */ - tmp = tcg_const_i32(0); - tcg_gen_add2_i32(QREG_CC_N, QREG_CC_X, src, tmp, QREG_CC_X, tmp); - tcg_gen_sub2_i32(QREG_CC_N, QREG_CC_X, dest, tmp, QREG_CC_N, QREG_CC_X); + zero = tcg_constant_i32(0); + tcg_gen_add2_i32(QREG_CC_N, QREG_CC_X, src, zero, QREG_CC_X, zero); + tcg_gen_sub2_i32(QREG_CC_N, QREG_CC_X, dest, zero, QREG_CC_N, QREG_CC_X); gen_ext(QREG_CC_N, QREG_CC_N, opsize, 1); tcg_gen_andi_i32(QREG_CC_X, QREG_CC_X, 1); /* Compute signed-overflow for subtract. */ + tmp = tcg_temp_new(); tcg_gen_xor_i32(QREG_CC_V, QREG_CC_N, dest); tcg_gen_xor_i32(tmp, dest, src); tcg_gen_and_i32(QREG_CC_V, QREG_CC_V, tmp); @@ -3283,7 +3285,7 @@ DISAS_INSN(adda) static inline void gen_addx(DisasContext *s, TCGv src, TCGv dest, int opsize) { - TCGv tmp; + TCGv tmp, zero; gen_flush_flags(s); /* compute old Z */ @@ -3292,13 +3294,14 @@ static inline void gen_addx(DisasContext *s, TCGv src, TCGv dest, int opsize) * (X, N) = src + dest + X; */ - tmp = tcg_const_i32(0); - tcg_gen_add2_i32(QREG_CC_N, QREG_CC_X, QREG_CC_X, tmp, dest, tmp); - tcg_gen_add2_i32(QREG_CC_N, QREG_CC_X, QREG_CC_N, QREG_CC_X, src, tmp); + zero = tcg_constant_i32(0); + tcg_gen_add2_i32(QREG_CC_N, QREG_CC_X, QREG_CC_X, zero, dest, zero); + tcg_gen_add2_i32(QREG_CC_N, QREG_CC_X, QREG_CC_N, QREG_CC_X, src, zero); gen_ext(QREG_CC_N, QREG_CC_N, opsize, 1); /* Compute signed-overflow for addition. */ + tmp = tcg_temp_new(); tcg_gen_xor_i32(QREG_CC_V, QREG_CC_N, src); tcg_gen_xor_i32(tmp, dest, src); tcg_gen_andc_i32(QREG_CC_V, QREG_CC_V, tmp); From patchwork Mon Feb 27 05:41:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656867 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2185366wrb; Sun, 26 Feb 2023 21:53:53 -0800 (PST) X-Google-Smtp-Source: AK7set8fBp3UqwC5sd1Eso2g1htQNhroQeXMVgk8CVX8GDnsHrpvzU6oaepZQLLIfddAyABlAlRy X-Received: by 2002:ac8:4e88:0:b0:3ba:6595:8640 with SMTP id 8-20020ac84e88000000b003ba65958640mr41316947qtp.19.1677477233215; Sun, 26 Feb 2023 21:53:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477233; cv=none; d=google.com; s=arc-20160816; b=CLV7FLgO49ZRNsoOXNlEclUWQTcDyt/wZd/wbwJ+1VcGD2BqAyvgtUEUYn+R+lZ21y cZ3mmLkjgBbvktcamloYHk31qeYM0drnaDiE5mIyybgJ1fxinGgDpMEngLbPID7xQm08 Ik2AJS5/KQy7R1AGarwhx+vOxgtJj41plQA/7F92rT6iF4yzAmW0KcrtiB/9Ho++ZDhK v9VVI26kj6hrhacT7b7AN0vxWGN6FZL6eGBuNW+osbJ7AJyVfA2KauxnCkvCsrlhhAgw /kgO/EEObEezyqf3R37TbRF/jAgEx5xeXWwg58paiw8TsuvgO53ub1jPpjlayRDhNsOm 8m/A== 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=/zCqZBQrzNOn6osZDTRgqatKCTehdYwPWQUE6TO3Ir0=; b=aG5JKSaGMam1YKlp2aL5ZDlPExyx434uFx/pB8mhXL8V45vEgWDUKNsxmuSyru3VeF 2cU7SLeIppucs/mIYimbKY82i47ty5uYQKIkunE36BwKb3Mr0uXsEOl9g80j5JF2+YUB yD2EP/R8c+kA9/iAITQ6rzF3zlD6ERytUua1Q92EXaJPrqZr9o4toFabmD7okDGu5x5b RDp1Q23iUeYFwBewE83iBUS3WkMLxZR45MeFViY7z5h1U/e75vHqAgvCIiy1RZK4N1h3 k62oBh63jcj8RrGpIAPwVTZ8GfTT+b75Qn7ioD0+oredxfffskFPCipmOox+qQ8+01XZ SpWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FCPEKdow; 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 q18-20020a05622a031200b003b82e92b364si5737839qtw.503.2023.02.26.21.53.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:53:53 -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=FCPEKdow; 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 1pWWJD-0006f7-Qe; Mon, 27 Feb 2023 00:44:23 -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 1pWWIr-0005Y4-75 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:05 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIn-0005Lx-QI for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:59 -0500 Received: by mail-pj1-x102c.google.com with SMTP id c23so4878308pjo.4 for ; Sun, 26 Feb 2023 21:43: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=/zCqZBQrzNOn6osZDTRgqatKCTehdYwPWQUE6TO3Ir0=; b=FCPEKdowx1+Zhn3QKVOhpybUPL3EijaO7Y43UfPpXNGmALsHDbUBfgYAyKzaN0B11P eL71/lX0kMQHKg+ToN/tJNnAvUoq7cDr5snSUVGicroy/yaC5AMXZOgtOU2iE98hv8xB I5UvNlOBS9iZc1QvooNZVihXO76WPB701N7sVt6Qc91yKThw4mVtaTK7HFNuw+E/2hbd RmvknCMcHqiaEdWzW9yIzjh9g8nPInbK+uJxR9zgUNs+GCnhjKcsYGxqGDi9f72X+7BF jnAdlAE8z++mw+6XpixMyLwfdvedQ8pC5Mm9WQwiY0nrkCjkaZQSbbMSP1+odN2I2P/H iwsg== 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=/zCqZBQrzNOn6osZDTRgqatKCTehdYwPWQUE6TO3Ir0=; b=wxo1bXJm0m4Rma9TgKgskFDtQvjhjANncpvMUed5GQ4anqZNHigF2HWM3om3iBPJQ5 Noxi1al8vXSZXbAvDpGdwNzjudtU/Z5pz0x3t4afhrELossfdwaFgA6mZ5TlAy+UCzwQ 0/JhBo0UX4/pLxVoBFDI7VjLk3NqrnGu+JbdTVLM2+WZSJb87PuiNlIkbUma7hOkeGhB YfIIa6nHgnilChFUh+l4C/b0jGUVlJAe074RSXpIv3R8AFzL+LRjhWcDze5q/x56L0FA l/eY1k5wfaKBz4Wfv28wEYFzteMj3BF6b0DlN6iCRyhupxTcSxLPQ1mUGxxVQwq/yJCt cD6A== X-Gm-Message-State: AO0yUKUNYc0T/NEi0rO5H6eN5ms+MjHJbRapdYMRiSlaGvAqWwgNLKO6 QALpcL8+skTfWdgHtFi4+kAvLFUIpDKIF2AiT7s= X-Received: by 2002:a05:6a20:748d:b0:cc:b0e0:5534 with SMTP id p13-20020a056a20748d00b000ccb0e05534mr8457008pzd.60.1677476636070; Sun, 26 Feb 2023 21:43:56 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43: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 27/70] target/m68k: Avoid tcg_const_i32 in bfop_reg Date: Sun, 26 Feb 2023 19:41:50 -1000 Message-Id: <20230227054233.390271-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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 Tidy up the whole function, hoisting is_bfffo as a common test for whether tlen and tofs needed. Use tcg_constant_i32, and load a separate temporary for mask. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/m68k/translate.c | 42 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 6f4151232f..3d97aaf578 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -4031,14 +4031,8 @@ DISAS_INSN(bfop_reg) TCGv src = DREG(insn, 0); int len = ((extract32(ext, 0, 5) - 1) & 31) + 1; int ofs = extract32(ext, 6, 5); /* big bit-endian */ - TCGv mask, tofs, tlen; - - tofs = NULL; - tlen = NULL; - if ((insn & 0x0f00) == 0x0d00) { /* bfffo */ - tofs = tcg_temp_new(); - tlen = tcg_temp_new(); - } + TCGv mask, tofs = NULL, tlen = NULL; + bool is_bfffo = (insn & 0x0f00) == 0x0d00; if ((ext & 0x820) == 0) { /* Immediate width and offset. */ @@ -4049,45 +4043,49 @@ DISAS_INSN(bfop_reg) tcg_gen_rotli_i32(QREG_CC_N, src, ofs); } tcg_gen_andi_i32(QREG_CC_N, QREG_CC_N, ~maski); - mask = tcg_const_i32(ror32(maski, ofs)); - if (tofs) { - tcg_gen_movi_i32(tofs, ofs); - tcg_gen_movi_i32(tlen, len); + + mask = tcg_constant_i32(ror32(maski, ofs)); + if (is_bfffo) { + tofs = tcg_constant_i32(ofs); + tlen = tcg_constant_i32(len); } } else { TCGv tmp = tcg_temp_new(); + + mask = tcg_temp_new(); if (ext & 0x20) { /* Variable width */ tcg_gen_subi_i32(tmp, DREG(ext, 0), 1); tcg_gen_andi_i32(tmp, tmp, 31); - mask = tcg_const_i32(0x7fffffffu); - tcg_gen_shr_i32(mask, mask, tmp); - if (tlen) { + tcg_gen_shr_i32(mask, tcg_constant_i32(0x7fffffffu), tmp); + if (is_bfffo) { + tlen = tcg_temp_new(); tcg_gen_addi_i32(tlen, tmp, 1); } } else { /* Immediate width */ - mask = tcg_const_i32(0x7fffffffu >> (len - 1)); - if (tlen) { - tcg_gen_movi_i32(tlen, len); + tcg_gen_movi_i32(mask, 0x7fffffffu >> (len - 1)); + if (is_bfffo) { + tlen = tcg_constant_i32(len); } } + if (ext & 0x800) { /* Variable offset */ tcg_gen_andi_i32(tmp, DREG(ext, 6), 31); tcg_gen_rotl_i32(QREG_CC_N, src, tmp); tcg_gen_andc_i32(QREG_CC_N, QREG_CC_N, mask); tcg_gen_rotr_i32(mask, mask, tmp); - if (tofs) { - tcg_gen_mov_i32(tofs, tmp); + if (is_bfffo) { + tofs = tmp; } } else { /* Immediate offset (and variable width) */ tcg_gen_rotli_i32(QREG_CC_N, src, ofs); tcg_gen_andc_i32(QREG_CC_N, QREG_CC_N, mask); tcg_gen_rotri_i32(mask, mask, ofs); - if (tofs) { - tcg_gen_movi_i32(tofs, ofs); + if (is_bfffo) { + tofs = tcg_constant_i32(ofs); } } } From patchwork Mon Feb 27 05:41:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656904 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2228539wrb; Mon, 27 Feb 2023 00:14:20 -0800 (PST) X-Google-Smtp-Source: AK7set/mltufiHO4MdEYbZ3v+zKLDXJkplb256DFslFodYJHnahLAofgk+MKz54Gs+O5VbIf0Y0U X-Received: by 2002:ad4:5c62:0:b0:56e:fce0:a50 with SMTP id i2-20020ad45c62000000b0056efce00a50mr47228006qvh.52.1677485660592; Mon, 27 Feb 2023 00:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485660; cv=none; d=google.com; s=arc-20160816; b=LIlgZW3RwWDCsS/yfhkHq7+cJ0NzkDmxRnyT7GIijZhNNJvqLCkoe6JiwNdBiruEKF UgK7m9snyQwTmKvCCc8P1MrlGzSINI302w/4q8KeOLX8IaW7z6f8WREEx2hKvaHxPFZR g5ysmItrBqGZyeBFEeMpL4MGo7o3EWMYq5Q7WdH+ZhyaGp06QwlBvWNcTAU9avWoFnDr uUTSYDNp+HZYTczspIGlGT7jwh5t/X+f0iDMiDrHZNQUAwNzDl0s5YjpYr7xWVHyW/xg xWFyW/T20nZnMzKMqevFB3hjKUJRbpZKH764IvYWvX2eWSeyDG/7t8YdZFxo/ScT7hfx olDA== 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=ACEQFJsCeUwaXp7PoC/4fjWEfP1E4KipqQGgtxf0o58=; b=Hd4PSbdn3b/pHcSghuZIDb4zFtCNDZojLTr+ROQuzHESUVvPBQ8ZwE97vHPid4PjnM QK7XCu7um71ScNn1NNifOIInUtY2Yece0t1n6Ny9dRwxbHyfXidKujetmui5tNKcTgt0 Yh4N8q1RGh0YfU2c+7EMrmFqJPPimiCuk4A9WVbrRd5eKYdWh8q6FEcroFr4YBDXhMYW TCVG5S8qzc5a9to7YMZKDQu/Ah/1wcWZ5W08hoIt9x1Nc++lf6UI77qZfJTtuSH7fFjg JZ2rHSOhO5fTNeOkDznd64rOfQmpbhAwFatFXVt6ZWMXmyt3uoB8EnkN9wzonxZ9ufyQ 5fcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K20mHKyU; 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 q30-20020a37f71e000000b00735691c43dbsi5275172qkj.18.2023.02.27.00.14.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:14:20 -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=K20mHKyU; 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 1pWWJF-0006om-ON; Mon, 27 Feb 2023 00:44:25 -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 1pWWJ6-0005vv-O5 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:16 -0500 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIu-0005Oy-TJ for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:12 -0500 Received: by mail-pj1-x102a.google.com with SMTP id x34so4945407pjj.0 for ; Sun, 26 Feb 2023 21:44:00 -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=ACEQFJsCeUwaXp7PoC/4fjWEfP1E4KipqQGgtxf0o58=; b=K20mHKyUpbMdBve+NBezk3D4PrI3rGLY1YYvW4RSvMoS4eOT1iS0XvMvthNyL1Axhg WAIhj1m112b9e+k547OKjNHGzIl6g1lS1z0Hhikq0gOGejNGxQGvvFBrtTk0kMEweN60 awQPSLlmZBsjM/k7ZaoF3dxN3TS2SUgTX/DoxC3+8mLcHOr17obHeYumDswl7Gkrx9tq hyaK3SvwKTBKlV3frZNPDF3Y30zsk/xqB641/HunZBYabBuWFVKftZ4GZIoKsMuCrw9T hmto5ddicEeb0i1HSyX1TkF4zFhCQr5rNjpDRGW8vd9na12z5NTFOca28OlYmBJnPEy/ beJQ== 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=ACEQFJsCeUwaXp7PoC/4fjWEfP1E4KipqQGgtxf0o58=; b=wCcn8z3Z3xkPpy2wRTwypNpfx1d+q3/g9vsFAiX8jsjwbJuUasW9hfK1pbGgSR8CVx 93IN96H1pfq/ckO7QakXHFaCQtFelfl+kWzTToOgHiNa5JueuSpzvm2P8mDuKDPPgRb5 SOmt5+PhkojvQfH/nETczh6LK7AO3B+crqlU6bYDNpCshBxdQTgNQWRx5Kzc73Uu73sn OR7maWXw9wv9kSAOQUeM5HLiqHWYb53h91GFVHRu1/Xprv1nBL1hEFJABIkzporZt8Xk 5kYToidhkE+c8gk3B35Trpr1GQCmBr2avI/RbVLc0hvJNZDk/lUa+f8qPj7kTCAef2EA KehQ== X-Gm-Message-State: AO0yUKV424ev/6yS4yTjCXVXpH7DNiMskS4NQTSgEwnDFSv7+tfX10UK C/HXaBI6z8JCFN3lOnJ4RhLOHtjorYxfZAeKhhM= X-Received: by 2002:a05:6a21:789c:b0:cb:c276:58cc with SMTP id bf28-20020a056a21789c00b000cbc27658ccmr22169314pzc.28.1677476638849; Sun, 26 Feb 2023 21:43:58 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:58 -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 28/70] target/m68k: Avoid tcg_const_* throughout Date: Sun, 26 Feb 2023 19:41:51 -1000 Message-Id: <20230227054233.390271-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.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 All remaining uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/m68k/translate.c | 158 ++++++++++++++++++++-------------------- 1 file changed, 77 insertions(+), 81 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 3d97aaf578..e16c608ef8 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -264,10 +264,7 @@ static void gen_jmp(DisasContext *s, TCGv dest) static void gen_raise_exception(int nr) { - TCGv_i32 tmp; - - tmp = tcg_const_i32(nr); - gen_helper_raise_exception(cpu_env, tmp); + gen_helper_raise_exception(cpu_env, tcg_constant_i32(nr)); } static void gen_raise_exception_format2(DisasContext *s, int nr, @@ -471,7 +468,7 @@ static TCGv gen_lea_indexed(CPUM68KState *env, DisasContext *s, TCGv base) if ((ext & 0x80) == 0) { /* base not suppressed */ if (IS_NULL_QREG(base)) { - base = tcg_const_i32(offset + bd); + base = tcg_constant_i32(offset + bd); bd = 0; } if (!IS_NULL_QREG(add)) { @@ -487,7 +484,7 @@ static TCGv gen_lea_indexed(CPUM68KState *env, DisasContext *s, TCGv base) add = tmp; } } else { - add = tcg_const_i32(bd); + add = tcg_constant_i32(bd); } if ((ext & 3) != 0) { /* memory indirect */ @@ -623,8 +620,7 @@ static void gen_flush_flags(DisasContext *s) break; default: - t0 = tcg_const_i32(s->cc_op); - gen_helper_flush_flags(cpu_env, t0); + gen_helper_flush_flags(cpu_env, tcg_constant_i32(s->cc_op)); s->cc_op_synced = 1; break; } @@ -785,14 +781,14 @@ static TCGv gen_lea_mode(CPUM68KState *env, DisasContext *s, switch (reg0) { case 0: /* Absolute short. */ offset = (int16_t)read_im16(env, s); - return tcg_const_i32(offset); + return tcg_constant_i32(offset); case 1: /* Absolute long. */ offset = read_im32(env, s); - return tcg_const_i32(offset); + return tcg_constant_i32(offset); case 2: /* pc displacement */ offset = s->pc; offset += (int16_t)read_im16(env, s); - return tcg_const_i32(offset); + return tcg_constant_i32(offset); case 3: /* pc index+displacement. */ return gen_lea_indexed(env, s, NULL_QREG); case 4: /* Immediate. */ @@ -1171,23 +1167,23 @@ static int gen_ea_mode_fp(CPUM68KState *env, DisasContext *s, int mode, } switch (opsize) { case OS_BYTE: - tmp = tcg_const_i32((int8_t)read_im8(env, s)); + tmp = tcg_constant_i32((int8_t)read_im8(env, s)); gen_helper_exts32(cpu_env, fp, tmp); break; case OS_WORD: - tmp = tcg_const_i32((int16_t)read_im16(env, s)); + tmp = tcg_constant_i32((int16_t)read_im16(env, s)); gen_helper_exts32(cpu_env, fp, tmp); break; case OS_LONG: - tmp = tcg_const_i32(read_im32(env, s)); + tmp = tcg_constant_i32(read_im32(env, s)); gen_helper_exts32(cpu_env, fp, tmp); break; case OS_SINGLE: - tmp = tcg_const_i32(read_im32(env, s)); + tmp = tcg_constant_i32(read_im32(env, s)); gen_helper_extf32(cpu_env, fp, tmp); break; case OS_DOUBLE: - t64 = tcg_const_i64(read_im64(env, s)); + t64 = tcg_constant_i64(read_im64(env, s)); gen_helper_extf64(cpu_env, fp, t64); break; case OS_EXTENDED: @@ -1195,9 +1191,9 @@ static int gen_ea_mode_fp(CPUM68KState *env, DisasContext *s, int mode, gen_exception(s, s->base.pc_next, EXCP_FP_UNIMP); break; } - tmp = tcg_const_i32(read_im32(env, s) >> 16); + tmp = tcg_constant_i32(read_im32(env, s) >> 16); tcg_gen_st16_i32(tmp, fp, offsetof(FPReg, l.upper)); - t64 = tcg_const_i64(read_im64(env, s)); + t64 = tcg_constant_i64(read_im64(env, s)); tcg_gen_st_i64(t64, fp, offsetof(FPReg, l.lower)); break; case OS_PACKED: @@ -1257,7 +1253,7 @@ static void gen_cc_cond(DisasCompare *c, DisasContext *s, int cond) goto done; case 10: /* PL */ case 11: /* MI */ - c->v2 = tcg_const_i32(0); + c->v2 = tcg_constant_i32(0); c->v1 = tmp = tcg_temp_new(); tcg_gen_sub_i32(tmp, QREG_CC_N, QREG_CC_V); gen_ext(tmp, tmp, op - CC_OP_CMPB, 1); @@ -1273,7 +1269,7 @@ static void gen_cc_cond(DisasCompare *c, DisasContext *s, int cond) } } - c->v2 = tcg_const_i32(0); + c->v2 = tcg_constant_i32(0); switch (cond) { case 0: /* T */ @@ -2004,7 +2000,7 @@ DISAS_INSN(movem) addr = tcg_temp_new(); tcg_gen_mov_i32(addr, tmp); - incr = tcg_const_i32(opsize_bytes(opsize)); + incr = tcg_constant_i32(opsize_bytes(opsize)); if (is_load) { /* memory to register */ @@ -2240,13 +2236,13 @@ DISAS_INSN(arith_im) opsize = insn_opsize(insn); switch (opsize) { case OS_BYTE: - im = tcg_const_i32((int8_t)read_im8(env, s)); + im = tcg_constant_i32((int8_t)read_im8(env, s)); break; case OS_WORD: - im = tcg_const_i32((int16_t)read_im16(env, s)); + im = tcg_constant_i32((int16_t)read_im16(env, s)); break; case OS_LONG: - im = tcg_const_i32(read_im32(env, s)); + im = tcg_constant_i32(read_im32(env, s)); break; default: g_assert_not_reached(); @@ -2398,7 +2394,6 @@ DISAS_INSN(cas2w) { uint16_t ext1, ext2; TCGv addr1, addr2; - TCGv regs; /* cas2 Dc1:Dc2,Du1:Du2,(Rn1):(Rn2) */ @@ -2430,13 +2425,13 @@ DISAS_INSN(cas2w) * Dc2 = (R2) */ - regs = tcg_const_i32(REG(ext2, 6) | - (REG(ext1, 6) << 3) | - (REG(ext2, 0) << 6) | - (REG(ext1, 0) << 9)); if (tb_cflags(s->base.tb) & CF_PARALLEL) { gen_helper_exit_atomic(cpu_env); } else { + TCGv regs = tcg_constant_i32(REG(ext2, 6) | + (REG(ext1, 6) << 3) | + (REG(ext2, 0) << 6) | + (REG(ext1, 0) << 9)); gen_helper_cas2w(cpu_env, regs, addr1, addr2); } @@ -2480,10 +2475,10 @@ DISAS_INSN(cas2l) * Dc2 = (R2) */ - regs = tcg_const_i32(REG(ext2, 6) | - (REG(ext1, 6) << 3) | - (REG(ext2, 0) << 6) | - (REG(ext1, 0) << 9)); + regs = tcg_constant_i32(REG(ext2, 6) | + (REG(ext1, 6) << 3) | + (REG(ext2, 0) << 6) | + (REG(ext1, 0) << 9)); if (tb_cflags(s->base.tb) & CF_PARALLEL) { gen_helper_cas2l_parallel(cpu_env, regs, addr1, addr2); } else { @@ -2557,7 +2552,7 @@ DISAS_INSN(negx) * (X, N) = -(src + X); */ - z = tcg_const_i32(0); + z = tcg_constant_i32(0); tcg_gen_add2_i32(QREG_CC_N, QREG_CC_X, src, z, QREG_CC_X, z); tcg_gen_sub2_i32(QREG_CC_N, QREG_CC_X, z, z, QREG_CC_N, QREG_CC_X); gen_ext(QREG_CC_N, QREG_CC_N, opsize, 1); @@ -2602,8 +2597,7 @@ DISAS_INSN(clr) int opsize; TCGv zero; - zero = tcg_const_i32(0); - + zero = tcg_constant_i32(0); opsize = insn_opsize(insn); DEST_EA(env, insn, opsize, zero, NULL); gen_logic_cc(s, zero, opsize); @@ -2939,7 +2933,7 @@ DISAS_INSN(jump) } if ((insn & 0x40) == 0) { /* jsr */ - gen_push(s, tcg_const_i32(s->pc)); + gen_push(s, tcg_constant_i32(s->pc)); } gen_jmp(s, tmp); } @@ -2964,7 +2958,7 @@ DISAS_INSN(addsubq) if (imm == 0) { imm = 8; } - val = tcg_const_i32(imm); + val = tcg_constant_i32(imm); dest = tcg_temp_new(); tcg_gen_mov_i32(dest, src); if ((insn & 0x38) == 0x08) { @@ -3008,7 +3002,7 @@ DISAS_INSN(branch) } if (op == 1) { /* bsr */ - gen_push(s, tcg_const_i32(s->pc)); + gen_push(s, tcg_constant_i32(s->pc)); } if (op > 1) { /* Bcc */ @@ -3157,9 +3151,10 @@ DISAS_INSN(mov3q) int val; val = (insn >> 9) & 7; - if (val == 0) + if (val == 0) { val = -1; - src = tcg_const_i32(val); + } + src = tcg_constant_i32(val); gen_logic_cc(s, src, OS_LONG); DEST_EA(env, insn, OS_LONG, src, NULL); } @@ -3437,7 +3432,7 @@ static inline void shift_reg(DisasContext *s, uint16_t insn, int opsize) tcg_gen_extr_i64_i32(QREG_CC_N, QREG_CC_C, t64); /* Note that C=0 if shift count is 0, and we get that for free. */ } else { - TCGv zero = tcg_const_i32(0); + TCGv zero = tcg_constant_i32(0); tcg_gen_extrl_i64_i32(QREG_CC_N, t64); tcg_gen_shri_i32(QREG_CC_C, QREG_CC_N, bits); tcg_gen_movcond_i32(TCG_COND_EQ, QREG_CC_C, @@ -3459,7 +3454,7 @@ static inline void shift_reg(DisasContext *s, uint16_t insn, int opsize) * V = ((s ^ t) & (-1 << (bits - 1))) != 0 */ if (!logical && m68k_feature(s->env, M68K_FEATURE_M68K)) { - TCGv_i64 tt = tcg_const_i64(32); + TCGv_i64 tt = tcg_constant_i64(32); /* if shift is greater than 32, use 32 */ tcg_gen_movcond_i64(TCG_COND_GT, s64, s64, tt, tt, s64); /* Sign extend the input to 64 bits; re-do the shift. */ @@ -3640,7 +3635,7 @@ static TCGv rotate_x(TCGv reg, TCGv shift, int left, int size) { TCGv X, shl, shr, shx, sz, zero; - sz = tcg_const_i32(size); + sz = tcg_constant_i32(size); shr = tcg_temp_new(); shl = tcg_temp_new(); @@ -3651,7 +3646,7 @@ static TCGv rotate_x(TCGv reg, TCGv shift, int left, int size) tcg_gen_sub_i32(shr, shr, shift); /* shr = size + 1 - shift */ tcg_gen_subi_i32(shx, shift, 1); /* shx = shift - 1 */ /* shx = shx < 0 ? size : shx; */ - zero = tcg_const_i32(0); + zero = tcg_constant_i32(0); tcg_gen_movcond_i32(TCG_COND_LT, shx, shx, zero, sz, shx); } else { tcg_gen_mov_i32(shr, shift); /* shr = shift */ @@ -3730,7 +3725,7 @@ static TCGv rotate32_x(TCGv reg, TCGv shift, int left) /* if shift == 0, register and X are not affected */ - zero = tcg_const_i32(0); + zero = tcg_constant_i32(0); tcg_gen_movcond_i32(TCG_COND_EQ, X, shift, zero, QREG_CC_X, X); tcg_gen_movcond_i32(TCG_COND_EQ, reg, shift, zero, reg, lo); @@ -3748,7 +3743,7 @@ DISAS_INSN(rotate_im) tmp = 8; } - shift = tcg_const_i32(tmp); + shift = tcg_constant_i32(tmp); if (insn & 8) { rotate(DREG(insn, 0), shift, left, 32); } else { @@ -3773,7 +3768,7 @@ DISAS_INSN(rotate8_im) tmp = 8; } - shift = tcg_const_i32(tmp); + shift = tcg_constant_i32(tmp); if (insn & 8) { rotate(reg, shift, left, 8); } else { @@ -3797,7 +3792,7 @@ DISAS_INSN(rotate16_im) tmp = 8; } - shift = tcg_const_i32(tmp); + shift = tcg_constant_i32(tmp); if (insn & 8) { rotate(reg, shift, left, 16); } else { @@ -3912,7 +3907,7 @@ DISAS_INSN(rotate_mem) SRC_EA(env, src, OS_WORD, 0, &addr); - shift = tcg_const_i32(1); + shift = tcg_constant_i32(1); if (insn & 0x0200) { rotate(src, shift, left, 16); } else { @@ -4006,12 +4001,12 @@ DISAS_INSN(bfext_mem) if (ext & 0x20) { len = DREG(ext, 0); } else { - len = tcg_const_i32(extract32(ext, 0, 5)); + len = tcg_constant_i32(extract32(ext, 0, 5)); } if (ext & 0x800) { ofs = DREG(ext, 6); } else { - ofs = tcg_const_i32(extract32(ext, 6, 5)); + ofs = tcg_constant_i32(extract32(ext, 6, 5)); } if (is_sign) { @@ -4127,12 +4122,12 @@ DISAS_INSN(bfop_mem) if (ext & 0x20) { len = DREG(ext, 0); } else { - len = tcg_const_i32(extract32(ext, 0, 5)); + len = tcg_constant_i32(extract32(ext, 0, 5)); } if (ext & 0x800) { ofs = DREG(ext, 6); } else { - ofs = tcg_const_i32(extract32(ext, 6, 5)); + ofs = tcg_constant_i32(extract32(ext, 6, 5)); } switch (insn & 0x0f00) { @@ -4244,12 +4239,12 @@ DISAS_INSN(bfins_mem) if (ext & 0x20) { len = DREG(ext, 0); } else { - len = tcg_const_i32(extract32(ext, 0, 5)); + len = tcg_constant_i32(extract32(ext, 0, 5)); } if (ext & 0x800) { ofs = DREG(ext, 6); } else { - ofs = tcg_const_i32(extract32(ext, 6, 5)); + ofs = tcg_constant_i32(extract32(ext, 6, 5)); } gen_helper_bfins_mem(QREG_CC_N, cpu_env, addr, src, ofs, len); @@ -4382,7 +4377,7 @@ DISAS_INSN(move16_mem) TCGv reg, addr; reg = AREG(insn, 0); - addr = tcg_const_i32(read_im32(env, s)); + addr = tcg_constant_i32(read_im32(env, s)); if ((insn >> 3) & 1) { /* MOVE16 (xxx).L, (Ay) */ @@ -4572,14 +4567,14 @@ DISAS_INSN(cf_movec) } else { reg = DREG(ext, 12); } - gen_helper_cf_movec_to(cpu_env, tcg_const_i32(ext & 0xfff), reg); + gen_helper_cf_movec_to(cpu_env, tcg_constant_i32(ext & 0xfff), reg); gen_exit_tb(s); } DISAS_INSN(m68k_movec) { uint16_t ext; - TCGv reg; + TCGv reg, creg; if (IS_USER(s)) { gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); @@ -4593,10 +4588,11 @@ DISAS_INSN(m68k_movec) } else { reg = DREG(ext, 12); } + creg = tcg_constant_i32(ext & 0xfff); if (insn & 1) { - gen_helper_m68k_movec_to(cpu_env, tcg_const_i32(ext & 0xfff), reg); + gen_helper_m68k_movec_to(cpu_env, creg, reg); } else { - gen_helper_m68k_movec_from(reg, cpu_env, tcg_const_i32(ext & 0xfff)); + gen_helper_m68k_movec_from(reg, cpu_env, creg); } gen_exit_tb(s); } @@ -4647,7 +4643,7 @@ DISAS_INSN(pflush) return; } - opmode = tcg_const_i32((insn >> 3) & 3); + opmode = tcg_constant_i32((insn >> 3) & 3); gen_helper_pflush(cpu_env, AREG(insn, 0), opmode); } @@ -4659,7 +4655,7 @@ DISAS_INSN(ptest) gen_exception(s, s->base.pc_next, EXCP_PRIVILEGE); return; } - is_read = tcg_const_i32((insn >> 5) & 1); + is_read = tcg_constant_i32((insn >> 5) & 1); gen_helper_ptest(cpu_env, AREG(insn, 0), is_read); } #endif @@ -4829,7 +4825,7 @@ static void gen_op_fmove_fcr(CPUM68KState *env, DisasContext *s, gen_exception(s, s->base.pc_next, EXCP_ILLEGAL); return; } - tmp = tcg_const_i32(read_im32(env, s)); + tmp = tcg_constant_i32(read_im32(env, s)); gen_store_fcr(s, tmp, mask); return; } @@ -4966,7 +4962,7 @@ DISAS_INSN(fpu) case 2: if (insn == 0xf200 && (ext & 0xfc00) == 0x5c00) { /* fmovecr */ - TCGv rom_offset = tcg_const_i32(opmode); + TCGv rom_offset = tcg_constant_i32(opmode); cpu_dest = gen_fp_ptr(REG(ext, 7)); gen_helper_fconst(cpu_env, cpu_dest, rom_offset); return; @@ -5190,7 +5186,7 @@ static void gen_fcc_cond(DisasCompare *c, DisasContext *s, int cond) { TCGv fpsr; - c->v2 = tcg_const_i32(0); + c->v2 = tcg_constant_i32(0); /* TODO: Raise BSUN exception. */ fpsr = tcg_temp_new(); gen_load_fcr(s, fpsr, M68K_FPSR); @@ -5410,7 +5406,7 @@ DISAS_INSN(fsave) if (m68k_feature(s->env, M68K_FEATURE_M68040)) { /* always write IDLE */ - TCGv idle = tcg_const_i32(0x41000000); + TCGv idle = tcg_constant_i32(0x41000000); DEST_EA(env, insn, OS_LONG, idle, NULL); } else { disas_undef(env, s, insn); @@ -5540,7 +5536,7 @@ DISAS_INSN(mac) /* Skip the accumulate if the value is already saturated. */ l1 = gen_new_label(); tmp = tcg_temp_new(); - gen_op_and32(tmp, QREG_MACSR, tcg_const_i32(MACSR_PAV0 << acc)); + gen_op_and32(tmp, QREG_MACSR, tcg_constant_i32(MACSR_PAV0 << acc)); gen_op_jmp_nz32(tmp, l1); } #endif @@ -5551,11 +5547,11 @@ DISAS_INSN(mac) tcg_gen_add_i64(MACREG(acc), MACREG(acc), s->mactmp); if (s->env->macsr & MACSR_FI) - gen_helper_macsatf(cpu_env, tcg_const_i32(acc)); + gen_helper_macsatf(cpu_env, tcg_constant_i32(acc)); else if (s->env->macsr & MACSR_SU) - gen_helper_macsats(cpu_env, tcg_const_i32(acc)); + gen_helper_macsats(cpu_env, tcg_constant_i32(acc)); else - gen_helper_macsatu(cpu_env, tcg_const_i32(acc)); + gen_helper_macsatu(cpu_env, tcg_constant_i32(acc)); #if 0 /* Disabled because conditional branches clobber temporary vars. */ @@ -5574,7 +5570,7 @@ DISAS_INSN(mac) /* Skip the accumulate if the value is already saturated. */ l1 = gen_new_label(); tmp = tcg_temp_new(); - gen_op_and32(tmp, QREG_MACSR, tcg_const_i32(MACSR_PAV0 << acc)); + gen_op_and32(tmp, QREG_MACSR, tcg_constant_i32(MACSR_PAV0 << acc)); gen_op_jmp_nz32(tmp, l1); } #endif @@ -5583,18 +5579,18 @@ DISAS_INSN(mac) else tcg_gen_add_i64(MACREG(acc), MACREG(acc), s->mactmp); if (s->env->macsr & MACSR_FI) - gen_helper_macsatf(cpu_env, tcg_const_i32(acc)); + gen_helper_macsatf(cpu_env, tcg_constant_i32(acc)); else if (s->env->macsr & MACSR_SU) - gen_helper_macsats(cpu_env, tcg_const_i32(acc)); + gen_helper_macsats(cpu_env, tcg_constant_i32(acc)); else - gen_helper_macsatu(cpu_env, tcg_const_i32(acc)); + gen_helper_macsatu(cpu_env, tcg_constant_i32(acc)); #if 0 /* Disabled because conditional branches clobber temporary vars. */ if (l1 != -1) gen_set_label(l1); #endif } - gen_helper_mac_set_flags(cpu_env, tcg_const_i32(acc)); + gen_helper_mac_set_flags(cpu_env, tcg_constant_i32(acc)); if (insn & 0x30) { TCGv rw; @@ -5644,8 +5640,8 @@ DISAS_INSN(move_mac) int src; TCGv dest; src = insn & 3; - dest = tcg_const_i32((insn >> 9) & 3); - gen_helper_mac_move(cpu_env, dest, tcg_const_i32(src)); + dest = tcg_constant_i32((insn >> 9) & 3); + gen_helper_mac_move(cpu_env, dest, tcg_constant_i32(src)); gen_mac_clear_flags(); gen_helper_mac_set_flags(cpu_env, dest); } @@ -5670,7 +5666,7 @@ DISAS_INSN(from_mext) TCGv reg; TCGv acc; reg = (insn & 8) ? AREG(insn, 0) : DREG(insn, 0); - acc = tcg_const_i32((insn & 0x400) ? 2 : 0); + acc = tcg_constant_i32((insn & 0x400) ? 2 : 0); if (s->env->macsr & MACSR_FI) gen_helper_get_mac_extf(reg, cpu_env, acc); else @@ -5705,7 +5701,7 @@ DISAS_INSN(to_mac) } tcg_gen_andi_i32(QREG_MACSR, QREG_MACSR, ~(MACSR_PAV0 << accnum)); gen_mac_clear_flags(); - gen_helper_mac_set_flags(cpu_env, tcg_const_i32(accnum)); + gen_helper_mac_set_flags(cpu_env, tcg_constant_i32(accnum)); } DISAS_INSN(to_macsr) @@ -5728,7 +5724,7 @@ DISAS_INSN(to_mext) TCGv val; TCGv acc; SRC_EA(env, val, OS_LONG, 0, NULL); - acc = tcg_const_i32((insn & 0x400) ? 2 : 0); + acc = tcg_constant_i32((insn & 0x400) ? 2 : 0); if (s->env->macsr & MACSR_FI) gen_helper_set_mac_extf(cpu_env, val, acc); else if (s->env->macsr & MACSR_SU) From patchwork Mon Feb 27 05:41:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656889 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2227091wrb; Mon, 27 Feb 2023 00:09:46 -0800 (PST) X-Google-Smtp-Source: AK7set/TZAbxUHFTqwXpcTMD5UqmlGy3UmbbN9mY31HuDmudnMEulydek46jUUFSr/He4x53M7IO X-Received: by 2002:ad4:596e:0:b0:570:3d41:d5ba with SMTP id eq14-20020ad4596e000000b005703d41d5bamr47075449qvb.10.1677485386243; Mon, 27 Feb 2023 00:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485386; cv=none; d=google.com; s=arc-20160816; b=s/QJcsAOGWyccBTXQO8dFUbUjR9tetfOwB/wfSzAgrNPmaOScgMIEEwE2S9BxFcR55 TKrEC7774V9pBzLqAtWMPz9pCVE5wyGzsCcq6SXZQkxei9SHZM8xP5wNrW+12iTZkODn TBARETG9E5sGUqO9WUry8QbnLuGeqteXIBPCQ+ZBrJb6i/NIVuRsMY3WqAJL5pW70TYF pKw8E7dmQBBYEcvaXGpPWVqaR8MXiyJVfpEPrNF6wnJXY8UhnPW6d0MkRcqgibh3VkNW ki3CYzvT3Vf2aGCuWbdD6Ybkz8q3TpDUuOrjytEsDiFKmymMFf9PaIfVaQmIKgLTGTCJ UN+Q== 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=yvNzI3zdsY5ktRe+CgRMmOgY3KlQHbZNKJe85/su0xc=; b=KbK92hdE4KPT/nQzCYmpMTflUnz54Kfacm658JNQEnJBfvRAEWtZstS7q4l/UUgnG7 OMu7At4q9Hyi1oInlpPK/v3SJm+4QYB3nNnQw6rjekAd8K8VrpP6/Sfux67ckO/tP7cN p7F1QnWSatnFTXopl+QmgJwM6ivFqKo43MhGubs5kAi3OewF/gfTMgZ3eItgaW3zR0Qq +oI4Q672QkTigrtLJasPKcFY9TQSTnWEk8X7pOIuIqcyHJLd8Xa8EdTyKEi+QvtG0UCW NXEj8NjEUMSEK82uEQVI/BzBnP0W1Ew5OCBI/MrhtZw1TdTE6OXQ2PMDVCGun+X4QEcM VWSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GOM0cGFQ; 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 i11-20020a0c9c8b000000b0053527d7215asi6125007qvf.426.2023.02.27.00.09.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:09:46 -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=GOM0cGFQ; 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 1pWWJM-00072w-0Q; Mon, 27 Feb 2023 00:44:32 -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 1pWWJA-0006JL-4K for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:20 -0500 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWJ0-000572-89 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:19 -0500 Received: by mail-pj1-x1041.google.com with SMTP id gi3-20020a17090b110300b0023762f642dcso5038368pjb.4 for ; Sun, 26 Feb 2023 21:44:01 -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=yvNzI3zdsY5ktRe+CgRMmOgY3KlQHbZNKJe85/su0xc=; b=GOM0cGFQTikciSHBoj6KkxTyXQnoTKcAWSeESUDxFXHxijRHdDmH9D5H4rDTlToUtO r96lgGYrZhNckPiZ33qbQuAQfVPS/o5cb/d6pprfYOPS5p/2yIYCbWT+uQfRBzNmIQ/c H6k0OHin0KjLuROAPDOWzw/maUwfI1Vnl2eYqC+/QqNx8iF7Sq5AgQVlT4y5Hwm1l5SC 6HnDz7txEkylofhtYv9cMKMsCbK0uGGz6PFz1c7ltLOWMD8pzOYzMiTeDcN7qiPp52Qq 9mOrUyA38A1HHCwVtQOs/SXxlldQAw6W8NwFdxwWzku5x8Hdz+MNjyqtDga0x5H9+2VE DeSQ== 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=yvNzI3zdsY5ktRe+CgRMmOgY3KlQHbZNKJe85/su0xc=; b=18Mo41SunY+Dv89WJUo6uKdsmXrNTad9oyQyyGN1Wc3bbxPVvFJ9Ydmc35NMcMvP9W vqADNa10XxauPG9UZDdZfUn8U4wyn/PfNxrIAGfrBE1KE70wwRpcMjOv0+WrxdUglHEV nGe9XwR2RyNIQR5rTp4HlIUfuGJrtfbxMiJEOKwnfHN4J8d0xbpN5hXwJp1qtXXms9gb 7lqy1ryptPB6W4ViJ4zpGXNqYsMF1ajBQW6eyaZY3m51sE15uul8E7ejdl5TYOFJD/1/ +HXDzPKePBdUQxkTqD69Kbm8wtuhbQ/yr3w9IE2K9K1CLW7ot5fwxDxRbvm5ZvM1Dvgh 5mfg== X-Gm-Message-State: AO0yUKVBwHwCqt0cZh4CFTgFBGgBtjK8OGWRjIPc2vobobMmc6utX82G asEyw5RusKCaEKKJWwesdfvutp6l/83LbLM8+n2OUA== X-Received: by 2002:a05:6a20:8412:b0:cd:74aa:df55 with SMTP id c18-20020a056a20841200b000cd74aadf55mr1128589pzd.25.1677476641238; Sun, 26 Feb 2023 21:44:01 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:44:00 -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 29/70] target/microblaze: Avoid tcg_const_* throughout Date: Sun, 26 Feb 2023 19:41:52 -1000 Message-Id: <20230227054233.390271-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1041; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1041.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 All uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/microblaze/translate.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index eb6bdb49e1..ee0d7b81ad 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -101,9 +101,7 @@ static void t_sync_flags(DisasContext *dc) static void gen_raise_exception(DisasContext *dc, uint32_t index) { - TCGv_i32 tmp = tcg_const_i32(index); - - gen_helper_raise_exception(cpu_env, tmp); + gen_helper_raise_exception(cpu_env, tcg_constant_i32(index)); dc->base.is_jmp = DISAS_NORETURN; } @@ -116,7 +114,7 @@ static void gen_raise_exception_sync(DisasContext *dc, uint32_t index) static void gen_raise_hw_excp(DisasContext *dc, uint32_t esr_ec) { - TCGv_i32 tmp = tcg_const_i32(esr_ec); + TCGv_i32 tmp = tcg_constant_i32(esr_ec); tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUMBState, esr)); gen_raise_exception_sync(dc, EXCP_HW_EXCP); @@ -260,7 +258,7 @@ static bool do_typeb_val(DisasContext *dc, arg_typeb *arg, bool side_effects, rd = reg_for_write(dc, arg->rd); ra = reg_for_read(dc, arg->ra); - imm = tcg_const_i32(arg->imm); + imm = tcg_constant_i32(arg->imm); fn(rd, ra, imm); return true; @@ -305,7 +303,7 @@ static bool do_typeb_val(DisasContext *dc, arg_typeb *arg, bool side_effects, /* No input carry, but output carry. */ static void gen_add(TCGv_i32 out, TCGv_i32 ina, TCGv_i32 inb) { - TCGv_i32 zero = tcg_const_i32(0); + TCGv_i32 zero = tcg_constant_i32(0); tcg_gen_add2_i32(out, cpu_msr_c, ina, zero, inb, zero); } @@ -313,7 +311,7 @@ static void gen_add(TCGv_i32 out, TCGv_i32 ina, TCGv_i32 inb) /* Input and output carry. */ static void gen_addc(TCGv_i32 out, TCGv_i32 ina, TCGv_i32 inb) { - TCGv_i32 zero = tcg_const_i32(0); + TCGv_i32 zero = tcg_constant_i32(0); TCGv_i32 tmp = tcg_temp_new_i32(); tcg_gen_add2_i32(tmp, cpu_msr_c, ina, zero, cpu_msr_c, zero); @@ -546,7 +544,7 @@ static void gen_rsub(TCGv_i32 out, TCGv_i32 ina, TCGv_i32 inb) /* Input and output carry. */ static void gen_rsubc(TCGv_i32 out, TCGv_i32 ina, TCGv_i32 inb) { - TCGv_i32 zero = tcg_const_i32(0); + TCGv_i32 zero = tcg_constant_i32(0); TCGv_i32 tmp = tcg_temp_new_i32(); tcg_gen_not_i32(tmp, ina); @@ -1117,8 +1115,8 @@ static bool do_bcc(DisasContext *dc, int dest_rb, int dest_imm, } /* Compute the final destination into btarget. */ - zero = tcg_const_i32(0); - next = tcg_const_i32(dc->base.pc_next + (delay + 1) * 4); + zero = tcg_constant_i32(0); + next = tcg_constant_i32(dc->base.pc_next + (delay + 1) * 4); tcg_gen_movcond_i32(dc->jmp_cond, cpu_btarget, reg_for_read(dc, ra), zero, cpu_btarget, next); @@ -1226,8 +1224,6 @@ static bool trans_mbar(DisasContext *dc, arg_mbar *arg) /* Sleep. */ if (mbar_imm & 16) { - TCGv_i32 tmp_1; - if (trap_userspace(dc, true)) { /* Sleep is a privileged instruction. */ return true; @@ -1235,8 +1231,7 @@ static bool trans_mbar(DisasContext *dc, arg_mbar *arg) t_sync_flags(dc); - tmp_1 = tcg_const_i32(1); - tcg_gen_st_i32(tmp_1, cpu_env, + tcg_gen_st_i32(tcg_constant_i32(1), cpu_env, -offsetof(MicroBlazeCPU, env) +offsetof(CPUState, halted)); @@ -1401,8 +1396,8 @@ static bool trans_mts(DisasContext *dc, arg_mts *arg) case 0x1004: /* TLBHI */ case 0x1005: /* TLBSX */ { - TCGv_i32 tmp_ext = tcg_const_i32(arg->e); - TCGv_i32 tmp_reg = tcg_const_i32(arg->rs & 7); + TCGv_i32 tmp_ext = tcg_constant_i32(arg->e); + TCGv_i32 tmp_reg = tcg_constant_i32(arg->rs & 7); gen_helper_mmu_write(cpu_env, tmp_ext, tmp_reg, src); } @@ -1487,8 +1482,8 @@ static bool trans_mfs(DisasContext *dc, arg_mfs *arg) case 0x1004: /* TLBHI */ case 0x1005: /* TLBSX */ { - TCGv_i32 tmp_ext = tcg_const_i32(arg->e); - TCGv_i32 tmp_reg = tcg_const_i32(arg->rs & 7); + TCGv_i32 tmp_ext = tcg_constant_i32(arg->e); + TCGv_i32 tmp_reg = tcg_constant_i32(arg->rs & 7); gen_helper_mmu_read(dest, cpu_env, tmp_ext, tmp_reg); } @@ -1555,7 +1550,7 @@ static bool do_get(DisasContext *dc, int rd, int rb, int imm, int ctrl) tcg_gen_movi_i32(t_id, imm); } - t_ctrl = tcg_const_i32(ctrl); + t_ctrl = tcg_constant_i32(ctrl); gen_helper_get(reg_for_write(dc, rd), t_id, t_ctrl); return true; } @@ -1585,7 +1580,7 @@ static bool do_put(DisasContext *dc, int ra, int rb, int imm, int ctrl) tcg_gen_movi_i32(t_id, imm); } - t_ctrl = tcg_const_i32(ctrl); + t_ctrl = tcg_constant_i32(ctrl); gen_helper_put(t_id, t_ctrl, reg_for_read(dc, ra)); return true; } From patchwork Mon Feb 27 05:41:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656922 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2230501wrb; Mon, 27 Feb 2023 00:20:53 -0800 (PST) X-Google-Smtp-Source: AK7set9PX9E7qVtBjAO4cMVjsnS3L0z0Jv20cvdAdIuBdjcH/oxkZaGWpg5tU9qWkWKMepKERxoP X-Received: by 2002:ad4:5d45:0:b0:56e:a39f:f05f with SMTP id jk5-20020ad45d45000000b0056ea39ff05fmr54620597qvb.37.1677486053294; Mon, 27 Feb 2023 00:20:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486053; cv=none; d=google.com; s=arc-20160816; b=srUCnwJpR9mQWbi8QedIb4KlchB2rtEJNPsZnTdPFQrV3ah0MANA93pPfFn6SLWrJN YPnMQTB8NNR1vRAQdC8/qxQvOtRxPX1CQo7Gn6DwSqnnFwEj4NTeii1vmpF6xq0ZOeLg 4/IBlwovp+bbndFetred5nsYhlZQ4fceFPAi5+5f6SV/T/fGw+lcyhIqdj50H6PGqdbi qdb0JrvTk+ddPbHAjGqhquWqgY9eYELSnMWRsGdljvxNNqj4xfTQ8Cvx9eQsJ+dUn8h6 UcwsFbh+Jzd2Ejyn16tL8Wz7pJvdJ3+BDtuTC7jjVePrr1sZ7SIvD0o0D3hSIUFuhcxE 4SjA== 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=MxXl5KF71DhlaBsV+RHw1EwwhElryOwogRYDGewzQzE=; b=j1L3UZAtbUp5ZkjENl5wS4okVsTQQjHrBTa1wVK28gKWag0+5P9DS9mcR/9eXBzdZe uTptbkzvc9anAVfWdT3JZJ9npsMQ79X1DVBDRb+vYn+q+hVTh2s+rTjRHFcQuaVhqxZg llKxADykxLIWCnQNz7LoQUL8sG/TNpwrhvvazmjJPDeWTHSNHoCYkHH6kmoneHaCKHRK 3jOLZzgBe5TW6wOITdA0UUWD7TQ1XYmipockyn5Yf58cKuC0eEByqo27Z33QtAKK/O+O Ei/Ow178o8OapZaWgUUSEltLSgiJS+3LEqtmV+LEaXn7JNffdXWPiJUiGIGhM1lWyGk5 DzBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L+aIQFx1; 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 u6-20020a0cdd06000000b0056f2ba3d7c6si5878591qvk.33.2023.02.27.00.20.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:20:53 -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=L+aIQFx1; 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 1pWWJO-0007Fa-I5; Mon, 27 Feb 2023 00:44:34 -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 1pWWJB-0006QO-L6 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:21 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIy-0005Lt-96 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:21 -0500 Received: by mail-pj1-x1036.google.com with SMTP id cp7-20020a17090afb8700b0023756229427so8922186pjb.1 for ; Sun, 26 Feb 2023 21:44:04 -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=MxXl5KF71DhlaBsV+RHw1EwwhElryOwogRYDGewzQzE=; b=L+aIQFx1HWcGWNQ4XX/bF83Fx9vN/XqK25oXZMwLL18lRapyzh28edn4vRWnXTZc+/ Lg42QIk7BFnfo0CSeOvZJNbdLAy2uy8cORs8xnIBEKjGb54Njp7Taf2Oa2UouyPpr0pf gf57B0R6rCUsFMxh3Ab0A065waS5OnMDFtqWeyCQIEhMyyKEYu7xTe7aDQydwOuJg/95 6VbZ4ErBjOE0OhvT0nOlSwXjRCdl11kmBN4wEGA0BiL/p9aK7HD4y9siuDAXY0jKEgzt YlvRHpitJnzBt59NF3wL0uTto8QUHeCB1IuY2LIe/egyKlVO+IFFMxb/3uexhpOqLTVR z1VQ== 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=MxXl5KF71DhlaBsV+RHw1EwwhElryOwogRYDGewzQzE=; b=QvQmeU9tKeX9TYn+y+mQE91IJxj9ef4XL/J3oWEwVNzjSg9GLIydHazSUGIts8VluI cII26Ucmt3AqTC2y4K9oLplcAUZNAkm3P7lVE0RdBznFStUx2GAmQc0F8Yp31iAZEOQE NfXbEQIIGQrV06MYf+PaQdVnp0j2G5oeAJqmq7FaqhvwCFK9P3iYCn6L5coZz81lXXd2 oB3SvMbXB6+MUvryJ3XCJMmVuQEqwhhIVh8Sf3uWpIDcQZUpFJnFW1PPftIMpGMyF81V BrOeVdlH3DriUzxIYfDyouKpB/VzohIwfb3UBkiy4f9Ck91zMKB6zwYXEs2v9ajySElh 5Kpg== X-Gm-Message-State: AO0yUKX0gHXcmYS/6s5l7cTeEAXXhiC0shvIbFn8Bp/RhC1N2O3ThJRQ hB7aznlaTsHo1Ms9LrRP7qwPIaHixWK4eKnwwdQ= X-Received: by 2002:a05:6a20:1443:b0:c6:c030:81aa with SMTP id a3-20020a056a20144300b000c6c03081aamr29213041pzi.59.1677476643715; Sun, 26 Feb 2023 21:44:03 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.44.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:44:03 -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 30/70] target/mips: Split out gen_lxl Date: Sun, 26 Feb 2023 19:41:53 -1000 Message-Id: <20230227054233.390271-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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 Common subroutine for LDL and LWL. Use tcg_constant_tl instead of tcg_const_tl and t2. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/mips/tcg/translate.c | 106 ++++++++++++------------------------ 1 file changed, 36 insertions(+), 70 deletions(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 0f27ca6149..f8ea7a54a3 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -1995,6 +1995,32 @@ static target_ulong pc_relative_pc(DisasContext *ctx) return pc; } +/* LWL or LDL, depending on MemOp. */ +static void gen_lxl(DisasContext *ctx, TCGv reg, TCGv addr, + int mem_idx, MemOp mop) +{ + int sizem1 = memop_size(mop) - 1; + TCGv t0 = tcg_temp_new(); + TCGv t1 = tcg_temp_new(); + + /* + * Do a byte access to possibly trigger a page + * fault with the unaligned address. + */ + tcg_gen_qemu_ld_tl(t1, addr, mem_idx, MO_UB); + tcg_gen_andi_tl(t1, addr, sizem1); + if (!cpu_is_bigendian(ctx)) { + tcg_gen_xori_tl(t1, t1, sizem1); + } + tcg_gen_shli_tl(t1, t1, 3); + tcg_gen_andi_tl(t0, addr, ~sizem1); + tcg_gen_qemu_ld_tl(t0, t0, mem_idx, mop); + tcg_gen_shl_tl(t0, t0, t1); + tcg_gen_shl_tl(t1, tcg_constant_tl(-1), t1); + tcg_gen_andc_tl(t1, reg, t1); + tcg_gen_or_tl(reg, t0, t1); +} + /* Load */ static void gen_ld(DisasContext *ctx, uint32_t opc, int rt, int base, int offset) @@ -2034,25 +2060,9 @@ static void gen_ld(DisasContext *ctx, uint32_t opc, break; case OPC_LDL: t1 = tcg_temp_new(); - /* - * Do a byte access to possibly trigger a page - * fault with the unaligned address. - */ - tcg_gen_qemu_ld_tl(t1, t0, mem_idx, MO_UB); - tcg_gen_andi_tl(t1, t0, 7); - if (!cpu_is_bigendian(ctx)) { - tcg_gen_xori_tl(t1, t1, 7); - } - tcg_gen_shli_tl(t1, t1, 3); - tcg_gen_andi_tl(t0, t0, ~7); - tcg_gen_qemu_ld_tl(t0, t0, mem_idx, MO_TEUQ); - tcg_gen_shl_tl(t0, t0, t1); - t2 = tcg_const_tl(-1); - tcg_gen_shl_tl(t2, t2, t1); gen_load_gpr(t1, rt); - tcg_gen_andc_tl(t1, t1, t2); - tcg_gen_or_tl(t0, t0, t1); - gen_store_gpr(t0, rt); + gen_lxl(ctx, t1, t0, mem_idx, MO_TEUQ); + gen_store_gpr(t1, rt); break; case OPC_LDR: t1 = tcg_temp_new(); @@ -2133,26 +2143,10 @@ static void gen_ld(DisasContext *ctx, uint32_t opc, /* fall through */ case OPC_LWL: t1 = tcg_temp_new(); - /* - * Do a byte access to possibly trigger a page - * fault with the unaligned address. - */ - tcg_gen_qemu_ld_tl(t1, t0, mem_idx, MO_UB); - tcg_gen_andi_tl(t1, t0, 3); - if (!cpu_is_bigendian(ctx)) { - tcg_gen_xori_tl(t1, t1, 3); - } - tcg_gen_shli_tl(t1, t1, 3); - tcg_gen_andi_tl(t0, t0, ~3); - tcg_gen_qemu_ld_tl(t0, t0, mem_idx, MO_TEUL); - tcg_gen_shl_tl(t0, t0, t1); - t2 = tcg_const_tl(-1); - tcg_gen_shl_tl(t2, t2, t1); gen_load_gpr(t1, rt); - tcg_gen_andc_tl(t1, t1, t2); - tcg_gen_or_tl(t0, t0, t1); - tcg_gen_ext32s_tl(t0, t0); - gen_store_gpr(t0, rt); + gen_lxl(ctx, t1, t0, mem_idx, MO_TEUL); + tcg_gen_ext32s_tl(t1, t1); + gen_store_gpr(t1, rt); break; case OPC_LWRE: mem_idx = MIPS_HFLAG_UM; @@ -4220,28 +4214,12 @@ static void gen_loongson_lswc2(DisasContext *ctx, int rt, case OPC_GSLWLC1: check_cp1_enabled(ctx); gen_base_offset_addr(ctx, t0, rs, shf_offset); - t1 = tcg_temp_new(); - tcg_gen_qemu_ld_tl(t1, t0, ctx->mem_idx, MO_UB); - tcg_gen_andi_tl(t1, t0, 3); - if (!cpu_is_bigendian(ctx)) { - tcg_gen_xori_tl(t1, t1, 3); - } - tcg_gen_shli_tl(t1, t1, 3); - tcg_gen_andi_tl(t0, t0, ~3); - tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEUL); - tcg_gen_shl_tl(t0, t0, t1); - t2 = tcg_const_tl(-1); - tcg_gen_shl_tl(t2, t2, t1); fp0 = tcg_temp_new_i32(); gen_load_fpr32(ctx, fp0, rt); + t1 = tcg_temp_new(); tcg_gen_ext_i32_tl(t1, fp0); - tcg_gen_andc_tl(t1, t1, t2); - tcg_gen_or_tl(t0, t0, t1); -#if defined(TARGET_MIPS64) - tcg_gen_extrl_i64_i32(fp0, t0); -#else - tcg_gen_ext32s_tl(fp0, t0); -#endif + gen_lxl(ctx, t1, t0, ctx->mem_idx, MO_TEUL); + tcg_gen_trunc_tl_i32(fp0, t1); gen_store_fpr32(ctx, fp0, rt); break; case OPC_GSLWRC1: @@ -4277,21 +4255,9 @@ static void gen_loongson_lswc2(DisasContext *ctx, int rt, check_cp1_enabled(ctx); gen_base_offset_addr(ctx, t0, rs, shf_offset); t1 = tcg_temp_new(); - tcg_gen_qemu_ld_tl(t1, t0, ctx->mem_idx, MO_UB); - tcg_gen_andi_tl(t1, t0, 7); - if (!cpu_is_bigendian(ctx)) { - tcg_gen_xori_tl(t1, t1, 7); - } - tcg_gen_shli_tl(t1, t1, 3); - tcg_gen_andi_tl(t0, t0, ~7); - tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEUQ); - tcg_gen_shl_tl(t0, t0, t1); - t2 = tcg_const_tl(-1); - tcg_gen_shl_tl(t2, t2, t1); gen_load_fpr64(ctx, t1, rt); - tcg_gen_andc_tl(t1, t1, t2); - tcg_gen_or_tl(t0, t0, t1); - gen_store_fpr64(ctx, t0, rt); + gen_lxl(ctx, t1, t0, ctx->mem_idx, MO_TEUQ); + gen_store_fpr64(ctx, t1, rt); break; case OPC_GSLDRC1: check_cp1_enabled(ctx); From patchwork Mon Feb 27 05:41:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656853 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2184670wrb; Sun, 26 Feb 2023 21:50:49 -0800 (PST) X-Google-Smtp-Source: AK7set+tNpiT31KpivlqxjfiHm3Bhw6sWT2TmzZS2jSPdQhW9wUGWcKrg//um/8VM+i46msXLtZM X-Received: by 2002:a05:622a:5:b0:3bf:a72f:d0bd with SMTP id x5-20020a05622a000500b003bfa72fd0bdmr33212674qtw.3.1677477049711; Sun, 26 Feb 2023 21:50:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477049; cv=none; d=google.com; s=arc-20160816; b=rcF2p1ZZCcROeLsfwWZ9cVpWq+g306KpnV7QAlFYAdwSMqfx6ai2+zLMqj0IvukYBO 0KREdnKE5QT4fRMM4m3vWGt/tcVoJBs317RIA1Ylgt6bzIdeqofwMV7Ro1hsTi5D5cyN kIkeuQIDgyCaiHHExFg3FhY1Vi46e+yoQAr98uHVCpfneA50Kahtz3uogmKJycOYXLWG hP9ey7bSoEIlyASsazBTxKRJaMXdF5D5rP3UVW+3TxFlO3vY3VhUa2sXleJDRAxVSY7K Qp46y96uvhTC8S8Sr7eyMR3ATaftLr3Nr+C82+L1qFZI6Igcv4H6KQNWd66mjzE8KFXA Vkhw== 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=f5HkfxXUrjRf6po5AE8ZwpRBRkLy99acvSQejoULsiE=; b=Sd4gi2jwBQPE57m/CxTDIvooB1MMZhb5srOh+OlQwPYH1WSw7l1lH55TzSOsNSu+0L FLtzvGTuDksqCDWk41C7t/LMTpjHYL/4Y0BuVsw/cPxNAQywG/257Zv1CGzu6gGdXCkW udYggMoqQ5D8tmmWDD56760k6CFsBnRi6+7itFVuK2VSq1pBcfbnPwUb3xiAuJj0y4Oj ro7f4sL4LKgRR+P+tINEPejooAH60FvQy2GhqOnORuPkTw8IUgE0oDCIso2jF9jpLOo6 vFiGLd/1JoIi29ZSYzLdJ/C+zBUtEUEw/7Eg4R96TpTEtxd/kOyF4gPPALS+ATs1nZTZ DMAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HJtPyqVm; 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 p9-20020a05622a00c900b003b86cf0da6bsi6028270qtw.60.2023.02.26.21.50.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:50:49 -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=HJtPyqVm; 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 1pWWJR-0007Vt-HK; Mon, 27 Feb 2023 00:44:37 -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 1pWWJD-0006fe-Pk for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:23 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWJ6-0005Rk-LO for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:23 -0500 Received: by mail-pg1-x536.google.com with SMTP id s17so2854969pgv.4 for ; Sun, 26 Feb 2023 21:44:07 -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=f5HkfxXUrjRf6po5AE8ZwpRBRkLy99acvSQejoULsiE=; b=HJtPyqVmDbZkgrjR6skBdWao80/147CJzeLpkaoa5Qup7+gzeMZoqPUvYB9AVab+OA tUS4tDYsCZmStrpSW7l9qYxpyDxYAtjz/EfckDRjXrS1rtIthE46WPfidyYso4K8KHZE Pd8ZuI/oMrPVszutLQlYwLOTEtWN3nSbr+Zm3GfUIzuuAqXo4fjeYzOgkXqYl1JMqp3i e8H7uZIsVCXqbH7WhuAL7DBCf3PNqQZfBDu5VG+xYfPtnlQ4E18m+XNZdivDGWsIekZu qQPyfi1/8mchybosbCMsRcZLbKnCpliQhHPzEXp05v2jGNuamvYzou0VNX7+IZM3h93I eRzw== 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=f5HkfxXUrjRf6po5AE8ZwpRBRkLy99acvSQejoULsiE=; b=Z/8GI2LFKZKzGmTtTKc7evIBF2kRLT3Tza0bTBFFX3RNKCMyogSAIq3tJXAS+XTMLV uo+fLXu/dYvCNSFnkcqHfFLbH6XpQaUyhJYtlWVqMNe3jymSAX6qSWVec9jSmY2b/H4l eykEbfh0l0aI/cBS1ZX+MUii0LGuyvDqNSYGGvVcqD9DMlM5J1g+YVgnrDlRUg/mAByS kC4E8nlDIDtKtDZxd54JaoZ/8jPDcXXkscxeUgMO+Rc05/nwm0LXKAYRHNxy0l+vHKy9 Yw/J+awyN4DkcBMzuDCPly1hgrBzRpiWesuD0TMF64r9q4fnLq5jwQtVyW2dG5bi6bVI x68A== X-Gm-Message-State: AO0yUKX4m41AVhXQWlZ2P3TcXZC7PYeC60A7To/La5LVXvqzkMNvmcBv jSKJwSKwCH9tWKH9ZRIyNnEZLBLeCN6SyPktsAk= X-Received: by 2002:aa7:981c:0:b0:5e2:62b7:f785 with SMTP id e28-20020aa7981c000000b005e262b7f785mr10315566pfl.29.1677476646144; Sun, 26 Feb 2023 21:44:06 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:44:05 -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 31/70] target/mips: Split out gen_lxr Date: Sun, 26 Feb 2023 19:41:54 -1000 Message-Id: <20230227054233.390271-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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 Common subroutine for LDR and LWR. Use tcg_constant_tl of ~1 instead of tcg_const_tl of 0x..fe. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/mips/tcg/translate.c | 116 +++++++++++++----------------------- 1 file changed, 40 insertions(+), 76 deletions(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index f8ea7a54a3..5c5660da5a 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -2021,11 +2021,39 @@ static void gen_lxl(DisasContext *ctx, TCGv reg, TCGv addr, tcg_gen_or_tl(reg, t0, t1); } +/* LWR or LDR, depending on MemOp. */ +static void gen_lxr(DisasContext *ctx, TCGv reg, TCGv addr, + int mem_idx, MemOp mop) +{ + int size = memop_size(mop); + int sizem1 = size - 1; + TCGv t0 = tcg_temp_new(); + TCGv t1 = tcg_temp_new(); + + /* + * Do a byte access to possibly trigger a page + * fault with the unaligned address. + */ + tcg_gen_qemu_ld_tl(t1, addr, mem_idx, MO_UB); + tcg_gen_andi_tl(t1, addr, sizem1); + if (cpu_is_bigendian(ctx)) { + tcg_gen_xori_tl(t1, t1, sizem1); + } + tcg_gen_shli_tl(t1, t1, 3); + tcg_gen_andi_tl(t0, addr, ~sizem1); + tcg_gen_qemu_ld_tl(t0, t0, mem_idx, mop); + tcg_gen_shr_tl(t0, t0, t1); + tcg_gen_xori_tl(t1, t1, size * 8 - 1); + tcg_gen_shl_tl(t1, tcg_constant_tl(~1), t1); + tcg_gen_and_tl(t1, reg, t1); + tcg_gen_or_tl(reg, t0, t1); +} + /* Load */ static void gen_ld(DisasContext *ctx, uint32_t opc, int rt, int base, int offset) { - TCGv t0, t1, t2; + TCGv t0, t1; int mem_idx = ctx->mem_idx; if (rt == 0 && ctx->insn_flags & (INSN_LOONGSON2E | INSN_LOONGSON2F | @@ -2066,26 +2094,9 @@ static void gen_ld(DisasContext *ctx, uint32_t opc, break; case OPC_LDR: t1 = tcg_temp_new(); - /* - * Do a byte access to possibly trigger a page - * fault with the unaligned address. - */ - tcg_gen_qemu_ld_tl(t1, t0, mem_idx, MO_UB); - tcg_gen_andi_tl(t1, t0, 7); - if (cpu_is_bigendian(ctx)) { - tcg_gen_xori_tl(t1, t1, 7); - } - tcg_gen_shli_tl(t1, t1, 3); - tcg_gen_andi_tl(t0, t0, ~7); - tcg_gen_qemu_ld_tl(t0, t0, mem_idx, MO_TEUQ); - tcg_gen_shr_tl(t0, t0, t1); - tcg_gen_xori_tl(t1, t1, 63); - t2 = tcg_const_tl(0xfffffffffffffffeull); - tcg_gen_shl_tl(t2, t2, t1); gen_load_gpr(t1, rt); - tcg_gen_and_tl(t1, t1, t2); - tcg_gen_or_tl(t0, t0, t1); - gen_store_gpr(t0, rt); + gen_lxr(ctx, t1, t0, mem_idx, MO_TEUQ); + gen_store_gpr(t1, rt); break; case OPC_LDPC: t1 = tcg_const_tl(pc_relative_pc(ctx)); @@ -2153,27 +2164,10 @@ static void gen_ld(DisasContext *ctx, uint32_t opc, /* fall through */ case OPC_LWR: t1 = tcg_temp_new(); - /* - * Do a byte access to possibly trigger a page - * fault with the unaligned address. - */ - tcg_gen_qemu_ld_tl(t1, t0, mem_idx, MO_UB); - tcg_gen_andi_tl(t1, t0, 3); - if (cpu_is_bigendian(ctx)) { - tcg_gen_xori_tl(t1, t1, 3); - } - tcg_gen_shli_tl(t1, t1, 3); - tcg_gen_andi_tl(t0, t0, ~3); - tcg_gen_qemu_ld_tl(t0, t0, mem_idx, MO_TEUL); - tcg_gen_shr_tl(t0, t0, t1); - tcg_gen_xori_tl(t1, t1, 31); - t2 = tcg_const_tl(0xfffffffeull); - tcg_gen_shl_tl(t2, t2, t1); gen_load_gpr(t1, rt); - tcg_gen_and_tl(t1, t1, t2); - tcg_gen_or_tl(t0, t0, t1); - tcg_gen_ext32s_tl(t0, t0); - gen_store_gpr(t0, rt); + gen_lxr(ctx, t1, t0, mem_idx, MO_TEUL); + tcg_gen_ext32s_tl(t1, t1); + gen_store_gpr(t1, rt); break; case OPC_LLE: mem_idx = MIPS_HFLAG_UM; @@ -4150,7 +4144,7 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt) static void gen_loongson_lswc2(DisasContext *ctx, int rt, int rs, int rd) { - TCGv t0, t1, t2; + TCGv t0, t1; TCGv_i32 fp0; #if defined(TARGET_MIPS64) int lsq_rt1 = ctx->opcode & 0x1f; @@ -4225,29 +4219,12 @@ static void gen_loongson_lswc2(DisasContext *ctx, int rt, case OPC_GSLWRC1: check_cp1_enabled(ctx); gen_base_offset_addr(ctx, t0, rs, shf_offset); - t1 = tcg_temp_new(); - tcg_gen_qemu_ld_tl(t1, t0, ctx->mem_idx, MO_UB); - tcg_gen_andi_tl(t1, t0, 3); - if (cpu_is_bigendian(ctx)) { - tcg_gen_xori_tl(t1, t1, 3); - } - tcg_gen_shli_tl(t1, t1, 3); - tcg_gen_andi_tl(t0, t0, ~3); - tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEUL); - tcg_gen_shr_tl(t0, t0, t1); - tcg_gen_xori_tl(t1, t1, 31); - t2 = tcg_const_tl(0xfffffffeull); - tcg_gen_shl_tl(t2, t2, t1); fp0 = tcg_temp_new_i32(); gen_load_fpr32(ctx, fp0, rt); + t1 = tcg_temp_new(); tcg_gen_ext_i32_tl(t1, fp0); - tcg_gen_and_tl(t1, t1, t2); - tcg_gen_or_tl(t0, t0, t1); -#if defined(TARGET_MIPS64) - tcg_gen_extrl_i64_i32(fp0, t0); -#else - tcg_gen_ext32s_tl(fp0, t0); -#endif + gen_lxr(ctx, t1, t0, ctx->mem_idx, MO_TEUL); + tcg_gen_trunc_tl_i32(fp0, t1); gen_store_fpr32(ctx, fp0, rt); break; #if defined(TARGET_MIPS64) @@ -4263,22 +4240,9 @@ static void gen_loongson_lswc2(DisasContext *ctx, int rt, check_cp1_enabled(ctx); gen_base_offset_addr(ctx, t0, rs, shf_offset); t1 = tcg_temp_new(); - tcg_gen_qemu_ld_tl(t1, t0, ctx->mem_idx, MO_UB); - tcg_gen_andi_tl(t1, t0, 7); - if (cpu_is_bigendian(ctx)) { - tcg_gen_xori_tl(t1, t1, 7); - } - tcg_gen_shli_tl(t1, t1, 3); - tcg_gen_andi_tl(t0, t0, ~7); - tcg_gen_qemu_ld_tl(t0, t0, ctx->mem_idx, MO_TEUQ); - tcg_gen_shr_tl(t0, t0, t1); - tcg_gen_xori_tl(t1, t1, 63); - t2 = tcg_const_tl(0xfffffffffffffffeull); - tcg_gen_shl_tl(t2, t2, t1); gen_load_fpr64(ctx, t1, rt); - tcg_gen_and_tl(t1, t1, t2); - tcg_gen_or_tl(t0, t0, t1); - gen_store_fpr64(ctx, t0, rt); + gen_lxr(ctx, t1, t0, ctx->mem_idx, MO_TEUQ); + gen_store_fpr64(ctx, t1, rt); break; #endif default: From patchwork Mon Feb 27 05:41:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656843 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2183961wrb; Sun, 26 Feb 2023 21:48:12 -0800 (PST) X-Google-Smtp-Source: AK7set+xWeu18jpCxc1/zGe7x0V/Pl12oVS5lDgB65lIoNdeNutU3g+68XeBThZn0FuSqQjnGvHH X-Received: by 2002:a05:6214:508b:b0:56f:52ba:ccf7 with SMTP id kk11-20020a056214508b00b0056f52baccf7mr39527998qvb.14.1677476892102; Sun, 26 Feb 2023 21:48:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677476892; cv=none; d=google.com; s=arc-20160816; b=aDaGxw9GccOkTwj8ASYv7U7pE3dGH4JF9hwHNvWPi9dL3Psopn7w+qvZGHj1QqDPZ2 1ud3Q4Hsyl0831B0qIi8mr4Vrgk5cNuKQWqiKJQQjUDzLr+mZmN3Q/UNhU9EKKzMw9Wy f0MqKeg0lbCYx20Lu4Y3hVgJ8fsmj8VM8HMfq2/IZVmu2d2xabh++0oWsS/HGf8ATmc7 Pi16nhwTKIMgsnf2UTLVEx6arXCvmPnoPgxOSPaBg/Q7oBqHnR5M+1wVsP8xoJFIOQAk 5KYTj5nnWIJh1C32slNZ+tQHDSUbGuQEAH1AanxAiGLVQRTkm0LVhPb2bpKg3PEhc0LC vITA== 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=jL4pgNANfuKMXeC5MxlI1VBXfKn/ZH3qWozXHmWvjwc=; b=w+1xVMJSwl2Ygo0xLMHugU8fE88OxA8yQie+FUARZMevMVrqCw2WTq6MKItKJNdUzT Jt02h8OUPAVQdvZGbIGDcpgBUEtghnT2HL/VRwD6SNfwGjABF8i+EHxdts1UhU2xrq0m GPJROxbZwh/2ND3UjA1BXB8iSoG4E1hbd6p/tek08FiItDRBAzfFR+EryztNy7mZukzA kuYgefdyUndDVp9IXT3V+X3ylQ9lV6iQlrEKpLi13jf0XQH/aUGM3jbTLkzX3GRN5JqV 78Gtxj02m5L9rXKMBZZ/yOTrdhBqx4Yb9t+4yBS5PvWKO2G962lLsoB/v3RJwfRq2Ozp aLHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AubVIYB8; 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 l6-20020a0ce086000000b0056ea7cac144si5606412qvk.376.2023.02.26.21.48.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:48:12 -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=AubVIYB8; 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 1pWWJd-0008TQ-Be; Mon, 27 Feb 2023 00:44:49 -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 1pWWJG-0006sz-KP for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:26 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWJ6-0005TW-TO for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:26 -0500 Received: by mail-pf1-x42b.google.com with SMTP id ce7so2787804pfb.9 for ; Sun, 26 Feb 2023 21:44:09 -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=jL4pgNANfuKMXeC5MxlI1VBXfKn/ZH3qWozXHmWvjwc=; b=AubVIYB8izX+nN3mZvh5FVQkgK91M8d39Z1G9nsPEiFGm1y+vMAESoAbDzjw9t5jVQ ecaWJLHTWVcI3SpVF4wEVUlyGanlTljml1WjQkyPD2h6yo8aySjdyZ8FHvud1HGPOPG0 8qA5jmGrmGVY2xbjHJ80vyuaUgwGfbV3FHVLlkmN+blvwxAokV2lWAW3qoJvCzwAW1H2 m2pBGszC2miouWoxhuL6kPy0/jFMdMjPqe0qiXrmm+tXRrXhVGwM6aPr3VSlK0eiNk7s 22f7J5ZWnZOoRzHPvaOjMEK3X9A70SO9AEMV65svS7rALt7RyDcQ7BWeHhYtiAKE9eWd Hryw== 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=jL4pgNANfuKMXeC5MxlI1VBXfKn/ZH3qWozXHmWvjwc=; b=uWu/+zNGWXpXGJb2/4nRuWpnnrBnAw359mrcwzBiHBJi4Nqhx2cvJNIzdsG8sDitPK 8bRHEM5EzZEfc8fC0Tns9TwDEKOIHJgNhNyGC2urO0+hsciQLe9z/fDPGgxd/oBkWwmb dviq+Q19ACE6avoWAe6+Hpnd8DS6kgPsN/kw/Qw+qGhRLGQ/JgfozoBuw5NkqGVKTdXW I4BxQU5nf4+S+kGVJr7uXE1FK6MEZ8gdwBx80/U2+C7DKqifgzwmt+LdRtKkKjn44oTI fqq+x/W36HA+056Nsya71CUeX6ti4wtHpn8+iUmojfwcJ73WH6dMf9VcMiYtueT1If+I McWA== X-Gm-Message-State: AO0yUKUft1C3fVV+sKXEZX7Nn6XzZtajur13g+Vs0i8kkBO2HzTNe18E 68EFfVEVxHe1K94WZsCivHSi64+dCr2vdpj1ems= X-Received: by 2002:aa7:9dc7:0:b0:5a8:5424:d138 with SMTP id g7-20020aa79dc7000000b005a85424d138mr22258676pfq.16.1677476648662; Sun, 26 Feb 2023 21:44:08 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.44.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:44:08 -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 32/70] target/mips: Avoid tcg_const_tl in gen_r6_ld Date: Sun, 26 Feb 2023 19:41:55 -1000 Message-Id: <20230227054233.390271-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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 Allocate a separate temp for modification. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/mips/tcg/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 5c5660da5a..bec0a26c83 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -2964,8 +2964,8 @@ static void gen_HILO(DisasContext *ctx, uint32_t opc, int acc, int reg) static inline void gen_r6_ld(target_long addr, int reg, int memidx, MemOp memop) { - TCGv t0 = tcg_const_tl(addr); - tcg_gen_qemu_ld_tl(t0, t0, memidx, memop); + TCGv t0 = tcg_temp_new(); + tcg_gen_qemu_ld_tl(t0, tcg_constant_tl(addr), memidx, memop); gen_store_gpr(t0, reg); } From patchwork Mon Feb 27 05:41:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656924 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2230689wrb; Mon, 27 Feb 2023 00:21:38 -0800 (PST) X-Google-Smtp-Source: AK7set/cB1AvBxxi7pB7UrRb2N+j22NVuvo/NV/2RZt1YnoD/CHOwqCdKmDEfxVTydqTRA5QAB1Y X-Received: by 2002:a05:6214:d83:b0:56b:7ec7:b158 with SMTP id e3-20020a0562140d8300b0056b7ec7b158mr38340379qve.36.1677486097843; Mon, 27 Feb 2023 00:21:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486097; cv=none; d=google.com; s=arc-20160816; b=W/iZkTrmJ0V3T5CaJtfW5YKOGeqSOdyPM/8z7p1qqBg0QC5krcz8fdFtltAhjxN/3Z EBwzxcKsOl/S6EqWCpvDsGxjHedDRstSqkhmNuldPdfxQvq6s70TFQHKuCteveO6xiEB 5iCvg/8A/Cd//NQjZXlarJjFZXD5W+BUOemRNcNWSCHK1xbwUPACf957LIRhfiuJY+py +NBV7zlOgBHrJqoKBKSVIA5+JAobGWCbciT3yGpVkci1bgTzSAtthGaNqxDLaS3sSbnT EAP8maQtv6P6aVotr4xgLjvfqNXU8OAl0K77D69vvz9cTSMpOME8pm+cl0wEZv+wexOh kw4Q== 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=AsiT8/XOksduitHrlpP1MGWNlFlr9y0PJN3cA7kqumo=; b=M2FsOp/WIbeEFHcIWcSj7dKzmzAUxfjUHPH3Vz++phUlykuhTz+z7c6I2PN9wgOBVk 5nlMIp52Z/JFRVmwi6gO4h1mHvtkhLHU7eWEiiuQqZGovtOaQD05pOwlSzok+eStWSmI 8X/sjZLvq3lqesQxlazj0XOIwugvyn7RHHJMdPdOEh5o4jji120iNyULqfZcdrYn+OiC eX7YBfws1O9oz71r1dOkFeI7XBGmzDCJSolqpFYOXBxpsBSJBsyeBafFuhjuRvAiYJcG wAjFcofIIdzaokKRs6hLfzk4aLzK/grDw2ZvKmDI1lLG6BAjnqgyCnOoSMXa4CHdkKvS Hanw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N9ThMpRM; 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 u19-20020a05620a0c5300b0072daf2bec9esi5941427qki.621.2023.02.27.00.21.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:21:37 -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=N9ThMpRM; 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 1pWWJa-00088G-M0; Mon, 27 Feb 2023 00:44:46 -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 1pWWJM-000763-AX for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:32 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWJ6-0004oU-Vk for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:28 -0500 Received: by mail-pf1-x429.google.com with SMTP id n2so2773784pfo.12 for ; Sun, 26 Feb 2023 21:44:11 -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=AsiT8/XOksduitHrlpP1MGWNlFlr9y0PJN3cA7kqumo=; b=N9ThMpRMSlT5f4wQuz1BlI1TBIcPsQbaYdBWJYL77xiQ1E0sbDUT62Bu8fCCOkElpK 2wSVEh2ze8t8n7TrS+2bLVSSIKnTedxgkG6C1dZ5rwFVv2n/Pzjon3HVKxHLWJkfqig4 fQIm30F3KnztVHNHoKfO64yPYncClX4Sh7FTcEopEzC5zOGqBMQD9q8CuirrDAIG+iSm ay4Uj9GwMMUnPn8fdjsrkq9BGQhbOpQkJ9Sq/4vIn0rRnMqnXZzj7uZN0Nsszgxqh/ZC Nw8F7/rBdlcMcHEeynw3+tUZxNFl0QnQwlz+Ge+kY+v76FvGqfsH5kacc5CaHeouXz+4 hFug== 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=AsiT8/XOksduitHrlpP1MGWNlFlr9y0PJN3cA7kqumo=; b=U7sft2A6C3iBelLbDcWT3m33I/hhWPl7B3dbih1j6KV6y9X2xo/XxgZ9dANA7Zj8zP Z6KjYsh6q3kSnfpUfTJmPQuOrmTFp6wyLVMomtmUGgzzG1j92/8pArr2kKLiTX6KnPAj rb6SbhQfdZz16Rkgj5/vsFI6EJiA77D05bVrke/BsCgX3Ta+pagapjXMu+9WGoJuAkW3 Sczchxf/bQCo7jImzn/p4gPfo5d4npqYOzQ+VCy9UgOvyEfm38mHAvecews/bkhH49VK ejoQttHcsLfi0EelsjTJcsNu9ED0PqOQPB7yNI9/3qSvegHNBlAwqzBMGFZ6q1/bq4pL HC7A== X-Gm-Message-State: AO0yUKVPIiIDDEBrhDyuYf/p4bEIGC88u3JsismwO2YBpQpQqgQEc1JJ DFfPCHUtpTsaNVfs+PXJ5vmedxwtZL/AxqFpK3E= X-Received: by 2002:aa7:982e:0:b0:5dc:d34:d9f6 with SMTP id q14-20020aa7982e000000b005dc0d34d9f6mr13799435pfl.2.1677476651140; Sun, 26 Feb 2023 21:44:11 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.44.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:44:10 -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 33/70] target/mips: Avoid tcg_const_* throughout Date: Sun, 26 Feb 2023 19:41:56 -1000 Message-Id: <20230227054233.390271-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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 All remaining uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/mips/tcg/mxu_translate.c | 4 +- target/mips/tcg/translate.c | 56 +++++++++++------------ target/mips/tcg/tx79_translate.c | 4 +- target/mips/tcg/micromips_translate.c.inc | 4 +- target/mips/tcg/nanomips_translate.c.inc | 16 ++++--- 5 files changed, 43 insertions(+), 41 deletions(-) diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translate.c index 8703b0cef4..bdd20709c0 100644 --- a/target/mips/tcg/mxu_translate.c +++ b/target/mips/tcg/mxu_translate.c @@ -1072,7 +1072,7 @@ static void gen_mxu_D16MAX_D16MIN(DisasContext *ctx) uint32_t XRx = XRb ? XRb : XRc; /* ...and do half-word-wise max/min with one operand 0 */ TCGv_i32 t0 = tcg_temp_new(); - TCGv_i32 t1 = tcg_const_i32(0); + TCGv_i32 t1 = tcg_constant_i32(0); /* the left half-word first */ tcg_gen_andi_i32(t0, mxu_gpr[XRx - 1], 0xFFFF0000); @@ -1163,7 +1163,7 @@ static void gen_mxu_Q8MAX_Q8MIN(DisasContext *ctx) uint32_t XRx = XRb ? XRb : XRc; /* ...and do byte-wise max/min with one operand 0 */ TCGv_i32 t0 = tcg_temp_new(); - TCGv_i32 t1 = tcg_const_i32(0); + TCGv_i32 t1 = tcg_constant_i32(0); int32_t i; /* the leftmost byte (byte 3) first */ diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index bec0a26c83..7f1f12e0c7 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -2099,14 +2099,14 @@ static void gen_ld(DisasContext *ctx, uint32_t opc, gen_store_gpr(t1, rt); break; case OPC_LDPC: - t1 = tcg_const_tl(pc_relative_pc(ctx)); + t1 = tcg_constant_tl(pc_relative_pc(ctx)); gen_op_addr_add(ctx, t0, t0, t1); tcg_gen_qemu_ld_tl(t0, t0, mem_idx, MO_TEUQ); gen_store_gpr(t0, rt); break; #endif case OPC_LWPC: - t1 = tcg_const_tl(pc_relative_pc(ctx)); + t1 = tcg_constant_tl(pc_relative_pc(ctx)); gen_op_addr_add(ctx, t0, t0, t1); tcg_gen_qemu_ld_tl(t0, t0, mem_idx, MO_TESL); gen_store_gpr(t0, rt); @@ -2733,7 +2733,7 @@ static void gen_cond_move(DisasContext *ctx, uint32_t opc, t0 = tcg_temp_new(); gen_load_gpr(t0, rt); - t1 = tcg_const_tl(0); + t1 = tcg_constant_tl(0); t2 = tcg_temp_new(); gen_load_gpr(t2, rs); switch (opc) { @@ -3084,8 +3084,8 @@ static void gen_r6_muldiv(DisasContext *ctx, int opc, int rd, int rs, int rt) break; case R6_OPC_DIVU: { - TCGv t2 = tcg_const_tl(0); - TCGv t3 = tcg_const_tl(1); + TCGv t2 = tcg_constant_tl(0); + TCGv t3 = tcg_constant_tl(1); tcg_gen_ext32u_tl(t0, t0); tcg_gen_ext32u_tl(t1, t1); tcg_gen_movcond_tl(TCG_COND_EQ, t1, t1, t2, t3, t1); @@ -3095,8 +3095,8 @@ static void gen_r6_muldiv(DisasContext *ctx, int opc, int rd, int rs, int rt) break; case R6_OPC_MODU: { - TCGv t2 = tcg_const_tl(0); - TCGv t3 = tcg_const_tl(1); + TCGv t2 = tcg_constant_tl(0); + TCGv t3 = tcg_constant_tl(1); tcg_gen_ext32u_tl(t0, t0); tcg_gen_ext32u_tl(t1, t1); tcg_gen_movcond_tl(TCG_COND_EQ, t1, t1, t2, t3, t1); @@ -3175,16 +3175,16 @@ static void gen_r6_muldiv(DisasContext *ctx, int opc, int rd, int rs, int rt) break; case R6_OPC_DDIVU: { - TCGv t2 = tcg_const_tl(0); - TCGv t3 = tcg_const_tl(1); + TCGv t2 = tcg_constant_tl(0); + TCGv t3 = tcg_constant_tl(1); tcg_gen_movcond_tl(TCG_COND_EQ, t1, t1, t2, t3, t1); tcg_gen_divu_i64(cpu_gpr[rd], t0, t1); } break; case R6_OPC_DMODU: { - TCGv t2 = tcg_const_tl(0); - TCGv t3 = tcg_const_tl(1); + TCGv t2 = tcg_constant_tl(0); + TCGv t3 = tcg_constant_tl(1); tcg_gen_movcond_tl(TCG_COND_EQ, t1, t1, t2, t3, t1); tcg_gen_remu_i64(cpu_gpr[rd], t0, t1); } @@ -3248,8 +3248,8 @@ static void gen_div1_tx79(DisasContext *ctx, uint32_t opc, int rs, int rt) break; case MMI_OPC_DIVU1: { - TCGv t2 = tcg_const_tl(0); - TCGv t3 = tcg_const_tl(1); + TCGv t2 = tcg_constant_tl(0); + TCGv t3 = tcg_constant_tl(1); tcg_gen_ext32u_tl(t0, t0); tcg_gen_ext32u_tl(t1, t1); tcg_gen_movcond_tl(TCG_COND_EQ, t1, t1, t2, t3, t1); @@ -3304,8 +3304,8 @@ static void gen_muldiv(DisasContext *ctx, uint32_t opc, break; case OPC_DIVU: { - TCGv t2 = tcg_const_tl(0); - TCGv t3 = tcg_const_tl(1); + TCGv t2 = tcg_constant_tl(0); + TCGv t3 = tcg_constant_tl(1); tcg_gen_ext32u_tl(t0, t0); tcg_gen_ext32u_tl(t1, t1); tcg_gen_movcond_tl(TCG_COND_EQ, t1, t1, t2, t3, t1); @@ -3355,8 +3355,8 @@ static void gen_muldiv(DisasContext *ctx, uint32_t opc, break; case OPC_DDIVU: { - TCGv t2 = tcg_const_tl(0); - TCGv t3 = tcg_const_tl(1); + TCGv t2 = tcg_constant_tl(0); + TCGv t3 = tcg_constant_tl(1); tcg_gen_movcond_tl(TCG_COND_EQ, t1, t1, t2, t3, t1); tcg_gen_divu_i64(cpu_LO[acc], t0, t1); tcg_gen_remu_i64(cpu_HI[acc], t0, t1); @@ -4908,7 +4908,7 @@ static void gen_bshfl(DisasContext *ctx, uint32_t op2, int rt, int rd) case OPC_WSBH: { TCGv t1 = tcg_temp_new(); - TCGv t2 = tcg_const_tl(0x00FF00FF); + TCGv t2 = tcg_constant_tl(0x00FF00FF); tcg_gen_shri_tl(t1, t0, 8); tcg_gen_and_tl(t1, t1, t2); @@ -4928,7 +4928,7 @@ static void gen_bshfl(DisasContext *ctx, uint32_t op2, int rt, int rd) case OPC_DSBH: { TCGv t1 = tcg_temp_new(); - TCGv t2 = tcg_const_tl(0x00FF00FF00FF00FFULL); + TCGv t2 = tcg_constant_tl(0x00FF00FF00FF00FFULL); tcg_gen_shri_tl(t1, t0, 8); tcg_gen_and_tl(t1, t1, t2); @@ -4940,7 +4940,7 @@ static void gen_bshfl(DisasContext *ctx, uint32_t op2, int rt, int rd) case OPC_DSHD: { TCGv t1 = tcg_temp_new(); - TCGv t2 = tcg_const_tl(0x0000FFFF0000FFFFULL); + TCGv t2 = tcg_constant_tl(0x0000FFFF0000FFFFULL); tcg_gen_shri_tl(t1, t0, 16); tcg_gen_and_tl(t1, t1, t2); @@ -8451,7 +8451,7 @@ static void gen_mftr(CPUMIPSState *env, DisasContext *ctx, int rt, int rd, case 5: case 6: case 7: - gen_helper_mftc0_configx(t0, cpu_env, tcg_const_tl(sel)); + gen_helper_mftc0_configx(t0, cpu_env, tcg_constant_tl(sel)); break; default: goto die; @@ -9477,7 +9477,7 @@ static inline void gen_movcf_ps(DisasContext *ctx, int fs, int fd, static void gen_sel_s(DisasContext *ctx, enum fopcode op1, int fd, int ft, int fs) { - TCGv_i32 t1 = tcg_const_i32(0); + TCGv_i32 t1 = tcg_constant_i32(0); TCGv_i32 fp0 = tcg_temp_new_i32(); TCGv_i32 fp1 = tcg_temp_new_i32(); TCGv_i32 fp2 = tcg_temp_new_i32(); @@ -9510,7 +9510,7 @@ static void gen_sel_s(DisasContext *ctx, enum fopcode op1, int fd, int ft, static void gen_sel_d(DisasContext *ctx, enum fopcode op1, int fd, int ft, int fs) { - TCGv_i64 t1 = tcg_const_i64(0); + TCGv_i64 t1 = tcg_constant_i64(0); TCGv_i64 fp0 = tcg_temp_new_i64(); TCGv_i64 fp1 = tcg_temp_new_i64(); TCGv_i64 fp2 = tcg_temp_new_i64(); @@ -11508,7 +11508,7 @@ void gen_addiupc(DisasContext *ctx, int rx, int imm, static void gen_cache_operation(DisasContext *ctx, uint32_t op, int base, int16_t offset) { - TCGv_i32 t0 = tcg_const_i32(op); + TCGv_i32 t0 = tcg_constant_i32(op); TCGv t1 = tcg_temp_new(); gen_base_offset_addr(ctx, t1, base, offset); gen_helper_cache(cpu_env, t1, t0); @@ -11852,7 +11852,7 @@ static void gen_mipsdsp_arith(DisasContext *ctx, uint32_t op1, uint32_t op2, case OPC_PRECR_SRA_PH_W: check_dsp_r2(ctx); { - TCGv_i32 sa_t = tcg_const_i32(v2); + TCGv_i32 sa_t = tcg_constant_i32(v2); gen_helper_precr_sra_ph_w(cpu_gpr[ret], sa_t, v1_t, cpu_gpr[ret]); break; @@ -11860,7 +11860,7 @@ static void gen_mipsdsp_arith(DisasContext *ctx, uint32_t op1, uint32_t op2, case OPC_PRECR_SRA_R_PH_W: check_dsp_r2(ctx); { - TCGv_i32 sa_t = tcg_const_i32(v2); + TCGv_i32 sa_t = tcg_constant_i32(v2); gen_helper_precr_sra_r_ph_w(cpu_gpr[ret], sa_t, v1_t, cpu_gpr[ret]); break; @@ -12049,14 +12049,14 @@ static void gen_mipsdsp_arith(DisasContext *ctx, uint32_t op1, uint32_t op2, case OPC_PRECR_SRA_QH_PW: check_dsp_r2(ctx); { - TCGv_i32 ret_t = tcg_const_i32(ret); + TCGv_i32 ret_t = tcg_constant_i32(ret); gen_helper_precr_sra_qh_pw(v2_t, v1_t, v2_t, ret_t); break; } case OPC_PRECR_SRA_R_QH_PW: check_dsp_r2(ctx); { - TCGv_i32 sa_v = tcg_const_i32(ret); + TCGv_i32 sa_v = tcg_constant_i32(ret); gen_helper_precr_sra_r_qh_pw(v2_t, v1_t, v2_t, sa_v); break; } diff --git a/target/mips/tcg/tx79_translate.c b/target/mips/tcg/tx79_translate.c index d46bc73972..3a45a1bfea 100644 --- a/target/mips/tcg/tx79_translate.c +++ b/target/mips/tcg/tx79_translate.c @@ -243,8 +243,8 @@ static bool trans_parallel_compare(DisasContext *ctx, arg_r *a, return true; } - c0 = tcg_const_tl(0); - c1 = tcg_const_tl(0xffffffff); + c0 = tcg_constant_tl(0); + c1 = tcg_constant_tl(0xffffffff); ax = tcg_temp_new_i64(); bx = tcg_temp_new_i64(); t0 = tcg_temp_new_i64(); diff --git a/target/mips/tcg/micromips_translate.c.inc b/target/mips/tcg/micromips_translate.c.inc index 23f80d4315..e8b193aeda 100644 --- a/target/mips/tcg/micromips_translate.c.inc +++ b/target/mips/tcg/micromips_translate.c.inc @@ -704,8 +704,8 @@ static void gen_ldst_multiple(DisasContext *ctx, uint32_t opc, int reglist, gen_base_offset_addr(ctx, t0, base, offset); - t1 = tcg_const_tl(reglist); - t2 = tcg_const_i32(ctx->mem_idx); + t1 = tcg_constant_tl(reglist); + t2 = tcg_constant_i32(ctx->mem_idx); save_cpu_state(ctx, 1); switch (opc) { diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/nanomips_translate.c.inc index b3df7fec40..9398e28000 100644 --- a/target/mips/tcg/nanomips_translate.c.inc +++ b/target/mips/tcg/nanomips_translate.c.inc @@ -3359,7 +3359,7 @@ static void gen_pool32a5_nanomips_insn(DisasContext *ctx, int opc, case 0: /* PRECR_SRA_PH_W */ { - TCGv_i32 sa_t = tcg_const_i32(rd); + TCGv_i32 sa_t = tcg_constant_i32(rd); gen_helper_precr_sra_ph_w(v1_t, sa_t, v1_t, cpu_gpr[rt]); gen_store_gpr(v1_t, rt); @@ -3368,7 +3368,7 @@ static void gen_pool32a5_nanomips_insn(DisasContext *ctx, int opc, case 1: /* PRECR_SRA_R_PH_W */ { - TCGv_i32 sa_t = tcg_const_i32(rd); + TCGv_i32 sa_t = tcg_constant_i32(rd); gen_helper_precr_sra_r_ph_w(v1_t, sa_t, v1_t, cpu_gpr[rt]); gen_store_gpr(v1_t, rt); @@ -3864,10 +3864,12 @@ static int decode_nanomips_32_48_opc(CPUMIPSState *env, DisasContext *ctx) check_nms(ctx); if (rt != 0) { TCGv t0 = tcg_temp_new(); - TCGv_i32 shift = tcg_const_i32(extract32(ctx->opcode, 0, 5)); - TCGv_i32 shiftx = tcg_const_i32(extract32(ctx->opcode, 7, 4) - << 1); - TCGv_i32 stripe = tcg_const_i32(extract32(ctx->opcode, 6, 1)); + TCGv_i32 shift = + tcg_constant_i32(extract32(ctx->opcode, 0, 5)); + TCGv_i32 shiftx = + tcg_constant_i32(extract32(ctx->opcode, 7, 4) << 1); + TCGv_i32 stripe = + tcg_constant_i32(extract32(ctx->opcode, 6, 1)); gen_load_gpr(t0, rs); gen_helper_rotx(cpu_gpr[rt], t0, shift, shiftx, stripe); @@ -4500,7 +4502,7 @@ static int decode_isa_nanomips(CPUMIPSState *env, DisasContext *ctx) /* make sure instructions are on a halfword boundary */ if (ctx->base.pc_next & 0x1) { - TCGv tmp = tcg_const_tl(ctx->base.pc_next); + TCGv tmp = tcg_constant_tl(ctx->base.pc_next); tcg_gen_st_tl(tmp, cpu_env, offsetof(CPUMIPSState, CP0_BadVAddr)); generate_exception_end(ctx, EXCP_AdEL); return 2; From patchwork Mon Feb 27 05:41:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656917 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2230344wrb; Mon, 27 Feb 2023 00:20:20 -0800 (PST) X-Google-Smtp-Source: AK7set9kRQW16rjcygtIM4jtQ/k5iBLZKo8fol+csNsKmPFWzsmZ2c3Hlv9jCV79TphQYK2DlX04 X-Received: by 2002:a05:6214:1941:b0:56e:b16d:ec93 with SMTP id q1-20020a056214194100b0056eb16dec93mr51933582qvk.4.1677486020640; Mon, 27 Feb 2023 00:20:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486020; cv=none; d=google.com; s=arc-20160816; b=Ilv+p9P3T5tgVIanZAu/yzyT3zi0XIoqPRpemTcvoEf4+mOWXHWcuPImhQGh6dbU6U u3A9uFcedWFRRZHd/Ka+0S4yIh9OIjAMcoG0TR3UXxqt00De1wHXzkH+iqG41lPUZnvn v2WC7P89e2GNzFbD8rZ3gEqGCgEskOvwgU/5gnsl+NTKp/7kKeAn8RITRKvJGaXJir9q sp/9boWrgIce1Ou6UA4nLNbLmIMeSlQYcMCuEwgelG5ycmA1yyRaCp/Fi8uFedp4o1wh Q/b6AoHP2IFCwwdlf+DZIcJxX1LEqsuvrRGzImm+QzedP9nNo7lUvxzCwj35ePbygDQz VrPw== 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=Yrg+WFYxJya6wAchTB9F/B6YD3KKU7NwvfedNNECx5Y=; b=sdmqloFApOtoToEUFbaqVzvbbJgJXmLiEow/0iM5/KsTHXFstOmdHkC3Edz9hW4h+W AgvIFKpwP4PjCVnHQqP8OXLJqp5aFdCJ4CCqmb8M6L5rVumNu578fgRlvMaahdax08Sy YqgmXsdcR9jCNOzglPiUWRuBrhPZs7V0KjItrjOtmopsBHOs2wOT+tb6RDF7F6CURw0F OA7ChuURW0OKUUYG7eFZIwYi/dDcqrYIY3gwM5VNvb7WtdvNLM6QoypWajBKUvPypkwX wTLJ286tZ96DRaZ9onYWx/YuFJX6Y41+zOGsk2BdufvWtN5ER4CaKvlWCBys0KEgMdtq FzMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ETg8EjBc; 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 z14-20020a0cf00e000000b0056eff66f664si5880187qvk.297.2023.02.27.00.20.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:20:20 -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=ETg8EjBc; 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 1pWWJO-0007Gd-Pc; Mon, 27 Feb 2023 00:44:34 -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 1pWWJB-0006Rt-Rw for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:21 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWJ6-0005Uh-D8 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:21 -0500 Received: by mail-pj1-x102c.google.com with SMTP id 6-20020a17090a190600b00237c5b6ecd7so4395155pjg.4 for ; Sun, 26 Feb 2023 21:44:14 -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=Yrg+WFYxJya6wAchTB9F/B6YD3KKU7NwvfedNNECx5Y=; b=ETg8EjBcG8VzUHqiTwkZGxarGGVloeac7FWVACvw69W4/8bs/PsrRm+tbNqeZXrbXs h7PW/O+BmkmFlITBvhH6bs9HstcXNd6A7JdI8tNBp8eGUxv7BW59b3OAFpj2L0VYm3My 1zYTyROwqWZ9S0OrlGEZo9YGvgQRRl2iD/cDGCFQu7x2IVW5ONtyCAfS89hq5OU09a02 aX4lCbcE9amiKE2kxrY9yNpunb9Dl2mGuxCavzyT8FXcQSEYtdoPpS06q6qE5wK/jqWb kQrlHHqGdfEaLZfC+/BUKJwbMVKWOl67j0ps4Ohfmxjw2E7GInIqK77hAfY6+SVLUlZF 0PKw== 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=Yrg+WFYxJya6wAchTB9F/B6YD3KKU7NwvfedNNECx5Y=; b=stxC2zTIs/ZWLTre50/nPmWqF6FX2XGshq8PehawGup3XZ93FgMGVXv1MH7wtj6xSX qNEHRms1lLeNHJMOzW6k0CE2Sta5TipmpA5ozjkLiXoqYbr6PPf2+jp916tgbMiuagv7 W3FHdTTILyZuboB7U1+N0IG4ctSzk5eO8DPRIfDCltpvAxEF2y1tSJpSVEl/68beMxab U+pWH8q+vdb2/kn5p3XOdnMkUp2uVndSBpYKdasqssjCCJ+7xJOB4v2WIdQe8JL2A9Lw +Tb0uKepgwl5QW/9y9iKzxJBsR98Z9MioeKEcLC5ozqfy7R3WGcfZmecDGfXt3UESYsZ LhUQ== X-Gm-Message-State: AO0yUKWZI+LjszhhtVh/Cqmx8S11U3rWYRRbdvgEOSRB7k+Ag+7zyhBE ikIgHmUogpmwF7XJpV10TeYFiYDzc/ieKrdl2B8= X-Received: by 2002:a05:6a20:3b17:b0:cd:1e80:5840 with SMTP id c23-20020a056a203b1700b000cd1e805840mr3500794pzh.34.1677476653804; Sun, 26 Feb 2023 21:44:13 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.44.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:44:13 -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 34/70] target/ppc: Split out gen_vx_vmul10 Date: Sun, 26 Feb 2023 19:41:57 -1000 Message-Id: <20230227054233.390271-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Move the body out of this large macro. Use tcg_constant_i64. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/ppc/translate/vmx-impl.c.inc | 95 +++++++++++++++-------------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc index 05ba9c9492..ee656d6a44 100644 --- a/target/ppc/translate/vmx-impl.c.inc +++ b/target/ppc/translate/vmx-impl.c.inc @@ -171,53 +171,56 @@ static void gen_mtvscr(DisasContext *ctx) gen_helper_mtvscr(cpu_env, val); } +static void gen_vx_vmul10(DisasContext *ctx, bool add_cin, bool ret_carry) +{ + TCGv_i64 t0; + TCGv_i64 t1; + TCGv_i64 t2; + TCGv_i64 avr; + TCGv_i64 ten, z; + + if (unlikely(!ctx->altivec_enabled)) { + gen_exception(ctx, POWERPC_EXCP_VPU); + return; + } + + t0 = tcg_temp_new_i64(); + t1 = tcg_temp_new_i64(); + t2 = tcg_temp_new_i64(); + avr = tcg_temp_new_i64(); + ten = tcg_constant_i64(10); + z = tcg_constant_i64(0); + + if (add_cin) { + get_avr64(avr, rA(ctx->opcode), false); + tcg_gen_mulu2_i64(t0, t1, avr, ten); + get_avr64(avr, rB(ctx->opcode), false); + tcg_gen_andi_i64(t2, avr, 0xF); + tcg_gen_add2_i64(avr, t2, t0, t1, t2, z); + set_avr64(rD(ctx->opcode), avr, false); + } else { + get_avr64(avr, rA(ctx->opcode), false); + tcg_gen_mulu2_i64(avr, t2, avr, ten); + set_avr64(rD(ctx->opcode), avr, false); + } + + if (ret_carry) { + get_avr64(avr, rA(ctx->opcode), true); + tcg_gen_mulu2_i64(t0, t1, avr, ten); + tcg_gen_add2_i64(t0, avr, t0, t1, t2, z); + set_avr64(rD(ctx->opcode), avr, false); + set_avr64(rD(ctx->opcode), z, true); + } else { + get_avr64(avr, rA(ctx->opcode), true); + tcg_gen_mul_i64(t0, avr, ten); + tcg_gen_add_i64(avr, t0, t2); + set_avr64(rD(ctx->opcode), avr, true); + } +} + #define GEN_VX_VMUL10(name, add_cin, ret_carry) \ -static void glue(gen_, name)(DisasContext *ctx) \ -{ \ - TCGv_i64 t0; \ - TCGv_i64 t1; \ - TCGv_i64 t2; \ - TCGv_i64 avr; \ - TCGv_i64 ten, z; \ - \ - if (unlikely(!ctx->altivec_enabled)) { \ - gen_exception(ctx, POWERPC_EXCP_VPU); \ - return; \ - } \ - \ - t0 = tcg_temp_new_i64(); \ - t1 = tcg_temp_new_i64(); \ - t2 = tcg_temp_new_i64(); \ - avr = tcg_temp_new_i64(); \ - ten = tcg_const_i64(10); \ - z = tcg_const_i64(0); \ - \ - if (add_cin) { \ - get_avr64(avr, rA(ctx->opcode), false); \ - tcg_gen_mulu2_i64(t0, t1, avr, ten); \ - get_avr64(avr, rB(ctx->opcode), false); \ - tcg_gen_andi_i64(t2, avr, 0xF); \ - tcg_gen_add2_i64(avr, t2, t0, t1, t2, z); \ - set_avr64(rD(ctx->opcode), avr, false); \ - } else { \ - get_avr64(avr, rA(ctx->opcode), false); \ - tcg_gen_mulu2_i64(avr, t2, avr, ten); \ - set_avr64(rD(ctx->opcode), avr, false); \ - } \ - \ - if (ret_carry) { \ - get_avr64(avr, rA(ctx->opcode), true); \ - tcg_gen_mulu2_i64(t0, t1, avr, ten); \ - tcg_gen_add2_i64(t0, avr, t0, t1, t2, z); \ - set_avr64(rD(ctx->opcode), avr, false); \ - set_avr64(rD(ctx->opcode), z, true); \ - } else { \ - get_avr64(avr, rA(ctx->opcode), true); \ - tcg_gen_mul_i64(t0, avr, ten); \ - tcg_gen_add_i64(avr, t0, t2); \ - set_avr64(rD(ctx->opcode), avr, true); \ - } \ -} \ + static void glue(gen_, name)(DisasContext *ctx) \ + { gen_vx_vmul10(ctx, add_cin, ret_carry); } GEN_VX_VMUL10(vmul10uq, 0, 0); GEN_VX_VMUL10(vmul10euq, 1, 0); From patchwork Mon Feb 27 05:41:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656833 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2183617wrb; Sun, 26 Feb 2023 21:47:01 -0800 (PST) X-Google-Smtp-Source: AK7set9g6Zvh7BzSYD6fcMPjG9z2KfmuRC2kwqMH08a06wWUIqDrNmp1yWj+UxPq7Qg+vu33YPSA X-Received: by 2002:ac8:58d1:0:b0:3ba:1d8d:f6eb with SMTP id u17-20020ac858d1000000b003ba1d8df6ebmr29437936qta.58.1677476821683; Sun, 26 Feb 2023 21:47:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677476821; cv=none; d=google.com; s=arc-20160816; b=fEuFzAWFiU6OTXOa/2DsjTsWaIsubQokvH7XZKA21W427HKf4E1szzZi7WSx8AcXC1 6fonGXEMi3Az7L7W05rcb5ddspS/5oiW1JvVeXqjlFY2FAyBrNJ0rFh+35oW66sEw1o5 nlpdImNAq9UlvhPgPW+kcgBz2UMzgH4teX0TSopClgGXAvhA9dgIfdrpL0EPwVthMZEq GvRYzqEX4elK5IALo/mrSJCfeqyu0sF8Dr/+qOHaqCMCuQMrKX3vLGcVMR520nJG6Pjp CGQGh8joba97UZNEY5kDeX8HYrryxsMkeDZHKfX4LTKQbr/MNP9pYVRhhgF5IwZnzFzg Mu7g== 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=gjNRxwXY6IlZzT4K+cjSfeV6vMtijiEuE4yFA9wqFGg=; b=FMkqwdwob1JMS6ccOZ1yO227IQqUSzR3g68gWAhzDIsE3/sMw0yHKDsKkRUY9Djb3W S/IPAmM2zSrNgW6ro0vDtjM3OI5cpzQBp5uhC2NPQaqOGBLzf4tImF6yUAIFczJI/O+R Sg9ZSE4CIixzDr/71FTzPkOHq82pZSEP2aPMyQ4rsbG3okti37wKukKD9Ka52SKn5XcR Rm29gNnY2locLWE8C0D7o3FbPy/+MCxsUT9NuwnU6kAnUhSQAYg2+xjCNkfpBn6QsvXP J29OmlN9+ngiOKOwuY9MWIzBhepWVdYjXj8eohoti3qMjntGU/wPxQw/6+2gc4rAdrLB WPHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="QUcD3nf/"; 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 m18-20020a05620a24d200b006fec2c77e8fsi4276338qkn.481.2023.02.26.21.47.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:47:01 -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="QUcD3nf/"; 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 1pWWJs-0000kN-RV; Mon, 27 Feb 2023 00:45:04 -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 1pWWJN-00078l-0z for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:33 -0500 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWJ7-0005Ai-He for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:27 -0500 Received: by mail-pf1-x42f.google.com with SMTP id c10so2156129pfv.13 for ; Sun, 26 Feb 2023 21:44:16 -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=gjNRxwXY6IlZzT4K+cjSfeV6vMtijiEuE4yFA9wqFGg=; b=QUcD3nf/lF6IVFVsZYfDBxEDNL295vscaynrkiAZ95bdHGPuSpiwrMOZoWGoufPDA2 NnU8zxc03I/dbRPvunCfr+2o/vyH0vuX7m2hKVA4np7f7Rs2dwUyBOYq5ZAB16aHIEgo FqY9bVaaxHxa0ihafI758X0nAg5xEBipWkDMJ11L1Hph5SGHhOM2IHxXFSJL488KCd0i hS2rNwjIeyhME48h50BqXwSCdBJHPJYPZOtWGWg1uS+T+ccxJqSq08bc6LkUd3sGFUnD ffXtndeVRYFQnaQhBVS+ixRANT6I+jSICPofwQxGNpAw0nzPjIkT0op65Nxfb3zzqPwi ZI9A== 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=gjNRxwXY6IlZzT4K+cjSfeV6vMtijiEuE4yFA9wqFGg=; b=8Lag7JZ8kfnorCORtON+E0qXBciNeBbeMtUIteJ1BiIBFr+YaAOkP8VSJvlqpeH4kA /xwXE2BZNfijjQEW/2+xJvtRqU65RfVlFTQOoblmeuPq46eOs7FuPs34XnljKj4JcgdA d3BDmGgOyvjbGnB0lai5rleLkDPLXN3wwtY4anKoy49xj6xKl1nFcs+SdwFrFtUx3xUJ eROsrydH7I0fuqKAr3jcilMfmxj+B9S0D/VldZbd/fr08/L5qEzGtYL5SOxTnPOJjByE sm9IDpkFMwBg3zMnSTt7f02R2VHh1Iu51YzmaLNBS9Z5JBVu/6rLxyL1rA+iKU89hujH zq5A== X-Gm-Message-State: AO0yUKXteliKcaX4bFn5N/nVT1uB9PL6Z1j/I+aVFH/5jwzZkrgHTpBg sks9Bsj1cmZHekP1aypzJkkujlj32SAl4eEoQpk= X-Received: by 2002:a62:7b82:0:b0:5a8:d364:62ab with SMTP id w124-20020a627b82000000b005a8d36462abmr21987857pfc.17.1677476656376; Sun, 26 Feb 2023 21:44:16 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:44:15 -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 35/70] target/ppc: Avoid tcg_const_i64 in do_vector_shift_quad Date: Sun, 26 Feb 2023 19:41:58 -1000 Message-Id: <20230227054233.390271-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/ppc/translate/vmx-impl.c.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc index ee656d6a44..7af6d7217d 100644 --- a/target/ppc/translate/vmx-impl.c.inc +++ b/target/ppc/translate/vmx-impl.c.inc @@ -906,7 +906,6 @@ static bool do_vector_shift_quad(DisasContext *ctx, arg_VX *a, bool right, hi = tcg_temp_new_i64(); lo = tcg_temp_new_i64(); t0 = tcg_temp_new_i64(); - t1 = tcg_const_i64(0); get_avr64(lo, a->vra, false); get_avr64(hi, a->vra, true); @@ -917,7 +916,10 @@ static bool do_vector_shift_quad(DisasContext *ctx, arg_VX *a, bool right, if (right) { tcg_gen_movcond_i64(TCG_COND_NE, lo, t0, zero, hi, lo); if (alg) { + t1 = tcg_temp_new_i64(); tcg_gen_sari_i64(t1, lo, 63); + } else { + t1 = zero; } tcg_gen_movcond_i64(TCG_COND_NE, hi, t0, zero, t1, hi); } else { From patchwork Mon Feb 27 05:41:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656883 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2224266wrb; Mon, 27 Feb 2023 00:01:52 -0800 (PST) X-Google-Smtp-Source: AK7set8DLAie5quzDOQ00tJbL2IUimrQQJN95o9wUhtw1rLH6HCdLgAx+z9l9MveA809ke+AlC7K X-Received: by 2002:a05:622a:510:b0:3bf:d35d:98c0 with SMTP id l16-20020a05622a051000b003bfd35d98c0mr6307672qtx.29.1677484912725; Mon, 27 Feb 2023 00:01:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677484912; cv=none; d=google.com; s=arc-20160816; b=lwvb+f6tvYrSXxy0PEQ2HNlqmdY1JduPOk+YKum1+w7ymXpexajax5UdUiKy/H75GF dbU3BXqUJkJ3Di7yppdz1jXmMjKwdj6sBHTEcX/0d/8UJ4wGhIJzyQEXBOc8QJG1bmku NJcEleyKtN8u61hJMteXxMD34uWw3lxxed1QL/csSidZZ4UHB2ZRZ/mToATBwHfm2XmS t9uIpcbJ+HZoeODwBCAqOLSH2ovSseu76u1mdk3D3D9bY5blqA8hRRwnxhQpA3eWq6gK jRDFV24e6UzNv9qCD1uMV20z3zozjWn1QERDXJBvZ6L+AH1UQ2kWMoxhZRXx6vTGnM6J 9rOQ== 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=4GAyAzn2ZAR1Xu40Rif6JsZO69wqLVIHDcxI5i2jvKA=; b=hoXZtXfGPh/6jh9EmdTgQeS8BdvcTNyNC6Coi2nkaKqSUXEoy6WlgECaUvDmwq/IS5 gNDsuT/9D0GSZdRinXaWXuyjo01UzMPWgwvpQCYZv61TbqhjpGzLTcl2Or3mlh4/ElS+ F92jgwEB3TeXoA79ir8BCtCADFTc0Rb0ZZH2UNQM4lxDzSXAQQ1v3RBfgBfAx6PsYZdB HnCzXzi8fk6xsT77Offw4qLdSIfJuNC4H+VGavnulIFVYlTeR/jRHnTB8xRKlads9NlQ 1x6lboV1l9945AAJxdPkVOZQMi6Gpbfh+CmwNtofV+QOWPEUbE+fliKHZpYWZrWAFe9E BVkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=akYJCbEx; 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 i12-20020ac85c0c000000b003bfba5c3345si5886448qti.758.2023.02.27.00.01.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:01:52 -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=akYJCbEx; 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 1pWWJo-0000NB-5f; Mon, 27 Feb 2023 00:45:00 -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 1pWWJM-00077y-Qt for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:32 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWJA-0005Xb-H6 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:29 -0500 Received: by mail-pf1-x430.google.com with SMTP id ce7so2787957pfb.9 for ; Sun, 26 Feb 2023 21:44:19 -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=4GAyAzn2ZAR1Xu40Rif6JsZO69wqLVIHDcxI5i2jvKA=; b=akYJCbEx4Mz8DVowhrD2O3jxEtkwnC/v46zN4VlbzCODRxaAu9HTPum1MzvvBSAVTm Bkl+CkiJi+c4+EyW+gkoMC3Mbar5T5aJ7UKgg1UgFs4AX3Z3D93Y95pvB/luRK+HJfuj UIkGV9IJ87f/+8XomXrRDMKzBrhlkwYNTcycmM5Ykzpmdib/YlCTiSkPqF6G1U0DQmAN geb1D/IdUBzpXlxfFiKTAabrSqj2CuyA5JOoWsIanOgGEOESoomEmSM+d53SNuZwf7kI YRhPvX9XvBG+UfLuLago5o+U3tRe5ukzapOEPL/9vZ0uWX+Mjm3MehhnHVc6SF8ubJwh h5QA== 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=4GAyAzn2ZAR1Xu40Rif6JsZO69wqLVIHDcxI5i2jvKA=; b=uxhbgoCTS87I98ORyfYxixdzEjzlAVXfdqsbQDHCxL9LkrAFkBOfxqAEPp9AEhJOFp 6mresTLNcYkWZfR/4qG/NQV0NYm+UvKCMkM+Zm9rpxLqR5VP6GVti8CkOVtmSuuLpLO6 pjjV2jMB1hcRRHbSVKUHTdB9FTyH7JsIcvNJC8R6PuARLd2XNhzypCqQA+Wdw3FPqBl8 VgLpmr9rfuGzKC9Gd/LQOVvSpaOWad8OqLcwrBJgQ/RZPBxdAI6/JAHdxhtAAR5+LCbh 3ljO9I8N8d92hO5Wt2FZTkQySEh0EFkwFotdJvGrOCJoUB4kFXftP3q402O+wyh/84SA tG0w== X-Gm-Message-State: AO0yUKVXkcQS+obnhOQzSxHSJdZU/rKg8RrR4ER+kWB9z12krX3jawdz Mq0K8nc5+/bJq+UEntQrrp5RX+cuvQYAsqjnQsM= X-Received: by 2002:aa7:8ecc:0:b0:5a8:bcf2:125 with SMTP id b12-20020aa78ecc000000b005a8bcf20125mr18566963pfr.21.1677476658975; Sun, 26 Feb 2023 21:44:18 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:44:18 -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 36/70] target/ppc: Avoid tcg_const_i64 in do_vcntmb Date: Sun, 26 Feb 2023 19:41:59 -1000 Message-Id: <20230227054233.390271-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Compute both partial results separately and accumulate at the end, instead of accumulating in the middle. Signed-off-by: Richard Henderson --- target/ppc/translate/vmx-impl.c.inc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc index 7af6d7217d..ca27c11d87 100644 --- a/target/ppc/translate/vmx-impl.c.inc +++ b/target/ppc/translate/vmx-impl.c.inc @@ -2236,24 +2236,25 @@ static bool trans_MTVSRBMI(DisasContext *ctx, arg_DX_b *a) static bool do_vcntmb(DisasContext *ctx, arg_VX_mp *a, int vece) { - TCGv_i64 rt, vrb, mask; - rt = tcg_const_i64(0); - vrb = tcg_temp_new_i64(); + TCGv_i64 r[2], mask; + + r[0] = tcg_temp_new_i64(); + r[1] = tcg_temp_new_i64(); mask = tcg_constant_i64(dup_const(vece, 1ULL << ((8 << vece) - 1))); for (int i = 0; i < 2; i++) { - get_avr64(vrb, a->vrb, i); + get_avr64(r[i], a->vrb, i); if (a->mp) { - tcg_gen_and_i64(vrb, mask, vrb); + tcg_gen_and_i64(r[i], mask, r[i]); } else { - tcg_gen_andc_i64(vrb, mask, vrb); + tcg_gen_andc_i64(r[i], mask, r[i]); } - tcg_gen_ctpop_i64(vrb, vrb); - tcg_gen_add_i64(rt, rt, vrb); + tcg_gen_ctpop_i64(r[i], r[i]); } - tcg_gen_shli_i64(rt, rt, TARGET_LONG_BITS - 8 + vece); - tcg_gen_trunc_i64_tl(cpu_gpr[a->rt], rt); + tcg_gen_add_i64(r[0], r[0], r[1]); + tcg_gen_shli_i64(r[0], r[0], TARGET_LONG_BITS - 8 + vece); + tcg_gen_trunc_i64_tl(cpu_gpr[a->rt], r[0]); return true; } From patchwork Mon Feb 27 05:42:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656877 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2190695wrb; Sun, 26 Feb 2023 22:11:14 -0800 (PST) X-Google-Smtp-Source: AK7set+nNzm9R5IJybSXeT+ywKBncON48FvVumU9RtF1wllGHZLKqAYjHf3gCK3OP1yGzbn8P2Sf X-Received: by 2002:a05:622a:1104:b0:3bf:a1aa:25a0 with SMTP id e4-20020a05622a110400b003bfa1aa25a0mr40171713qty.17.1677478274359; Sun, 26 Feb 2023 22:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677478274; cv=none; d=google.com; s=arc-20160816; b=mIYKmsPpblcOPd1CuH8HljBs9Fks71FGNk5McWfsvoonn9C5LWsijCAaeBB2xJdtkT htAnNe0KqWblbKpsEhae6GErXTiatl4ss6DQ459OD8lsQsRXdEleOhJndbiyinNBjZ8K IYLBDUGdmnV0/yo7M1mQ5dpdsyt7LzPYewN2iIjs0dhtGXgUvlrt/74JN57ADWREecYB R6oAR+sEjig4wpwTCMeGV/Z54yJL6PSVCyKYXSubJo0jenEmG0v3bAKcjQFuVR1dH1wu KnPEr87+kyot844Mq8jsBU3AyxKWYHgPIe3//9kK+Hh9O5o5CQeVbh7rU2t1Y5XGPMW5 DgaA== 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=fXCMxBWQmLHmmqt1iKjCO3RiwtMJobhj4kTdr9q0fJo=; b=lCZudMQTDx+MacxII7NXk3gDFDY9bAxS3pjTwTFPlDvDz52NzARaMX9yz6ydxCyajP MFW3RfjhYdxy41zkKhmr7EY8wkjaZbsfLSi7hs5tmoRj4Si716cIclBFjV5O4BSBQXKa 1ZLqsWwYtijgrTPE3B7G3fKt6rWMQOe1vCwYrPMIjg6ryUMF8qjIMEw8rxahRzxHIBh/ ucx9r/AIVwvlNn2KBuX5rLmQIz+0Dtz8EconR1QNxcLrsnGAE3jwaq/2Xb1FaKvv+E88 /RZbpxjC00XAE1WsxLq66O5sJzeIx5mcA9MrWPpX7fU9R8dlSSt0+g6pV9rErkoez9Bx LM9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Iytrot8C; 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 c66-20020a379a45000000b00731860c3ccbsi5044148qke.355.2023.02.26.22.11.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 22:11:14 -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=Iytrot8C; 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 1pWWJc-0008QE-Mo; Mon, 27 Feb 2023 00:44:48 -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 1pWWJM-00077T-Ky for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:32 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWJC-0005Ro-DQ for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:30 -0500 Received: by mail-pf1-x42a.google.com with SMTP id z11so2807094pfh.4 for ; Sun, 26 Feb 2023 21:44:21 -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=fXCMxBWQmLHmmqt1iKjCO3RiwtMJobhj4kTdr9q0fJo=; b=Iytrot8CZ+x91sOgJ81SvVKzTnlb4e5C49eQ32YhiCL1b6jIwY6hVlmR5fRsxMR+1c QOq1fBVAA9EgKhCd516whjlNxq7oRQ3RMhA7FVVCcfY+F1vOiMXEDHTPY6q7hn+bMR8X wNIbm+UDhTavVxC8EBJT9L3Sk+YtgqQD4PeABJUnuPO6lYSgOT1nAMwpFEj4gAFZEN2r wc4pxQ6lgyxvzTfj0mh0FySJt8/vbIdh/pYRVx9Lm18lYUdP02stRIJINu5UE36T3lGv l9RnVpbyxcr9yv5yl2j6dPLjqyKBk+Z0DSuqdQC7YFUzLgciBo8PCSsPY0Io9+Q72Oyy YZZQ== 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=fXCMxBWQmLHmmqt1iKjCO3RiwtMJobhj4kTdr9q0fJo=; b=blDbfVNAni/oxgLx+SK+Ysd6KSHff1l0zMx+OvvHF/tZp731RhvOjhwQ/Ljvmo0Zps K4GKaALgdTX0hLwAneRC/Zod7KI0Lab6RjShjGp8limCBvMLgG/VpCwKdVquatXVLh1E S66TGZXx0uTMOFCxHooDwT8ItPdUaD8PJw47zGjICbzbMBw0wh1Al5nSja5EO2P8BAvt ccUrPLCMnBvw7ZDmc/Piu0ZdDplZ+t+6BYw0h82RpTqkOHtRcQbF+EGaolo0et+h2bUk Uy3adKT8qjuU0eh3NA2TbloYjUQBNWM0NDJmVhiQsE7V0eC1BJasDPXUou3r0mg4CViq wjkA== X-Gm-Message-State: AO0yUKUgMRbzKspTkduiLYO1PICmATBjbGTZkWiL7Dx8RgmICJyZdjkC USOCzNk2vE4McJav/1B+FdHcF/f8lmr6bMuvEGY= X-Received: by 2002:aa7:9597:0:b0:5a8:4b27:5db2 with SMTP id z23-20020aa79597000000b005a84b275db2mr20400884pfj.1.1677476661484; Sun, 26 Feb 2023 21:44:21 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:44:21 -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 37/70] target/ppc: Avoid tcg_const_* in vmx-impl.c.inc Date: Sun, 26 Feb 2023 19:42:00 -1000 Message-Id: <20230227054233.390271-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/translate/vmx-impl.c.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx-impl.c.inc index ca27c11d87..112233b541 100644 --- a/target/ppc/translate/vmx-impl.c.inc +++ b/target/ppc/translate/vmx-impl.c.inc @@ -1624,7 +1624,7 @@ static void glue(gen_, name)(DisasContext *ctx) \ gen_exception(ctx, POWERPC_EXCP_VPU); \ return; \ } \ - uimm = tcg_const_i32(UIMM5(ctx->opcode)); \ + uimm = tcg_constant_i32(UIMM5(ctx->opcode)); \ rb = gen_avr_ptr(rB(ctx->opcode)); \ rd = gen_avr_ptr(rD(ctx->opcode)); \ gen_helper_##name(cpu_env, rd, rb, uimm); \ @@ -1965,7 +1965,7 @@ static void gen_vsldoi(DisasContext *ctx) ra = gen_avr_ptr(rA(ctx->opcode)); rb = gen_avr_ptr(rB(ctx->opcode)); rd = gen_avr_ptr(rD(ctx->opcode)); - sh = tcg_const_i32(VSH(ctx->opcode)); + sh = tcg_constant_i32(VSH(ctx->opcode)); gen_helper_vsldoi(rd, ra, rb, sh); } @@ -2575,7 +2575,7 @@ static void gen_##op(DisasContext *ctx) \ rb = gen_avr_ptr(rB(ctx->opcode)); \ rd = gen_avr_ptr(rD(ctx->opcode)); \ \ - ps = tcg_const_i32((ctx->opcode & 0x200) != 0); \ + ps = tcg_constant_i32((ctx->opcode & 0x200) != 0); \ \ gen_helper_##op(cpu_crf[6], rd, ra, rb, ps); \ } @@ -2594,7 +2594,7 @@ static void gen_##op(DisasContext *ctx) \ rb = gen_avr_ptr(rB(ctx->opcode)); \ rd = gen_avr_ptr(rD(ctx->opcode)); \ \ - ps = tcg_const_i32((ctx->opcode & 0x200) != 0); \ + ps = tcg_constant_i32((ctx->opcode & 0x200) != 0); \ \ gen_helper_##op(cpu_crf[6], rd, rb, ps); \ } @@ -2726,7 +2726,7 @@ static void gen_##op(DisasContext *ctx) \ } \ ra = gen_avr_ptr(rA(ctx->opcode)); \ rd = gen_avr_ptr(rD(ctx->opcode)); \ - st_six = tcg_const_i32(rB(ctx->opcode)); \ + st_six = tcg_constant_i32(rB(ctx->opcode)); \ gen_helper_##op(rd, ra, st_six); \ } From patchwork Mon Feb 27 05:42:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656908 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2229593wrb; Mon, 27 Feb 2023 00:17:51 -0800 (PST) X-Google-Smtp-Source: AK7set+kKxVMtDxZis9icB5ouyagLgGZmAk2NJTGSz8BhCs44gXoehEDcTjIR3qxR4mvnvNoB0bj X-Received: by 2002:a05:6214:e61:b0:571:428:73dc with SMTP id jz1-20020a0562140e6100b00571042873dcmr38252762qvb.34.1677485871522; Mon, 27 Feb 2023 00:17:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485871; cv=none; d=google.com; s=arc-20160816; b=GR2sR9mFbfw94OrDU98pdCzqUu9Y9FRgXV4nSoHsSncxi3TE3+alL1DMD17YF7XhuM 874IoAr0NDe2nrjJzNJGGHFnbBfvY/D4pttaxYcsFQDXi4x7m9eoytCveEb8CUEx7pmN Jssk1oFbAl02Gg1EI2964v03vFEgwiWbcTZKEnQY5kIr7vgvMKA6+aPZcP+7QnmtFyF6 f+Ir30hRWRuk5AhMlQXqdWh3vWHr9dFkE/Zf70V+vLzQBU6ky5fbTgOi6U/67FT8VGau 3t36YMaufA/qktz4zMSMI2vqeXa0cU9aqgEiimK2d8sCcC3yDZOO6H17zHtfnop7qDl+ L0Cg== 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=LajvWmI+pLtygQsSP7BRlVIFeqnQdv7FpjH6OPM0h/s=; b=oAKALSGtwd6Jlv6oibJsp575uKapKRYNolVEgN/Jsz6ABsQ7bRieUxJZ2+UW1HuLsN Gioc4LtoctY4pR+soopLWJCn15EFJOe1OBuMz2eyRKQ6aQN08KwryK/F9A0h7s+W2lAG ey3dXXT6wzD22+y+Rey2snliISPBH/1m8quCiLAUOGZ1Lof5UzE4NDGdVvqvwZ9xxiSz T0CnjSJUfIGUBvxEegTpy3GidSKJgH60u27WR0SZUJ8pdZIOJ75b19iVENMxwI+nfVjB AS2MzSYdigGGpAmN7E8a1cM4AwgdcVPNF2mxEuXJEXRKX91lLVeioKWGps1lyLrfjhb+ Q1hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="UQe/gMPP"; 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 r1-20020a0ccc01000000b0056ea051a8edsi5943548qvk.323.2023.02.27.00.17.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:17:51 -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="UQe/gMPP"; 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 1pWWJt-0000pa-Ri; Mon, 27 Feb 2023 00:45:05 -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 1pWWJN-00079z-8Z for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:33 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWJF-0005bc-Sw for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:32 -0500 Received: by mail-pf1-x434.google.com with SMTP id z11so2807132pfh.4 for ; Sun, 26 Feb 2023 21:44:25 -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=LajvWmI+pLtygQsSP7BRlVIFeqnQdv7FpjH6OPM0h/s=; b=UQe/gMPPOxNpxVX3ybzi8T75p0aDK3PMe/c5PlVr1N199yb+U/rIXA8soXeBgnX7q3 uFBRlur1kZA9xTh/YhAgBwC7x31wTXn8B3RM6DSuBh/H4tp/TAlRNtNXkuG4y72JOBA6 zTDDQ3veI1Mcfo8PffQYkzalaDZWh75eOoAa4PlKdBRbcxvk+pin79N5wgDQVg9TU0Dr Ozvrzym6xya4aBmgzhnuHLCOK7GGTLvGRPpwgdQUWdbzY9g7jFVpFciy/5sa70VIPw9T O1VJ5UPSzOZwQrgBNd1weXWgbX3I+abxpBCHQKrNAWmq9OOjAy7PEUOVGkG76w+sbP3T mIgA== 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=LajvWmI+pLtygQsSP7BRlVIFeqnQdv7FpjH6OPM0h/s=; b=BQCQ7PnGI6sNakn6NcukIPUjg1yB9Y8KQ5XrkB1dHAJqOr72nD6Hyu0MMZeVxa0QX5 csjo6db1XP9NQXPbFE2bJEearwJZ3RqxmM6imxiFMiDUykJ7wLDZ4flgyUZzPRwlLNvQ cxDjmRa4dCqY/gEPrsdYiEJZIJ0FhdVZVL/PnlJtZiZksRcztPIVwZs8vtOFXN2AQxUx o24nXDJDjxE2AGKoC6At+Pk8RYV7aInhymT8XMiZL9+nTt3Py/KyiiVVEbN4Bwst3uyk HfPAzYX5jyau+zZYMhYdZWw+QaBnO3KH9ETut/Rzc99hk/waeQ+aq7rH07yniY25amg8 Y65Q== X-Gm-Message-State: AO0yUKWfJGrhSe/V+brCfGTmKsUFRI9CVKa7gDY9dDv1nZ1h+fPi74rv n6yyQMcWpYIzkOoy9wjTNqMD7xCgSgKTg6l1Z2c= X-Received: by 2002:aa7:9639:0:b0:5ab:be1b:c75e with SMTP id r25-20020aa79639000000b005abbe1bc75emr21305279pfg.24.1677476664118; Sun, 26 Feb 2023 21:44:24 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.44.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:44:23 -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 38/70] target/ppc: Avoid tcg_const_* in xxeval Date: Sun, 26 Feb 2023 19:42:01 -1000 Message-Id: <20230227054233.390271-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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 Initialize a new temp instead of tcg_const_*. Fix a pasto in a comment. Signed-off-by: Richard Henderson --- target/ppc/translate/vsx-impl.c.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc index 6e63403727..9916784e64 100644 --- a/target/ppc/translate/vsx-impl.c.inc +++ b/target/ppc/translate/vsx-impl.c.inc @@ -2449,7 +2449,8 @@ static void gen_xxeval_i64(TCGv_i64 t, TCGv_i64 a, TCGv_i64 b, TCGv_i64 c, TCGv_i64 conj, disj; conj = tcg_temp_new_i64(); - disj = tcg_const_i64(0); + disj = tcg_temp_new_i64(); + tcg_gen_movi_i64(disj, 0); /* Iterate over set bits from the least to the most significant bit */ while (imm) { @@ -2492,8 +2493,9 @@ static void gen_xxeval_vec(unsigned vece, TCGv_vec t, TCGv_vec a, TCGv_vec b, int bit; TCGv_vec disj, conj; - disj = tcg_const_zeros_vec_matching(t); conj = tcg_temp_new_vec_matching(t); + disj = tcg_temp_new_vec_matching(t); + tcg_gen_dupi_vec(vece, disj, 0); /* Iterate over set bits from the least to the most significant bit */ while (imm) { @@ -2546,7 +2548,7 @@ static bool trans_XXEVAL(DisasContext *ctx, arg_8RR_XX4_imm *a) /* Equivalent functions that can be implemented with a single gen_gvec */ switch (a->imm) { - case 0b00000000: /* true */ + case 0b00000000: /* false */ set_cpu_vsr(a->xt, tcg_constant_i64(0), true); set_cpu_vsr(a->xt, tcg_constant_i64(0), false); break; From patchwork Mon Feb 27 05:42:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656886 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2226325wrb; Mon, 27 Feb 2023 00:07:28 -0800 (PST) X-Google-Smtp-Source: AK7set/1KDlkjL5H+kvqpFDkWVmk6cBhxRJ9FN3oTHvjc6GF9BD9J5Eztu+v6L0wf2dzN9snDfRZ X-Received: by 2002:a05:622a:1047:b0:3bd:11a5:c114 with SMTP id f7-20020a05622a104700b003bd11a5c114mr39429552qte.63.1677485248812; Mon, 27 Feb 2023 00:07:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485248; cv=none; d=google.com; s=arc-20160816; b=mzAMhA3UrT0g4M23EnQh1p/Nlzuky051kAqzz7J16iPBz4JUdXaBNJMp6GoBarIPPq 5+lgRLeDv3BrSq6YodTXKHWA41EFzyvt+V1RD+pkzF+1idEmgu4YJJmyc8XN8b0BebdN 9uS35fDfYrDx2UbrCR8yLNfSK6DiIoPzNAqo2KeGNqWssGH4ouyl7I7jzSToBfvQAHDI kMV64HJYksfjis/xrMPNuY/hMgU/WJN0pg+ANb7XCgl9ooNXSmi4IWUDU5A//DtmWvMa sPq+vCD5OPDpGK7hlaq6hG8+uyx9GEnDD1stWiwyf0NxukLQlFL+sBHVewObnXwttFj5 yKOA== 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=/choyUiuVszNnrsokDt6HTpPjrDSeCtIo9k1KJDgu7s=; b=ekAihGKzlzW1QxmY7FfTJI2vBLz9QbSRZ/MpaPEPkvfgLDyyuHcBpSFy0ld3564xi4 gy4Oe74oSVY8AHdsbhIPooG7BYNZNsDvHV+Uh3yMCrUOj8blni/XkJLGNB5zdCtAASmx WURjvjbASUhBbzFY2SHvryd404W8ig8lu2T8xHeallUcTUKfgrF5uLD2rIk3rw45yoOr 7M5RNr95XZ6f7MVNqsPtRgAaS3IDTOrLqywjkp7pPUn7Ixzvw9skbLtY+9TMpjngXKGw SKfdyiHFzlCp7S35HWmd4gjC2Q1ZgAy5bmIiQ4tsEfvOpc5LlFqLJfFhTUyD1LB4LRe8 asFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AF5C9Lmg; 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 b13-20020ac85bcd000000b003b62f36a410si6158197qtb.151.2023.02.27.00.07.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:07:28 -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=AF5C9Lmg; 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 1pWWJZ-000805-7z; Mon, 27 Feb 2023 00:44:45 -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 1pWWJO-0007H2-QK for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:34 -0500 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWJL-0005dy-OY for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:44:34 -0500 Received: by mail-pf1-x42c.google.com with SMTP id g12so2839257pfi.0 for ; Sun, 26 Feb 2023 21:44:27 -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=/choyUiuVszNnrsokDt6HTpPjrDSeCtIo9k1KJDgu7s=; b=AF5C9Lmg0UhvnWdbZXvAZ+Lk7hBWs8CNaHQFImgWHxGk3E/5zvqoFakRYm42hjbT5M wqLwDp2G0QzETIHVUl4ILfTHqK7mGXlAaCT0EQ7j2yvEJLZDlaqlRvUMqahy9Oc5B9Gq LEK9etg0nY7f3RGVwiCSI/pix5QTYOBWqj8LYkNa6pSdAOO7H6kA9iBXs715hIfcVCja azdc7Fu2nDPdhGZMU5JwjwIjwjc9cNGOPWPxfemTPFS648vliLnRoPHqFJjKgbV0JHNT TZXmlhiA+l+Lwu/VnlOutczFHtP6AVMN3niAV2ybFJH3HnIbXh0co4e9SY2bb7b8a1H+ 7MPQ== 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=/choyUiuVszNnrsokDt6HTpPjrDSeCtIo9k1KJDgu7s=; b=fPPtsRcS2uMR0F6zm8gtVIKvn4MqHbUvqUxMqLa7n7YK8pD+U14IlCEb/+nP8FeuXu B05GH6cR9NzU2llZa/ShJd5lg0IM2OZkRrnA95fCGKa+0j0ubWNTac0HYyKpuyWvOF/Y Q1hCK1kqeKwUO7+1DUN7ueQbp9KNuLcKsXX+28B1Gp2S3ZuXuL4ktCOLzLtPX7/YNK2P cusMksQY/cazzpUxUylHN+O228kEikH5eUYoO5K0W98ZZJHO6euh99cssk1b5/YeCIBF 07s2BSlFBsn8SFEOEgTGWTAZztJdGeRxOh0M6Uxnky5OeEo0kWQg9T6nejXPMp6hb53N S2/A== X-Gm-Message-State: AO0yUKX0bjk5bZKO8BckGjpxDEwA5wK3RB2Yec8IN0SuBz2CGNc//IDI BJDEY8fojATPboIPSnluoSqsRr4EQ6ZXY6Sq9b0= X-Received: by 2002:aa7:960c:0:b0:5a0:c4b6:edd6 with SMTP id q12-20020aa7960c000000b005a0c4b6edd6mr21247336pfg.0.1677476666887; Sun, 26 Feb 2023 21:44:26 -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 d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.44.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:44:26 -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 39/70] target/ppc: Avoid tcg_const_* in vsx-impl.c.inc Date: Sun, 26 Feb 2023 19:42:02 -1000 Message-Id: <20230227054233.390271-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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 All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/translate/vsx-impl.c.inc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc index 9916784e64..0f5b0056f1 100644 --- a/target/ppc/translate/vsx-impl.c.inc +++ b/target/ppc/translate/vsx-impl.c.inc @@ -154,7 +154,7 @@ static void gen_lxvdsx(DisasContext *ctx) static void gen_bswap16x8(TCGv_i64 outh, TCGv_i64 outl, TCGv_i64 inh, TCGv_i64 inl) { - TCGv_i64 mask = tcg_const_i64(0x00FF00FF00FF00FF); + TCGv_i64 mask = tcg_constant_i64(0x00FF00FF00FF00FF); TCGv_i64 t0 = tcg_temp_new_i64(); TCGv_i64 t1 = tcg_temp_new_i64(); @@ -825,7 +825,7 @@ static bool trans_XSCVQPDP(DisasContext *ctx, arg_X_tb_rc *a) REQUIRE_INSNS_FLAGS2(ctx, ISA300); REQUIRE_VSX(ctx); - ro = tcg_const_i32(a->rc); + ro = tcg_constant_i32(a->rc); xt = gen_avr_ptr(a->rt); xb = gen_avr_ptr(a->rb); @@ -860,7 +860,7 @@ static void gen_##name(DisasContext *ctx) \ gen_exception(ctx, POWERPC_EXCP_VSXU); \ return; \ } \ - opc = tcg_const_i32(ctx->opcode); \ + opc = tcg_constant_i32(ctx->opcode); \ gen_helper_##name(cpu_env, opc); \ } @@ -900,7 +900,7 @@ static void gen_##name(DisasContext *ctx) \ gen_exception(ctx, POWERPC_EXCP_VSXU); \ return; \ } \ - opc = tcg_const_i32(ctx->opcode); \ + opc = tcg_constant_i32(ctx->opcode); \ xa = gen_vsr_ptr(xA(ctx->opcode)); \ xb = gen_vsr_ptr(xB(ctx->opcode)); \ gen_helper_##name(cpu_env, opc, xa, xb); \ @@ -915,7 +915,7 @@ static void gen_##name(DisasContext *ctx) \ gen_exception(ctx, POWERPC_EXCP_VSXU); \ return; \ } \ - opc = tcg_const_i32(ctx->opcode); \ + opc = tcg_constant_i32(ctx->opcode); \ xb = gen_vsr_ptr(xB(ctx->opcode)); \ gen_helper_##name(cpu_env, opc, xb); \ } @@ -929,7 +929,7 @@ static void gen_##name(DisasContext *ctx) \ gen_exception(ctx, POWERPC_EXCP_VSXU); \ return; \ } \ - opc = tcg_const_i32(ctx->opcode); \ + opc = tcg_constant_i32(ctx->opcode); \ xt = gen_vsr_ptr(rD(ctx->opcode) + 32); \ xa = gen_vsr_ptr(rA(ctx->opcode) + 32); \ xb = gen_vsr_ptr(rB(ctx->opcode) + 32); \ @@ -945,7 +945,7 @@ static void gen_##name(DisasContext *ctx) \ gen_exception(ctx, POWERPC_EXCP_VSXU); \ return; \ } \ - opc = tcg_const_i32(ctx->opcode); \ + opc = tcg_constant_i32(ctx->opcode); \ xt = gen_vsr_ptr(rD(ctx->opcode) + 32); \ xb = gen_vsr_ptr(rB(ctx->opcode) + 32); \ gen_helper_##name(cpu_env, opc, xt, xb); \ @@ -960,7 +960,7 @@ static void gen_##name(DisasContext *ctx) \ gen_exception(ctx, POWERPC_EXCP_VSXU); \ return; \ } \ - opc = tcg_const_i32(ctx->opcode); \ + opc = tcg_constant_i32(ctx->opcode); \ xa = gen_vsr_ptr(rA(ctx->opcode) + 32); \ xb = gen_vsr_ptr(rB(ctx->opcode) + 32); \ gen_helper_##name(cpu_env, opc, xa, xb); \ @@ -1994,8 +1994,8 @@ static void gen_xsxsigdp(DisasContext *ctx) exp = tcg_temp_new_i64(); t0 = tcg_temp_new_i64(); t1 = tcg_temp_new_i64(); - zr = tcg_const_i64(0); - nan = tcg_const_i64(2047); + zr = tcg_constant_i64(0); + nan = tcg_constant_i64(2047); get_cpu_vsr(t1, xB(ctx->opcode), true); tcg_gen_extract_i64(exp, t1, 52, 11); @@ -2026,8 +2026,8 @@ static void gen_xsxsigqp(DisasContext *ctx) get_cpu_vsr(xbl, rB(ctx->opcode) + 32, false); exp = tcg_temp_new_i64(); t0 = tcg_temp_new_i64(); - zr = tcg_const_i64(0); - nan = tcg_const_i64(32767); + zr = tcg_constant_i64(0); + nan = tcg_constant_i64(32767); tcg_gen_extract_i64(exp, xbh, 48, 15); tcg_gen_movi_i64(t0, 0x0001000000000000); @@ -2193,8 +2193,8 @@ static void gen_xvxsigdp(DisasContext *ctx) get_cpu_vsr(xbl, xB(ctx->opcode), false); exp = tcg_temp_new_i64(); t0 = tcg_temp_new_i64(); - zr = tcg_const_i64(0); - nan = tcg_const_i64(2047); + zr = tcg_constant_i64(0); + nan = tcg_constant_i64(2047); tcg_gen_extract_i64(exp, xbh, 52, 11); tcg_gen_movi_i64(t0, 0x0010000000000000); From patchwork Mon Feb 27 05:42:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656892 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2227416wrb; Mon, 27 Feb 2023 00:10:49 -0800 (PST) X-Google-Smtp-Source: AK7set8L+3QSz7xxyu5xessuWnFLU9yrLIqMugS+svH8d7tpE0bTwVxfaHcA/LK94QQm7NR3b/OV X-Received: by 2002:a05:6214:1c49:b0:56a:d94d:6deb with SMTP id if9-20020a0562141c4900b0056ad94d6debmr46864562qvb.25.1677485449508; Mon, 27 Feb 2023 00:10:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485449; cv=none; d=google.com; s=arc-20160816; b=Bf8ZPpYFMXdP0KKowjyRfMSk0zj5UdfmCw6bhMi1ttx3bK5EbuIkxB2lr5xpkbgYlG 3ICdGnaTPNuVaHU30F/XRlP18lr1XxSo+I3Oic27OEU912NaEeAYXAl3EaslRcttK2tI 37IwA86n8GPVI7GkLLbboi+1o9kPbgmsX876+UI5dGKhzwVGPIGWznEPS3EarYEdv1mf KJrX/JqCm0TMwEbEF6P3RT4JNuApjaGrocgu4w5S/r6cpLKZzui2FU0nx8V6FgonOIV7 j22ndJ0fwk6B04qIqsknek2CFHuAAUrasvMCZhp6Hv9MfTGSRYNgwsCuc2WsLujZQ+91 E6Sg== 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=YED/oFHPDajrG5dAWvXY/hvFs/yeoyJEXCZ48T5LxeE=; b=0IM2kKUQoAp9Tb2aVgj4uZcMGybZ3MMSJynJPBysXNMh4Yw9IEzOTNDhSCYZ1YUrFr PuCLMmIIGqT1jhx6QpUcxGUDUcTV2w7j419KMS4zz3tciem9RvRyPW+2m4xBkxTAn4AI Ly55O8r76zHeoMYdm7Z26NxpN4t4h+mhCUeSoMGTBH+cvytMH68hY9zVfduqRAF//Squ U26/bKKLeaAcR2AYJMp8LOGFfr1925NGb5tUeo0B7OF7rmS7ht68SBZZq6GJ5wgOkY6t KnDVJ5zdUrOh1clVS+P185uILTpNvht6B7mmr9fwOTP94DZU3GYcWA1JSsObpxSgjGnL fDmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rsAiMs6J; 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 a4-20020a0cb344000000b005710a890100si5915090qvf.275.2023.02.27.00.10.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:10:49 -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=rsAiMs6J; 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 1pWWMY-0007yB-0Z; Mon, 27 Feb 2023 00:47:50 -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 1pWWMK-0007lj-AD for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:37 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMH-000717-Vj for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:35 -0500 Received: by mail-pj1-x102f.google.com with SMTP id k21-20020a17090aaa1500b002376652e160so5126451pjq.0 for ; Sun, 26 Feb 2023 21:47:31 -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=YED/oFHPDajrG5dAWvXY/hvFs/yeoyJEXCZ48T5LxeE=; b=rsAiMs6Jz26cs9pkt9TOU/wdcdRHh+JC8lRtf2p6lJtL+0V4rmI1MGx2guf8m9CAbU OXkAoTFb0Py0et4XkuXrBBGYlUmjPKIpOV2DkFnuCf9yvvBo1LBDA3e9YRms99J3oW6e miyaa+giwBvxg1UPJPqMl2dNilwnFdQZIzR23/4quFQD1BHTYtBqVv0zuq9ehLWQIZO6 tgdHd/q6+wBVK5Bl04U1v1Jyucdi6q/JzCvod23sSK+FCF1q6gF4pIeX3KoZ1UNyO106 JFUXEhdpRijeZG91FofTxV8uIsn5s8CA9lgMKcyh4C2DxZb1MSIB9AhVU0ng47V2X5s0 jgeQ== 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=YED/oFHPDajrG5dAWvXY/hvFs/yeoyJEXCZ48T5LxeE=; b=YkEtIjVosQa1/A0SMsEmvQuuzcG14MofOmr2GvclzmqrR8/f9wFpClO7fqDNG7Cz50 cuZvMhE2To/pkYF4P/ai4HAvChuschtG4w6SuW9BT0UJ8HsRy9MBg5NZ4wf/TPdJOmRx qVSwcnBRdoiiz5j4Zi9yXcvU+7dmcHHvFSzT/HaaMYm+tu6ySDR8Bvm3XyIVz6qracSm AF+vKzuc1TBejjb9Srfc15qx7FLGkdbmgayVbNONI5dDPbpAql/1fVfXFsEd7x6pvPAe VEbbB60CA6cy+sy4nyQEeqV0k5HhoQkyHZ95lqbslrMcfmCgLfh9cMrmZO7EioFGGKip paGQ== X-Gm-Message-State: AO0yUKXsmSPj+rsppfwY2C+9SgUUxm+7WVshGS4bB05/Ls+vvP4Nxxjd oglKInXl2jgAKpb3vsteLBFAYlQFVAcSIe+cznM= X-Received: by 2002:a17:903:110e:b0:19c:ac96:223b with SMTP id n14-20020a170903110e00b0019cac96223bmr18961544plh.40.1677476851065; Sun, 26 Feb 2023 21:47:31 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:30 -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 40/70] target/ppc: Avoid tcg_const_* in fp-impl.c.inc Date: Sun, 26 Feb 2023 19:42:03 -1000 Message-Id: <20230227054233.390271-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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 All uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/translate/fp-impl.c.inc | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/target/ppc/translate/fp-impl.c.inc b/target/ppc/translate/fp-impl.c.inc index d5d88e7d49..57d8437851 100644 --- a/target/ppc/translate/fp-impl.c.inc +++ b/target/ppc/translate/fp-impl.c.inc @@ -348,7 +348,7 @@ static void gen_fcmpo(DisasContext *ctx) t0 = tcg_temp_new_i64(); t1 = tcg_temp_new_i64(); gen_reset_fpstatus(); - crf = tcg_const_i32(crfD(ctx->opcode)); + crf = tcg_constant_i32(crfD(ctx->opcode)); get_fpr(t0, rA(ctx->opcode)); get_fpr(t1, rB(ctx->opcode)); gen_helper_fcmpo(cpu_env, t0, t1, crf); @@ -368,7 +368,7 @@ static void gen_fcmpu(DisasContext *ctx) t0 = tcg_temp_new_i64(); t1 = tcg_temp_new_i64(); gen_reset_fpstatus(); - crf = tcg_const_i32(crfD(ctx->opcode)); + crf = tcg_constant_i32(crfD(ctx->opcode)); get_fpr(t0, rA(ctx->opcode)); get_fpr(t1, rB(ctx->opcode)); gen_helper_fcmpu(cpu_env, t0, t1, crf); @@ -541,7 +541,7 @@ static void gen_mcrfs(DisasContext *ctx) tcg_gen_andi_i64(tnew_fpscr, tnew_fpscr, ~((0xF << shift) & FP_EX_CLEAR_BITS)); /* FEX and VX need to be updated, so don't set fpscr directly */ - tmask = tcg_const_i32(1 << nibble); + tmask = tcg_constant_i32(1 << nibble); gen_helper_store_fpscr(cpu_env, tnew_fpscr, tmask); } @@ -681,9 +681,7 @@ static void gen_mtfsb0(DisasContext *ctx) crb = 31 - crbD(ctx->opcode); gen_reset_fpstatus(); if (likely(crb != FPSCR_FEX && crb != FPSCR_VX)) { - TCGv_i32 t0; - t0 = tcg_const_i32(crb); - gen_helper_fpscr_clrbit(cpu_env, t0); + gen_helper_fpscr_clrbit(cpu_env, tcg_constant_i32(crb)); } if (unlikely(Rc(ctx->opcode) != 0)) { tcg_gen_trunc_tl_i32(cpu_crf[1], cpu_fpscr); @@ -703,9 +701,7 @@ static void gen_mtfsb1(DisasContext *ctx) crb = 31 - crbD(ctx->opcode); /* XXX: we pretend we can only do IEEE floating-point computations */ if (likely(crb != FPSCR_FEX && crb != FPSCR_VX && crb != FPSCR_NI)) { - TCGv_i32 t0; - t0 = tcg_const_i32(crb); - gen_helper_fpscr_setbit(cpu_env, t0); + gen_helper_fpscr_setbit(cpu_env, tcg_constant_i32(crb)); } if (unlikely(Rc(ctx->opcode) != 0)) { tcg_gen_trunc_tl_i32(cpu_crf[1], cpu_fpscr); @@ -733,10 +729,12 @@ static void gen_mtfsf(DisasContext *ctx) gen_inval_exception(ctx, POWERPC_EXCP_INVAL_INVAL); return; } - if (l) { - t0 = tcg_const_i32((ctx->insns_flags2 & PPC2_ISA205) ? 0xffff : 0xff); + if (!l) { + t0 = tcg_constant_i32(flm << (w * 8)); + } else if (ctx->insns_flags2 & PPC2_ISA205) { + t0 = tcg_constant_i32(0xffff); } else { - t0 = tcg_const_i32(flm << (w * 8)); + t0 = tcg_constant_i32(0xff); } t1 = tcg_temp_new_i64(); get_fpr(t1, rB(ctx->opcode)); @@ -767,8 +765,8 @@ static void gen_mtfsfi(DisasContext *ctx) return; } sh = (8 * w) + 7 - bf; - t0 = tcg_const_i64(((uint64_t)FPIMM(ctx->opcode)) << (4 * sh)); - t1 = tcg_const_i32(1 << sh); + t0 = tcg_constant_i64(((uint64_t)FPIMM(ctx->opcode)) << (4 * sh)); + t1 = tcg_constant_i32(1 << sh); gen_helper_store_fpscr(cpu_env, t0, t1); if (unlikely(Rc(ctx->opcode) != 0)) { tcg_gen_trunc_tl_i32(cpu_crf[1], cpu_fpscr); From patchwork Mon Feb 27 05:42:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656923 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2230627wrb; Mon, 27 Feb 2023 00:21:24 -0800 (PST) X-Google-Smtp-Source: AK7set9Z+hZjSrRf8nCiaK9cjc39oq+nm/HNo9kML2bvEIcMe3LJhegOuz1w4KXDd3Als3STMdyY X-Received: by 2002:ac8:5f54:0:b0:3bd:16cf:2f10 with SMTP id y20-20020ac85f54000000b003bd16cf2f10mr35733420qta.35.1677486083821; Mon, 27 Feb 2023 00:21:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486083; cv=none; d=google.com; s=arc-20160816; b=lQAhvJrY9fpidakgUZi/QLYpXnj6fHBrI1VnQ+9aSsYJPEGbMB+UINXXBi8Tnk0w5l Zfuc1aUQGKAexjBbOSVYZpREL9ez7gAO823bbSd3QCpOw7l6cj/BngF7Tc4B/VTmJR56 knPWM0/fAhx21kpzqv9+ss1yQOTF3JV/k7NNVHbMUd1yCbSNG2iCvdEaDfKdakOdQ59J CGaHIImLZVlMTy2S00D5cQOypfZle/rFJzgCJAm7IOUp7FnFw6to0rjY1Gyb8UKrj7W7 HK9xpPT2mYEN/qDPQpjHsgSkXnkPGhVkpEKt9ipUrKSb5AzMRnfIy6eLFanSbRWMtQOo oDTA== 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=7jpkfH5p2t23I+xxdw6uRxaIWCvz9AwC1FPMX8AE4Sw=; b=NpAYVseyFj3mKPSd4T1zLpiNJeCAeWaEcJFLcANM5a2OyF6uJCtEM00vJ4AiFUVTa/ wAOv0TMTrw+wVX8daT4vrq+sfiEYoVBRXH62bFkpSN32brfP2+YLYWxxOcoeCCMHqNTd FL9gBLybaSH7Zqp9hSa/+YzWuBTQepf40uzndL3/rqv1PwZO47S2dsmfYZuQ0+qAQgE2 t6eShhC3eFykusQt0BIZ9ABBesJ4abEpm4ZrMJ3Mwu4bdqsdorrPbf8cmYjv/7a4yE67 Z24S3plrOhVqKmnnKp68VX2yushKFZGNlnnaUxyzz7n9pgbN/x0uWvfAp6zOxEJKCZyB H6qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lro8Bsse; 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 h20-20020a05620a401400b0073b425f6e7esi6195898qko.594.2023.02.27.00.21.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:21:23 -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=Lro8Bsse; 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 1pWWMa-0008Rr-8V; Mon, 27 Feb 2023 00:47:52 -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 1pWWMQ-0007si-B3 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:43 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMK-000720-3O for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:39 -0500 Received: by mail-pl1-x635.google.com with SMTP id y11so1419543plg.1 for ; Sun, 26 Feb 2023 21:47:34 -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=7jpkfH5p2t23I+xxdw6uRxaIWCvz9AwC1FPMX8AE4Sw=; b=Lro8BsseqHGybYNgGZTW5kKipHMTdLqzlo09sIqP0ssDcJsIbE8jcI5suoLiMdvSbr yOnfrtnvistm/rh7rf0Hm/4aVGCdcfrjUXvn5HYHtL9+dv1r1NkEMz6cWfwSK9YFzjee 4mn/+XfgEJy1Wr0JUDSQHcLBvWJ1RQfsDgq/R3D1bDtKS6AUhgfm0hwlmJpw0v/lN/IB YuklpKgOsGfxlUr27BzY1CnEz5R1vBD4PogSBJV82UmGhIy7QtpdAQH/fGLTj3I3E6+U VVRMRbYRaL1pweVZAdQtWH3ue5vyBcfUMYG+/eWGyf50H3Gyu0H+9XgAwjphCFekT5z4 B6vw== 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=7jpkfH5p2t23I+xxdw6uRxaIWCvz9AwC1FPMX8AE4Sw=; b=KFhiF+4eSiJxZ7BkEp92qc+ZjP7mcQ1+3o1bZQubqgh54gE0ymr9cAuhvpCRG3cLaP To/odC25yO8hhKof6WU7l6D1BE9awOkMSYhrSgIB8h4FUcynmlbIWjT7J9Hcz46Z1mwr t6CtbYKMmVQJGzfDuFgErrFonNtXaNc4rsaxnNRtVDbmn533ks2a18lETL7vW0LFgCN2 JFak3n0mhWJ40ErTHqfpI3JS+jBCrwTiYUJ+63tuYvUHUYgY16tMVd/47tPyx0f9Dgkq OD3wx8DNuIdRKwVGapp/QtKmBDPFdXZSPTu+UD50UMpexo18vMgEYsIfVZi1yEFq7l0i wgag== X-Gm-Message-State: AO0yUKXKRoknjf15C+jFaw/tTCntZCPGw500hn7rznhjPtbf/kc+q/Fa bPeRbhPmDpDVAj9azXah/uhLdalYgnfydvl/e4I= X-Received: by 2002:a17:903:41cd:b0:19a:a9d8:e47f with SMTP id u13-20020a17090341cd00b0019aa9d8e47fmr30574088ple.36.1677476853562; Sun, 26 Feb 2023 21:47:33 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:33 -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 41/70] target/ppc: Avoid tcg_const_* in power8-pmu-regs.c.inc Date: Sun, 26 Feb 2023 19:42:04 -1000 Message-Id: <20230227054233.390271-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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 All uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/power8-pmu-regs.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/ppc/power8-pmu-regs.c.inc b/target/ppc/power8-pmu-regs.c.inc index 42f2cd04a1..d900e13cad 100644 --- a/target/ppc/power8-pmu-regs.c.inc +++ b/target/ppc/power8-pmu-regs.c.inc @@ -177,7 +177,7 @@ void spr_write_MMCR2_ureg(DisasContext *ctx, int sprn, int gprn) void spr_read_PMC(DisasContext *ctx, int gprn, int sprn) { - TCGv_i32 t_sprn = tcg_const_i32(sprn); + TCGv_i32 t_sprn = tcg_constant_i32(sprn); gen_icount_io_start(ctx); gen_helper_read_pmc(cpu_gpr[gprn], cpu_env, t_sprn); @@ -210,7 +210,7 @@ void spr_read_PMC56_ureg(DisasContext *ctx, int gprn, int sprn) void spr_write_PMC(DisasContext *ctx, int sprn, int gprn) { - TCGv_i32 t_sprn = tcg_const_i32(sprn); + TCGv_i32 t_sprn = tcg_constant_i32(sprn); gen_icount_io_start(ctx); gen_helper_store_pmc(cpu_env, t_sprn, cpu_gpr[gprn]); From patchwork Mon Feb 27 05:42:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656885 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2226116wrb; Mon, 27 Feb 2023 00:06:51 -0800 (PST) X-Google-Smtp-Source: AK7set8c+Xa9gTy9xfnOFJPlFp/tNw6BNzm8W57ZX07jgsTAUwVPgv5l0DVyhXU1VS5PONLGCwX1 X-Received: by 2002:ac8:4e4d:0:b0:3bd:1728:8881 with SMTP id e13-20020ac84e4d000000b003bd17288881mr32512132qtw.19.1677485211088; Mon, 27 Feb 2023 00:06:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485211; cv=none; d=google.com; s=arc-20160816; b=P8oNP6QGIZA2yMTxONWSnlMc6MVmMkzeafKWYZpA5XSBCxtv22LAE+32DlILugiSaA sMkQPTCBP/PLAH/xk0PyXYjHvdCbQe1jJ3Iomq/e6cZoa6uX0n1WPlOTMc1fL0rhY6FR pRn/2ONvjlf9E/csAxKSGG89WoEjEgjk3rxLjQJFPrpWSHZ55V8jKXp6b7o822bG0vQ2 PjixRcHQa/64JcOvHQg01umXQ0IgXv3jwFLNdmLIWbuAhyuXMqeE3a1hiXQRvH1G+LLs G7YsIWE9fUNB+xIfCxBZr6ynv3waFF0YKObrUYu4/Sw7Gdl3SSEz5lKPJq9zxbbu+HLv RV2g== 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=8BcaG/n519i/UBItiVRrFltGPWM55r+QU3b/X76kpm8=; b=T7lv/A4YJ+jIrLx0cX6lQvQJNOeMpvxWj0Xpb7NNjQDvl4M2LF2EiikNk6Qi6b81G8 2G/namK/dAdxtKctaOPDzTzazsr2nFnogef5KsIlyDd+vzlyNYKyKg7eZ/xOkdk5c29r Znz7TxzE940FYUy862QvvaVr8nb7HZ+/hK6YSXLdUEE/CEgg7qCF2ALQDKQb5YAt7UkS ITjTTPs5p4rM++4RUI2tqHtp8pgEAe1YRQErnAPyTH7+EfeDNWUjyQBVKHiO8AAl/O+V Yy8wSSaZGZ+5yrLs4DdSp2aoNf+RWTWCzO2vzz/HoSe6dYvADFxJ1jaxG4E7p4Ij2JyV PKeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uBRKeu2X; 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 g13-20020ac87f4d000000b003bcda120a13si6259224qtk.644.2023.02.27.00.06.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:06:51 -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=uBRKeu2X; 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 1pWWMi-000114-0Q; Mon, 27 Feb 2023 00:48:00 -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 1pWWMQ-0007t3-EO for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:43 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWML-00073L-Tb for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:40 -0500 Received: by mail-pl1-x62c.google.com with SMTP id ky4so5588132plb.3 for ; Sun, 26 Feb 2023 21:47:36 -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=8BcaG/n519i/UBItiVRrFltGPWM55r+QU3b/X76kpm8=; b=uBRKeu2Xmcd8eMU0ZConFG8KN7cYHLICJP4BWWLwIhy8BLztChKsQ3rqXClgEmg3Qt 6ByFvOtp1TigauK7d6/Q3/vaRpTJMbJPSxagSUOUh+I0FBC1LyLdq4H+BuBELyBM+obF 6+qCna20LN3HGmQr1cI59923FqwtjQE0lh9LfS9hX92tnY2oCK/IgJ4DDjn7wdq4ublX 5eTdMv9G9HONpW5Ls9FEEpUKgE2fJRhwT409TgXX7OHm6yuAXdgXf6jkTSX0HSZTMnvS v0DXR65Pv+pp6Bsf1fCW46yIKBV39N5Rz5XGc6WhcBxRq1kQJ2ItrFBCmK3JXDwXlv4F nnWg== 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=8BcaG/n519i/UBItiVRrFltGPWM55r+QU3b/X76kpm8=; b=BHjK1TBQ/qQiTPJCjXg0XmR09HTu7CLLfprFHcPfnyMOcqxET5lpB5JP0qnsjE7S5m StQxqlIFhoIKzudWz164HlbsnqHDsCRhsCTJJYgHR9fMIOHfytK/yJ8H6SZPba8jRvkr Z81Pmxj5IqrDxF9cFDVyKaTOV3A6cncFd65RQFfpkiEIBve22J05FrGT6ACs4SlNlNzl JkI3McaH8Y7ZxPvuGeqngHqc4Am1u8AdHceMYLN45G+M3mTjcC3IQ1JrDS4EfqJYCVsx HGKCrZurnaXZSPKUuVPZ1UJqyf1Wpi6v8OR7D8v9i8B17z56sygh61HqgUoGw138omld pQRg== X-Gm-Message-State: AO0yUKWzpEzYf3fCv77Tf8EnLcCknhC7e6974geTQU5L6aoZxLS2aqyX AHQVPdAjEQLqfdcS9o1Yf9UMkIUYEjnJnNw8mRU= X-Received: by 2002:a17:903:244c:b0:19a:95ab:6b63 with SMTP id l12-20020a170903244c00b0019a95ab6b63mr26740975pls.66.1677476856036; Sun, 26 Feb 2023 21:47:36 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:35 -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 42/70] target/ppc: Rewrite trans_ADDG6S Date: Sun, 26 Feb 2023 19:42:05 -1000 Message-Id: <20230227054233.390271-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Compute all carry bits in parallel instead of a loop. Signed-off-by: Richard Henderson --- target/ppc/translate/fixedpoint-impl.c.inc | 44 +++++++++++----------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/target/ppc/translate/fixedpoint-impl.c.inc b/target/ppc/translate/fixedpoint-impl.c.inc index 20ea484c3d..02d86b77a8 100644 --- a/target/ppc/translate/fixedpoint-impl.c.inc +++ b/target/ppc/translate/fixedpoint-impl.c.inc @@ -484,33 +484,35 @@ static bool trans_PEXTD(DisasContext *ctx, arg_X *a) static bool trans_ADDG6S(DisasContext *ctx, arg_X *a) { - const uint64_t carry_bits = 0x1111111111111111ULL; - TCGv t0, t1, carry, zero = tcg_constant_tl(0); + const target_ulong carry_bits = (target_ulong)-1 / 0xf; + TCGv in1, in2, carryl, carryh, tmp; + TCGv zero = tcg_constant_tl(0); REQUIRE_INSNS_FLAGS2(ctx, BCDA_ISA206); - t0 = tcg_temp_new(); - t1 = tcg_const_tl(0); - carry = tcg_const_tl(0); + in1 = cpu_gpr[a->ra]; + in2 = cpu_gpr[a->rb]; + tmp = tcg_temp_new(); + carryl = tcg_temp_new(); + carryh = tcg_temp_new(); - for (int i = 0; i < 16; i++) { - tcg_gen_shri_tl(t0, cpu_gpr[a->ra], i * 4); - tcg_gen_andi_tl(t0, t0, 0xf); - tcg_gen_add_tl(t1, t1, t0); + /* Addition with carry. */ + tcg_gen_add2_tl(carryl, carryh, in1, zero, in2, zero); + /* Addition without carry. */ + tcg_gen_xor_tl(tmp, in1, in2); + /* Difference between the two is carry in to each bit. */ + tcg_gen_xor_tl(carryl, carryl, tmp); - tcg_gen_shri_tl(t0, cpu_gpr[a->rb], i * 4); - tcg_gen_andi_tl(t0, t0, 0xf); - tcg_gen_add_tl(t1, t1, t0); + /* + * The carry-out that we're looking for is the carry-in to + * the next nibble. Shift the double-word down one nibble, + * which puts all of the bits back into one word. + */ + tcg_gen_extract2_tl(carryl, carryl, carryh, 4); - tcg_gen_andi_tl(t1, t1, 0x10); - tcg_gen_setcond_tl(TCG_COND_NE, t1, t1, zero); - - tcg_gen_shli_tl(t0, t1, i * 4); - tcg_gen_or_tl(carry, carry, t0); - } - - tcg_gen_xori_tl(carry, carry, (target_long)carry_bits); - tcg_gen_muli_tl(cpu_gpr[a->rt], carry, 6); + /* Invert, isolate the carry bits, and produce 6's. */ + tcg_gen_andc_tl(carryl, tcg_constant_tl(carry_bits), carryl); + tcg_gen_muli_tl(cpu_gpr[a->rt], carryl, 6); return true; } From patchwork Mon Feb 27 05:42:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656929 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2231519wrb; Mon, 27 Feb 2023 00:24:26 -0800 (PST) X-Google-Smtp-Source: AK7set9i9i+VAaXmAfzbCqny3Z1X1QRRrqjUEbXLsHRaDYCgPvoA7keU7xVvtvxvXh8ba/dW3Nta X-Received: by 2002:ac8:5c0c:0:b0:3b6:2f3f:2713 with SMTP id i12-20020ac85c0c000000b003b62f3f2713mr42582331qti.25.1677486266287; Mon, 27 Feb 2023 00:24:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486266; cv=none; d=google.com; s=arc-20160816; b=B4oyi5Bf3//GioFMGJYJ9U/2eMKHBu1wsdmHYzVBjH0PktczWIV8pc4yqfw4j5a0gJ wWrj6fWhm26XmilfxuLxczRGLBlfwPtMYo6fL5tHWtjccHNDwUY+j82LigK9v5OF3wWR HX/cR1C7VYk9ZKJvUwDizZ0nLHldBGGWnfTeBHGE+E6gBFgUXq5acqOWnRbsHBbNpXZ6 k34A/+xTO5jQJkZ1qnflM48RL0+HZq2T7C92OPZ4b7rDkbuGMy/LqSmEcXHncv/WBTa7 8ZWcFI5lZEkYp0SeywzrCktA2Y7Dq3dW2dKKiFNFOkjgPxGlxj4+kbLBbSEqYlL/Bium oiyQ== 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=YPI3gM35f9kqtK6SwX2bfmUKEAAhOjVzMIqtanR4H+c=; b=qMlfhczcCpbd7dtbdExGxkeav3EOIAIwviLH2MuFbhh2mtUyiSZpixUy7GyNnXYIx7 xtHcPlWzQRocO1yh16i/H4jHaqYuxHkv+sb/nP0gIEuxjLtMyNsc9lgIx/GFoq0BN3t5 ipS+X/AAZwkUEHTWmx6Tbxtao74zJlkT/zRfJZrNfZl9L6ydez/qK0L/EaB1throgoWg hdXxWyH53QVkOKZUS8DJVsfE052/ARkuMa2Y2o+1KW+aaBEAC5MoVTiKQu96yc3crfoY CZmFbHFyaLa4kj8eQicjHkOahWDDFC11hrCtABDkwxBok1WGRHZ82B2c5xsQmzA8NAxq rPnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wqCQ2XqR; 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 d2-20020a05622a100200b003ba2a171913si5906650qte.578.2023.02.27.00.24.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:24:26 -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=wqCQ2XqR; 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 1pWWMl-0001Nv-Bq; Mon, 27 Feb 2023 00:48:03 -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 1pWWMW-00087B-Lc for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:49 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMP-00074i-RB for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:47 -0500 Received: by mail-pl1-x630.google.com with SMTP id y11so1419682plg.1 for ; Sun, 26 Feb 2023 21:47:39 -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=YPI3gM35f9kqtK6SwX2bfmUKEAAhOjVzMIqtanR4H+c=; b=wqCQ2XqRqzMwN4CQ1dMPlJbwaxJMem8BYVNyRiptWNHYpZxnGZeVHhk43Xi4vzKBrI CUpIExMkypOscQNrlsDv090uQq0bnoJjvnBXcJ1KF43910HLsXYnN+vvdaRHOxlK58Vc rlRyFHxYDH7UXsLf0t3TqLyfX1HnowEAljpUYrqY5NRJudz3SrBK5YAzo6L8ZraZFzTd YioOkzvnQotfLB7lh4GOfujgB9BanYK5Dgve/G7GIJU+PpEmsrIRU3IsoNzZ4sw1j7Tl Nx1kQDJiaSCKUDlbQ2xossFWsnn8RnXdY7qFOMUO1qWedArYZes1DZjV6IcqJT6XIFJy U0pw== 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=YPI3gM35f9kqtK6SwX2bfmUKEAAhOjVzMIqtanR4H+c=; b=sYiYb7mazbWWbUO3YaAaHEKijTgcil3G402io50F5IT9f8uyuN41tsmxLHEjo1ktRo YaHVavd+RM+Zm1jhz2fh9DFZVJY5ZBnbUedePJj8uihd9hehLgeoDwq+Sa0KfZYz17km Kz0UBGFcUlL1NkSQiECVE/peHkQ4Va1ml5+EreKrweWBOad2E97LkXLOHnklwyD8j8Ru r+d8Imjnau9b1QJ3oKIBH86+ka5aaqIEquGn8ty9FV1ViS7m33AZQ9erFqOZsxBaxT4l acyJnvbP8mdbYRDvWI288Y0MbRFn7yGj026Smhz6TrTH3OchzEqxTNkImAz9MWlEW43a zfxg== X-Gm-Message-State: AO0yUKWpS1clX5ZwLTV+hUXYTqSk/hYlSvF0Sjpq771W11jde9RsGmbv fJFDpk7KF/gNFxPVOYK3M67RGYIoRBeHOzgVWP0= X-Received: by 2002:a17:903:2903:b0:19d:2542:96b7 with SMTP id lh3-20020a170903290300b0019d254296b7mr339748plb.39.1677476858650; Sun, 26 Feb 2023 21:47:38 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:38 -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 43/70] target/ppc: Fix gen_tlbsx_booke206 Date: Sun, 26 Feb 2023 19:42:06 -1000 Message-Id: <20230227054233.390271-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 Fix incorrect read from rD. Avoid adding 0 when rA == 0. Signed-off-by: Richard Henderson --- target/ppc/translate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index f74f3b8f0d..52b812a01f 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -5867,12 +5867,10 @@ static void gen_tlbsx_booke206(DisasContext *ctx) CHK_SV(ctx); if (rA(ctx->opcode)) { t0 = tcg_temp_new(); - tcg_gen_mov_tl(t0, cpu_gpr[rD(ctx->opcode)]); + tcg_gen_add_tl(t0, cpu_gpr[rA(ctx->opcode)], cpu_gpr[rB(ctx->opcode)]); } else { - t0 = tcg_const_tl(0); + t0 = cpu_gpr[rB(ctx->opcode)]; } - - tcg_gen_add_tl(t0, t0, cpu_gpr[rB(ctx->opcode)]); gen_helper_booke206_tlbsx(cpu_env, t0); #endif /* defined(CONFIG_USER_ONLY) */ } From patchwork Mon Feb 27 05:42:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656909 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2229629wrb; Mon, 27 Feb 2023 00:17:59 -0800 (PST) X-Google-Smtp-Source: AK7set8FRA1zvKKlaYVYO60c8Dxu4DKw5CEoBUDoRWGJEbKSNVDtRD11S40wZsohxwkkVSR4ahvj X-Received: by 2002:a05:6214:248c:b0:56e:9551:196b with SMTP id gi12-20020a056214248c00b0056e9551196bmr45144610qvb.3.1677485879527; Mon, 27 Feb 2023 00:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485879; cv=none; d=google.com; s=arc-20160816; b=r6JrMSKhs1LTM+qtg9yrSiWxlaFO+soTZpwVH20Q5GECoItyR8MXmKY4DO9SAJuV+n 2/YZkTFaVUdHAh7yrMPTQ7JFl3jNChtSSewpXyukYlh9CIMLkZdOTA4EdM2O5mqR2WPh rJMFcPN5dZ/PmsssWUMK+atMsyPfv/49rsxM0i/lc1cuJv5l9aAE6xBal92a/bkgAdpE G8pjung1bGAdJ+Jj/9UtXI6uhpgwntxKoLKuRz1bJBhdQuRY8rcqI8zbTmE2J0YwOdkI emcsRucjFdDZyrfoMY6ODIaJrDzG6Yc4o48Mbj0Jz1MU/xFhiNDH7T+tUEtAk6+TprLu wbiQ== 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=fcr99wziH116ux009K4xDB5EATn9J5O54brfNdbRB7g=; b=IIx0ne+CBPHZqBAdFYou92bNuyuyZNeDJQajMeAFqC0K5JP6VzFJXARNmq3YQ43dod OBv80YCd9ExJ2EOiLbUw3KFUmdOi6M3RYR/zd2LJTH8imUaeI6paidoDF/FvqUENpVQQ Iu80xnXvma9c/jzTzYEH9h61+OAarY1pjQixtvQwSFJsfkIJHjzy2i9INbKNJ4eE7BhC o9Gcr2nnem/UrdyCaNks1wUd1x3Ys+Oj6JjwmK1CKdGa+q20Y1JAtv6x9EUHfgoM9rJE BqGeZSoZuCUJaaVMZlesTdZl3fPtvClnhsQQ5VXfR7eDxYwCcIUMnaVT0FQa+e/vGaUG M6JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gEUYIQ8K; 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 206-20020a370ad7000000b0070695f77965si5473239qkk.340.2023.02.27.00.17.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:17:59 -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=gEUYIQ8K; 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 1pWWMf-0000h8-Kh; Mon, 27 Feb 2023 00:47:57 -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 1pWWMZ-0008Ll-DC for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:51 -0500 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMS-00075s-PD for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:50 -0500 Received: by mail-pj1-x1043.google.com with SMTP id h17-20020a17090aea9100b0023739b10792so5089973pjz.1 for ; Sun, 26 Feb 2023 21:47:42 -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=fcr99wziH116ux009K4xDB5EATn9J5O54brfNdbRB7g=; b=gEUYIQ8KRZTSdiSuyJjzlkSX6XB1me6R7t+4Dc8EjWbfgfGKdESQaQGnHnAGrSSQHQ YSHC3y56CgC/2wu7ItjTm1QiYtDHiIkqIWOotN71Mz36aARhvTvoYF3E/9afpInV2NWG aHxNz79HgO+GeDqQuD5EELhfKSLvEhYcLgfvvHm4TSGvWw3bhAR6bbokFrZy64M+iUTI 8DW+1L7RjVcRUGiHeBosDDGkZkz1er5UOzwAq6yUh0nEPz3E8qGv8UbWFaAEbbJBEjQ1 zt79jHhRJ2LLI9/EPfJyIVtMmIX/J9qfTS3uGG6jUh5a74pA+Myr6fwgcgkpfiz8B0Wr 1emA== 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=fcr99wziH116ux009K4xDB5EATn9J5O54brfNdbRB7g=; b=NW6wCUJDv42Nijo/6xWbV+FIzIQamOdLj7LZ9Cr8aC90A+H3WF22/vsOHJoH4GIzW7 iWU1t4CsT8NP/UEdMm3o/vNZQQVh2lEON+445KaDRDp71/8ibey7p2rkfLJ/ipxC9XtQ 1HdJNiu1DYycfQFDvyMp+GeCo2zx83AGY7e0ni2Hlo5SaqxIwTsn8ejQtvuxSeyw8C7f +EZDpQ0nJ6e1pyNL7op0v2slHgKurOSrnI6RL4E6socbiFbCPij3edu7kl72EiNk+KrI HV6RI5d+ldyR4M9IWZ44OMTixHFDZJyOim4YHv5mR0W79vH3MBVL1KnrLfhaQZVjUbja /Dyw== X-Gm-Message-State: AO0yUKUCzIf7W9WTkp/m6MEIen04FqtUnI1UM2RYpRWoCmn27zBoF2pa O0gwgXgbU3nuqmi/NT95fqbtAWUlDG1GNR1MV67xgw== X-Received: by 2002:a17:902:fb8c:b0:19c:f2d5:5830 with SMTP id lg12-20020a170902fb8c00b0019cf2d55830mr5703241plb.44.1677476861383; Sun, 26 Feb 2023 21:47:41 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:40 -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 44/70] target/ppc: Avoid tcg_const_* in translate.c Date: Sun, 26 Feb 2023 19:42:07 -1000 Message-Id: <20230227054233.390271-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1043.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org All remaining uses are strictly read-only. Signed-off-by: Richard Henderson --- target/ppc/translate.c | 142 +++++++++++++++++++++-------------------- 1 file changed, 72 insertions(+), 70 deletions(-) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 52b812a01f..fb545423f5 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -263,8 +263,8 @@ static void gen_exception_err(DisasContext *ctx, uint32_t excp, uint32_t error) * faulting instruction */ gen_update_nip(ctx, ctx->cia); - t0 = tcg_const_i32(excp); - t1 = tcg_const_i32(error); + t0 = tcg_constant_i32(excp); + t1 = tcg_constant_i32(error); gen_helper_raise_exception_err(cpu_env, t0, t1); ctx->base.is_jmp = DISAS_NORETURN; } @@ -278,7 +278,7 @@ static void gen_exception(DisasContext *ctx, uint32_t excp) * faulting instruction */ gen_update_nip(ctx, ctx->cia); - t0 = tcg_const_i32(excp); + t0 = tcg_constant_i32(excp); gen_helper_raise_exception(cpu_env, t0); ctx->base.is_jmp = DISAS_NORETURN; } @@ -289,7 +289,7 @@ static void gen_exception_nip(DisasContext *ctx, uint32_t excp, TCGv_i32 t0; gen_update_nip(ctx, nip); - t0 = tcg_const_i32(excp); + t0 = tcg_constant_i32(excp); gen_helper_raise_exception(cpu_env, t0); ctx->base.is_jmp = DISAS_NORETURN; } @@ -386,7 +386,7 @@ void spr_noaccess(DisasContext *ctx, int gprn, int sprn) static void spr_load_dump_spr(int sprn) { #ifdef PPC_DUMP_SPR_ACCESSES - TCGv_i32 t0 = tcg_const_i32(sprn); + TCGv_i32 t0 = tcg_constant_i32(sprn); gen_helper_load_dump_spr(cpu_env, t0); #endif } @@ -400,7 +400,7 @@ void spr_read_generic(DisasContext *ctx, int gprn, int sprn) static void spr_store_dump_spr(int sprn) { #ifdef PPC_DUMP_SPR_ACCESSES - TCGv_i32 t0 = tcg_const_i32(sprn); + TCGv_i32 t0 = tcg_constant_i32(sprn); gen_helper_store_dump_spr(cpu_env, t0); #endif } @@ -672,25 +672,25 @@ void spr_read_ibat_h(DisasContext *ctx, int gprn, int sprn) void spr_write_ibatu(DisasContext *ctx, int sprn, int gprn) { - TCGv_i32 t0 = tcg_const_i32((sprn - SPR_IBAT0U) / 2); + TCGv_i32 t0 = tcg_constant_i32((sprn - SPR_IBAT0U) / 2); gen_helper_store_ibatu(cpu_env, t0, cpu_gpr[gprn]); } void spr_write_ibatu_h(DisasContext *ctx, int sprn, int gprn) { - TCGv_i32 t0 = tcg_const_i32(((sprn - SPR_IBAT4U) / 2) + 4); + TCGv_i32 t0 = tcg_constant_i32(((sprn - SPR_IBAT4U) / 2) + 4); gen_helper_store_ibatu(cpu_env, t0, cpu_gpr[gprn]); } void spr_write_ibatl(DisasContext *ctx, int sprn, int gprn) { - TCGv_i32 t0 = tcg_const_i32((sprn - SPR_IBAT0L) / 2); + TCGv_i32 t0 = tcg_constant_i32((sprn - SPR_IBAT0L) / 2); gen_helper_store_ibatl(cpu_env, t0, cpu_gpr[gprn]); } void spr_write_ibatl_h(DisasContext *ctx, int sprn, int gprn) { - TCGv_i32 t0 = tcg_const_i32(((sprn - SPR_IBAT4L) / 2) + 4); + TCGv_i32 t0 = tcg_constant_i32(((sprn - SPR_IBAT4L) / 2) + 4); gen_helper_store_ibatl(cpu_env, t0, cpu_gpr[gprn]); } @@ -712,25 +712,25 @@ void spr_read_dbat_h(DisasContext *ctx, int gprn, int sprn) void spr_write_dbatu(DisasContext *ctx, int sprn, int gprn) { - TCGv_i32 t0 = tcg_const_i32((sprn - SPR_DBAT0U) / 2); + TCGv_i32 t0 = tcg_constant_i32((sprn - SPR_DBAT0U) / 2); gen_helper_store_dbatu(cpu_env, t0, cpu_gpr[gprn]); } void spr_write_dbatu_h(DisasContext *ctx, int sprn, int gprn) { - TCGv_i32 t0 = tcg_const_i32(((sprn - SPR_DBAT4U) / 2) + 4); + TCGv_i32 t0 = tcg_constant_i32(((sprn - SPR_DBAT4U) / 2) + 4); gen_helper_store_dbatu(cpu_env, t0, cpu_gpr[gprn]); } void spr_write_dbatl(DisasContext *ctx, int sprn, int gprn) { - TCGv_i32 t0 = tcg_const_i32((sprn - SPR_DBAT0L) / 2); + TCGv_i32 t0 = tcg_constant_i32((sprn - SPR_DBAT0L) / 2); gen_helper_store_dbatl(cpu_env, t0, cpu_gpr[gprn]); } void spr_write_dbatl_h(DisasContext *ctx, int sprn, int gprn) { - TCGv_i32 t0 = tcg_const_i32(((sprn - SPR_DBAT4L) / 2) + 4); + TCGv_i32 t0 = tcg_constant_i32(((sprn - SPR_DBAT4L) / 2) + 4); gen_helper_store_dbatl(cpu_env, t0, cpu_gpr[gprn]); } @@ -1040,13 +1040,15 @@ void spr_write_booke206_mmucsr0(DisasContext *ctx, int sprn, int gprn) void spr_write_booke_pid(DisasContext *ctx, int sprn, int gprn) { - TCGv_i32 t0 = tcg_const_i32(sprn); + TCGv_i32 t0 = tcg_constant_i32(sprn); gen_helper_booke_setpid(cpu_env, t0, cpu_gpr[gprn]); } + void spr_write_eplc(DisasContext *ctx, int sprn, int gprn) { gen_helper_booke_set_eplc(cpu_env, cpu_gpr[gprn]); } + void spr_write_epsc(DisasContext *ctx, int sprn, int gprn) { gen_helper_booke_set_epsc(cpu_env, cpu_gpr[gprn]); @@ -1080,9 +1082,9 @@ void spr_read_mas73(DisasContext *ctx, int gprn, int sprn) static void gen_fscr_facility_check(DisasContext *ctx, int facility_sprn, int bit, int sprn, int cause) { - TCGv_i32 t1 = tcg_const_i32(bit); - TCGv_i32 t2 = tcg_const_i32(sprn); - TCGv_i32 t3 = tcg_const_i32(cause); + TCGv_i32 t1 = tcg_constant_i32(bit); + TCGv_i32 t2 = tcg_constant_i32(sprn); + TCGv_i32 t3 = tcg_constant_i32(cause); gen_helper_fscr_facility_check(cpu_env, t1, t2, t3); } @@ -1090,9 +1092,9 @@ static void gen_fscr_facility_check(DisasContext *ctx, int facility_sprn, static void gen_msr_facility_check(DisasContext *ctx, int facility_sprn, int bit, int sprn, int cause) { - TCGv_i32 t1 = tcg_const_i32(bit); - TCGv_i32 t2 = tcg_const_i32(sprn); - TCGv_i32 t3 = tcg_const_i32(cause); + TCGv_i32 t1 = tcg_constant_i32(bit); + TCGv_i32 t2 = tcg_constant_i32(sprn); + TCGv_i32 t3 = tcg_constant_i32(cause); gen_helper_msr_facility_check(cpu_env, t1, t2, t3); } @@ -1388,7 +1390,7 @@ static inline void gen_op_cmp(TCGv arg0, TCGv arg1, int s, int crf) static inline void gen_op_cmpi(TCGv arg0, target_ulong arg1, int s, int crf) { - TCGv t0 = tcg_const_tl(arg1); + TCGv t0 = tcg_constant_tl(arg1); gen_op_cmp(arg0, t0, s, crf); } @@ -1409,7 +1411,7 @@ static inline void gen_op_cmp32(TCGv arg0, TCGv arg1, int s, int crf) static inline void gen_op_cmpi32(TCGv arg0, target_ulong arg1, int s, int crf) { - TCGv t0 = tcg_const_tl(arg1); + TCGv t0 = tcg_constant_tl(arg1); gen_op_cmp32(arg0, t0, s, crf); } @@ -1476,7 +1478,7 @@ static void gen_isel(DisasContext *ctx) tcg_gen_extu_i32_tl(t0, cpu_crf[bi >> 2]); tcg_gen_andi_tl(t0, t0, mask); - zr = tcg_const_tl(0); + zr = tcg_constant_tl(0); tcg_gen_movcond_tl(TCG_COND_NE, cpu_gpr[rD(ctx->opcode)], t0, zr, rA(ctx->opcode) ? cpu_gpr[rA(ctx->opcode)] : zr, cpu_gpr[rB(ctx->opcode)]); @@ -1568,7 +1570,7 @@ static inline void gen_op_arith_add(DisasContext *ctx, TCGv ret, TCGv arg1, tcg_gen_mov_tl(ca32, ca); } } else { - TCGv zero = tcg_const_tl(0); + TCGv zero = tcg_constant_tl(0); if (add_ca) { tcg_gen_add2_tl(t0, ca, arg1, zero, ca, zero); tcg_gen_add2_tl(t0, ca, t0, ca, arg2, zero); @@ -1609,7 +1611,7 @@ static void glue(gen_, name)(DisasContext *ctx) \ add_ca, compute_ca, compute_ov) \ static void glue(gen_, name)(DisasContext *ctx) \ { \ - TCGv t0 = tcg_const_tl(const_val); \ + TCGv t0 = tcg_constant_tl(const_val); \ gen_op_arith_add(ctx, cpu_gpr[rD(ctx->opcode)], \ cpu_gpr[rA(ctx->opcode)], t0, \ ca, glue(ca, 32), \ @@ -1636,7 +1638,7 @@ GEN_INT_ARITH_ADD_CONST(addzeo, 0x16, 0, cpu_ca, 1, 1, 1) /* addic addic.*/ static inline void gen_op_addic(DisasContext *ctx, bool compute_rc0) { - TCGv c = tcg_const_tl(SIMM(ctx->opcode)); + TCGv c = tcg_constant_tl(SIMM(ctx->opcode)); gen_op_arith_add(ctx, cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)], c, cpu_ca, cpu_ca32, 0, 1, 0, compute_rc0); } @@ -1709,7 +1711,7 @@ GEN_INT_ARITH_DIVW(divwo, 0x1F, 1, 1); #define GEN_DIVE(name, hlpr, compute_ov) \ static void gen_##name(DisasContext *ctx) \ { \ - TCGv_i32 t0 = tcg_const_i32(compute_ov); \ + TCGv_i32 t0 = tcg_constant_i32(compute_ov); \ gen_helper_##hlpr(cpu_gpr[rD(ctx->opcode)], cpu_env, \ cpu_gpr[rA(ctx->opcode)], cpu_gpr[rB(ctx->opcode)], t0); \ if (unlikely(Rc(ctx->opcode) != 0)) { \ @@ -1802,8 +1804,8 @@ static inline void gen_op_arith_modw(DisasContext *ctx, TCGv ret, TCGv arg1, tcg_gen_rem_i32(t3, t0, t1); tcg_gen_ext_i32_tl(ret, t3); } else { - TCGv_i32 t2 = tcg_const_i32(1); - TCGv_i32 t3 = tcg_const_i32(0); + TCGv_i32 t2 = tcg_constant_i32(1); + TCGv_i32 t3 = tcg_constant_i32(0); tcg_gen_movcond_i32(TCG_COND_EQ, t1, t1, t3, t2, t1); tcg_gen_remu_i32(t3, t0, t1); tcg_gen_extu_i32_tl(ret, t3); @@ -1842,8 +1844,8 @@ static inline void gen_op_arith_modd(DisasContext *ctx, TCGv ret, TCGv arg1, tcg_gen_movcond_i64(TCG_COND_NE, t1, t2, t3, t2, t1); tcg_gen_rem_i64(ret, t0, t1); } else { - TCGv_i64 t2 = tcg_const_i64(1); - TCGv_i64 t3 = tcg_const_i64(0); + TCGv_i64 t2 = tcg_constant_i64(1); + TCGv_i64 t3 = tcg_constant_i64(0); tcg_gen_movcond_i64(TCG_COND_EQ, t1, t1, t3, t2, t1); tcg_gen_remu_i64(ret, t0, t1); } @@ -2038,7 +2040,7 @@ static inline void gen_op_arith_subf(DisasContext *ctx, TCGv ret, TCGv arg1, } else if (add_ca) { TCGv zero, inv1 = tcg_temp_new(); tcg_gen_not_tl(inv1, arg1); - zero = tcg_const_tl(0); + zero = tcg_constant_tl(0); tcg_gen_add2_tl(t0, cpu_ca, arg2, zero, cpu_ca, zero); tcg_gen_add2_tl(t0, cpu_ca, t0, cpu_ca, inv1, zero); gen_op_arith_compute_ca32(ctx, t0, inv1, arg2, cpu_ca32, 0); @@ -2083,7 +2085,7 @@ static void glue(gen_, name)(DisasContext *ctx) \ add_ca, compute_ca, compute_ov) \ static void glue(gen_, name)(DisasContext *ctx) \ { \ - TCGv t0 = tcg_const_tl(const_val); \ + TCGv t0 = tcg_constant_tl(const_val); \ gen_op_arith_subf(ctx, cpu_gpr[rD(ctx->opcode)], \ cpu_gpr[rA(ctx->opcode)], t0, \ add_ca, compute_ca, compute_ov, Rc(ctx->opcode)); \ @@ -2107,7 +2109,7 @@ GEN_INT_ARITH_SUBF_CONST(subfzeo, 0x16, 0, 1, 1, 1) /* subfic */ static void gen_subfic(DisasContext *ctx) { - TCGv c = tcg_const_tl(SIMM(ctx->opcode)); + TCGv c = tcg_constant_tl(SIMM(ctx->opcode)); gen_op_arith_subf(ctx, cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)], c, 0, 1, 0, 0); } @@ -2115,7 +2117,7 @@ static void gen_subfic(DisasContext *ctx) /* neg neg. nego nego. */ static inline void gen_op_arith_neg(DisasContext *ctx, bool compute_ov) { - TCGv zero = tcg_const_tl(0); + TCGv zero = tcg_constant_tl(0); gen_op_arith_subf(ctx, cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)], zero, 0, 0, compute_ov, Rc(ctx->opcode)); } @@ -2214,7 +2216,7 @@ GEN_LOGICAL2(nor, tcg_gen_nor_tl, 0x03, PPC_INTEGER); #if defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY) static void gen_pause(DisasContext *ctx) { - TCGv_i32 t0 = tcg_const_i32(0); + TCGv_i32 t0 = tcg_constant_i32(0); tcg_gen_st_i32(t0, cpu_env, -offsetof(PowerPCCPU, env) + offsetof(CPUState, halted)); @@ -3256,7 +3258,7 @@ static void gen_lmw(DisasContext *ctx) } gen_set_access_type(ctx, ACCESS_INT); t0 = tcg_temp_new(); - t1 = tcg_const_i32(rD(ctx->opcode)); + t1 = tcg_constant_i32(rD(ctx->opcode)); gen_addr_imm_index(ctx, t0, 0); gen_helper_lmw(cpu_env, t0, t1); } @@ -3273,7 +3275,7 @@ static void gen_stmw(DisasContext *ctx) } gen_set_access_type(ctx, ACCESS_INT); t0 = tcg_temp_new(); - t1 = tcg_const_i32(rS(ctx->opcode)); + t1 = tcg_constant_i32(rS(ctx->opcode)); gen_addr_imm_index(ctx, t0, 0); gen_helper_stmw(cpu_env, t0, t1); } @@ -3311,8 +3313,8 @@ static void gen_lswi(DisasContext *ctx) gen_set_access_type(ctx, ACCESS_INT); t0 = tcg_temp_new(); gen_addr_register(ctx, t0); - t1 = tcg_const_i32(nb); - t2 = tcg_const_i32(start); + t1 = tcg_constant_i32(nb); + t2 = tcg_constant_i32(start); gen_helper_lsw(cpu_env, t0, t1, t2); } @@ -3329,9 +3331,9 @@ static void gen_lswx(DisasContext *ctx) gen_set_access_type(ctx, ACCESS_INT); t0 = tcg_temp_new(); gen_addr_reg_index(ctx, t0); - t1 = tcg_const_i32(rD(ctx->opcode)); - t2 = tcg_const_i32(rA(ctx->opcode)); - t3 = tcg_const_i32(rB(ctx->opcode)); + t1 = tcg_constant_i32(rD(ctx->opcode)); + t2 = tcg_constant_i32(rA(ctx->opcode)); + t3 = tcg_constant_i32(rB(ctx->opcode)); gen_helper_lswx(cpu_env, t0, t1, t2, t3); } @@ -3352,8 +3354,8 @@ static void gen_stswi(DisasContext *ctx) if (nb == 0) { nb = 32; } - t1 = tcg_const_i32(nb); - t2 = tcg_const_i32(rS(ctx->opcode)); + t1 = tcg_constant_i32(nb); + t2 = tcg_constant_i32(rS(ctx->opcode)); gen_helper_stsw(cpu_env, t0, t1, t2); } @@ -3373,7 +3375,7 @@ static void gen_stswx(DisasContext *ctx) t1 = tcg_temp_new_i32(); tcg_gen_trunc_tl_i32(t1, cpu_xer); tcg_gen_andi_i32(t1, t1, 0x7F); - t2 = tcg_const_i32(rS(ctx->opcode)); + t2 = tcg_constant_i32(rS(ctx->opcode)); gen_helper_stsw(cpu_env, t0, t1, t2); } @@ -3943,7 +3945,7 @@ static void gen_wait(DisasContext *ctx) * to occur. */ if (wc == 0) { - TCGv_i32 t0 = tcg_const_i32(1); + TCGv_i32 t0 = tcg_constant_i32(1); tcg_gen_st_i32(t0, cpu_env, -offsetof(PowerPCCPU, env) + offsetof(CPUState, halted)); /* Stop translation, as the CPU is supposed to sleep from now */ @@ -3989,7 +3991,7 @@ static void gen_doze(DisasContext *ctx) TCGv_i32 t; CHK_HV(ctx); - t = tcg_const_i32(PPC_PM_DOZE); + t = tcg_constant_i32(PPC_PM_DOZE); gen_helper_pminsn(cpu_env, t); /* Stop translation, as the CPU is supposed to sleep from now */ gen_exception_nip(ctx, EXCP_HLT, ctx->base.pc_next); @@ -4004,7 +4006,7 @@ static void gen_nap(DisasContext *ctx) TCGv_i32 t; CHK_HV(ctx); - t = tcg_const_i32(PPC_PM_NAP); + t = tcg_constant_i32(PPC_PM_NAP); gen_helper_pminsn(cpu_env, t); /* Stop translation, as the CPU is supposed to sleep from now */ gen_exception_nip(ctx, EXCP_HLT, ctx->base.pc_next); @@ -4019,7 +4021,7 @@ static void gen_stop(DisasContext *ctx) TCGv_i32 t; CHK_HV(ctx); - t = tcg_const_i32(PPC_PM_STOP); + t = tcg_constant_i32(PPC_PM_STOP); gen_helper_pminsn(cpu_env, t); /* Stop translation, as the CPU is supposed to sleep from now */ gen_exception_nip(ctx, EXCP_HLT, ctx->base.pc_next); @@ -4034,7 +4036,7 @@ static void gen_sleep(DisasContext *ctx) TCGv_i32 t; CHK_HV(ctx); - t = tcg_const_i32(PPC_PM_SLEEP); + t = tcg_constant_i32(PPC_PM_SLEEP); gen_helper_pminsn(cpu_env, t); /* Stop translation, as the CPU is supposed to sleep from now */ gen_exception_nip(ctx, EXCP_HLT, ctx->base.pc_next); @@ -4049,7 +4051,7 @@ static void gen_rvwinkle(DisasContext *ctx) TCGv_i32 t; CHK_HV(ctx); - t = tcg_const_i32(PPC_PM_RVWINKLE); + t = tcg_constant_i32(PPC_PM_RVWINKLE); gen_helper_pminsn(cpu_env, t); /* Stop translation, as the CPU is supposed to sleep from now */ gen_exception_nip(ctx, EXCP_HLT, ctx->base.pc_next); @@ -4506,7 +4508,7 @@ static void gen_tw(DisasContext *ctx) if (check_unconditional_trap(ctx)) { return; } - t0 = tcg_const_i32(TO(ctx->opcode)); + t0 = tcg_constant_i32(TO(ctx->opcode)); gen_helper_tw(cpu_env, cpu_gpr[rA(ctx->opcode)], cpu_gpr[rB(ctx->opcode)], t0); } @@ -4520,8 +4522,8 @@ static void gen_twi(DisasContext *ctx) if (check_unconditional_trap(ctx)) { return; } - t0 = tcg_const_tl(SIMM(ctx->opcode)); - t1 = tcg_const_i32(TO(ctx->opcode)); + t0 = tcg_constant_tl(SIMM(ctx->opcode)); + t1 = tcg_constant_i32(TO(ctx->opcode)); gen_helper_tw(cpu_env, cpu_gpr[rA(ctx->opcode)], t0, t1); } @@ -4534,7 +4536,7 @@ static void gen_td(DisasContext *ctx) if (check_unconditional_trap(ctx)) { return; } - t0 = tcg_const_i32(TO(ctx->opcode)); + t0 = tcg_constant_i32(TO(ctx->opcode)); gen_helper_td(cpu_env, cpu_gpr[rA(ctx->opcode)], cpu_gpr[rB(ctx->opcode)], t0); } @@ -4548,8 +4550,8 @@ static void gen_tdi(DisasContext *ctx) if (check_unconditional_trap(ctx)) { return; } - t0 = tcg_const_tl(SIMM(ctx->opcode)); - t1 = tcg_const_i32(TO(ctx->opcode)); + t0 = tcg_constant_tl(SIMM(ctx->opcode)); + t1 = tcg_constant_i32(TO(ctx->opcode)); gen_helper_td(cpu_env, cpu_gpr[rA(ctx->opcode)], t0, t1); } #endif @@ -5018,7 +5020,7 @@ static void gen_dcbz(DisasContext *ctx) gen_set_access_type(ctx, ACCESS_CACHE); tcgv_addr = tcg_temp_new(); - tcgv_op = tcg_const_i32(ctx->opcode & 0x03FF000); + tcgv_op = tcg_constant_i32(ctx->opcode & 0x03FF000); gen_addr_reg_index(ctx, tcgv_addr); gen_helper_dcbz(cpu_env, tcgv_addr, tcgv_op); } @@ -5031,7 +5033,7 @@ static void gen_dcbzep(DisasContext *ctx) gen_set_access_type(ctx, ACCESS_CACHE); tcgv_addr = tcg_temp_new(); - tcgv_op = tcg_const_i32(ctx->opcode & 0x03FF000); + tcgv_op = tcg_constant_i32(ctx->opcode & 0x03FF000); gen_addr_reg_index(ctx, tcgv_addr); gen_helper_dcbzep(cpu_env, tcgv_addr, tcgv_op); } @@ -5106,7 +5108,7 @@ static void gen_mfsr(DisasContext *ctx) TCGv t0; CHK_SV(ctx); - t0 = tcg_const_tl(SR(ctx->opcode)); + t0 = tcg_constant_tl(SR(ctx->opcode)); gen_helper_load_sr(cpu_gpr[rD(ctx->opcode)], cpu_env, t0); #endif /* defined(CONFIG_USER_ONLY) */ } @@ -5135,7 +5137,7 @@ static void gen_mtsr(DisasContext *ctx) TCGv t0; CHK_SV(ctx); - t0 = tcg_const_tl(SR(ctx->opcode)); + t0 = tcg_constant_tl(SR(ctx->opcode)); gen_helper_store_sr(cpu_env, t0, cpu_gpr[rS(ctx->opcode)]); #endif /* defined(CONFIG_USER_ONLY) */ } @@ -5167,7 +5169,7 @@ static void gen_mfsr_64b(DisasContext *ctx) TCGv t0; CHK_SV(ctx); - t0 = tcg_const_tl(SR(ctx->opcode)); + t0 = tcg_constant_tl(SR(ctx->opcode)); gen_helper_load_sr(cpu_gpr[rD(ctx->opcode)], cpu_env, t0); #endif /* defined(CONFIG_USER_ONLY) */ } @@ -5196,7 +5198,7 @@ static void gen_mtsr_64b(DisasContext *ctx) TCGv t0; CHK_SV(ctx); - t0 = tcg_const_tl(SR(ctx->opcode)); + t0 = tcg_constant_tl(SR(ctx->opcode)); gen_helper_store_sr(cpu_env, t0, cpu_gpr[rS(ctx->opcode)]); #endif /* defined(CONFIG_USER_ONLY) */ } @@ -5550,7 +5552,7 @@ static void gen_mfdcr(DisasContext *ctx) TCGv dcrn; CHK_SV(ctx); - dcrn = tcg_const_tl(SPR(ctx->opcode)); + dcrn = tcg_constant_tl(SPR(ctx->opcode)); gen_helper_load_dcr(cpu_gpr[rD(ctx->opcode)], cpu_env, dcrn); #endif /* defined(CONFIG_USER_ONLY) */ } @@ -5564,7 +5566,7 @@ static void gen_mtdcr(DisasContext *ctx) TCGv dcrn; CHK_SV(ctx); - dcrn = tcg_const_tl(SPR(ctx->opcode)); + dcrn = tcg_constant_tl(SPR(ctx->opcode)); gen_helper_store_dcr(cpu_env, dcrn, cpu_gpr[rS(ctx->opcode)]); #endif /* defined(CONFIG_USER_ONLY) */ } @@ -5785,7 +5787,7 @@ static void gen_tlbre_440(DisasContext *ctx) case 1: case 2: { - TCGv_i32 t0 = tcg_const_i32(rB(ctx->opcode)); + TCGv_i32 t0 = tcg_constant_i32(rB(ctx->opcode)); gen_helper_440_tlbre(cpu_gpr[rD(ctx->opcode)], cpu_env, t0, cpu_gpr[rA(ctx->opcode)]); } @@ -5831,7 +5833,7 @@ static void gen_tlbwe_440(DisasContext *ctx) case 1: case 2: { - TCGv_i32 t0 = tcg_const_i32(rB(ctx->opcode)); + TCGv_i32 t0 = tcg_constant_i32(rB(ctx->opcode)); gen_helper_440_tlbwe(cpu_env, t0, cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)]); } @@ -5973,7 +5975,7 @@ static void gen_wrteei(DisasContext *ctx) /* dlmzb */ static void gen_dlmzb(DisasContext *ctx) { - TCGv_i32 t0 = tcg_const_i32(Rc(ctx->opcode)); + TCGv_i32 t0 = tcg_constant_i32(Rc(ctx->opcode)); gen_helper_dlmzb(cpu_gpr[rA(ctx->opcode)], cpu_env, cpu_gpr[rS(ctx->opcode)], cpu_gpr[rB(ctx->opcode)], t0); } From patchwork Mon Feb 27 05:42:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656872 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2185639wrb; Sun, 26 Feb 2023 21:55:10 -0800 (PST) X-Google-Smtp-Source: AK7set+y7/0t1Mkq3suPSZsJlXS3LGMXhT7l2IBR4ajIeCwn5SyTntbCavi52MlHwfPqCRe9wzda X-Received: by 2002:a05:6214:27eb:b0:56e:c1da:f68f with SMTP id jt11-20020a05621427eb00b0056ec1daf68fmr41938872qvb.26.1677477310496; Sun, 26 Feb 2023 21:55:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477310; cv=none; d=google.com; s=arc-20160816; b=cNHr00dFayXENdGibA7/CxUJGCHt2KOkPBxu83UYqcdZ8eJgV894FBSBPSM7NnS168 a5N6xfquuKUHgzU8c3d/jKspSrTxMFp1o6ZWrlBhW9B8YdvKSb4C4S7nL/IVKy33Oi5W hbD4qumnxocXUOSIagQZOECqhO4CSgIbRy+ilAgHI422vVUZLO90KNPaOpjqRWq0Crnm AfXVVO7Ynv8KxhGSMAhoTOzUyLSZ7O0JF+CIVjNz1aO1zolg5iSkbuMAVUa01C7bwsoA WZiSvEyF82PJx2AcuuHdP/jzM52L9DY5/v5YcfILbTlIgyHgRClv/v9xG50A/t5KqvLk X99Q== 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=aVJSO2h9tfQcb+TtXx2WZrUSZTfG/Y+e52Wp9jBRA8w=; b=RViA11Sb2K0Y7Lkk3GUlw1LXaexZ0a+1k0NMhUAg+Wh8R7eZ4TRRJJ7Zo1z6YVrIZn KsxLEZ1tlGAWyUX33uBLc9fadCHr1milxJhC3EFj1VtLHipYmpAH7O6l2Swr2DoCb9g0 6xGCNiTct4Zopb3AMgJMZzKRmHpoOvGBw33OSvXbEGzA1SLfHmRt0RZ+jNNv8YE9Cd+K YMzvGoXCjWsmd4pGgpH8civ8wemYG0hnt+B41+EfavUU3cChnpZE2rqbFPHar4YussNe SGJ3woG2y+Ny4+6AAl8EkFG0UdjGPF8y3fkaRDEeC2s4CR/sXbLwlVPOedlqPFPII6cl kmNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ISLHfyMR; 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 fh6-20020a0562141a0600b0056c242d9f79si6087208qvb.554.2023.02.26.21.55.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:55:10 -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=ISLHfyMR; 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 1pWWN0-00039h-Nn; Mon, 27 Feb 2023 00:48:18 -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 1pWWMa-000051-LP for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:52 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMS-00073L-Oz for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:52 -0500 Received: by mail-pl1-x62c.google.com with SMTP id ky4so5588337plb.3 for ; Sun, 26 Feb 2023 21:47:44 -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=aVJSO2h9tfQcb+TtXx2WZrUSZTfG/Y+e52Wp9jBRA8w=; b=ISLHfyMRU/+WDpTjnPft+E6v9lWzTbrl8FOqrdLr8eXVjwQeAAQja6dqt+KbS+xZxR ovLu6VotnRTaka08dwlkS92INEgypjfPjEhKRrpiLWXkSe30TM8N0k0y83pGNTBZkO6q o7Of3nbYVbDEduZalXPR7yj8HVC7lw3FfyLm3yiGtP6LInDwcPn/UD5+6cyW2dUfeeCN I9/WDvRXZpT1MJmDGn72jNj3/qoEMchqlL3fEVenHt6rlSx21IcDkb/Qn5EOmR+aMYuC +R2X3k5Qf+6Y8+Mb51hTJc6EJ9BoWbG7bszL7+H79lxXeJsJSwn/dD5ruoKscSUCWKic SuHQ== 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=aVJSO2h9tfQcb+TtXx2WZrUSZTfG/Y+e52Wp9jBRA8w=; b=e11xlGw6m6aroN6R7NuWjdwoU8SM3UaqJrQpk0p0xXs3tANIbzaQdRVc0ycydkpDyp BNdkMybkI0QrNJJO7/n8nHsC/twU4i3aTn1Un3iSEPjqRL9kAigTN1Kdiaj7ZrqIvYrP EuTpgotNkONpXERNQNYWiSb4bwgDAyzHzjoecW9moKrS6ibBqFq6RgoFfz3QhyApGhaC O6GgBOSEwC5XaKOQpJE7PGIF+E8+O67Kod76I2RjST5kZ8C/YwSFgYyZnM+KqrugPG1O DtVfd/dBcIac8M9kysMTxBHd0/W4wnPE1OphAIx86sdyBWnyT+IYpJbHlg1BTQGYWUhO 0OGw== X-Gm-Message-State: AO0yUKUe40+S2Ac9+0DXsCcXsZhMtEzP7g10U2L+dxe/EkQ+brpXESui flTjfazjwZi4z3vlvCLj+UPsDpouPzWPaYCbmuk= X-Received: by 2002:a17:902:f685:b0:19d:1ffd:1485 with SMTP id l5-20020a170902f68500b0019d1ffd1485mr843921plg.66.1677476863953; Sun, 26 Feb 2023 21:47:43 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:43 -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 45/70] target/riscv: Avoid tcg_const_* Date: Sun, 26 Feb 2023 19:42:08 -1000 Message-Id: <20230227054233.390271-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org All uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Weiwei Li --- target/riscv/translate.c | 4 ++-- target/riscv/insn_trans/trans_rvv.c.inc | 4 ++-- target/riscv/insn_trans/trans_rvzfh.c.inc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 180fa5d30d..5c558a6f5f 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -201,8 +201,8 @@ static void gen_nanbox_h(TCGv_i64 out, TCGv_i64 in) */ static void gen_check_nanbox_h(TCGv_i64 out, TCGv_i64 in) { - TCGv_i64 t_max = tcg_const_i64(0xffffffffffff0000ull); - TCGv_i64 t_nan = tcg_const_i64(0xffffffffffff7e00ull); + TCGv_i64 t_max = tcg_constant_i64(0xffffffffffff0000ull); + TCGv_i64 t_nan = tcg_constant_i64(0xffffffffffff7e00ull); tcg_gen_movcond_i64(TCG_COND_GEU, out, in, t_max, in, t_nan); } diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index 0607eff5e6..cee793a440 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -237,8 +237,8 @@ static bool trans_vsetvli(DisasContext *s, arg_vsetvli *a) static bool trans_vsetivli(DisasContext *s, arg_vsetivli *a) { - TCGv s1 = tcg_const_tl(a->rs1); - TCGv s2 = tcg_const_tl(a->zimm); + TCGv s1 = tcg_constant_tl(a->rs1); + TCGv s2 = tcg_constant_tl(a->zimm); return do_vsetivli(s, a->rd, s1, s2); } diff --git a/target/riscv/insn_trans/trans_rvzfh.c.inc b/target/riscv/insn_trans/trans_rvzfh.c.inc index 03773e2aa8..a563cac97a 100644 --- a/target/riscv/insn_trans/trans_rvzfh.c.inc +++ b/target/riscv/insn_trans/trans_rvzfh.c.inc @@ -300,7 +300,7 @@ static bool trans_fsgnjn_h(DisasContext *ctx, arg_fsgnjn_h *a) * Replace bit 15 in rs1 with inverse in rs2. * This formulation retains the nanboxing of rs1. */ - mask = tcg_const_i64(~MAKE_64BIT_MASK(15, 1)); + mask = tcg_constant_i64(~MAKE_64BIT_MASK(15, 1)); tcg_gen_not_i64(rs2, rs2); tcg_gen_andc_i64(rs2, rs2, mask); tcg_gen_and_i64(dest, mask, rs1); From patchwork Mon Feb 27 05:42:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656887 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2226626wrb; Mon, 27 Feb 2023 00:08:28 -0800 (PST) X-Google-Smtp-Source: AK7set94KmJkwVVBsW1Lpm+I0X4moIe4vrW/rZW4T+p/b3vqAVfCMt1QKVz2PFb8EMMUQpC8lhu6 X-Received: by 2002:ac8:584f:0:b0:3ba:ef:fc0e with SMTP id h15-20020ac8584f000000b003ba00effc0emr42266420qth.57.1677485308143; Mon, 27 Feb 2023 00:08:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485308; cv=none; d=google.com; s=arc-20160816; b=Z2O0Bf9XEoeYjMP4xUdlT76x1aEittDs6lznaKVDA2AQNXLTvGwCTJkGPLSz4nUgDc GONMG/OACHyxDq09GxLQSgvxlfVs0h62w69YL/dXyS3a+oDphbGgclDW3xJqnYaHCn95 da8E5vDWn2AcXU4SlWkzLWpo2qbS+rI5yK/rExEHqRoObfJiE/M8QsyijibBCsXnP+b2 IjGQOMMqxezr5zPoBXvKaqtFwupAxTIKncS1betfoBmFpCVrt6lBzbV8Ao2Z6s0hEPcK E38yhiThijbeoYbGAEwi4HBsCXJnvjTtRBrYQastPwTsSVO09WKorFkQLECBYaIh1LcV BSbg== 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=FKIUVjbl8DPLcvn6krGNHyWegUHfiPg1Pbu7JBCgIrE=; b=L5WaverZumO7RCB/5iG0dNA1082QswrmdLYjiyxhLB1drMmSutYYLEkv/8SD7rwGar p6xeiOhdOT+NvdIS02LGO/2svW4dVSzDNAj/qRuZKntDdEEBa8j8XfH+A1hM2goJzopW pLlB/cnmFSeUrP8BoncoebGuE62TlN7XLaGME/dNmaO17xfcZksfowGl5peOv1aZwppj W/1rxD5TNEoTmRwYyE1WMSuZwvZCiDkUWjigM4FUy62EDpd5bDQdp+ZRcDe8pdnJdZyW XO1ejaiFh3JdgLY2g0rKKghNKNemUzUPZsH7cXLwswCwNM7TDkA7MM1z2dcHe+quXUmq fFwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r43K95Nn; 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 o16-20020a05622a009000b003b69e2f6565si6058755qtw.105.2023.02.27.00.08.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:08:28 -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=r43K95Nn; 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 1pWWMn-0001ez-Pb; Mon, 27 Feb 2023 00:48:05 -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 1pWWMc-0000L0-BI for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:54 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMY-00078Q-0U for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:53 -0500 Received: by mail-pj1-x1034.google.com with SMTP id qa18-20020a17090b4fd200b0023750b675f5so8877436pjb.3 for ; Sun, 26 Feb 2023 21:47:47 -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=FKIUVjbl8DPLcvn6krGNHyWegUHfiPg1Pbu7JBCgIrE=; b=r43K95NnmgE112llmqV3lfV1zm/F4PSdwKsmPdzYhCNm28JRKnp6/y1Wl+Jr7GLKpW Qz8g+sfqk3/eydusr3rOBHwmwV4ZyZ9Mmr9GbTjLZaCR11urYP3lUfkPfRSXBa4Tqlni 7ONJ3OIy0D8ZaHK0gOK2DudtrOl5hRJCxVlb3yVSOLIljUFI6/myGoaDuYixjvZSVoI3 KU7ee+y/GUUI5nuaJCqqRiN8yUwRQu1rxri2D7E0MZ4IKXvE2V2vKQkpSwphkqwM3Y8R bszTqjVnlC8b1eA3odaW96AzAXE9jTcK/3QZUi1FTn7uHUJ9RaWY6elcI8byIU75L/8J oAFA== 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=FKIUVjbl8DPLcvn6krGNHyWegUHfiPg1Pbu7JBCgIrE=; b=6SStIRHe0HNzBvWNXR90yxSb/x66pMWhNVBmC8eR/VdNJ1k30kWqtv2Y4KPG/nc9U/ OkILaAJ3/YEQEQ1Xea/Eb4lZQihSvUCALuflRsfWL+OvWM/SKLhovHOiDrLHEvFociWF IBkhyMgW+FPIcWSUXCwTVuOJlgOptx3lktxaiGqTA5/pHjsKMzILCgttsbO9sS5ijWlv EP8rrv2jJs6I3wy8kmRUkEuqp/qjYo7FXPSf0cPvWE7Trc9JseFLbJUoZdCm1egtVFWX Ghh79wI6qyS48GL3091VUHpz4n/50lAzryS2Zt5JoQbBlBKGQLBlH/Y/285v8yuCfS5e afXA== X-Gm-Message-State: AO0yUKWsI2Pg55k4BTzohX6AVao/2RAxvQLV8MKsTztKhU2SOCV3JqB/ HVSpe+McrBEUXsD+uxUykZXwzSnJ8fpF5TPqNys= X-Received: by 2002:a17:903:183:b0:19d:bf12:8a69 with SMTP id z3-20020a170903018300b0019dbf128a69mr157112plg.49.1677476866671; Sun, 26 Feb 2023 21:47:46 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:46 -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 46/70] target/rx: Use tcg_gen_abs_i32 Date: Sun, 26 Feb 2023 19:42:09 -1000 Message-Id: <20230227054233.390271-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 Remove the local definition of rx_abs. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/rx/translate.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index 6624414739..998e6e0b7e 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -1126,21 +1126,11 @@ static bool trans_SBB_mr(DisasContext *ctx, arg_SBB_mr *a) return true; } -static void rx_abs(TCGv ret, TCGv arg1) -{ - TCGv neg; - TCGv zero; - neg = tcg_temp_new(); - zero = tcg_const_i32(0); - tcg_gen_neg_i32(neg, arg1); - tcg_gen_movcond_i32(TCG_COND_LT, ret, arg1, zero, neg, arg1); -} - /* abs rd */ /* abs rs, rd */ static bool trans_ABS_rr(DisasContext *ctx, arg_ABS_rr *a) { - rx_gen_op_rr(rx_abs, a->rd, a->rs); + rx_gen_op_rr(tcg_gen_abs_i32, a->rd, a->rs); return true; } From patchwork Mon Feb 27 05:42:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656860 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2184950wrb; Sun, 26 Feb 2023 21:52:02 -0800 (PST) X-Google-Smtp-Source: AK7set9XL3HW4lbWRrG09cTTx9pISZj4QAoD+Ja9d9XH75v5QB5043BCPAZDwAJ4SCW6QKJLg6ZB X-Received: by 2002:a05:622a:1306:b0:3bf:c352:c8cc with SMTP id v6-20020a05622a130600b003bfc352c8ccmr14727792qtk.31.1677477122090; Sun, 26 Feb 2023 21:52:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477122; cv=none; d=google.com; s=arc-20160816; b=tPUNkmQGxZoUOXNYipsO9dP7v86f8XhqcQ8rQag6c4jEKzuMXew0pU4PYcv56nuJ1e VOPdmHgF51Jf77WMJjyPVIWOQGSD+6Y6/Ycs7KJkEzOJV0DYYMKED6CjvGdjXv5VU43I diJdMXuiuTmsN/WbeIYM8rOzYnb7xjYkTgG0UryrwjtvG4e8LI6m9achSrOMzqu77E19 8H24PMkM+bcJCwNMDfEChSnJ8IldLO0yTOuue4DVtv/0LM1W9oYT9RitCwhBka2fZBLH gk59n2GRTU2dBNfHpYh3sI9pEhC0fYTEqMCsvG0ojPXKm5H77a4rIBcvnCMs3EZiGx6D STxA== 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=Rl72DxjHCuAt8m2JA2lIrs6gx/xD/HZtPB0tpD3hLcY=; b=zHw7A4j2MTDQ/OBZZHK35jVewHBORsqa6+9xjkrVaA7zDQ5S2+H58fARTAtUvpmMTD csBofrXxFiD5pkYLOcJmk1zSibkHR+o/4yLYvTaTyKVvnQsbC7Ww5By9VgtwYC+LdA1w ErX0cLagnTfZil+1jDLcOFEY8VTT8aNoWnp3qg3cTNlo621NYIimgaKaM9pu/yxSLsKN IWyvs2GZbofCa/tMn4E4GSQ5p8f4TI1ObhLCNiB/fehMdfeEgLjSAr6sImIpbV0Moz7E x9NgIturcaXkbeZ7gTXZc4jdFuPnLWjBPG91L25EN9GcW8Org6D/XSIzyEnPk9N8g8lh PVpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oBtLo43q; 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 b5-20020a05620a04e500b0070625107dd1si1177583qkh.384.2023.02.26.21.52.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:52:02 -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=oBtLo43q; 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 1pWWN3-0003KP-Co; Mon, 27 Feb 2023 00:48:21 -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 1pWWMc-0000MR-KK for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:54 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMY-000718-4P for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:54 -0500 Received: by mail-pj1-x102b.google.com with SMTP id q31-20020a17090a17a200b0023750b69614so5040258pja.5 for ; Sun, 26 Feb 2023 21:47:49 -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=Rl72DxjHCuAt8m2JA2lIrs6gx/xD/HZtPB0tpD3hLcY=; b=oBtLo43qqmUNwIOXRSaS7NJqlCVxM5fCrvorXVyxsTZkmOn4w7SGih4Gxr6E9kd3mD ZnXDTTvf+F3KGVdAEZWgtFMZh9G0hPcuZ0xnoKECcHgrEM60rNqe3TYT+FXqzfJOIBrh Vmzwxr/RSW9SEeGR96aG3KwuD518lnpLcD46LPdVDHplR+SAL3JOG5iraVbplXMWM1J7 oxwsAmOkAGu8xBvR2GAKM4rdsvGVRsMetBh9IEuQeLWfDZZq+YgzktY8zDZ8goEMV2Xe zNR2o8QK7VMI01D3rj/pI3Fki0vxJxCbZyyh63ZT3eqjg2sJgQwdqPX6T1VWtNVJScVt MexQ== 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=Rl72DxjHCuAt8m2JA2lIrs6gx/xD/HZtPB0tpD3hLcY=; b=cJ7wDpMeM/037kSgQTWQJysyfSWNhhQuzvK4VQhPRmTxIkA01aQu/W/zBRAtY2GTuG inIjGwnSWGUxRqBDjWINKUrehOAhkabnnNaoZC7QZVe968ATDdyizPVZv6F4O7xor9VI i+fEYHpWu1UNmsD2zn26HvDWFa0b6n46VhYyGKeTgo5wtblzYbv+GLKEiUI4XkNi2A47 my5XXiV21560VhcLvR/DdwiaDWOYfKfocx3cowiD5q/qpOQ0RzWcpy1D4vU9riRSuSX5 6k9/W7oT6OpZvAP0zZf4mf/ONmpxPpwa4lTP+aOIFPjHDPoa1Hh3UlhJHmxpa3qqR04P cMCw== X-Gm-Message-State: AO0yUKV3PwL7ls2IM4bC1o19uyhjLl+x42o8aAatVdXh2C7H/iqZUvF0 V4RnggTkuFHU1xumRT1wGhfjvhf2c6RY2Fk7C6c= X-Received: by 2002:a17:903:27c8:b0:19c:f232:21ca with SMTP id km8-20020a17090327c800b0019cf23221camr5679677plb.3.1677476869212; Sun, 26 Feb 2023 21:47:49 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:48 -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 47/70] target/rx: Use cpu_psw_z as temp in flags computation Date: Sun, 26 Feb 2023 19:42:10 -1000 Message-Id: <20230227054233.390271-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Since PSW_Z = PSW_S, we can move that assignment to the end and use PSW_Z as a temporary while computing PSW_O. Use tcg_constant_i32 instead of tcg_const_i32. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/rx/translate.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index 998e6e0b7e..c47aa26893 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -967,14 +967,13 @@ static bool trans_NEG_rr(DisasContext *ctx, arg_NEG_rr *a) /* ret = arg1 + arg2 + psw_c */ static void rx_adc(TCGv ret, TCGv arg1, TCGv arg2) { - TCGv z; - z = tcg_const_i32(0); + TCGv z = tcg_constant_i32(0); tcg_gen_add2_i32(cpu_psw_s, cpu_psw_c, arg1, z, cpu_psw_c, z); tcg_gen_add2_i32(cpu_psw_s, cpu_psw_c, cpu_psw_s, cpu_psw_c, arg2, z); - tcg_gen_mov_i32(cpu_psw_z, cpu_psw_s); tcg_gen_xor_i32(cpu_psw_o, cpu_psw_s, arg1); - tcg_gen_xor_i32(z, arg1, arg2); - tcg_gen_andc_i32(cpu_psw_o, cpu_psw_o, z); + tcg_gen_xor_i32(cpu_psw_z, arg1, arg2); + tcg_gen_andc_i32(cpu_psw_o, cpu_psw_o, cpu_psw_z); + tcg_gen_mov_i32(cpu_psw_z, cpu_psw_s); tcg_gen_mov_i32(ret, cpu_psw_s); } @@ -1006,13 +1005,12 @@ static bool trans_ADC_mr(DisasContext *ctx, arg_ADC_mr *a) /* ret = arg1 + arg2 */ static void rx_add(TCGv ret, TCGv arg1, TCGv arg2) { - TCGv z; - z = tcg_const_i32(0); + TCGv z = tcg_constant_i32(0); tcg_gen_add2_i32(cpu_psw_s, cpu_psw_c, arg1, z, arg2, z); - tcg_gen_mov_i32(cpu_psw_z, cpu_psw_s); tcg_gen_xor_i32(cpu_psw_o, cpu_psw_s, arg1); - tcg_gen_xor_i32(z, arg1, arg2); - tcg_gen_andc_i32(cpu_psw_o, cpu_psw_o, z); + tcg_gen_xor_i32(cpu_psw_z, arg1, arg2); + tcg_gen_andc_i32(cpu_psw_o, cpu_psw_o, cpu_psw_z); + tcg_gen_mov_i32(cpu_psw_z, cpu_psw_s); tcg_gen_mov_i32(ret, cpu_psw_s); } @@ -1042,23 +1040,23 @@ static bool trans_ADD_rrr(DisasContext *ctx, arg_ADD_rrr *a) /* ret = arg1 - arg2 */ static void rx_sub(TCGv ret, TCGv arg1, TCGv arg2) { - TCGv temp; tcg_gen_sub_i32(cpu_psw_s, arg1, arg2); - tcg_gen_mov_i32(cpu_psw_z, cpu_psw_s); tcg_gen_setcond_i32(TCG_COND_GEU, cpu_psw_c, arg1, arg2); tcg_gen_xor_i32(cpu_psw_o, cpu_psw_s, arg1); - temp = tcg_temp_new_i32(); - tcg_gen_xor_i32(temp, arg1, arg2); - tcg_gen_and_i32(cpu_psw_o, cpu_psw_o, temp); + tcg_gen_xor_i32(cpu_psw_z, arg1, arg2); + tcg_gen_and_i32(cpu_psw_o, cpu_psw_o, cpu_psw_z); + tcg_gen_mov_i32(cpu_psw_z, cpu_psw_s); /* CMP not required return */ if (ret) { tcg_gen_mov_i32(ret, cpu_psw_s); } } + static void rx_cmp(TCGv dummy, TCGv arg1, TCGv arg2) { rx_sub(NULL, arg1, arg2); } + /* ret = arg1 - arg2 - !psw_c */ /* -> ret = arg1 + ~arg2 + psw_c */ static void rx_sbb(TCGv ret, TCGv arg1, TCGv arg2) From patchwork Mon Feb 27 05:42:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656882 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2223977wrb; Mon, 27 Feb 2023 00:01:13 -0800 (PST) X-Google-Smtp-Source: AK7set9+VxjPgkCRtFBkyFsQtI6u4AkIFs3JzR6Y1Lqjcd6mZU8du87h9LsCeUnDmDtqgCbcrdD7 X-Received: by 2002:a05:6214:dc7:b0:56e:f417:2ac0 with SMTP id 7-20020a0562140dc700b0056ef4172ac0mr54725897qvt.10.1677484873764; Mon, 27 Feb 2023 00:01:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677484873; cv=none; d=google.com; s=arc-20160816; b=sSw7ERRMZC3CJ6TH/7ika9ljU5MiSxyeNH4IwWGaq21jQphvAaiH+BOrSu5euKPMNg +hwqWoQC9oBR2Cmu5pPz+k4TN09QyWouocvZCDYLUafUoKz8o59HRIZCia/AIylFLldG /uakUqoo2YNt7medZrefGpzyPMPO8Ciu7m3h+OXteDb0ZL87C9R9AVuH4SCy2HTIDPwL VSrUFQ2nbEL7HveZW+TGbU2pGb0u+gVKnHFAuE6SN5CIUUkOCldxN2lwXQuxFkSKag5B YEwKg17aD60pral+B0kl1NnYpdpe2DDKKrOBMzqgBjIfXbt1FdG7//Hp3LgCM+YiN2RF RVRg== 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=BXfLkdSGhIhYLj+zF+EO/topHFdhgFnMNuKv4zKtRz4=; b=d9kh3pRmmyMONo4vkiu2Ij4zKQZgCYYrLEGO4OCcCqkByEVvRHz5NGSp6iuHBB7QEf Si4cpzA4vgmrs5AR+M9rIpgflIBTDBMm7FmGUFoRJBW1oNq1f20uuzbYGwwbpRKDTPnD LqlYTrcnmuwHRyYvHF6w/eHsCur/Xnm9hEfR/TNWV9Fta9FZLMXxFygQKrzVYr1AhwfA /9f2jonzNgRnZRptlD4QS9oJSpg+CBf4HmIxiiWGcfumnUV88CiQ++qWQTzzmZ33I/0R 4e/rMS7y9mdl3glADBsfET5AFvHhDMQHEP0vmRJKYPrg1AALTaSaJMb+4FRjjJNkJ/A8 onrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DF0um1RB; 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 i1-20020a05620a404100b007426234f31csi6437317qko.584.2023.02.27.00.01.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:01:13 -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=DF0um1RB; 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 1pWWN9-0003jD-FH; Mon, 27 Feb 2023 00:48:27 -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 1pWWMg-0000u2-O3 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:58 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMb-0007C0-K4 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:58 -0500 Received: by mail-pj1-x102d.google.com with SMTP id x34so4952411pjj.0 for ; Sun, 26 Feb 2023 21:47:52 -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=BXfLkdSGhIhYLj+zF+EO/topHFdhgFnMNuKv4zKtRz4=; b=DF0um1RBOFgOE3wUlq6/GdigsRLtIi1t5Y/fSsnksvG4kZjaPXz/sIYxmmsCRGKXhY k/UAiheXRYzT+oC12U+UY+Po3rqw08cZKc539IKO3iuKTDaL9UegP+iwhewRXiv6nT4W cTXd2llHTZmh65z3PLhfWVoYiIyLk7G3f/Lf6QgLlT4SQxlFVuj9Rfdm8UeoTZoLnmSB 9lwPodnxkg5vNJ3BbS6M780TZxJ6KSgrWZJYpK3miZlEAjNPoCkIkIyb/GxAp9/pszvx M8TR92mOKG5BHj+tJFzZUt7aqORp+zhfbju7o/LVIydCt7bHIO4as6WYkgFg2Q73bPQU nJfA== 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=BXfLkdSGhIhYLj+zF+EO/topHFdhgFnMNuKv4zKtRz4=; b=BOf0qOyLpdYcoBePhR/lSc55w2EilYCuM9LbJknZh0ngKp8LtmqN4QSGnwStcXZ5A6 qhyhMp57TgO+QRSlRL0+FGjrFgdJKnZGTLQNEm9K3J9ZwPYrSKRvG9tD5AV8D9tud7jV FKTZuLmvNc5jMuVQ0ZKGwAxclb+njR9m9CcT4G2Z9MAM/2m0hxukGeUKGlTMVgjfyuOX daWJsz6gY2IksgFrjCqcNlUBHZdqSL7keSOblqULUQVPchH4+5ZmONI2GsIw62RocasV jGUTstr4LsfMxTrSiujMhEqXesk9IKfGF8YO8OFBd1NgImCji3KI7jN/fTNCe7uSumra f75A== X-Gm-Message-State: AO0yUKUG0hlkGqUReVqgElbRcoc9OgJoob1R55sRcXZJju3wQGsaZML6 /z1Y5cYtefEyQ7itqFnWQPwc3E3OwTJm8Go2idc= X-Received: by 2002:a17:902:d4ca:b0:19a:9880:175f with SMTP id o10-20020a170902d4ca00b0019a9880175fmr29539857plg.51.1677476871972; Sun, 26 Feb 2023 21:47:51 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:51 -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 48/70] target/rx: Avoid tcg_const_i32 when new temp needed Date: Sun, 26 Feb 2023 19:42:11 -1000 Message-Id: <20230227054233.390271-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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 These three cases use a constant as first input, and then overwrite the temp in the output. Separate them. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/rx/translate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index c47aa26893..6b218d5d5e 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -1313,10 +1313,10 @@ static bool trans_SHLL_rr(DisasContext *ctx, arg_SHLL_rr *a) done = gen_new_label(); /* if (cpu_regs[a->rs]) { */ tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_regs[a->rs], 0, noshift); - count = tcg_const_i32(32); + count = tcg_temp_new(); tmp = tcg_temp_new(); tcg_gen_andi_i32(tmp, cpu_regs[a->rs], 31); - tcg_gen_sub_i32(count, count, tmp); + tcg_gen_sub_i32(count, tcg_constant_i32(32), tmp); tcg_gen_sar_i32(cpu_psw_c, cpu_regs[a->rd], count); tcg_gen_shl_i32(cpu_regs[a->rd], cpu_regs[a->rd], tmp); tcg_gen_setcondi_i32(TCG_COND_EQ, cpu_psw_o, cpu_psw_c, 0); @@ -1979,10 +1979,10 @@ static inline void rx_bnotr(TCGv reg, TCGv mask) cat3(arg_, name, _rr) * a) \ { \ TCGv mask, b; \ - mask = tcg_const_i32(1); \ + mask = tcg_temp_new(); \ b = tcg_temp_new(); \ tcg_gen_andi_i32(b, cpu_regs[a->rs], 31); \ - tcg_gen_shl_i32(mask, mask, b); \ + tcg_gen_shl_i32(mask, tcg_constant_i32(1), b); \ cat3(rx_, op, r)(cpu_regs[a->rd], mask); \ return true; \ } \ @@ -1990,10 +1990,10 @@ static inline void rx_bnotr(TCGv reg, TCGv mask) cat3(arg_, name, _rm) * a) \ { \ TCGv mask, mem, addr, b; \ - mask = tcg_const_i32(1); \ + mask = tcg_temp_new(); \ b = tcg_temp_new(); \ tcg_gen_andi_i32(b, cpu_regs[a->rd], 7); \ - tcg_gen_shl_i32(mask, mask, b); \ + tcg_gen_shl_i32(mask, tcg_constant_i32(1), b); \ mem = tcg_temp_new(); \ addr = rx_index_addr(ctx, mem, a->ld, MO_8, a->rs); \ cat3(rx_, op, m)(addr, mask); \ From patchwork Mon Feb 27 05:42:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656876 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2186730wrb; Sun, 26 Feb 2023 21:59:29 -0800 (PST) X-Google-Smtp-Source: AK7set9WqKM0d8YTHV3pLOg0sTIqjWYV1hDU1+iL1pFIWSIwVoOvCzHv9O8vWRGbMIVE75/YpL5n X-Received: by 2002:a05:622a:104d:b0:3bf:d1b3:2be2 with SMTP id f13-20020a05622a104d00b003bfd1b32be2mr6933667qte.63.1677477568967; Sun, 26 Feb 2023 21:59:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477568; cv=none; d=google.com; s=arc-20160816; b=n/sXuQogmN4R2dSGHE9UTG5BBJIYcUoSTTnjDBG2SsQZJvrX34wmEeWPRV2KPXRD/I C3QwpjVkIeCxYcts9TIEBK4NEq2c/xRIGdMBgaCzm2mGWuftRLbhl7BPY7/n2OyG5XcX ldIWb2M4hTpwkbl94FZmrXxbLcw/ZL0SUB5OHKni4wKELeVR7vsVYZ0CYWwEsFgHSC8h Rkmi6McGwPG275cEcVoce36ol8lq3w9NRBZVvvnaMDF1HnzUJ9KWC4+PQeMHvdR3bfIP YlyI1KT3Y7GL/67whWUQV1DB+5+2SZ+9IcMSnKS68w0gEOe+fDghu+XCBMpmc6qpSSWU fblg== 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=bWtGI1X+TfUcRu7oZUXYCqGhprhtQLCjzZHoWlnqNGs=; b=h0AbqNWZrKfOUjxTUDfBho+5I4AACL/9NWdD3VahIz5kLTogqYCJNSExhYNiCgcThs L7KOT78/FVDhVbC5FvtwWevpEwos5zBsguS4nlpY3pZ//FKN9W3OjUYB3uoAqNMctfBl +QJM+kPnnrTvzxNH08/NnrIB8BjrUwZ771W5uV9lG1diQJm8VrUTS95nokChiMjfMOd9 e+07TYtmF7IqhwgMKmO0VCWwvf/IpeXVU8PEO2SeiLUyUTdcrF/eNwUlfjfj5gPtB6Wg KQvHDAfEhSGfGNoPDVVLVyqQRmTyQJPKoJcPdBCjUk42g/8KvSmAoz16PbFhdEznV7wP x+jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pQFTDT9Y; 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 ESMTP id g20-20020ac842d4000000b003ba3012cd74si5065395qtm.264.2023.02.26.21.59.28 for ; Sun, 26 Feb 2023 21:59:28 -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=pQFTDT9Y; 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 1pWWN0-00039i-PS; Mon, 27 Feb 2023 00:48:18 -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 1pWWMh-0000yR-Co for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:59 -0500 Received: from mail-pj1-x1041.google.com ([2607:f8b0:4864:20::1041]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMe-0007EH-8I for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:47:58 -0500 Received: by mail-pj1-x1041.google.com with SMTP id nw10-20020a17090b254a00b00233d7314c1cso8874454pjb.5 for ; Sun, 26 Feb 2023 21:47:55 -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=bWtGI1X+TfUcRu7oZUXYCqGhprhtQLCjzZHoWlnqNGs=; b=pQFTDT9YNTIb/oEUDJ7GZZQOGisqA75TWrfL/PutCQmthRWDqGlTEFh/R/d3yXxx45 ++xR//XcRgE3ydPIBRx8xAuvUuGLtvUDS/WH0lcbq0zue87fw4rpcagCVpHaDwjtQOpF 5giwQGFnNh6n+gbHuSP+SeK+F55Qu0CBNRN625ab1dpiBg5UmRP9Tc7Pf+aGrTiH6I11 3eIw5r6w8yFPswtHGWGwL8Ux62In/Ohk12wBg/RI0lcI6BcbEINWBja7Nl0T1mhen2ES kBzIvrnDIl61ZI4ZZohygR8E4pBnOUFMFGAEEIjlupV8kApduj9xWKNxBoVZr+XIAJUn fYaQ== 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=bWtGI1X+TfUcRu7oZUXYCqGhprhtQLCjzZHoWlnqNGs=; b=mUGSgyTth6hgQWqPyYcMzi3FoXzt8W0ztxfRw6EY0kW/M66lrZnPBngzVxKnwqrTF1 vVnybm5DH1Myn5p0m1Ii5hi4w8kdWX7KSmpqM6a/BgeLLAHKmnMLZwZYj6lV1PVQcV9W 2ON1cYbpFhPTAAcomAQdiNXuP/OFCnLNBWA98KntlYFw4QD8MCY3Kwo6jTKwOrmS42o8 tAEEUNuOjjb93PbocIW4PXEgdZPX1QTheYGqNDvGTHQ88uBmLA1UgGFH4vMYYmx3Mzwk jfDCN7RG8rvtRmLaHaLFUj7HDMIuPM7DARgQowrIu0OM/nuytG0WWtC6b9MWOCrd9sv5 SZZA== X-Gm-Message-State: AO0yUKXA1D7huzkYsHXH/Tm7VDKyIV9hXZcu0vFTLrMBWmJuXiYr2LCF iUJSHeQ7r93RCF78dq1vlGKihMsUZZ4LXbggLdr3oA== X-Received: by 2002:a17:902:e851:b0:19b:c2d:1222 with SMTP id t17-20020a170902e85100b0019b0c2d1222mr29003516plg.52.1677476874538; Sun, 26 Feb 2023 21:47:54 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:54 -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 49/70] target/rx: Avoid tcg_const_i32 Date: Sun, 26 Feb 2023 19:42:12 -1000 Message-Id: <20230227054233.390271-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1041; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1041.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 All remaining uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/rx/translate.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index 6b218d5d5e..70fad98e93 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -456,7 +456,7 @@ static bool trans_MOV_ir(DisasContext *ctx, arg_MOV_ir *a) static bool trans_MOV_im(DisasContext *ctx, arg_MOV_im *a) { TCGv imm, mem; - imm = tcg_const_i32(a->imm); + imm = tcg_constant_i32(a->imm); mem = tcg_temp_new(); tcg_gen_addi_i32(mem, cpu_regs[a->rd], a->dsp << a->sz); rx_gen_st(a->sz, imm, mem); @@ -729,8 +729,8 @@ static inline void stcond(TCGCond cond, int rd, int imm) { TCGv z; TCGv _imm; - z = tcg_const_i32(0); - _imm = tcg_const_i32(imm); + z = tcg_constant_i32(0); + _imm = tcg_constant_i32(imm); tcg_gen_movcond_i32(cond, cpu_regs[rd], cpu_psw_z, z, _imm, cpu_regs[rd]); } @@ -815,7 +815,7 @@ static inline void rx_gen_op_rrr(op3fn opr, int dst, int src, int src2) static inline void rx_gen_op_irr(op3fn opr, int dst, int src, uint32_t src2) { - TCGv imm = tcg_const_i32(src2); + TCGv imm = tcg_constant_i32(src2); opr(cpu_regs[dst], cpu_regs[src], imm); } @@ -1188,7 +1188,7 @@ static bool trans_MUL_rrr(DisasContext *ctx, arg_MUL_rrr *a) /* emul #imm, rd */ static bool trans_EMUL_ir(DisasContext *ctx, arg_EMUL_ir *a) { - TCGv imm = tcg_const_i32(a->imm); + TCGv imm = tcg_constant_i32(a->imm); if (a->rd > 14) { qemu_log_mask(LOG_GUEST_ERROR, "rd too large %d", a->rd); } @@ -1215,7 +1215,7 @@ static bool trans_EMUL_mr(DisasContext *ctx, arg_EMUL_mr *a) /* emulu #imm, rd */ static bool trans_EMULU_ir(DisasContext *ctx, arg_EMULU_ir *a) { - TCGv imm = tcg_const_i32(a->imm); + TCGv imm = tcg_constant_i32(a->imm); if (a->rd > 14) { qemu_log_mask(LOG_GUEST_ERROR, "rd too large %d", a->rd); } @@ -1585,7 +1585,7 @@ static bool trans_BRA_l(DisasContext *ctx, arg_BRA_l *a) static inline void rx_save_pc(DisasContext *ctx) { - TCGv pc = tcg_const_i32(ctx->base.pc_next); + TCGv pc = tcg_constant_i32(ctx->base.pc_next); push(pc); } @@ -1668,7 +1668,7 @@ static bool trans_SMOVB(DisasContext *ctx, arg_SMOVB *a) #define STRING(op) \ do { \ - TCGv size = tcg_const_i32(a->sz); \ + TCGv size = tcg_constant_i32(a->sz); \ gen_helper_##op(cpu_env, size); \ } while (0) @@ -1799,7 +1799,7 @@ static bool trans_MVTACLO(DisasContext *ctx, arg_MVTACLO *a) /* racw #imm */ static bool trans_RACW(DisasContext *ctx, arg_RACW *a) { - TCGv imm = tcg_const_i32(a->imm + 1); + TCGv imm = tcg_constant_i32(a->imm + 1); gen_helper_racw(cpu_env, imm); return true; } @@ -1809,7 +1809,7 @@ static bool trans_SAT(DisasContext *ctx, arg_SAT *a) { TCGv tmp, z; tmp = tcg_temp_new(); - z = tcg_const_i32(0); + z = tcg_constant_i32(0); /* S == 1 -> 0xffffffff / S == 0 -> 0x00000000 */ tcg_gen_sari_i32(tmp, cpu_psw_s, 31); /* S == 1 -> 0x7fffffff / S == 0 -> 0x80000000 */ @@ -1831,7 +1831,7 @@ static bool trans_SATR(DisasContext *ctx, arg_SATR *a) static bool cat3(trans_, name, _ir)(DisasContext *ctx, \ cat3(arg_, name, _ir) * a) \ { \ - TCGv imm = tcg_const_i32(li(ctx, 0)); \ + TCGv imm = tcg_constant_i32(li(ctx, 0)); \ gen_helper_##op(cpu_regs[a->rd], cpu_env, \ cpu_regs[a->rd], imm); \ return true; \ @@ -1865,7 +1865,7 @@ FOP(FDIV, fdiv) /* fcmp #imm, rd */ static bool trans_FCMP_ir(DisasContext *ctx, arg_FCMP_ir * a) { - TCGv imm = tcg_const_i32(li(ctx, 0)); + TCGv imm = tcg_constant_i32(li(ctx, 0)); gen_helper_fcmp(cpu_env, cpu_regs[a->rd], imm); return true; } @@ -1962,7 +1962,7 @@ static inline void rx_bnotr(TCGv reg, TCGv mask) { \ TCGv mask, mem, addr; \ mem = tcg_temp_new(); \ - mask = tcg_const_i32(1 << a->imm); \ + mask = tcg_constant_i32(1 << a->imm); \ addr = rx_index_addr(ctx, mem, a->ld, MO_8, a->rs); \ cat3(rx_, op, m)(addr, mask); \ return true; \ @@ -1971,7 +1971,7 @@ static inline void rx_bnotr(TCGv reg, TCGv mask) cat3(arg_, name, _ir) * a) \ { \ TCGv mask; \ - mask = tcg_const_i32(1 << a->imm); \ + mask = tcg_constant_i32(1 << a->imm); \ cat3(rx_, op, r)(cpu_regs[a->rd], mask); \ return true; \ } \ @@ -2116,7 +2116,7 @@ static bool trans_MVTC_i(DisasContext *ctx, arg_MVTC_i *a) { TCGv imm; - imm = tcg_const_i32(a->imm); + imm = tcg_constant_i32(a->imm); move_to_cr(ctx, imm, a->cr); return true; } @@ -2178,7 +2178,7 @@ static bool trans_INT(DisasContext *ctx, arg_INT *a) TCGv vec; tcg_debug_assert(a->imm < 0x100); - vec = tcg_const_i32(a->imm); + vec = tcg_constant_i32(a->imm); tcg_gen_movi_i32(cpu_pc, ctx->base.pc_next); gen_helper_rxint(cpu_env, vec); ctx->base.is_jmp = DISAS_NORETURN; From patchwork Mon Feb 27 05:42:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656855 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2184820wrb; Sun, 26 Feb 2023 21:51:29 -0800 (PST) X-Google-Smtp-Source: AK7set+J+Pi+tUjoq3GeYv5gNsaRK5ubAaP6CStAJrbQ09y1FdAhzm4cuDDP+vjxIFevvmTXd29x X-Received: by 2002:a05:622a:1104:b0:3bf:a1aa:25a0 with SMTP id e4-20020a05622a110400b003bfa1aa25a0mr40097366qty.17.1677477089613; Sun, 26 Feb 2023 21:51:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477089; cv=none; d=google.com; s=arc-20160816; b=uakJFXVPtf2EeAkXeppKze6fnKx7Hg/tw9rye8eim7CWrCGbEry2vqeZZSJ2rNvvY/ 4krkij7UzGlVgOo7O/fFPtLOq5dx6Y0EQ4YcDJLQBFfh4yRVi+8B5eFvVsHcz8+PvIrx eyQ1vqYzVPQiXLx6WT2GohVWswP+4Ncz+RHR1aHUACgl0E3Jv9ubhHTdlE8dOfNJl2oH qWzLsmbWf1rU24Mc4s6bAgOiHA/UvHTvtbtZ+yE1tAdq1ptOaj7mrWPU4AAxmv5nGt2O /epmryEeWloyIHmGD1UyOclQtchLxSARztXp/Yf2Imhe/RAUYy/5KN7TFXtbHQzHMHFp M7zw== 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=GJNhapK5cwKPuNHwm60EH5IqaxN8PX72mUhnmnmpcgg=; b=A+bPKgqxdE0LnWEYMcEtDgpBw+/2Q+S7NBylyvy4kfHy8Qi2t/Mhz2eR2EJgUbMenE D212znXGI18W/6FSY/RtCmzcxxe/1J0NUm0okHj0H3/e0k2tBSFRt1rU0pld5zPd7WX0 w7ON+H4Ot1g1YiN7rnzLAmbXQ61sGKrhmCe1851AgI1J41xKqNzVylLScCybywo8ucQf a3gKPsWOcnCCWpl11xsKKmlQBkOpf7RYs8Ct9pkUklCNs17s6J3ZWA2oF2NbK7BDII9y x8bbS8jisISO87gIxJ+G4iG3sZrCBs+xCRxO0XZxVCBIH7hKmdKFTXA9LtSXkfQvRTKH lD9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m2FVDx3U; 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 w8-20020a05620a424800b0073569baba8asi6131846qko.735.2023.02.26.21.51.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:51:29 -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=m2FVDx3U; 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 1pWWNX-00051X-UG; Mon, 27 Feb 2023 00:48:52 -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 1pWWMi-00019l-Sa for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:01 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMg-00074k-0P for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:00 -0500 Received: by mail-pj1-x102d.google.com with SMTP id l1so4914860pjt.2 for ; Sun, 26 Feb 2023 21:47:57 -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=GJNhapK5cwKPuNHwm60EH5IqaxN8PX72mUhnmnmpcgg=; b=m2FVDx3U78LRyj3V1cqS9X9ITZb+fhkH1AH2i8Z5YzqSySta/LD/yKTXBIu7HmWjIE st/XlNu2/xEsTNk8VgEX0AO4ISyaV1UqJoyhGMHUFjYwhvC6n1itADBxXeBHXI7VRBT0 uf1iBCWnBdnXcEj5WR6ghi7QiCHn0ml8OlX/TRuxO3WwKFQiiLMS917Tpk21l6M4Aevw 9KsgLi5C4Z/S9K6mXSmWZFE4u/dTs/EL41BB4SG/RxQPB3DL0w4o2DFp43tJl1U9q3/d kNlhS8njQHgAhxM+V51fP5H8aBsbEewEhxUXAosOq+EPDTcg2R6o1BdzeNdsUg2BEszW eY6A== 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=GJNhapK5cwKPuNHwm60EH5IqaxN8PX72mUhnmnmpcgg=; b=4DPfCDA2ulHM+bx2LUVjxFASwAO4d/Mz3MYdnKWWovvLr73cezYcH93R9NOIxUIDUw tGf6vOmqQD1ySUendsKAwyDnRcxBJZTvAMRvcH13eUrGgvC6RAB31YfpsNwI7oYelu72 VPmCExavVtH48+ZuQ4RcmIKnOANpLXnPBbgW/QDDfN72JOoWVJIxaQWKLMMp8zDwKZmt tCShNmdxVIi9HQeK7I9nNcM1Ko5PhgucS9ldZkXI9oOPaTxEX95WJ0ugFk6wZb60ucoX j8A2pAM5oyR7lLXqq7ZXfcx/VpDevcptN/CM32OcoxA2LS0I+UDVMDKN0welYHySegZp QX8Q== X-Gm-Message-State: AO0yUKVG14xdLy7eWsvrRWViIXLbBe7ut3mAj+xlFlVgnhePC1bXdqlc VAqHkXbuguUGSoIwISpYF210VOaKL4ciil+B3eM= X-Received: by 2002:a17:902:6b01:b0:19c:f849:80a1 with SMTP id o1-20020a1709026b0100b0019cf84980a1mr5239419plk.27.1677476877016; Sun, 26 Feb 2023 21:47:57 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:56 -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 50/70] target/s390x: Split out gen_ri2 Date: Sun, 26 Feb 2023 19:42:13 -1000 Message-Id: <20230227054233.390271-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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 Use tcg_constant_i64. Adjust in2_mri2_* to allocate a new temporary for the output, using gen_ri2 for the address. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/s390x/tcg/translate.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 9974162527..7969051ce9 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -5745,9 +5745,14 @@ static void in2_a2(DisasContext *s, DisasOps *o) } #define SPEC_in2_a2 0 +static TCGv gen_ri2(DisasContext *s) +{ + return tcg_constant_i64(s->base.pc_next + (int64_t)get_field(s, i2) * 2); +} + static void in2_ri2(DisasContext *s, DisasOps *o) { - o->in2 = tcg_const_i64(s->base.pc_next + (int64_t)get_field(s, i2) * 2); + o->in2 = gen_ri2(s); } #define SPEC_in2_ri2 0 @@ -5835,29 +5840,29 @@ static void in2_m2_64a(DisasContext *s, DisasOps *o) static void in2_mri2_16u(DisasContext *s, DisasOps *o) { - in2_ri2(s, o); - tcg_gen_qemu_ld16u(o->in2, o->in2, get_mem_index(s)); + o->in2 = tcg_temp_new_i64(); + tcg_gen_qemu_ld16u(o->in2, gen_ri2(s), get_mem_index(s)); } #define SPEC_in2_mri2_16u 0 static void in2_mri2_32s(DisasContext *s, DisasOps *o) { - in2_ri2(s, o); - tcg_gen_qemu_ld32s(o->in2, o->in2, get_mem_index(s)); + o->in2 = tcg_temp_new_i64(); + tcg_gen_qemu_ld32s(o->in2, gen_ri2(s), get_mem_index(s)); } #define SPEC_in2_mri2_32s 0 static void in2_mri2_32u(DisasContext *s, DisasOps *o) { - in2_ri2(s, o); - tcg_gen_qemu_ld32u(o->in2, o->in2, get_mem_index(s)); + o->in2 = tcg_temp_new_i64(); + tcg_gen_qemu_ld32u(o->in2, gen_ri2(s), get_mem_index(s)); } #define SPEC_in2_mri2_32u 0 static void in2_mri2_64(DisasContext *s, DisasOps *o) { - in2_ri2(s, o); - tcg_gen_qemu_ld64(o->in2, o->in2, get_mem_index(s)); + o->in2 = tcg_temp_new_i64(); + tcg_gen_qemu_ld64(o->in2, gen_ri2(s), get_mem_index(s)); } #define SPEC_in2_mri2_64 0 From patchwork Mon Feb 27 05:42:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656871 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2185604wrb; Sun, 26 Feb 2023 21:54:58 -0800 (PST) X-Google-Smtp-Source: AK7set8cRPMRz9w4D1q/hHHun1EqjfdjWH1h7/vg81S20uRiP2ir4wJkgxO5OWGFuB/4H3HWmFPO X-Received: by 2002:a05:622a:1114:b0:3a7:e625:14f with SMTP id e20-20020a05622a111400b003a7e625014fmr38029685qty.9.1677477298661; Sun, 26 Feb 2023 21:54:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477298; cv=none; d=google.com; s=arc-20160816; b=eUS1N3hpj/adEQoyHtxhBfyXS4YdIJ/4BqC+FZQRU9aYv/PRxb1jMBy7RQbUb4ksui okXBxenZxqkNyKTK/D6W+9Zt1YibIxMowcN5QrOX2QaDcR6tmSoPKXu9awHSvmpbQ1nO VX9vMYQhsQ/Rog++GngvBvje8P0EMJ7r7o0K8k+R7XL3+6lHmmUPO093Rn5I3IWLDtCs X+6FDb/0pqm3/mc+JRUNYXThPMqeXM9Zu6yZLn8olil7P22u3LOm64wmVNHgZPWJDObp SQb2i//1BGhnUI6U/pvjr1dsNrEWPjUoYElyO0WIdKgb0pMsbhjxxOe95l8icItJreNd iR4Q== 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=aemW4nd0+d8gVoUBFCo/IxkPgvf30U3J+wX8+SNzXzA=; b=iKj6P+AgFGkj4JCSTraBGLHK54xS+pRSSa1SEu9acmQDQ3UO2NE/aylFWQU6b64HA+ QSnrG9nU5ZYP1PspoCM4rkQR8B8N8x5U5HU5vruo03SfxJEo8oXg5OreqqCTyseT6k8A /ADqpVF1mKkbdhE54BwZbh1qnag4VJw5JIjPZ9chRM56stZPG5AtHnoz1CDryACr4Jl3 Zv7/NAPKlPW9KAdzHg5ge0CAdNQgQjwwXR7G9NBkfL4nR6RM6SiR0Qal9yjAx2VaKcWY VKJGoLoreGbDq/2FPpCnjMC+D4O4mjYq9r+URY38SDm5KPlAXPPcH5if49dLzlUMA9dI BI1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iBfkiXi9; 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 g8-20020ac85808000000b003b9d6b8786csi5728250qtg.545.2023.02.26.21.54.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:54:58 -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=iBfkiXi9; 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 1pWWNb-0005Is-7u; Mon, 27 Feb 2023 00:48:55 -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 1pWWMl-0001SB-NC for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:03 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMj-0007J6-Ek for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:03 -0500 Received: by mail-pj1-x102c.google.com with SMTP id oj5so927729pjb.5 for ; Sun, 26 Feb 2023 21:48:00 -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=aemW4nd0+d8gVoUBFCo/IxkPgvf30U3J+wX8+SNzXzA=; b=iBfkiXi9n9FO6rW8nyiU/cnJ3NlJcIcX5lbzB80r7RrqIpju1OzyrtPo8VKxrql1jQ oZlmWp0Dd3+86Ox955A61cRxVzwnI7i63mGl1DsnV9cQPSIQxo5ovf8gCSnrfW47z5tv TFYvnTHLXq5N4+eNAlkMoDcGwvqKrrbFZOMzqlijrd5DO9bqaCDjlXsoPu369zZnhQ5A efnl4St1zLUI1ocUSvnuttfYinoG75Dx4Cjop0PSgfYNq+DuJTSKJ/m5nIZAbCx7xu01 076xhof5QHOEAHog+L178BT/zqEoDxkXVFWzrugjxdL0WXW3bfKFxSwHzJJpra4opaqS 4FGw== 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=aemW4nd0+d8gVoUBFCo/IxkPgvf30U3J+wX8+SNzXzA=; b=X6xr5hFuUhW33Hf7HD9Fdn0d48Vu5oLyAqSOmuYRb27ouZTpE0/FulXlBChDCbfGqF EV2ReJ/o5xSJ2TaqGAo2/vmPGCC45mPrCoCMgjxGXBDTd1MaqfkE9Vx+iwaDsClecfLv m11NummXJMfxQ/muguOkd/eKQM5TBGU8r//QtrIp4ZWCm6WIdcaQ/44dVMi9mcpx0Uaj LtyWh4yFkKNkdE+Ge/RhDs7bLbUqnmxsZCzMo7DJomkoQJlOVIWKSoloGLJiqK0OtlPo Yl6bHSdtZOr0EpDrlvniVcNsKW8AIXobGfZAfaepvlmfzyPjP9rLNCrP2P7g559JWtMT g4/Q== X-Gm-Message-State: AO0yUKWUYcZWQqVw5+0VNmc8WXjdGA6A/kXuM+MQLn9FUso/FpNTwd6O Xp07zNIFAgHjQXq/fpzVcGlIgKkLTmj6AhBPJ+U= X-Received: by 2002:a17:902:9a46:b0:19c:eaf0:985e with SMTP id x6-20020a1709029a4600b0019ceaf0985emr6134654plv.62.1677476879769; Sun, 26 Feb 2023 21:47:59 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:47:59 -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 51/70] target/s390x: Avoid tcg_const_i64 Date: Sun, 26 Feb 2023 19:42:14 -1000 Message-Id: <20230227054233.390271-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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 All uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/s390x/tcg/translate.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 7969051ce9..32d61fc40d 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -4857,13 +4857,13 @@ static DisasJumpType op_xi(DisasContext *s, DisasOps *o) static DisasJumpType op_zero(DisasContext *s, DisasOps *o) { - o->out = tcg_const_i64(0); + o->out = tcg_constant_i64(0); return DISAS_NEXT; } static DisasJumpType op_zero2(DisasContext *s, DisasOps *o) { - o->out = tcg_const_i64(0); + o->out = tcg_constant_i64(0); o->out2 = o->out; return DISAS_NEXT; } @@ -5762,7 +5762,7 @@ static void in2_sh(DisasContext *s, DisasOps *o) int d2 = get_field(s, d2); if (b2 == 0) { - o->in2 = tcg_const_i64(d2 & 0x3f); + o->in2 = tcg_constant_i64(d2 & 0x3f); } else { o->in2 = get_address(s, 0, b2, d2); tcg_gen_andi_i64(o->in2, o->in2, 0x3f); @@ -5868,46 +5868,46 @@ static void in2_mri2_64(DisasContext *s, DisasOps *o) static void in2_i2(DisasContext *s, DisasOps *o) { - o->in2 = tcg_const_i64(get_field(s, i2)); + o->in2 = tcg_constant_i64(get_field(s, i2)); } #define SPEC_in2_i2 0 static void in2_i2_8u(DisasContext *s, DisasOps *o) { - o->in2 = tcg_const_i64((uint8_t)get_field(s, i2)); + o->in2 = tcg_constant_i64((uint8_t)get_field(s, i2)); } #define SPEC_in2_i2_8u 0 static void in2_i2_16u(DisasContext *s, DisasOps *o) { - o->in2 = tcg_const_i64((uint16_t)get_field(s, i2)); + o->in2 = tcg_constant_i64((uint16_t)get_field(s, i2)); } #define SPEC_in2_i2_16u 0 static void in2_i2_32u(DisasContext *s, DisasOps *o) { - o->in2 = tcg_const_i64((uint32_t)get_field(s, i2)); + o->in2 = tcg_constant_i64((uint32_t)get_field(s, i2)); } #define SPEC_in2_i2_32u 0 static void in2_i2_16u_shl(DisasContext *s, DisasOps *o) { uint64_t i2 = (uint16_t)get_field(s, i2); - o->in2 = tcg_const_i64(i2 << s->insn->data); + o->in2 = tcg_constant_i64(i2 << s->insn->data); } #define SPEC_in2_i2_16u_shl 0 static void in2_i2_32u_shl(DisasContext *s, DisasOps *o) { uint64_t i2 = (uint32_t)get_field(s, i2); - o->in2 = tcg_const_i64(i2 << s->insn->data); + o->in2 = tcg_constant_i64(i2 << s->insn->data); } #define SPEC_in2_i2_32u_shl 0 #ifndef CONFIG_USER_ONLY static void in2_insn(DisasContext *s, DisasOps *o) { - o->in2 = tcg_const_i64(s->fields.raw_insn); + o->in2 = tcg_constant_i64(s->fields.raw_insn); } #define SPEC_in2_insn 0 #endif From patchwork Mon Feb 27 05:42:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656898 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2228093wrb; Mon, 27 Feb 2023 00:12:52 -0800 (PST) X-Google-Smtp-Source: AK7set9E8pDfGFg6uCP/pJn8EsHNY3ZPCWWiYKRzjNGITbcRQh8G42IarTeT/5pGNa260POiyZA7 X-Received: by 2002:a05:6214:400c:b0:56e:a819:f902 with SMTP id kd12-20020a056214400c00b0056ea819f902mr37868651qvb.2.1677485571972; Mon, 27 Feb 2023 00:12:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485571; cv=none; d=google.com; s=arc-20160816; b=cs+CtkmPQlee5iT+NltVTKq99+Z8rgK7cdY3QUgLweaB3bBPcYUbvdZEh33+AkQghm sXPpZ6aAAwh8R1iaPMdt2l8pQ2P5pGwJ0nHyNXQe1hR6Zt4Y4d4KftdUi3Fm4AN707Vf W2DSI0BL/s4oVVNEF6gry3RXrqo3ZSqoM/S0Mm1XDb5YnLnwpPNx9jq5gK56LQS7gppQ nUJOv8mjR/D2bfiiG/1VsXeioxL9Yde+WMqr5TXmYHpxDiKtIy7Lp7g9568yxw7Gx6lB 6oSB6rQe5/rfOJXWSR2oEvjRHYNBGyVxcUCSqTazjTM+omLvuNJsdC+EFd3kdu8mLEth yxRQ== 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=F8mjVuFnltiR4gPcGk7IGFaBrcNbVkEA2sWMEG5RD9U=; b=vMkyc37qUk/5OoHwFKSiAMbj0Tsj4bP9ny0zKvUK1dKF3XG0Vk/H6XSGwFmX43Y+sH D6PkjdXGtdT2LbFsyUWCeCMX3H/5sy3QeMR18npnuJIey70WSnlqKwBidxkK+idTQ6nu Ww7C98ejIU8xzghgEZZjoeaFLUJzir9lfJ3zOL7VqrIemCM/X/zFB/WkPW87WpAima4b pVJ6zzgkr3Y8V0yIHBiVdrZUwuxCxtDDUtrWVZ2yrgdOph7nuSOpihuBuEXtNq75Th18 QRRjyqX31hxAkNgHJ4Ktan84rglKCMYf7k9OXIBBpXwSWybkslm9jtTvTsRB4nyDSrvM 01Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YcnU6I+I; 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 h20-20020a05620a401400b0073b425f6e7esi6182677qko.594.2023.02.27.00.12.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:12:51 -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=YcnU6I+I; 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 1pWWNM-0004LE-M5; Mon, 27 Feb 2023 00:48:40 -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 1pWWMn-0001iC-TU for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:06 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMl-000722-TO for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:05 -0500 Received: by mail-pj1-x1031.google.com with SMTP id h17-20020a17090aea9100b0023739b10792so5090591pjz.1 for ; Sun, 26 Feb 2023 21:48:02 -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=F8mjVuFnltiR4gPcGk7IGFaBrcNbVkEA2sWMEG5RD9U=; b=YcnU6I+ImOLwQgIL1fAnp7CH3borVZyEibXRpPED2mkEVR5rk3vJUKFHywXb9QKey0 QIjnlo+7n+hTsDYr54exaQ7NRpSBRL2yri/rUgYtiFxllJEaAP8hsUVuM/hdA8oGWnJq unTe3sm+sxEG82Qi/O9a6EnyucrvfwojVOPxVH+JsEjBqXk732rbXXrAYGR0zVz7qkCA k/TA0235LZbYRHpeqcjnkrp6EeWEle5v8NywVdKZx62s8tM4dRZbcHM7Oa7doWhVb8w1 E3v6v9FDU5DNagEkQGMI4cOZMhVs5ZzGqNa9kc2IG06ztJ1VqdJkozdSVAyPhA+hQAwU 5h8A== 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=F8mjVuFnltiR4gPcGk7IGFaBrcNbVkEA2sWMEG5RD9U=; b=Z9yjC77juCL/xBYmABU5baH7SY4i+ssiQB8X1AadtY+uCCHOIPp2uL6BrfLXrIA+Sx ffG20n3Em1bo7wHaiPGnzjyzq10WqN9PFwgQX4x6UCQXRtljZBDUyQUacK74QqxLEEX+ WowjjLUGwXLFZ8WrMQ5c7Lp6qScVLAO9bcwzAnp9CkuFNmuVebs2YxC5w4PGMM00lLOc OGt/gzHrJPYDV+tmq7FoC0jiKelxK/ELZX1oz73JNGzWB99M67Vuy/zySn2kF+MXRAwK hseibzgQR9XGVMRDTyQ7Luu8WzD3eHus5/WpnOzbltKtZ1lLy7YeH34stxGNwbp9SOMg 5Wnw== X-Gm-Message-State: AO0yUKU60K0QMkG+iCbVYeQ5V5WyV1Zz6TrOTJyIfndX6ubXPP8s1M4H uxi6ZB6BA6JFh/kRRIN1A5uhAFZrQRzFTsfbCXE= X-Received: by 2002:a17:902:7687:b0:19c:f005:92d0 with SMTP id m7-20020a170902768700b0019cf00592d0mr5724458pll.25.1677476882335; Sun, 26 Feb 2023 21:48:02 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:01 -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 52/70] target/sh4: Avoid tcg_const_i32 for TAS.B Date: Sun, 26 Feb 2023 19:42:15 -1000 Message-Id: <20230227054233.390271-53-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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 Since we're assigning to cpu_sr_t in the end, use that as the intermediate temp as well. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/sh4/translate.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/target/sh4/translate.c b/target/sh4/translate.c index ad6de41712..70a45c26e8 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -1610,12 +1610,9 @@ static void _decode_opc(DisasContext * ctx) tcg_gen_shri_i32(REG(B11_8), REG(B11_8), 16); return; case 0x401b: /* tas.b @Rn */ - { - TCGv val = tcg_const_i32(0x80); - tcg_gen_atomic_fetch_or_i32(val, REG(B11_8), val, - ctx->memidx, MO_UB); - tcg_gen_setcondi_i32(TCG_COND_EQ, cpu_sr_t, val, 0); - } + tcg_gen_atomic_fetch_or_i32(cpu_sr_t, REG(B11_8), + tcg_constant_i32(0x80), ctx->memidx, MO_UB); + tcg_gen_setcondi_i32(TCG_COND_EQ, cpu_sr_t, cpu_sr_t, 0); return; case 0xf00d: /* fsts FPUL,FRn - FPSCR: Nothing */ CHECK_FPU_ENABLED From patchwork Mon Feb 27 05:42:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656938 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2233529wrb; Mon, 27 Feb 2023 00:31:47 -0800 (PST) X-Google-Smtp-Source: AK7set9wyW55wcjSOQC6lkQb5FhIa6WVsO3DYUSrpfaYWDeOjwfT5IpfO3v7ZDlnejXNFSKmVBPq X-Received: by 2002:a05:6214:f6c:b0:56c:13cc:d21f with SMTP id iy12-20020a0562140f6c00b0056c13ccd21fmr48043278qvb.50.1677486707646; Mon, 27 Feb 2023 00:31:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486707; cv=none; d=google.com; s=arc-20160816; b=i3UePISPL57/Ptv/mdqkjqBm2t7tlbCj6k51nJL0JGtOWKq1qva1LhhPOogGUMreHZ eMv4KC1HAi9cP4Wyh1gN403zOVkqLWAdevwWsxhg9sGiWUYBPlnQa/9egrtK3dXpuzRZ QrT0TVxIsqXL/EG3HJb4zHmmeJfyEHnAexHkGhIZtKjEjkzZQ+D47S+9m1A2Gf+FYWqT zY2TQfhas00w0zy+8YsKVdPvGwgNLKeM+kPHBo428I6N5UAxCd1zbVWFvW+SOuiSTJlQ Fu8qNjG5DRqzdpSFsPy6l/IEo/aFusHpzmOrh1Lqp2RYrMb4QZNf9sLVp5SBl8SHhiIB e1CQ== 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=cdRDdNWfFqD4FUaoiGI/L+KvxtDfP/G1FLTK9icUxXA=; b=dUqjtDTX5vyuuW5z1+DLE4khNeLdfT811MueZn3davFGXVyx2GcAW3LVxsrwhR8uFI tmTGydds43hIiOzIDqvcsgkKSNY3VRDCL2EeygNAJASZeJ0CpmF/+bOmC6TIG3Bg7+Te v0jLaURIsHcJnH3NKdtBXS8wdtHvEfgKlNYD/rxcQIfVQ/B4tvwnYL77RMQ/UXn3Wic3 RBiMJxKB8+mgvqF/xs94WUDGNRUTjpVLRjnNA9IzZomlexhm+jchjR8W9GntJfljFfOl BC/hSp9TouepduLL34gWbfd6H6rLHcV5RLBU1gSYNUoK9gvxKHqB3A85HL5X6mEuAJfC 3mug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AqqJIR4Y; 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 n17-20020a05620a223100b00725375894b5si5044854qkh.519.2023.02.27.00.31.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:31:47 -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=AqqJIR4Y; 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 1pWWNs-0006AZ-9t; Mon, 27 Feb 2023 00:49:13 -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 1pWWMq-0002CH-Ug for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:09 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMo-0007Mb-IV for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:08 -0500 Received: by mail-pl1-x643.google.com with SMTP id bh1so5538204plb.11 for ; Sun, 26 Feb 2023 21:48:05 -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=cdRDdNWfFqD4FUaoiGI/L+KvxtDfP/G1FLTK9icUxXA=; b=AqqJIR4YpbCJWZOdDpLGmynl5/UDCEA5MBjuIKuj1nN+8baGACFz2pZ+aM82nXqX/k CtABGn0lGyvEjFW1z1e+7jjicU/y7QLXTk948nT6812zkBwPNUW3dlBW2KJa+nSwoj/5 1lewWgGS4pLtBZoIMZDAMJhWzapT7jt6gUMSoRmJA68U3Fr/yslLmEoBM+27CMo5hyHN Xe8IC1ORIfGKUIGoigoCJpk80S6QNXMD+9d39A1RIoZqjGcqUaGcW3F49Uld2jqqyJYW i7uQg56k726fvYeJa1taJy61JKnlQ22nCujPKepe361ZONFvBp/9w7MEd0sQs+7U87YZ tHUg== 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=cdRDdNWfFqD4FUaoiGI/L+KvxtDfP/G1FLTK9icUxXA=; b=vh2+tebn54LdyPWYiXWLzWwpwkCJv5MbW6k6jxqN7axnbTCFR2Fc8mnzioJB314RDo 20vwNRZ1DuIl9+ad+zHDNFv6TWxG3fekvkcFvW/4zGU4TwsxjrDOJtcTW01cA3b5BLBT jyCDbsANU1df6zs+IP4JSWDy+oUYR3d8AEMe9ZBeXfKWmoYBXCIFzgoQMKejGTRfwh+f 6n+i/2mo9/yjf25cW9ikdgQwh1NZ4OkRq+dWwZXum2JSGn3leFlMYvYxeTkESyrUT6ti +xS30RQGvfJYEm+wgJ8oqf2McIZsA7YMniuTObsl3G+8LqJi12aUvMzeGUaTiQUM9CSL UoYQ== X-Gm-Message-State: AO0yUKUYVLhj9y+F5vYnRHNX/+W3BFYv6s+LAZD921KFr5b8P7RDN0/4 JDtua1l1OX/ypyBUPTwP5uoqoVhrMfKbpjAP2xs7lA== X-Received: by 2002:a17:903:430e:b0:19c:d796:9ab8 with SMTP id jz14-20020a170903430e00b0019cd7969ab8mr8398104plb.53.1677476885164; Sun, 26 Feb 2023 21:48:05 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:04 -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 53/70] target/sh4: Avoid tcg_const_i32 Date: Sun, 26 Feb 2023 19:42:16 -1000 Message-Id: <20230227054233.390271-54-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x643.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org All remaining uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/sh4/translate.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 70a45c26e8..97da8bce48 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -526,13 +526,13 @@ static void _decode_opc(DisasContext * ctx) return; case 0x9000: /* mov.w @(disp,PC),Rn */ { - TCGv addr = tcg_const_i32(ctx->base.pc_next + 4 + B7_0 * 2); + TCGv addr = tcg_constant_i32(ctx->base.pc_next + 4 + B7_0 * 2); tcg_gen_qemu_ld_i32(REG(B11_8), addr, ctx->memidx, MO_TESW); } return; case 0xd000: /* mov.l @(disp,PC),Rn */ { - TCGv addr = tcg_const_i32((ctx->base.pc_next + 4 + B7_0 * 4) & ~3); + TCGv addr = tcg_constant_i32((ctx->base.pc_next + 4 + B7_0 * 4) & ~3); tcg_gen_qemu_ld_i32(REG(B11_8), addr, ctx->memidx, MO_TESL); } return; @@ -694,7 +694,7 @@ static void _decode_opc(DisasContext * ctx) case 0x300e: /* addc Rm,Rn */ { TCGv t0, t1; - t0 = tcg_const_tl(0); + t0 = tcg_constant_tl(0); t1 = tcg_temp_new(); tcg_gen_add2_i32(t1, cpu_sr_t, cpu_sr_t, t0, REG(B7_4), t0); tcg_gen_add2_i32(REG(B11_8), cpu_sr_t, @@ -754,7 +754,7 @@ static void _decode_opc(DisasContext * ctx) TCGv t0 = tcg_temp_new(); TCGv t1 = tcg_temp_new(); TCGv t2 = tcg_temp_new(); - TCGv zero = tcg_const_i32(0); + TCGv zero = tcg_constant_i32(0); /* shift left arg1, saving the bit being pushed out and inserting T on the right */ @@ -849,7 +849,7 @@ static void _decode_opc(DisasContext * ctx) return; case 0x600a: /* negc Rm,Rn */ { - TCGv t0 = tcg_const_i32(0); + TCGv t0 = tcg_constant_i32(0); tcg_gen_add2_i32(REG(B11_8), cpu_sr_t, REG(B7_4), t0, cpu_sr_t, t0); tcg_gen_sub2_i32(REG(B11_8), cpu_sr_t, @@ -913,7 +913,7 @@ static void _decode_opc(DisasContext * ctx) case 0x300a: /* subc Rm,Rn */ { TCGv t0, t1; - t0 = tcg_const_tl(0); + t0 = tcg_constant_tl(0); t1 = tcg_temp_new(); tcg_gen_add2_i32(t1, cpu_sr_t, cpu_sr_t, t0, REG(B7_4), t0); tcg_gen_sub2_i32(REG(B11_8), cpu_sr_t, @@ -1242,7 +1242,7 @@ static void _decode_opc(DisasContext * ctx) TCGv imm; CHECK_NOT_DELAY_SLOT gen_save_cpu_state(ctx, true); - imm = tcg_const_i32(B7_0); + imm = tcg_constant_i32(B7_0); gen_helper_trapa(cpu_env, imm); ctx->base.is_jmp = DISAS_NORETURN; } @@ -1709,8 +1709,8 @@ static void _decode_opc(DisasContext * ctx) CHECK_FPU_ENABLED CHECK_FPSCR_PR_1 { - TCGv m = tcg_const_i32((ctx->opcode >> 8) & 3); - TCGv n = tcg_const_i32((ctx->opcode >> 10) & 3); + TCGv m = tcg_constant_i32((ctx->opcode >> 8) & 3); + TCGv n = tcg_constant_i32((ctx->opcode >> 10) & 3); gen_helper_fipr(cpu_env, m, n); return; } @@ -1722,7 +1722,7 @@ static void _decode_opc(DisasContext * ctx) if ((ctx->opcode & 0x0300) != 0x0100) { goto do_illegal; } - TCGv n = tcg_const_i32((ctx->opcode >> 10) & 3); + TCGv n = tcg_constant_i32((ctx->opcode >> 10) & 3); gen_helper_ftrv(cpu_env, n); return; } @@ -1926,7 +1926,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env) } op_dst = B11_8; op_opc = INDEX_op_xor_i32; - op_arg = tcg_const_i32(-1); + op_arg = tcg_constant_i32(-1); break; case 0x7000 ... 0x700f: /* add #imm,Rn */ @@ -1934,7 +1934,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env) goto fail; } op_opc = INDEX_op_add_i32; - op_arg = tcg_const_i32(B7_0s); + op_arg = tcg_constant_i32(B7_0s); break; case 0x3000: /* cmp/eq Rm,Rn */ @@ -1980,7 +1980,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env) goto fail; } op_opc = INDEX_op_setcond_i32; - op_arg = tcg_const_i32(0); + op_arg = tcg_constant_i32(0); NEXT_INSN; if ((ctx->opcode & 0xff00) != 0x8900 /* bt label */ From patchwork Mon Feb 27 05:42:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656880 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2213237wrb; Sun, 26 Feb 2023 23:22:21 -0800 (PST) X-Google-Smtp-Source: AK7set/41cG+rS3js4WYofKIBQKIYBoLU5DrOHVVM8/0g+X/iAytiLXCeOwWCmvbvquKjyIAFOBg X-Received: by 2002:a05:622a:1703:b0:3b6:9c63:5ca1 with SMTP id h3-20020a05622a170300b003b69c635ca1mr30352324qtk.43.1677482541759; Sun, 26 Feb 2023 23:22:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677482541; cv=none; d=google.com; s=arc-20160816; b=HTLMoVC1Ax5P4XbWxEIO13fSmMoq6Q7Zlj710vOjKp6hGrFcnjZFrvOdrcTia9Wch5 hVvsFZC7nIxWbInilmu383iIcbAv5XGDcObESsusU+hXCWIulYuZGWSQRFXmMYduQxfe FMJ0BD1wY8Gr2Fclo0mYWLH9qPVca/Qdt3Odb1TyN6h+D54Y0uTA1hLdXV9DJ8nALpFB rlI2zWUNNivfV5XlwypQO/3k1gZOJMUBXd5B8ZSuIAt/4MhfWpDhoi6E5QDLYA+xADqw gk0OsbfCEaiHwquCLtu5gcmCrLhmTjXmOpUnJdkojzdHss4qBPK9CATgbnShQLRSqbT4 Rc6w== 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=HoOc9y4gxns7hXo8hpTTJjZUS2Pw2Ja2akP0DgIEizQ=; b=HgO+Rn1aUFybW0OAGcaSImVVHcakTsOW2agGot+GS8XeaJZgTUovgyZ9CY1oH/eGxh RBCW5eCai56V0w6XLWaLhL3NQPhCsmdUvRDp8BHIw5rhSy2kld9hr9CLnvqgkEE5ECMs 7tmpvoAx31HCqe8MCL5jozg1U2Cx2QFJiJvtI2P8u+689WUX9HYeGKFWahxPtz6MxJeP Bu9Yd9wnaLb5TuGmXPRQ+KqAWTmnDnCm3lM6iwdUZDHN1syxdBTEyYPzWzXZ0GdBrKzS b6i2q4TVFed1TS68e8yyZRIJ93LuQRD8kYoc/autbrlY9CKUZkG2k95t5JiQualX6t2B eydw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RcIb40jX; 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 v7-20020a05622a188700b003b9dfd85b94si6062545qtc.374.2023.02.26.23.22.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 23:22:21 -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=RcIb40jX; 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 1pWWO6-0006g5-U1; Mon, 27 Feb 2023 00:49:26 -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 1pWWMu-0002bU-Bo for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:12 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMr-0007PQ-Gc for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:11 -0500 Received: by mail-pl1-x630.google.com with SMTP id u5so2165712plq.7 for ; Sun, 26 Feb 2023 21:48:08 -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=HoOc9y4gxns7hXo8hpTTJjZUS2Pw2Ja2akP0DgIEizQ=; b=RcIb40jX3ohyJrPxeRa/L+yr54MDdd8GW5iJsIQez//BRSURl54EZZHeEEYwv0+KG0 r+zeSo/LbPte2H3z/leyY5zQhcqfOoPARf84urcN2KeVKiNWRQ/qeEZem6Z7SW3Jy7bL 8Grgn5sYE4EPff59FPOCZG99OymZaWGqB0j+GbUWS6WFvI1d5vRWg95JB/6+28E7pd4x YB6yhYFaLpQIp9icV2bKavWpb7AiDSp8rEJrvucUzDVY6r2UZKdiZ2IUvsYiY1pYsgbM JQI+6PQFbZVTwKbrGlo42SmdSGbMDpptpGu4WM3orG9L2Xn2DMJFcVCYFwey6oRznnyu hfhg== 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=HoOc9y4gxns7hXo8hpTTJjZUS2Pw2Ja2akP0DgIEizQ=; b=E3VwQ5O+Ho+zgG8rnJ9dsXkmTRN19Ckm3ICKUw3YP7PPK0f2VfGhep0dAg6T09pbuy tqCBcaBfnq2hRsER7+UTTXrsMbs87D7GYCU1SLPurlqDSrm/4QllROgjUR4/01kP/EtW Cr+EtM61lKdZG7fMoN7H4gC9Vaj3tJoXSiwpRJnhqUyEB++sFn5gbI+jwod61jKKAZTh 4kLd/lDTFCePrjoPByWPwTmKxijBAC+jyvDv0IHIVvrre81Q2/t1cbrAw53LLnKkNf5m 4Yi+Dc55G/9l7ticALnV3Nn4l7Ex3JgmlJScOogiL9Ljgqg2roGAqQBN1zYqGln2RZgK 5BTw== X-Gm-Message-State: AO0yUKU5sw86YeO/JgfesTYaz9859uHcb8pBNx9M0pv5L8WqHM5zY2cc S4P6kImHMwYB4dGWtfGyOcSjVYZL2ZwtyXo+0lY= X-Received: by 2002:a17:903:430f:b0:19c:fc41:2dfd with SMTP id jz15-20020a170903430f00b0019cfc412dfdmr4598417plb.29.1677476887880; Sun, 26 Feb 2023 21:48:07 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:07 -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 54/70] tcg/sparc: Avoid tcg_const_tl in gen_edge Date: Sun, 26 Feb 2023 19:42:17 -1000 Message-Id: <20230227054233.390271-55-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 Push tcg_constant_tl into the shift argument directly. Since t1 no longer exists as a temp, replace with lo1, whose last use was just above. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 814f3f8b1e..925023adef 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2842,7 +2842,7 @@ static inline void gen_load_trap_state_at_tl(TCGv_ptr r_tsptr, TCGv_env cpu_env) static void gen_edge(DisasContext *dc, TCGv dst, TCGv s1, TCGv s2, int width, bool cc, bool left) { - TCGv lo1, lo2, t1, t2; + TCGv lo1, lo2; uint64_t amask, tabl, tabr; int shift, imask, omask; @@ -2909,10 +2909,8 @@ static void gen_edge(DisasContext *dc, TCGv dst, TCGv s1, TCGv s2, tcg_gen_shli_tl(lo1, lo1, shift); tcg_gen_shli_tl(lo2, lo2, shift); - t1 = tcg_const_tl(tabl); - t2 = tcg_const_tl(tabr); - tcg_gen_shr_tl(lo1, t1, lo1); - tcg_gen_shr_tl(lo2, t2, lo2); + tcg_gen_shr_tl(lo1, tcg_constant_tl(tabl), lo1); + tcg_gen_shr_tl(lo2, tcg_constant_tl(tabr), lo2); tcg_gen_andi_tl(dst, lo1, omask); tcg_gen_andi_tl(lo2, lo2, omask); @@ -2931,9 +2929,9 @@ static void gen_edge(DisasContext *dc, TCGv dst, TCGv s1, TCGv s2, lo2 |= -(s1 == s2) dst &= lo2 */ - tcg_gen_setcond_tl(TCG_COND_EQ, t1, s1, s2); - tcg_gen_neg_tl(t1, t1); - tcg_gen_or_tl(lo2, lo2, t1); + tcg_gen_setcond_tl(TCG_COND_EQ, lo1, s1, s2); + tcg_gen_neg_tl(lo1, lo1); + tcg_gen_or_tl(lo2, lo2, lo1); tcg_gen_and_tl(dst, dst, lo2); } From patchwork Mon Feb 27 05:42:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656926 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2231248wrb; Mon, 27 Feb 2023 00:23:40 -0800 (PST) X-Google-Smtp-Source: AK7set9nYLTcTxm/qcW/zCp2+lF1GGQHZLckRLERx5jLBcHVc6xECvcW0xS4sgOkCA8wZFwz8Nff X-Received: by 2002:a05:622a:1114:b0:3a7:e625:14f with SMTP id e20-20020a05622a111400b003a7e625014fmr38466984qty.9.1677486220009; Mon, 27 Feb 2023 00:23:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486219; cv=none; d=google.com; s=arc-20160816; b=RF/ZpW/1/CHKdbKZejLF1hG+Xl0k6qosuqkm8bhRyeKK6sfsJSGHiGbocdQDgV1dFd LkC3eWQYAy/4f/EkwgCtqLr1luqonL88aue5BSY2MKntgJ47cNge4VYYQ+YEvqakbBuY /r9q6d3965TJVA7nzHjTdldm9BIz3rYmXugXJdOvEWRDPo1qKIPAgdGA3vYD2Bgwqd+T YeDZUVmJPSX0BQvdGbGtOU60uIVdKRmY1dICS+BiOkcGy6mvlZI3zFESr7JHX7l6Gyj9 e2fr3StlMabyHLq3kcFJM6GUoFWjcNITe1OVCrAZKwyjXVehGJq0vR2ooBwSSk4eyQjG 3hLA== 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=476w+C7PuuVulk9A7rXUzrh5adLE+NiyBcTZuZG8peU=; b=MRoxkMbDWl6ZZIgFh4ediAauUlNstYy3NPxGLh9trpOXCZ4Qm7BzKgmnvsa8McfzKO ldQbGOFAGTQjUnDZa1DjuuoQZWcPwnmpZ92Zjco3H7k+PDFGLU5vJb1gIbuT8bfJ07dD ic1KQExQFNXB2NzIg2vCZWVPDVM8XtSNdKStErLx3T9uxBDPXizZCcTKY+IK15FZmdPP oN2qxPsrjbkiJAjnUPfe23n7v0otzsFM38PJ7Nms7TRLbs+3YodNnSeFGuV8P1EaoyvG sMMJz1RJyiGsc1UU5/2hsC20z6xPC4NMl6iPZ+WiNSvUq0lvUrAxIO2fKcu9D1um7a88 2Sxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hm4tUAxN; 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 d11-20020ac85d8b000000b003b6955054a1si6490537qtx.424.2023.02.27.00.23.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:23:39 -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=Hm4tUAxN; 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 1pWWO5-0006UT-Iv; Mon, 27 Feb 2023 00:49:25 -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 1pWWMy-00036O-WE for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:18 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMu-0007R5-G9 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:16 -0500 Received: by mail-pl1-x642.google.com with SMTP id u5so2165793plq.7 for ; Sun, 26 Feb 2023 21:48:11 -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=476w+C7PuuVulk9A7rXUzrh5adLE+NiyBcTZuZG8peU=; b=Hm4tUAxNrMmlyFbhxyYjt/JqVZIK1EPmiEs45p6s3r9J14OpN5vhzDzjKSBE5szYqa k1o0S6SStX1RU68HHyWQrc5K+PtU27FnFq5E8mkKns1u3gTIecLml16GUPN90GWrOvjq Zm9p6PQZcGg6zfYdxOfimJ3BRwDSxAZ7l3h/apr7nQ32EGbOeOGIvjrMFC1kS7OyJY/s ci6w0dD+8vLQypypCpD7I+3KWWEPMQNSDWA4eFR5cL42/GC7ns4C3tSEc4vNEXMrAgSL 3xyj/1GPmha57pFfV7itRDjDb+EyHjIVuQxBgFVECb6FuxFb7ZKSWtHt7a0UFIPx+lWo rP8w== 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=476w+C7PuuVulk9A7rXUzrh5adLE+NiyBcTZuZG8peU=; b=TsChwbkqfkcxbRdwvLdAduPiHDLHKNRvL7ip2kIILtZoYxe0SnLDYAcfiIcgSqRKie BcBJCXqo3Scg4QRujn5qzJcc2nRraAchyGcCG/uthSTMV+rEhAs/MkonLb2voRDnt6I7 Dlc5EgusRu0TomreLxiRlETmnFyW4prORb9c3sDa4bs0vVeppuQUVN4VqHx+eZX6pSHp +YMFvWXhLJ3M70AlMC5suBchVfVz2wfvcQglc9vnDfuA7tiTPKRDAUHrwDvhT/rnAcE1 4pibv9WIvMCQJQ6rv7EIcGOTyK5zWYtAnZ9SLanXfTa8y918+rQh5/3RJ5TNuVFPo+gA R2fQ== X-Gm-Message-State: AO0yUKU28E3ZjFtD+1iuA+8XaSVdV8Y+M3ZBE23QIAr4o5LQTZZbly8a S2tiLSxVvLf0B1lE6Fu8lxFcWPeGZYx4WrdaGDXLCg== X-Received: by 2002:a17:902:ab0c:b0:19c:d316:309a with SMTP id ik12-20020a170902ab0c00b0019cd316309amr8515832plb.4.1677476890449; Sun, 26 Feb 2023 21:48:10 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:10 -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 55/70] target/sparc: Avoid tcg_const_{tl,i32} Date: Sun, 26 Feb 2023 19:42:18 -1000 Message-Id: <20230227054233.390271-56-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x642.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 All remaining uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 80 +++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 42 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 925023adef..137bdc5159 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -550,7 +550,7 @@ static inline void gen_op_mulscc(TCGv dst, TCGv src1, TCGv src2) if (!(env->y & 1)) T1 = 0; */ - zero = tcg_const_tl(0); + zero = tcg_constant_tl(0); tcg_gen_andi_tl(cpu_cc_src, src1, 0xffffffff); tcg_gen_andi_tl(r_temp, cpu_y, 0x1); tcg_gen_andi_tl(cpu_cc_src2, src2, 0xffffffff); @@ -928,8 +928,8 @@ static void gen_branch_n(DisasContext *dc, target_ulong pc1) tcg_gen_mov_tl(cpu_pc, cpu_npc); tcg_gen_addi_tl(cpu_npc, cpu_npc, 4); - t = tcg_const_tl(pc1); - z = tcg_const_tl(0); + t = tcg_constant_tl(pc1); + z = tcg_constant_tl(0); tcg_gen_movcond_tl(TCG_COND_NE, cpu_npc, cpu_cond, z, t, cpu_npc); dc->pc = DYNAMIC_PC; @@ -938,9 +938,9 @@ static void gen_branch_n(DisasContext *dc, target_ulong pc1) static inline void gen_generic_branch(DisasContext *dc) { - TCGv npc0 = tcg_const_tl(dc->jump_pc[0]); - TCGv npc1 = tcg_const_tl(dc->jump_pc[1]); - TCGv zero = tcg_const_tl(0); + TCGv npc0 = tcg_constant_tl(dc->jump_pc[0]); + TCGv npc1 = tcg_constant_tl(dc->jump_pc[1]); + TCGv zero = tcg_constant_tl(0); tcg_gen_movcond_tl(TCG_COND_NE, cpu_npc, cpu_cond, zero, npc0, npc1); } @@ -981,18 +981,14 @@ static inline void save_state(DisasContext *dc) static void gen_exception(DisasContext *dc, int which) { - TCGv_i32 t; - save_state(dc); - t = tcg_const_i32(which); - gen_helper_raise_exception(cpu_env, t); + gen_helper_raise_exception(cpu_env, tcg_constant_i32(which)); dc->base.is_jmp = DISAS_NORETURN; } static void gen_check_align(TCGv addr, int mask) { - TCGv_i32 r_mask = tcg_const_i32(mask); - gen_helper_check_align(cpu_env, addr, r_mask); + gen_helper_check_align(cpu_env, addr, tcg_constant_i32(mask)); } static inline void gen_mov_pc_npc(DisasContext *dc) @@ -1074,7 +1070,7 @@ static void gen_compare(DisasCompare *cmp, bool xcc, unsigned int cond, cmp->cond = logic_cond[cond]; do_compare_dst_0: cmp->is_bool = false; - cmp->c2 = tcg_const_tl(0); + cmp->c2 = tcg_constant_tl(0); #ifdef TARGET_SPARC64 if (!xcc) { cmp->c1 = tcg_temp_new(); @@ -1127,7 +1123,7 @@ static void gen_compare(DisasCompare *cmp, bool xcc, unsigned int cond, cmp->cond = TCG_COND_NE; cmp->is_bool = true; cmp->c1 = r_dst = tcg_temp_new(); - cmp->c2 = tcg_const_tl(0); + cmp->c2 = tcg_constant_tl(0); switch (cond) { case 0x0: @@ -1192,7 +1188,7 @@ static void gen_fcompare(DisasCompare *cmp, unsigned int cc, unsigned int cond) cmp->cond = TCG_COND_NE; cmp->is_bool = true; cmp->c1 = r_dst = tcg_temp_new(); - cmp->c2 = tcg_const_tl(0); + cmp->c2 = tcg_constant_tl(0); switch (cc) { default: @@ -1307,7 +1303,7 @@ static void gen_compare_reg(DisasCompare *cmp, int cond, TCGv r_src) cmp->cond = tcg_invert_cond(gen_tcg_cond_reg[cond]); cmp->is_bool = false; cmp->c1 = r_src; - cmp->c2 = tcg_const_tl(0); + cmp->c2 = tcg_constant_tl(0); } static inline void gen_cond_reg(TCGv r_dst, int cond, TCGv r_src) @@ -1908,7 +1904,7 @@ static void gen_swap(DisasContext *dc, TCGv dst, TCGv src, static void gen_ldstub(DisasContext *dc, TCGv dst, TCGv addr, int mmu_idx) { - TCGv m1 = tcg_const_tl(0xff); + TCGv m1 = tcg_constant_tl(0xff); gen_address_mask(dc, addr); tcg_gen_atomic_xchg_tl(dst, addr, m1, mmu_idx, MO_UB); } @@ -2163,8 +2159,8 @@ static void gen_ld_asi(DisasContext *dc, TCGv dst, TCGv addr, break; default: { - TCGv_i32 r_asi = tcg_const_i32(da.asi); - TCGv_i32 r_mop = tcg_const_i32(memop); + TCGv_i32 r_asi = tcg_constant_i32(da.asi); + TCGv_i32 r_mop = tcg_constant_i32(memop); save_state(dc); #ifdef TARGET_SPARC64 @@ -2217,7 +2213,7 @@ static void gen_st_asi(DisasContext *dc, TCGv src, TCGv addr, { TCGv saddr = tcg_temp_new(); TCGv daddr = tcg_temp_new(); - TCGv four = tcg_const_tl(4); + TCGv four = tcg_constant_tl(4); TCGv_i32 tmp = tcg_temp_new_i32(); int i; @@ -2236,8 +2232,8 @@ static void gen_st_asi(DisasContext *dc, TCGv src, TCGv addr, #endif default: { - TCGv_i32 r_asi = tcg_const_i32(da.asi); - TCGv_i32 r_mop = tcg_const_i32(memop & MO_SIZE); + TCGv_i32 r_asi = tcg_constant_i32(da.asi); + TCGv_i32 r_mop = tcg_constant_i32(memop & MO_SIZE); save_state(dc); #ifdef TARGET_SPARC64 @@ -2313,15 +2309,15 @@ static void gen_ldstub_asi(DisasContext *dc, TCGv dst, TCGv addr, int insn) if (tb_cflags(dc->base.tb) & CF_PARALLEL) { gen_helper_exit_atomic(cpu_env); } else { - TCGv_i32 r_asi = tcg_const_i32(da.asi); - TCGv_i32 r_mop = tcg_const_i32(MO_UB); + TCGv_i32 r_asi = tcg_constant_i32(da.asi); + TCGv_i32 r_mop = tcg_constant_i32(MO_UB); TCGv_i64 s64, t64; save_state(dc); t64 = tcg_temp_new_i64(); gen_helper_ld_asi(t64, cpu_env, addr, r_asi, r_mop); - s64 = tcg_const_i64(0xff); + s64 = tcg_constant_i64(0xff); gen_helper_st_asi(cpu_env, addr, s64, r_asi, r_mop); tcg_gen_trunc_i64_tl(dst, t64); @@ -2382,7 +2378,7 @@ static void gen_ldf_asi(DisasContext *dc, TCGv addr, /* The first operation checks required alignment. */ memop = da.memop | MO_ALIGN_64; - eight = tcg_const_tl(8); + eight = tcg_constant_tl(8); for (i = 0; ; ++i) { tcg_gen_qemu_ld_i64(cpu_fpr[rd / 2 + i], addr, da.mem_idx, memop); @@ -2409,8 +2405,8 @@ static void gen_ldf_asi(DisasContext *dc, TCGv addr, default: { - TCGv_i32 r_asi = tcg_const_i32(da.asi); - TCGv_i32 r_mop = tcg_const_i32(da.memop); + TCGv_i32 r_asi = tcg_constant_i32(da.asi); + TCGv_i32 r_mop = tcg_constant_i32(da.memop); save_state(dc); /* According to the table in the UA2011 manual, the only @@ -2491,7 +2487,7 @@ static void gen_stf_asi(DisasContext *dc, TCGv addr, /* The first operation checks required alignment. */ memop = da.memop | MO_ALIGN_64; - eight = tcg_const_tl(8); + eight = tcg_constant_tl(8); for (i = 0; ; ++i) { tcg_gen_qemu_st_i64(cpu_fpr[rd / 2 + i], addr, da.mem_idx, memop); @@ -2566,8 +2562,8 @@ static void gen_ldda_asi(DisasContext *dc, TCGv addr, int insn, int rd) real hardware allows others. This can be seen with e.g. FreeBSD 10.3 wrt ASI_IC_TAG. */ { - TCGv_i32 r_asi = tcg_const_i32(da.asi); - TCGv_i32 r_mop = tcg_const_i32(da.memop); + TCGv_i32 r_asi = tcg_constant_i32(da.asi); + TCGv_i32 r_mop = tcg_constant_i32(da.memop); TCGv_i64 tmp = tcg_temp_new_i64(); save_state(dc); @@ -2625,8 +2621,8 @@ static void gen_stda_asi(DisasContext *dc, TCGv hi, TCGv addr, /* ??? In theory we've handled all of the ASIs that are valid for stda, and this should raise DAE_invalid_asi. */ { - TCGv_i32 r_asi = tcg_const_i32(da.asi); - TCGv_i32 r_mop = tcg_const_i32(da.memop); + TCGv_i32 r_asi = tcg_constant_i32(da.asi); + TCGv_i32 r_mop = tcg_constant_i32(da.memop); TCGv_i64 t64 = tcg_temp_new_i64(); /* See above. */ @@ -2686,8 +2682,8 @@ static void gen_ldda_asi(DisasContext *dc, TCGv addr, int insn, int rd) break; default: { - TCGv_i32 r_asi = tcg_const_i32(da.asi); - TCGv_i32 r_mop = tcg_const_i32(MO_UQ); + TCGv_i32 r_asi = tcg_constant_i32(da.asi); + TCGv_i32 r_mop = tcg_constant_i32(MO_UQ); save_state(dc); gen_helper_ld_asi(t64, cpu_env, addr, r_asi, r_mop); @@ -2724,7 +2720,7 @@ static void gen_stda_asi(DisasContext *dc, TCGv hi, TCGv addr, as a cacheline-style operation. */ { TCGv d_addr = tcg_temp_new(); - TCGv eight = tcg_const_tl(8); + TCGv eight = tcg_constant_tl(8); int i; tcg_gen_andi_tl(d_addr, addr, -8); @@ -2736,8 +2732,8 @@ static void gen_stda_asi(DisasContext *dc, TCGv hi, TCGv addr, break; default: { - TCGv_i32 r_asi = tcg_const_i32(da.asi); - TCGv_i32 r_mop = tcg_const_i32(MO_UQ); + TCGv_i32 r_asi = tcg_constant_i32(da.asi); + TCGv_i32 r_mop = tcg_constant_i32(MO_UQ); save_state(dc); gen_helper_st_asi(cpu_env, addr, t64, r_asi, r_mop); @@ -2786,7 +2782,7 @@ static void gen_fmovs(DisasContext *dc, DisasCompare *cmp, int rd, int rs) s1 = gen_load_fpr_F(dc, rs); s2 = gen_load_fpr_F(dc, rd); dst = gen_dest_fpr_F(dc); - zero = tcg_const_i32(0); + zero = tcg_constant_i32(0); tcg_gen_movcond_i32(TCG_COND_NE, dst, c32, zero, s1, s2); @@ -3215,7 +3211,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) TCGv_i32 r_const; r_tickptr = tcg_temp_new_ptr(); - r_const = tcg_const_i32(dc->mem_idx); + r_const = tcg_constant_i32(dc->mem_idx); tcg_gen_ld_ptr(r_tickptr, cpu_env, offsetof(CPUSPARCState, tick)); if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { @@ -3267,7 +3263,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) TCGv_i32 r_const; r_tickptr = tcg_temp_new_ptr(); - r_const = tcg_const_i32(dc->mem_idx); + r_const = tcg_constant_i32(dc->mem_idx); tcg_gen_ld_ptr(r_tickptr, cpu_env, offsetof(CPUSPARCState, stick)); if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { @@ -3397,7 +3393,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) TCGv_i32 r_const; r_tickptr = tcg_temp_new_ptr(); - r_const = tcg_const_i32(dc->mem_idx); + r_const = tcg_constant_i32(dc->mem_idx); tcg_gen_ld_ptr(r_tickptr, cpu_env, offsetof(CPUSPARCState, tick)); if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { From patchwork Mon Feb 27 05:42:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656913 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2229830wrb; Mon, 27 Feb 2023 00:18:38 -0800 (PST) X-Google-Smtp-Source: AK7set+Fdy3n1Ua5y8gudz+hThbLodwWbJqAATS/eCGsklsa42AL55aiN89BII4xMoPqjh27LiOu X-Received: by 2002:ad4:5bc7:0:b0:56e:8f5e:d972 with SMTP id t7-20020ad45bc7000000b0056e8f5ed972mr16357251qvt.3.1677485918292; Mon, 27 Feb 2023 00:18:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485918; cv=none; d=google.com; s=arc-20160816; b=GofrCNKOBFkS6oPPqSYLuCUv2D3+2IgEZqUJU9j1QVbWu7+XlmVx/hiqawm4bo+z1k 6KMuNB8N0FdOmVHP2vyn5QuR9oEMOqhCXAGysy5TLJpjsGQHYobcPyi0xtA4bvupatys x8ily5Rl/BI4ajpGq9y80q2IRP4sxzlk8Q+sHx0i92j1+lif/It5xTUID2aTyPkC6CLw lQA+V1M0gTTMWan6e2r3gKHfFM7UW12aJN6SYQdqebwNQF5Wgm2bIq//FuozEhoU96zB 1KCiN+U8W/oCvSNfUzq5gx0TK5h4t/ZoyseZJaf4LivHb+ybvretHAQAu+7RslvQsEgI uRHA== 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=gLmyB+iwGargxrSLV7jFqWBr2B0CWbel1NbBx9Fai2E=; b=jDP0jQ08CZHoy1trhkVWFOYExe47c260drFhWx7XgtXrEo/IsxXGZSyveagQM0q1H/ QiGcD+DhnNTdhrfJsyVcg2M2ZpVOYpRG04u2XHbJSBlu7K79f+FpM9Awm2NPci50IkzI 43Db6Gxmp1D2M7WvJ2/bJYSgC+M/dwvpuGVsE7tuKRRLt53AvNw6gFVTvgMxnYCEUIgY 0Bh7bDGTA4vDNZYO9hcFyCHwQyWWpk86mBiu0XFTvJKGUcYtEmIVuqMyluTIEkmcOfSV bwsrE3eD4qNP3zk4wopkwXCTqmb1uJfr2driMYArQ3OFVIsUfKiUGVSFXH9PSHWwe24P YSDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Htt+FENP; 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 g26-20020a0caada000000b0056eb136aa91si5630938qvb.63.2023.02.27.00.18.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:18:38 -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=Htt+FENP; 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 1pWWO7-0006nR-Nb; Mon, 27 Feb 2023 00:49:27 -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 1pWWN2-0003Ka-St for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:20 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMx-0007SY-29 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:20 -0500 Received: by mail-pj1-x1031.google.com with SMTP id y2so4894268pjg.3 for ; Sun, 26 Feb 2023 21:48:14 -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=gLmyB+iwGargxrSLV7jFqWBr2B0CWbel1NbBx9Fai2E=; b=Htt+FENPAIEPutTk3/7rQbR9HLFuc3kprQqUj20LXRwpU0b8D+PzdEGz5oAhPRsDji fOSwLXEroDBUMF8HTT/kIseH0DCiij5CwEtKJSUPr3dLFSpN5kh5sbE0LxLuhSxkycT6 INwzNRurA7KAvfKeGXqUheQw80i3y6ITp1+nY6SDiFdT5FMRmbBkTsdf3LHQdgjEuGrh d4AJbiXPyxAz0yhKZ539BkEG7yi/WqYm8or3pwT4AtviHZ27c+BBZoNyzdloGcWBJYMG i+5GhqkGYxGtMSzQXcqbt5rYSZCTMquABVA8cSn7rJKmHf3evqcZB+CEhX/ge5PjZDwR kpqw== 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=gLmyB+iwGargxrSLV7jFqWBr2B0CWbel1NbBx9Fai2E=; b=7az3ZT9huch7wdD19l9QGI4nzuE+IG2rcYrW3iD2kmM7hHTrEV/VbyeagRnJwFsZiZ 4Zk7OhnSgWn76pRHFcBl3TBZQ00ZYVNxhtiqCHmwFpOH0gFN1tVuRh6BdN2uO2Gd99CP xeXwygucgjrgnEPcECurUo3DrIyzf7dTU4Yb/hSNw5FUo1AWkiyuNZLqJVTxHaccTMN8 eTKxEjKudte97PNiuBC+baBSwOuBF56SO6Ltw1RSn6/JBntRr+KE6uwlpR4gcsHNzJkU /PvzmXgM0nB9mWIXOi/8AkbpFK3EfbqnGL7mAJg72xIpdrPejFGuSTWVdmCPaOk/pyuZ j04A== X-Gm-Message-State: AO0yUKUEkkgVDsMbQIWoErjbe7ygvzNNdgI1AqhnxQ2l2WVhJ5Zgadqq oFtul1LTefzQ0nUCffsBIAKnZFi6doVlLqPz624= X-Received: by 2002:a17:902:ec92:b0:19a:9864:2887 with SMTP id x18-20020a170902ec9200b0019a98642887mr8073949plg.7.1677476893125; Sun, 26 Feb 2023 21:48:13 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:12 -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 56/70] target/tricore: Split t_n as constant from temp as variable Date: Sun, 26 Feb 2023 19:42:19 -1000 Message-Id: <20230227054233.390271-57-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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 As required, allocate temp separately. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/tricore/translate.c | 268 +++++++++++++++++++------------------ 1 file changed, 140 insertions(+), 128 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 127f9a989a..194bef27a6 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -595,21 +595,22 @@ static inline void gen_madd_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_extr_i64_i32(temp, temp2, temp64); @@ -621,21 +622,22 @@ static inline void gen_maddsu_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_extr_i64_i32(temp, temp2, temp64); @@ -647,22 +649,22 @@ static inline void gen_maddsum_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); TCGv_i64 temp64_2 = tcg_temp_new_i64(); TCGv_i64 temp64_3 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_concat_i32_i64(temp64_3, r1_low, r1_high); @@ -682,23 +684,24 @@ static inline void gen_madds_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv temp3 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_extr_i64_i32(temp, temp2, temp64); @@ -718,23 +721,24 @@ static inline void gen_maddsus_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv temp3 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_extr_i64_i32(temp, temp2, temp64); @@ -752,22 +756,22 @@ static inline void gen_maddsums_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); TCGv_i64 temp64_2 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_sari_i64(temp64_2, temp64, 32); /* high */ @@ -785,22 +789,22 @@ static inline void gen_maddm_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); TCGv_i64 temp64_2 = tcg_temp_new_i64(); TCGv_i64 temp64_3 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mulm_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mulm_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mulm_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mulm_h, temp64, r2, r3, t_n); break; } tcg_gen_concat_i32_i64(temp64_2, r1_low, r1_high); @@ -813,21 +817,21 @@ static inline void gen_maddms_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); TCGv_i64 temp64_2 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mulm_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mulm_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mulm_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mulm_h, temp64, r2, r3, t_n); break; } tcg_gen_concat_i32_i64(temp64_2, r1_low, r1_high); @@ -839,20 +843,20 @@ static inline void gen_maddr64_h(TCGv ret, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } gen_helper_addr_h(ret, cpu_env, temp64, r1_low, r1_high); @@ -872,21 +876,22 @@ gen_maddr32_h(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) static inline void gen_maddsur32_h(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_andi_tl(temp2, r1, 0xffff0000); @@ -899,20 +904,20 @@ static inline void gen_maddr64s_h(TCGv ret, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } gen_helper_addr_h_ssov(ret, cpu_env, temp64, r1_low, r1_high); @@ -932,21 +937,22 @@ gen_maddr32s_h(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) static inline void gen_maddsur32s_h(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_andi_tl(temp2, r1, 0xffff0000); @@ -957,15 +963,15 @@ gen_maddsur32s_h(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) static inline void gen_maddr_q(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n) { - TCGv temp = tcg_const_i32(n); - gen_helper_maddr_q(ret, cpu_env, r1, r2, r3, temp); + TCGv t_n = tcg_constant_i32(n); + gen_helper_maddr_q(ret, cpu_env, r1, r2, r3, t_n); } static inline void gen_maddrs_q(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n) { - TCGv temp = tcg_const_i32(n); - gen_helper_maddr_q_ssov(ret, cpu_env, r1, r2, r3, temp); + TCGv t_n = tcg_constant_i32(n); + gen_helper_maddr_q_ssov(ret, cpu_env, r1, r2, r3, t_n); } static inline void @@ -1176,10 +1182,10 @@ gen_madds64_q(TCGv rl, TCGv rh, TCGv arg1_low, TCGv arg1_high, TCGv arg2, TCGv arg3, uint32_t n) { TCGv_i64 r1 = tcg_temp_new_i64(); - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); tcg_gen_concat_i32_i64(r1, arg1_low, arg1_high); - gen_helper_madd64_q_ssov(r1, cpu_env, r1, arg2, arg3, temp); + gen_helper_madd64_q_ssov(r1, cpu_env, r1, arg2, arg3, t_n); tcg_gen_extr_i64_i32(rl, rh, r1); } @@ -1516,21 +1522,22 @@ static inline void gen_msub_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_extr_i64_i32(temp, temp2, temp64); @@ -1542,23 +1549,24 @@ static inline void gen_msubs_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv temp3 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_extr_i64_i32(temp, temp2, temp64); @@ -1576,22 +1584,22 @@ static inline void gen_msubm_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); TCGv_i64 temp64_2 = tcg_temp_new_i64(); TCGv_i64 temp64_3 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mulm_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mulm_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mulm_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mulm_h, temp64, r2, r3, t_n); break; } tcg_gen_concat_i32_i64(temp64_2, r1_low, r1_high); @@ -1604,21 +1612,21 @@ static inline void gen_msubms_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); TCGv_i64 temp64_2 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mulm_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mulm_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mulm_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mulm_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mulm_h, temp64, r2, r3, t_n); break; } tcg_gen_concat_i32_i64(temp64_2, r1_low, r1_high); @@ -1630,20 +1638,20 @@ static inline void gen_msubr64_h(TCGv ret, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } gen_helper_subr_h(ret, cpu_env, temp64, r1_low, r1_high); @@ -1664,20 +1672,20 @@ static inline void gen_msubr64s_h(TCGv ret, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } gen_helper_subr_h_ssov(ret, cpu_env, temp64, r1_low, r1_high); @@ -1912,10 +1920,10 @@ gen_msubs64_q(TCGv rl, TCGv rh, TCGv arg1_low, TCGv arg1_high, TCGv arg2, TCGv arg3, uint32_t n) { TCGv_i64 r1 = tcg_temp_new_i64(); - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); tcg_gen_concat_i32_i64(r1, arg1_low, arg1_high); - gen_helper_msub64_q_ssov(r1, cpu_env, r1, arg2, arg3, temp); + gen_helper_msub64_q_ssov(r1, cpu_env, r1, arg2, arg3, t_n); tcg_gen_extr_i64_i32(rl, rh, r1); } @@ -1923,21 +1931,22 @@ static inline void gen_msubad_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_extr_i64_i32(temp, temp2, temp64); @@ -1949,22 +1958,22 @@ static inline void gen_msubadm_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); TCGv_i64 temp64_2 = tcg_temp_new_i64(); TCGv_i64 temp64_3 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_concat_i32_i64(temp64_3, r1_low, r1_high); @@ -1981,21 +1990,22 @@ gen_msubadm_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, static inline void gen_msubadr32_h(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_andi_tl(temp2, r1, 0xffff0000); @@ -2007,23 +2017,24 @@ static inline void gen_msubads_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv temp3 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_extr_i64_i32(temp, temp2, temp64); @@ -2041,22 +2052,22 @@ static inline void gen_msubadms_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); TCGv_i64 temp64 = tcg_temp_new_i64(); TCGv_i64 temp64_2 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_sari_i64(temp64_2, temp64, 32); /* high */ @@ -2072,21 +2083,22 @@ gen_msubadms_h(TCGv ret_low, TCGv ret_high, TCGv r1_low, TCGv r1_high, TCGv r2, static inline void gen_msubadr32s_h(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) { - TCGv temp = tcg_const_i32(n); + TCGv t_n = tcg_constant_i32(n); + TCGv temp = tcg_temp_new(); TCGv temp2 = tcg_temp_new(); TCGv_i64 temp64 = tcg_temp_new_i64(); switch (mode) { case MODE_LL: - GEN_HELPER_LL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LL(mul_h, temp64, r2, r3, t_n); break; case MODE_LU: - GEN_HELPER_LU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_LU(mul_h, temp64, r2, r3, t_n); break; case MODE_UL: - GEN_HELPER_UL(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UL(mul_h, temp64, r2, r3, t_n); break; case MODE_UU: - GEN_HELPER_UU(mul_h, temp64, r2, r3, temp); + GEN_HELPER_UU(mul_h, temp64, r2, r3, t_n); break; } tcg_gen_andi_tl(temp2, r1, 0xffff0000); From patchwork Mon Feb 27 05:42:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656915 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2229955wrb; Mon, 27 Feb 2023 00:19:02 -0800 (PST) X-Google-Smtp-Source: AK7set8D/y3eTV5ieis3TDlPlRLXpRwB/qmokQomGI0bqhc+E7u/iiLyWlU9NXA3DYitPMpgJg0h X-Received: by 2002:a05:6214:e8d:b0:56e:a4c5:9d9d with SMTP id hf13-20020a0562140e8d00b0056ea4c59d9dmr45156862qvb.22.1677485942728; Mon, 27 Feb 2023 00:19:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485942; cv=none; d=google.com; s=arc-20160816; b=IzkBee/T1dmoeKn/wJ30Qu/eD061OEP8BYGf8sJBE6GfxdOkpCB9Qf0bZ4coCp13xx 1/bdT570jlRqnJNMmZnRsumkAdWf6Z9No+3Bc69jlzRH6KnRQLcpmZtqhHVcoT1Y+T2a rGwHOBzGYdbsZNDBw3dOv56sCJ41h25OSmZWnrOAfxQPLOxOuKk1ae/Qy0UtYWeBJwxL BwTQuTVZ7Ox+apgbNd59ahhJVCiR9s8PQlc6BE4qe+Z9gJjZNzYWStwxQ/mQsn1cJpBg m2WEskeC829qhSgkgmfAodaWoWj7yNohqVBHDjFVOA/eyvSjuf+YUF8G3vv5mzBpnJte /5Ug== 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=AisW32xJlrcJQi+M6qK/ftrU2PNr6PIj4TLkVZ68u3o=; b=d2+V9Ml8O/Q7LErvlYGcMGpEsWDG9BjVqgwnyyQCoVPbVfGMzRItQxTKG9LX8jBdxu WtfqokVCCXeMWgPLmBatJELfP6zSOn51lxcshMcTK3kTp7/9sXylLbVsUNATwRDMNp4J frRbvHj7QtjJEHaASwY7Ywl3DyflzxF/BpTNyUPO1MWZ8/SkoLfgGSEWjtczPXZQyp7V 4rpbb796VNsKzYmb5bGoJ98KN1QGGOxv1WWY7or2LMlkD2joFvWiGTpZYby3Iu2Nz3i/ U/uZEDFN8rvEocINvBFpv8j4FI6kUaBh/BHShuJmXHl7p8f1PNBRy71XmjvFMTc3758w 6mKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zYeZ73qW; 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 x15-20020a0ce0cf000000b0056eb92fa1a6si5685985qvk.470.2023.02.27.00.19.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:19:02 -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=zYeZ73qW; 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 1pWWOD-0007lY-It; Mon, 27 Feb 2023 00:49:33 -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 1pWWN4-0003PY-2n for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:22 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWMz-00074j-0v for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:21 -0500 Received: by mail-pl1-x634.google.com with SMTP id v11so2041108plz.8 for ; Sun, 26 Feb 2023 21:48:16 -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=AisW32xJlrcJQi+M6qK/ftrU2PNr6PIj4TLkVZ68u3o=; b=zYeZ73qWVqHwn3qWRj8CZON5nItJjG2hW9OnHx04eY/CwM9Cp4yNdmWkHuloJ03wP+ W3VNo/QPi91RmvTqu43vrl9mGda49BUA1+59Kubm7VrPNZVziUvZ+6amJ9nOnDeMsxpf 1jwLM11ZGMccMEsreYL7MLBmjm7E9r/+k+z4Y1y9PIi8WWyglQGXUt4QbbJarUUbd8uK REt5EAqolMVzZgyuTn3E5GeFg7VLINSlHZu0ckF5i3ABibHjuyGVYHa+2WfYODxRmjCv rq8ypSUV8En7JNHZs0O8+9yP2XvQxGutN+jMtpGEOtRA9mdIHrvpwRgTq0I9TvpgPL4c 1KfQ== 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=AisW32xJlrcJQi+M6qK/ftrU2PNr6PIj4TLkVZ68u3o=; b=6ne4t84psKIxJaIfOaEr055Vy462CcPp2eWtvmKv+9MekOncwdWDFCe+WBrvsMi9IQ nBGX30OYWV7Gt9O7DjKZxyx6romlXEBv+OSCgI7OVDgPkmE7vcL4EV0NJVaMh16FANcw XPFA4pp28PnAjAc+RNphtJ7uwzPQfjNoCJ9ihyFhVKNo7SlEdyK7ctzItNzsygOawiBr wQCpRZ4v3BmyFXKGIfORrYDNUldlqnqCYdEiD8NAFcOKbb4DjscPaYMW6o5skA89t4Ys R3etv/6meI4PdkDTKyEHHMHaamZz+0lvtKBZtOFy8L38+8weAlfXcBUAMLs78RTymHhD vpcw== X-Gm-Message-State: AO0yUKU+TCZoI6CPtoD68jytwBviiaOsUJN8Orq4qIxGjV9puYSysSce eokpaY1RiO/feJJWAS6JAJ8dOO5ePlmZGzkbIw0= X-Received: by 2002:a17:903:1ce:b0:19d:20fe:c149 with SMTP id e14-20020a17090301ce00b0019d20fec149mr722361plh.34.1677476895749; Sun, 26 Feb 2023 21:48:15 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:15 -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 57/70] target/tricore: Rename t_off10 and use tcg_constant_i32 Date: Sun, 26 Feb 2023 19:42:20 -1000 Message-Id: <20230227054233.390271-58-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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 While temp3 could simply be initialized with tcg_constant_i32, the renaming makes the purpose clearer. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/tricore/translate.c | 56 ++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 194bef27a6..19cf4b6cc7 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -4380,7 +4380,7 @@ static void decode_bo_addrmode_bitreverse_circular(DisasContext *ctx) uint32_t op2; uint32_t off10; int32_t r1, r2; - TCGv temp, temp2, temp3; + TCGv temp, temp2, t_off10; r1 = MASK_OP_BO_S1D(ctx->opcode); r2 = MASK_OP_BO_S2(ctx->opcode); @@ -4389,7 +4389,7 @@ static void decode_bo_addrmode_bitreverse_circular(DisasContext *ctx) temp = tcg_temp_new(); temp2 = tcg_temp_new(); - temp3 = tcg_const_i32(off10); + t_off10 = tcg_constant_i32(off10); CHECK_REG_PAIR(r2); tcg_gen_ext16u_tl(temp, cpu_gpr_a[r2+1]); tcg_gen_add_tl(temp2, cpu_gpr_a[r2], temp); @@ -4403,7 +4403,7 @@ static void decode_bo_addrmode_bitreverse_circular(DisasContext *ctx) case OPC2_32_BO_CACHEA_WI_CIRC: case OPC2_32_BO_CACHEA_W_CIRC: case OPC2_32_BO_CACHEA_I_CIRC: - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_ST_A_BR: tcg_gen_qemu_st_tl(cpu_gpr_a[r1], temp2, ctx->mem_idx, MO_LEUL); @@ -4411,7 +4411,7 @@ static void decode_bo_addrmode_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_ST_A_CIRC: tcg_gen_qemu_st_tl(cpu_gpr_a[r1], temp2, ctx->mem_idx, MO_LEUL); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_ST_B_BR: tcg_gen_qemu_st_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_UB); @@ -4419,7 +4419,7 @@ static void decode_bo_addrmode_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_ST_B_CIRC: tcg_gen_qemu_st_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_UB); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_ST_D_BR: CHECK_REG_PAIR(r1); @@ -4434,7 +4434,7 @@ static void decode_bo_addrmode_bitreverse_circular(DisasContext *ctx) tcg_gen_rem_tl(temp, temp, temp2); tcg_gen_add_tl(temp2, cpu_gpr_a[r2], temp); tcg_gen_qemu_st_tl(cpu_gpr_d[r1+1], temp2, ctx->mem_idx, MO_LEUL); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_ST_DA_BR: CHECK_REG_PAIR(r1); @@ -4449,7 +4449,7 @@ static void decode_bo_addrmode_bitreverse_circular(DisasContext *ctx) tcg_gen_rem_tl(temp, temp, temp2); tcg_gen_add_tl(temp2, cpu_gpr_a[r2], temp); tcg_gen_qemu_st_tl(cpu_gpr_a[r1+1], temp2, ctx->mem_idx, MO_LEUL); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_ST_H_BR: tcg_gen_qemu_st_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LEUW); @@ -4457,7 +4457,7 @@ static void decode_bo_addrmode_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_ST_H_CIRC: tcg_gen_qemu_st_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LEUW); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_ST_Q_BR: tcg_gen_shri_tl(temp, cpu_gpr_d[r1], 16); @@ -4467,7 +4467,7 @@ static void decode_bo_addrmode_bitreverse_circular(DisasContext *ctx) case OPC2_32_BO_ST_Q_CIRC: tcg_gen_shri_tl(temp, cpu_gpr_d[r1], 16); tcg_gen_qemu_st_tl(temp, temp2, ctx->mem_idx, MO_LEUW); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_ST_W_BR: tcg_gen_qemu_st_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LEUL); @@ -4475,7 +4475,7 @@ static void decode_bo_addrmode_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_ST_W_CIRC: tcg_gen_qemu_st_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LEUL); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; default: generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC); @@ -4619,8 +4619,7 @@ static void decode_bo_addrmode_ld_bitreverse_circular(DisasContext *ctx) uint32_t op2; uint32_t off10; int r1, r2; - - TCGv temp, temp2, temp3; + TCGv temp, temp2, t_off10; r1 = MASK_OP_BO_S1D(ctx->opcode); r2 = MASK_OP_BO_S2(ctx->opcode); @@ -4629,7 +4628,7 @@ static void decode_bo_addrmode_ld_bitreverse_circular(DisasContext *ctx) temp = tcg_temp_new(); temp2 = tcg_temp_new(); - temp3 = tcg_const_i32(off10); + t_off10 = tcg_constant_i32(off10); CHECK_REG_PAIR(r2); tcg_gen_ext16u_tl(temp, cpu_gpr_a[r2+1]); tcg_gen_add_tl(temp2, cpu_gpr_a[r2], temp); @@ -4642,7 +4641,7 @@ static void decode_bo_addrmode_ld_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_LD_A_CIRC: tcg_gen_qemu_ld_tl(cpu_gpr_a[r1], temp2, ctx->mem_idx, MO_LEUL); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_LD_B_BR: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_SB); @@ -4650,7 +4649,7 @@ static void decode_bo_addrmode_ld_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_LD_B_CIRC: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_SB); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_LD_BU_BR: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_UB); @@ -4658,7 +4657,7 @@ static void decode_bo_addrmode_ld_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_LD_BU_CIRC: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_UB); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_LD_D_BR: CHECK_REG_PAIR(r1); @@ -4673,7 +4672,7 @@ static void decode_bo_addrmode_ld_bitreverse_circular(DisasContext *ctx) tcg_gen_rem_tl(temp, temp, temp2); tcg_gen_add_tl(temp2, cpu_gpr_a[r2], temp); tcg_gen_qemu_ld_tl(cpu_gpr_d[r1+1], temp2, ctx->mem_idx, MO_LEUL); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_LD_DA_BR: CHECK_REG_PAIR(r1); @@ -4688,7 +4687,7 @@ static void decode_bo_addrmode_ld_bitreverse_circular(DisasContext *ctx) tcg_gen_rem_tl(temp, temp, temp2); tcg_gen_add_tl(temp2, cpu_gpr_a[r2], temp); tcg_gen_qemu_ld_tl(cpu_gpr_a[r1+1], temp2, ctx->mem_idx, MO_LEUL); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_LD_H_BR: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LESW); @@ -4696,7 +4695,7 @@ static void decode_bo_addrmode_ld_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_LD_H_CIRC: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LESW); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_LD_HU_BR: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LEUW); @@ -4704,7 +4703,7 @@ static void decode_bo_addrmode_ld_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_LD_HU_CIRC: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LEUW); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_LD_Q_BR: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LEUW); @@ -4714,7 +4713,7 @@ static void decode_bo_addrmode_ld_bitreverse_circular(DisasContext *ctx) case OPC2_32_BO_LD_Q_CIRC: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LEUW); tcg_gen_shli_tl(cpu_gpr_d[r1], cpu_gpr_d[r1], 16); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_LD_W_BR: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LEUL); @@ -4722,7 +4721,7 @@ static void decode_bo_addrmode_ld_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_LD_W_CIRC: tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp2, ctx->mem_idx, MO_LEUL); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; default: generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC); @@ -4823,8 +4822,7 @@ static void decode_bo_addrmode_ldmst_bitreverse_circular(DisasContext *ctx) uint32_t op2; uint32_t off10; int r1, r2; - - TCGv temp, temp2, temp3; + TCGv temp, temp2, t_off10; r1 = MASK_OP_BO_S1D(ctx->opcode); r2 = MASK_OP_BO_S2(ctx->opcode); @@ -4833,7 +4831,7 @@ static void decode_bo_addrmode_ldmst_bitreverse_circular(DisasContext *ctx) temp = tcg_temp_new(); temp2 = tcg_temp_new(); - temp3 = tcg_const_i32(off10); + t_off10 = tcg_constant_i32(off10); CHECK_REG_PAIR(r2); tcg_gen_ext16u_tl(temp, cpu_gpr_a[r2+1]); tcg_gen_add_tl(temp2, cpu_gpr_a[r2], temp); @@ -4845,7 +4843,7 @@ static void decode_bo_addrmode_ldmst_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_LDMST_CIRC: gen_ldmst(ctx, r1, temp2); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_SWAP_W_BR: gen_swap(ctx, r1, temp2); @@ -4853,7 +4851,7 @@ static void decode_bo_addrmode_ldmst_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_SWAP_W_CIRC: gen_swap(ctx, r1, temp2); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_CMPSWAP_W_BR: gen_cmpswap(ctx, r1, temp2); @@ -4861,7 +4859,7 @@ static void decode_bo_addrmode_ldmst_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_CMPSWAP_W_CIRC: gen_cmpswap(ctx, r1, temp2); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; case OPC2_32_BO_SWAPMSK_W_BR: gen_swapmsk(ctx, r1, temp2); @@ -4869,7 +4867,7 @@ static void decode_bo_addrmode_ldmst_bitreverse_circular(DisasContext *ctx) break; case OPC2_32_BO_SWAPMSK_W_CIRC: gen_swapmsk(ctx, r1, temp2); - gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], temp3); + gen_helper_circ_update(cpu_gpr_a[r2+1], cpu_gpr_a[r2+1], t_off10); break; default: generate_trap(ctx, TRAPC_INSN_ERR, TIN2_IOPC); From patchwork Mon Feb 27 05:42:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656912 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2229815wrb; Mon, 27 Feb 2023 00:18:35 -0800 (PST) X-Google-Smtp-Source: AK7set9AeFkobxCAwuqkCVvZg/62LBmSEqsflgWrsTiFLm3grSl4Jn+Yn/73vHd8fG/T22KF84BG X-Received: by 2002:a05:622a:1306:b0:3bf:a9bf:9523 with SMTP id v6-20020a05622a130600b003bfa9bf9523mr15706939qtk.17.1677485915789; Mon, 27 Feb 2023 00:18:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485915; cv=none; d=google.com; s=arc-20160816; b=Mpf31Q55r6//KNK+bH6MrQA/q6pKFOfXEYlfiTO/lRK1m/AUSgwVOd4ynbhAIlxEaI 1LNmYrAcSrcdKF27VrTsY5pX56p3i7XefzUBg8viyMqxoHK/vD/rDA7Tj6mLVPwZZ0bl Gz/R81sHylK/Y3APZz+6l2lPfklPvTBftmV/Gw+km72RR0WXi979OUuaXRpF71UEBE03 mBAESTzHK8307twW4OdtahDdp+QvbQK9vjIH4g2fqkgfL8ObzZHMUz99K8TDop2Ucasm c+gKkKl0JG5B6NNN5GqFPQyoOmm5ccabqzpdo3Iq4PoDxkjPyw5mUlVJyEVbJv65bi6g QYPA== 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=G0WkLijhWCE0+Z/H5Y1BqFs6QzftCoo9iI0aU6IJMxw=; b=x1HnXxjg3t4+/Ba1u07f5mqEGG0NRFdzfnOgWr0ZmkOKEUB6qRIqUoOenhIYt4DHev 9dO8p8MbtZwVkJHxeZvut3L+KzGmel8kloYntpWnpf26mVGeWgg3PenHrim/Lm6m0zdj ZGrOLGr/Bsk/0s90CR3xqvdHuC4F4QTZPgExoNBN0YOIMsIE8odwyP3BR1ECqwe2Ev6E 8KwOkCN7g4kSDthFcfjeCVKAaD3/566cO/d31uBUhp9XuZXnO7c2aYI0ExPodhKpAN+i KU368L84ExlMXFHqdqxsoDnXqopzV3KYn42px4mZo3IQp8AbD0jG8bB4OjhzE/QPszdc rMOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qTLINJSM; 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 h2-20020a05620a400200b00742817f5f3dsi6578303qko.388.2023.02.27.00.18.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:18:35 -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=qTLINJSM; 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 1pWWOG-0008AO-Pk; Mon, 27 Feb 2023 00:49:36 -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 1pWWN4-0003Re-Hk for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:22 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWN1-0007Kh-HW for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:21 -0500 Received: by mail-pj1-x102b.google.com with SMTP id gi3-20020a17090b110300b0023762f642dcso5046025pjb.4 for ; Sun, 26 Feb 2023 21:48:18 -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=G0WkLijhWCE0+Z/H5Y1BqFs6QzftCoo9iI0aU6IJMxw=; b=qTLINJSMwcZZs9C4/WJG0zmh82SMhiY0ddaX7junmta3NiQCD8f3b1pA1wfV+fNn3E 35frLUBGbrxCVAiRROv5B1CBaA9kkJXZx7l31R8KLrMunmao3MW5/ty1njnXiCacDPDK oAEEy1XppUpv154kHIxRtXdu44Qdik5A266WG7AU+rjaXGUAlmyouH+MU4QqFHdwj8z6 /dxFmFBOJtJaPG5pa05VRaAFQ0FiCQmrPtJO9I5GHfzwIPD/rWIunrVwp6k8Puhqrwjn W/0bbzRZAjS8hB5UxSt+XLdxMTINBO+x4pa/8JNGGSKLviIWGOiUJ2n/udU9TuCNyKzs A6aQ== 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=G0WkLijhWCE0+Z/H5Y1BqFs6QzftCoo9iI0aU6IJMxw=; b=Fh7eWgV5XvQNcn/tfRAF8jGuE3QkbRDwxA1gR35mX1Vu+tvG0Lp50uKgYZOwEvdIRd HRNCr/Ls3FFBvAejvSc24ihTx3BMDYIlF+eCv35P8Sr8gtchZDNA8ziel2Z1aRpjLG/X ioSxQUSOPvx7u2mRAfrK2DWs0VzGvZ3ocpLPdLcV6TMv7yIG/u/52aL1fALWY36841ck RQiEP1X3tIW2FcNu1TG+W771WUpmPMfz26lkaGdyWO7nmJ2XDNwDRP/eNk3J9u1mPUUS VmisDW4GQ80eg/IfzVaojBpnH2lvafj1kRSn/tc6JwxvZ+aH6eMk3S7nq64JApYyHxqY qS2w== X-Gm-Message-State: AO0yUKX/EJ/GV8fSk6TijFAjj8RZZIwz22H2ajOWm0MFhCMQ8y7BS2uK BMWyI4EZIJOLVaTKqlw6WK4KWIdYx9ZGOHb8/mE= X-Received: by 2002:a17:902:ec90:b0:19a:e762:a1af with SMTP id x16-20020a170902ec9000b0019ae762a1afmr7575732plg.33.1677476898459; Sun, 26 Feb 2023 21:48:18 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:18 -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 58/70] target/tricore: Use min/max for saturate Date: Sun, 26 Feb 2023 19:42:21 -1000 Message-Id: <20230227054233.390271-59-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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 Use tcg_constant_i32 for the bounds. Signed-off-by: Richard Henderson --- target/tricore/translate.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 19cf4b6cc7..d5129f22f5 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -2442,21 +2442,13 @@ gen_msubsui_64(TCGv ret_low, TCGv ret_high, TCGv r1, TCGv r2_low, TCGv r2_high, static void gen_saturate(TCGv ret, TCGv arg, int32_t up, int32_t low) { - TCGv sat_neg = tcg_const_i32(low); - TCGv temp = tcg_const_i32(up); - - /* sat_neg = (arg < low ) ? low : arg; */ - tcg_gen_movcond_tl(TCG_COND_LT, sat_neg, arg, sat_neg, sat_neg, arg); - - /* ret = (sat_neg > up ) ? up : sat_neg; */ - tcg_gen_movcond_tl(TCG_COND_GT, ret, sat_neg, temp, temp, sat_neg); + tcg_gen_smax_tl(ret, arg, tcg_constant_i32(low)); + tcg_gen_smin_tl(ret, ret, tcg_constant_i32(up)); } static void gen_saturate_u(TCGv ret, TCGv arg, int32_t up) { - TCGv temp = tcg_const_i32(up); - /* sat_neg = (arg > up ) ? up : arg; */ - tcg_gen_movcond_tl(TCG_COND_GTU, ret, arg, temp, temp, arg); + tcg_gen_umin_tl(ret, ret, tcg_constant_i32(up)); } static void gen_shi(TCGv ret, TCGv r1, int32_t shift_count) From patchwork Mon Feb 27 05:42:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656874 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2186048wrb; Sun, 26 Feb 2023 21:56:41 -0800 (PST) X-Google-Smtp-Source: AK7set82thKe4zYRIRzB3I6SUgDS04qE8gKSDYKZpoGDGlVfKVrvhmxrQtT1QqcyxEbCOGXAv+hA X-Received: by 2002:ac8:5d8b:0:b0:3bf:c407:10c5 with SMTP id d11-20020ac85d8b000000b003bfc40710c5mr13992239qtx.26.1677477401197; Sun, 26 Feb 2023 21:56:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477401; cv=none; d=google.com; s=arc-20160816; b=gRQj03uqrnJCzbjZByDX/coOcX1yHP0BmgQ9TyLBTQZP9nFnE2D5jKF8nwLIJmEw7H oO1+zIkPVIQQ87i0WuPPkhPHwET/liUeDVcOju+mVv5RGkGmR9ky6PYtWc0MYsnos46P crvtBGAh9NA5B74HtnN+30ED20OKtBPdHpQ0qNM9kbv2T77Iho2BRTxxJ4GtDvArfrJg Z1Jja/qhRrAz3/0lyUc5prFj7uXejXH52bu2xzcUz3HLlsa9KNRIwRj8BsjQvoGhJdYh kaEkfyuP8vdK5FqDvThqeLMlyTg8knqY/TnVYnKSAkApJI9vT6tFHjYoBRoLnp5Ta5bw GaRw== 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=8N7xotiHYXic1O+ZngEc/VLZwzQZsxzh55isgdpz8J8=; b=UQzlGGLREA3WdqkGkBok2iJevsEHLL7vuHcptoqYwP3yWkdXvBRdd2SX392SRsRRA2 Kv/EferY30rzGDD2VddP1mRVtoQj7QMyfExVlkPsKhWeYuyuaaeOogCXMJoU2zv7+Cwq tLTKb2EXtoTuTDiKrUrd+Yk7HFSIoGfYFLucJr/WfmN8hqaJ5blIk95XCZkfpLxp36hf 5NHSIESuqjXTaeU/5gSoqy2Ozf9KHq+l+jGB0G6/L0CBEyMENKZw8sJtQDwsuUCZVwSA VdvKs7IAhMpNsUWms/GqzuLbpakn1B3PQujAm4qviPwvpczCrbjjGJmnK1Beb1by4E+Z bnMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ZUVtD/F2"; 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 i21-20020a05620a249500b0071f7f94585fsi6037814qkn.59.2023.02.26.21.56.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:56:41 -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="ZUVtD/F2"; 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 1pWWOE-0007sT-Hi; Mon, 27 Feb 2023 00:49:34 -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 1pWWN7-0003bz-6C for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:25 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWN4-0007W4-Mq for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:24 -0500 Received: by mail-pl1-x630.google.com with SMTP id i10so5550240plr.9 for ; Sun, 26 Feb 2023 21:48:21 -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=8N7xotiHYXic1O+ZngEc/VLZwzQZsxzh55isgdpz8J8=; b=ZUVtD/F27vUyfCT6aiJTqZlp5XxOntjL3saEiLCHem5ik5o4QMTo2TkY6IU3yk+jtO 6XaNAlMwh+0XEfs7VG9dOApUhOo0ErL9GHPGX3IyCGUw/NOl3ihpEH29tF/ak6BpzkyH oEZU6OwYX+SF43iX2uD2KL2itlS3mKUUTgJr6EbYfdD3Fs94fJzS6NIaT+HK2krsJZ2q y0k6E9hfKGU1952i7wldz83hLdTSHHcA0mQtVAUWWgMFlFeEFGsrIxKWYU5oQ7pjwXFj uyz06cQeYXdG/q4Sw7P2qH0duLQwb2Whv17aMwzti/x+D0YBywBMNEwlVM++UX/vY8rT iIqQ== 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=8N7xotiHYXic1O+ZngEc/VLZwzQZsxzh55isgdpz8J8=; b=O8zfdVhFav3CNwaCMP33QhAUQUtXUoaWlathE7NW1d3u+v12xgN4FneG4nDwd/5QMX 32ZLMIUUjoKIY80UqUojdsphgttGPndZlXZ1gQjao1IrV7ri4uA3exuQo3Dk7XtjtOsC PvK4IxTrRF9Zw2M5PMfkKWHHWBKO0GAmehzwAOcLJG9s9dtGHaxikj35crP2Wxi3yzol YGVgDEyUPJd0WUJl1uJDCWw/yj103lMXJHqEOk4kuRFM/eAgvFwKOHxCYfBL8IrbixcV q6yXZVgHYmb4HlMqJrp85GZUNFo+1W9fdmhHPeVwf3Y593RYO8qnrNZ/jLAMNO+opGD8 DC5Q== X-Gm-Message-State: AO0yUKXrTP3PJbFKI2dQmd3djqdjq3BzmnJ9w4cLvEh1MAMYi00G+q4n Pw740ib+jeXI7HEIncsXMuhytBJSjsiWWyfgNfY= X-Received: by 2002:a17:902:d48e:b0:19d:1230:439b with SMTP id c14-20020a170902d48e00b0019d1230439bmr3152137plg.63.1677476901086; Sun, 26 Feb 2023 21:48:21 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:20 -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 59/70] target/tricore: Use setcondi instead of explicit allocation Date: Sun, 26 Feb 2023 19:42:22 -1000 Message-Id: <20230227054233.390271-60-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 This removes the only use of temp. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/tricore/translate.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index d5129f22f5..6b7b876808 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -3506,17 +3506,14 @@ static void decode_sr_accu(DisasContext *ctx) { uint32_t op2; uint32_t r1; - TCGv temp; r1 = MASK_OP_SR_S1D(ctx->opcode); op2 = MASK_OP_SR_OP2(ctx->opcode); switch (op2) { case OPC2_16_SR_RSUB: - /* overflow only if r1 = -0x80000000 */ - temp = tcg_const_i32(-0x80000000); - /* calc V bit */ - tcg_gen_setcond_tl(TCG_COND_EQ, cpu_PSW_V, cpu_gpr_d[r1], temp); + /* calc V bit -- overflow only if r1 = -0x80000000 */ + tcg_gen_setcondi_tl(TCG_COND_EQ, cpu_PSW_V, cpu_gpr_d[r1], -0x80000000); tcg_gen_shli_tl(cpu_PSW_V, cpu_PSW_V, 31); /* calc SV bit */ tcg_gen_or_tl(cpu_PSW_SV, cpu_PSW_SV, cpu_PSW_V); From patchwork Mon Feb 27 05:42:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656873 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2185950wrb; Sun, 26 Feb 2023 21:56:20 -0800 (PST) X-Google-Smtp-Source: AK7set/rxXK02tsQTvgzQglfzhV+7SyiJe8DpVz0Tnr2Twp7irLDZH0bx1mX5uhDSpbFPirAU+3w X-Received: by 2002:a05:622a:189a:b0:3b9:bc8c:c210 with SMTP id v26-20020a05622a189a00b003b9bc8cc210mr13671163qtc.27.1677477380283; Sun, 26 Feb 2023 21:56:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677477380; cv=none; d=google.com; s=arc-20160816; b=bHIa33OgXxhS7ucTyJ2PyRcG6bgRDO9ObuxrnHnVZ3H5NQMGBI6J4qgyltoYg6BZ+U bvjVAlhTzJf77EZ4M6sHCgMzkL8hL7soNY5Wa3GXSvl32Uo4JnzISfpzfX0/cSJaTlha k60OUcLvx24ZHVawck0kFIEBUkhycioqTxYqjMDJxT+qv9vEq1zDQXi3QjrJzpTKeKwt r4JeSb6QaC3SQe0H3DC31m81T2FSlAtYTaheT3sJABP520cCG+QB6UaQDRUZ6XB5Q9pk bqAKiw6GlMlPEizR/zt7ETdDWYfTGTkCLuEml3PmLziyUA3ZZI2sheTp9oJAOeJbJH/H ge6w== 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=pbVY1YRte3qR5fLZYESRSG1NLBaIN6wrPtZwVv1o2+w=; b=fqThkWIN+z6zb3BVpW8KLXuqnbL7pLqkQ2BklIfZDbpcvvzjSfUyo6ew8+/ZWmFas8 FguAYqZFFGySyoK8Q1qTDG96u5zjTrpE/lFTurwKH7aNaivLr6WVSyufq9KsTixfdK9S GEjwBgeblEPZChqcJEf1GTFhA1WvvqFhiNwmUXAcrIHy+sf+3qrXdc5XicqlGiBeGm2p o1ZCvbkKC6gOVT8WGS5+yp/MnAXq1htd7cGML1TZShbnk65fMU647Ycc8ZN9/xfcV3Lh PmDrXpgBHrJ7zs2Ydh9xiDBzgsUAPsTVM2oLgieqxqfK7ukjYjB+7ZGa7SJI72iEP6eH zgXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y2IPbJks; 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 s26-20020a05622a1a9a00b003a4f21d8f92si5611030qtc.552.2023.02.26.21.56.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:56:20 -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=Y2IPbJks; 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 1pWWOE-0007oM-5E; Mon, 27 Feb 2023 00:49:34 -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 1pWWNA-0003qU-62 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:28 -0500 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWN6-0007Gb-SF for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:27 -0500 Received: by mail-pj1-x1030.google.com with SMTP id x34so4953315pjj.0 for ; Sun, 26 Feb 2023 21:48:24 -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=pbVY1YRte3qR5fLZYESRSG1NLBaIN6wrPtZwVv1o2+w=; b=Y2IPbJksQGxF2PSh23bEjGAI9C1Jhl6nAcH1ozPNe+Sv4mz35dJzDlRHRKmuRd/WSA ZktUPd20LwGAYEOa5MPpQtAcgYtM62xgdNlj9mbedPWgQEL4kfEJv2jIqqlNh6PRgRGg bOwJZqL+Q9qulBIOJJXXZn40wBlYc2Y3kCVDDuL4VavsfMMg2qh3Lw/fA81dynCqwgK/ QsaCXSqNxzbBwVRcSwaA/OyenjIFOYQorXrnXl4oOS2zcw34BS3PptQ6/qvOK3EcWk28 +zLDgn6MaLZMN3zp7JAq+8GMGm1jbASAUws3mzcFAHnCsOI8B523h6i393LjuDTdgLWs 8F5w== 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=pbVY1YRte3qR5fLZYESRSG1NLBaIN6wrPtZwVv1o2+w=; b=MOilupxiJxxojVNYm6bqhMj9t2y4vUM+W5g6iF0RzoXF7moeL4lKb6VJHlTNreF/hp zZG+hEViFb2ToBGtmORagS37xzEPW6hfunqrUiEOtCpqMxRbfNUTERdwLMC6GWr+3n/2 vuHnIVNoSMKb3/G6Gc4i/4sqFT4VUgi5kCHt8Dh/YIvXhR+jm+Y16u494L/Kih/kqeG8 c4akJeW7+QqB7E+bzUD/sYnOpbAmFbtJvHzPl3Ocdh11rH2EWwKbYqco/KXUFE6Ihzox WbUR8SEG0CZF6+qzXYFb2tuIfj4R3zacWE6zuPwx9DxcT8NC5rEtRRCJoyIYGk3uk6cz S1Gg== X-Gm-Message-State: AO0yUKXGOvmhwdP24xKle8ZuY/Yu1EwoUwQFCHOCj+XL3wBGm6V6jUl2 sCvlvfjSiqBTk46yY8UEGrl5P6uj+YHuSqRhV2Q= X-Received: by 2002:a17:903:189:b0:19c:df6e:6aec with SMTP id z9-20020a170903018900b0019cdf6e6aecmr8702614plg.7.1677476903767; Sun, 26 Feb 2023 21:48:23 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:23 -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 60/70] target/tricore: Drop some temp initialization Date: Sun, 26 Feb 2023 19:42:23 -1000 Message-Id: <20230227054233.390271-61-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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 The temp variables here are always set afterward; the initialization with a constant was discarded. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/tricore/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 6b7b876808..71c8f3d568 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -6906,7 +6906,7 @@ static void decode_rrr1_maddq_h(DisasContext *ctx) r4 = MASK_OP_RRR1_D(ctx->opcode); n = MASK_OP_RRR1_N(ctx->opcode); - temp = tcg_const_i32(n); + temp = tcg_temp_new(); temp2 = tcg_temp_new(); switch (op2) { @@ -7388,7 +7388,7 @@ static void decode_rrr1_msubq_h(DisasContext *ctx) r4 = MASK_OP_RRR1_D(ctx->opcode); n = MASK_OP_RRR1_N(ctx->opcode); - temp = tcg_const_i32(n); + temp = tcg_temp_new(); temp2 = tcg_temp_new(); switch (op2) { From patchwork Mon Feb 27 05:42:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656910 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2229775wrb; Mon, 27 Feb 2023 00:18:26 -0800 (PST) X-Google-Smtp-Source: AK7set+W8H0z07a7iWOOxrmS9Ic0EQtQqQgdKrMwFK/hvMHlXxeXaaLbM4I0MAqLFNn1QA+/7ruA X-Received: by 2002:a05:622a:11c7:b0:3bf:aa76:f4e1 with SMTP id n7-20020a05622a11c700b003bfaa76f4e1mr31718698qtk.40.1677485905994; Mon, 27 Feb 2023 00:18:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485905; cv=none; d=google.com; s=arc-20160816; b=bXGPdZZMTYfIxVrb3zT+v5kxbymLXTgcL5CwFKekBwGNwB+7Ed2qlKCAwguutXSnsW M/1/9JMkjohtX2z8KJjrnVm+Gs1gbSEwQfbvFtet9ufWx2h1AVcYnbBUM6rPjil5fiOX 7oHtWkRDZ2wWeuqNPDcpgKYfnVmmVsDBGFdj9+9kujdRT4qnvfrotB6KNi6kMk2itG8F qM27I5+P437V77Utm28+QgJzS/o4HP/LLUC/iAwY+xoKcRNvvhqzBlVXqKN+sHD/LhMg vA8cldhQ9oRdQ3YWBVl6jwNKpbsenxpDXz6n3xEVGxaJzkPRQY5iO3h2QIrJ9isyA3QT QIGg== 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=DIMzL9acyGxa+iCDYHzCCw6qObXk60UJrAsgT++SeHo=; b=sqMjzuxtzNSjCow+VcS24bCRAthYDPTpwsli6h0EJANn6Ih61hoLLnLSgwLDGhUhUA NYZwK8RLSQt7Kc0sU3Ncp7uj93JEvoI5tRcMnbcFNb+ABM+qUz9fYR9/j5B5km14kn5+ ojdEFYaG0MsZExpZJKFtw++qngdv/KVlf84qFDpGwa/YkKuSwrLLjHwkyTlioPyWD5jV 2yzKnhFO2L3rE3wDvYXr0fmWJ9US+uD3lB5h+Oxp1z8MUISlFNLRPnnrcvZlOS5Bb1HJ Sg0pTF2ImFYZ7nRZExcz7Act0t/g+RUE+3QhqdDXGXm2KWaVdj4ggKy1pSyP0IC8Sg7W CIwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TtA3I7mb; 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 j7-20020ac84047000000b003b8681d0a1dsi5307371qtl.404.2023.02.27.00.18.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:18:25 -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=TtA3I7mb; 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 1pWWOG-00088t-Bv; Mon, 27 Feb 2023 00:49:36 -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 1pWWNC-0004AW-VS for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:31 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWNA-0007ZB-18 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:30 -0500 Received: by mail-pl1-x636.google.com with SMTP id z2so5537322plf.12 for ; Sun, 26 Feb 2023 21:48:27 -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=DIMzL9acyGxa+iCDYHzCCw6qObXk60UJrAsgT++SeHo=; b=TtA3I7mb91RXzhat1pNeyE8EsklDmTa0hOBxwf2ibW88wSaDZ7UdDo3mQZIWTiX9Wg ynsDPLt0MOIzdPpGfPiC9h3HqGaUNQbh02OriVpWUz7uYv23OI2fDYTQ4nJOG5f8Odn5 rVm82Zk2YjixhpUKzScaEbCD7osNy2L0hOLYCVlTa7PjLooINWZX0qBv+Ucsz/UHgBaX rZ3Q4X4TXUl0HnDaa5CXDQR+O8IguMgN0UfCLoqaqwAQgGC0EhcM4PdSHJSswn/9lmbV 4guEKnT36l+Q71YeesZI+1SlnC1CbiLSkprcMTzLWp33vk9wH/9Ty6CQZOVh3pkYbxEr pUxg== 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=DIMzL9acyGxa+iCDYHzCCw6qObXk60UJrAsgT++SeHo=; b=29u6mwfg6m6yK9KHw7OW278+jzoGyBv0rWjgiU11ZkkgyYzOBCY652RMcCbxA3HySG c5JQjwBW+nGe4nB7mQOJ46B8P1qCY5X6j1LoNxSMTTFzsMX8MHS4qjpZ0RvOhmmP4aku TqWOxvPyPfi5zCgHPCPCL3ibDdHfNKIF3os1Zer7A8jXsXm42Xs0FCayBMejhEXD9k8h d+xvsaAMMXOMwbDBT3Iqb3WD17XwxNkSgUm3f7NffFdBRhG/euZm6v7m4kbEJMDvMvjZ 053+gV0pUa4XtRWB4yWbrDBoTP1WJKXHdaJPgNCp15kyNO/Eqf0hP0glA8l1HuufUn9P pynw== X-Gm-Message-State: AO0yUKWDKMzKAe4yM48PF3en1j8dywzBQIb08iJIcTq7Trog/AfKD9Jj f3roVCtDEsPgxmRPK1yyUrywsdyq56LSB63p0h0= X-Received: by 2002:a17:902:d4c3:b0:19c:c9d0:5bf8 with SMTP id o3-20020a170902d4c300b0019cc9d05bf8mr14192714plg.35.1677476906360; Sun, 26 Feb 2023 21:48:26 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:25 -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 61/70] target/tricore: Avoid tcg_const_i32 Date: Sun, 26 Feb 2023 19:42:24 -1000 Message-Id: <20230227054233.390271-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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 All remaining uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/tricore/translate.c | 127 +++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 63 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 71c8f3d568..3dd9327f6c 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -124,7 +124,7 @@ void tricore_cpu_dump_state(CPUState *cs, FILE *f, int flags) /* Makros for generating helpers */ #define gen_helper_1arg(name, arg) do { \ - TCGv_i32 helper_tmp = tcg_const_i32(arg); \ + TCGv_i32 helper_tmp = tcg_constant_i32(arg); \ gen_helper_##name(cpu_env, helper_tmp); \ } while (0) @@ -513,7 +513,7 @@ static inline void gen_madd32_d(TCGv ret, TCGv r1, TCGv r2, TCGv r3) static inline void gen_maddi32_d(TCGv ret, TCGv r1, TCGv r2, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_madd32_d(ret, r1, r2, temp); } @@ -579,7 +579,7 @@ static inline void gen_maddi64_d(TCGv ret_low, TCGv ret_high, TCGv r1, TCGv r2_low, TCGv r2_high, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_madd64_d(ret_low, ret_high, r1, r2_low, r2_high, temp); } @@ -587,7 +587,7 @@ static inline void gen_maddui64_d(TCGv ret_low, TCGv ret_high, TCGv r1, TCGv r2_low, TCGv r2_high, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_maddu64_d(ret_low, ret_high, r1, r2_low, r2_high, temp); } @@ -1224,7 +1224,7 @@ static inline void gen_msub32_d(TCGv ret, TCGv r1, TCGv r2, TCGv r3) static inline void gen_msubi32_d(TCGv ret, TCGv r1, TCGv r2, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_msub32_d(ret, r1, r2, temp); } @@ -1260,7 +1260,7 @@ static inline void gen_msubi64_d(TCGv ret_low, TCGv ret_high, TCGv r1, TCGv r2_low, TCGv r2_high, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_msub64_d(ret_low, ret_high, r1, r2_low, r2_high, temp); } @@ -1296,13 +1296,13 @@ static inline void gen_msubui64_d(TCGv ret_low, TCGv ret_high, TCGv r1, TCGv r2_low, TCGv r2_high, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_msubu64_d(ret_low, ret_high, r1, r2_low, r2_high, temp); } static inline void gen_addi_d(TCGv ret, TCGv r1, target_ulong r2) { - TCGv temp = tcg_const_i32(r2); + TCGv temp = tcg_constant_i32(r2); gen_add_d(ret, r1, temp); } @@ -1332,7 +1332,7 @@ static inline void gen_add_CC(TCGv ret, TCGv r1, TCGv r2) static inline void gen_addi_CC(TCGv ret, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_add_CC(ret, r1, temp); } @@ -1364,7 +1364,7 @@ static inline void gen_addc_CC(TCGv ret, TCGv r1, TCGv r2) static inline void gen_addci_CC(TCGv ret, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_addc_CC(ret, r1, temp); } @@ -1375,7 +1375,7 @@ static inline void gen_cond_add(TCGCond cond, TCGv r1, TCGv r2, TCGv r3, TCGv temp2 = tcg_temp_new(); TCGv result = tcg_temp_new(); TCGv mask = tcg_temp_new(); - TCGv t0 = tcg_const_i32(0); + TCGv t0 = tcg_constant_i32(0); /* create mask for sticky bits */ tcg_gen_setcond_tl(cond, mask, r4, t0); @@ -1404,7 +1404,7 @@ static inline void gen_cond_add(TCGCond cond, TCGv r1, TCGv r2, TCGv r3, static inline void gen_condi_add(TCGCond cond, TCGv r1, int32_t r2, TCGv r3, TCGv r4) { - TCGv temp = tcg_const_i32(r2); + TCGv temp = tcg_constant_i32(r2); gen_cond_add(cond, r1, temp, r3, r4); } @@ -1492,7 +1492,7 @@ static inline void gen_cond_sub(TCGCond cond, TCGv r1, TCGv r2, TCGv r3, TCGv temp2 = tcg_temp_new(); TCGv result = tcg_temp_new(); TCGv mask = tcg_temp_new(); - TCGv t0 = tcg_const_i32(0); + TCGv t0 = tcg_constant_i32(0); /* create mask for sticky bits */ tcg_gen_setcond_tl(cond, mask, r4, t0); @@ -1705,14 +1705,14 @@ gen_msubr32s_h(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) static inline void gen_msubr_q(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n) { - TCGv temp = tcg_const_i32(n); + TCGv temp = tcg_constant_i32(n); gen_helper_msubr_q(ret, cpu_env, r1, r2, r3, temp); } static inline void gen_msubrs_q(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n) { - TCGv temp = tcg_const_i32(n); + TCGv temp = tcg_constant_i32(n); gen_helper_msubr_q_ssov(ret, cpu_env, r1, r2, r3, temp); } @@ -2149,13 +2149,13 @@ static inline void gen_absdif(TCGv ret, TCGv r1, TCGv r2) static inline void gen_absdifi(TCGv ret, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_absdif(ret, r1, temp); } static inline void gen_absdifsi(TCGv ret, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_helper_absdif_ssov(ret, cpu_env, r1, temp); } @@ -2181,7 +2181,7 @@ static inline void gen_mul_i32s(TCGv ret, TCGv r1, TCGv r2) static inline void gen_muli_i32s(TCGv ret, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_mul_i32s(ret, r1, temp); } @@ -2202,7 +2202,7 @@ static inline void gen_mul_i64s(TCGv ret_low, TCGv ret_high, TCGv r1, TCGv r2) static inline void gen_muli_i64s(TCGv ret_low, TCGv ret_high, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_mul_i64s(ret_low, ret_high, r1, temp); } @@ -2223,31 +2223,32 @@ static inline void gen_mul_i64u(TCGv ret_low, TCGv ret_high, TCGv r1, TCGv r2) static inline void gen_muli_i64u(TCGv ret_low, TCGv ret_high, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_mul_i64u(ret_low, ret_high, r1, temp); } static inline void gen_mulsi_i32(TCGv ret, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_helper_mul_ssov(ret, cpu_env, r1, temp); } static inline void gen_mulsui_i32(TCGv ret, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_helper_mul_suov(ret, cpu_env, r1, temp); } + /* gen_maddsi_32(cpu_gpr_d[r4], cpu_gpr_d[r1], cpu_gpr_d[r3], const9); */ static inline void gen_maddsi_32(TCGv ret, TCGv r1, TCGv r2, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_helper_madd32_ssov(ret, cpu_env, r1, r2, temp); } static inline void gen_maddsui_32(TCGv ret, TCGv r1, TCGv r2, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_helper_madd32_suov(ret, cpu_env, r1, r2, temp); } @@ -2370,7 +2371,7 @@ static inline void gen_maddsi_64(TCGv ret_low, TCGv ret_high, TCGv r1, TCGv r2_low, TCGv r2_high, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_madds_64(ret_low, ret_high, r1, r2_low, r2_high, temp); } @@ -2388,19 +2389,19 @@ static inline void gen_maddsui_64(TCGv ret_low, TCGv ret_high, TCGv r1, TCGv r2_low, TCGv r2_high, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_maddsu_64(ret_low, ret_high, r1, r2_low, r2_high, temp); } static inline void gen_msubsi_32(TCGv ret, TCGv r1, TCGv r2, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_helper_msub32_ssov(ret, cpu_env, r1, r2, temp); } static inline void gen_msubsui_32(TCGv ret, TCGv r1, TCGv r2, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_helper_msub32_suov(ret, cpu_env, r1, r2, temp); } @@ -2418,7 +2419,7 @@ static inline void gen_msubsi_64(TCGv ret_low, TCGv ret_high, TCGv r1, TCGv r2_low, TCGv r2_high, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_msubs_64(ret_low, ret_high, r1, r2_low, r2_high, temp); } @@ -2436,7 +2437,7 @@ static inline void gen_msubsui_64(TCGv ret_low, TCGv ret_high, TCGv r1, TCGv r2_low, TCGv r2_high, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_msubsu_64(ret_low, ret_high, r1, r2_low, r2_high, temp); } @@ -2499,8 +2500,8 @@ static void gen_shaci(TCGv ret, TCGv r1, int32_t shift_count) /* clear PSW.V */ tcg_gen_movi_tl(cpu_PSW_V, 0); } else if (shift_count > 0) { - TCGv t_max = tcg_const_i32(0x7FFFFFFF >> shift_count); - TCGv t_min = tcg_const_i32(((int32_t) -0x80000000) >> shift_count); + TCGv t_max = tcg_constant_i32(0x7FFFFFFF >> shift_count); + TCGv t_min = tcg_constant_i32(((int32_t) -0x80000000) >> shift_count); /* calc carry */ msk_start = 32 - shift_count; @@ -2538,7 +2539,7 @@ static void gen_shas(TCGv ret, TCGv r1, TCGv r2) static void gen_shasi(TCGv ret, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_shas(ret, r1, temp); } @@ -2580,7 +2581,7 @@ static void gen_sh_cond(int cond, TCGv ret, TCGv r1, TCGv r2) static void gen_sh_condi(int cond, TCGv ret, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_sh_cond(cond, ret, r1, temp); } @@ -2591,13 +2592,13 @@ static inline void gen_adds(TCGv ret, TCGv r1, TCGv r2) static inline void gen_addsi(TCGv ret, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_helper_add_ssov(ret, cpu_env, r1, temp); } static inline void gen_addsui(TCGv ret, TCGv r1, int32_t con) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_helper_add_suov(ret, cpu_env, r1, temp); } @@ -2667,7 +2668,7 @@ static inline void gen_accumulating_condi(int cond, TCGv ret, TCGv r1, int32_t con, void(*op)(TCGv, TCGv, TCGv)) { - TCGv temp = tcg_const_i32(con); + TCGv temp = tcg_constant_i32(con); gen_accumulating_cond(cond, ret, r1, temp, op); } @@ -2834,8 +2835,8 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) static void generate_trap(DisasContext *ctx, int class, int tin) { - TCGv_i32 classtemp = tcg_const_i32(class); - TCGv_i32 tintemp = tcg_const_i32(tin); + TCGv_i32 classtemp = tcg_constant_i32(class); + TCGv_i32 tintemp = tcg_constant_i32(tin); gen_save_pc(ctx->base.pc_next); gen_helper_raise_exception_sync(cpu_env, classtemp, tintemp); @@ -2857,7 +2858,7 @@ static inline void gen_branch_cond(DisasContext *ctx, TCGCond cond, TCGv r1, static inline void gen_branch_condi(DisasContext *ctx, TCGCond cond, TCGv r1, int r2, int16_t address) { - TCGv temp = tcg_const_i32(r2); + TCGv temp = tcg_constant_i32(r2); gen_branch_cond(ctx, cond, r1, temp, address); } @@ -3186,14 +3187,14 @@ static void decode_src_opc(DisasContext *ctx, int op1) cpu_gpr_d[15]); break; case OPC1_16_SRC_CMOV: - temp = tcg_const_tl(0); - temp2 = tcg_const_tl(const4); + temp = tcg_constant_tl(0); + temp2 = tcg_constant_tl(const4); tcg_gen_movcond_tl(TCG_COND_NE, cpu_gpr_d[r1], cpu_gpr_d[15], temp, temp2, cpu_gpr_d[r1]); break; case OPC1_16_SRC_CMOVN: - temp = tcg_const_tl(0); - temp2 = tcg_const_tl(const4); + temp = tcg_constant_tl(0); + temp2 = tcg_constant_tl(const4); tcg_gen_movcond_tl(TCG_COND_EQ, cpu_gpr_d[r1], cpu_gpr_d[15], temp, temp2, cpu_gpr_d[r1]); break; @@ -3259,12 +3260,12 @@ static void decode_srr_opc(DisasContext *ctx, int op1) tcg_gen_and_tl(cpu_gpr_d[r1], cpu_gpr_d[r1], cpu_gpr_d[r2]); break; case OPC1_16_SRR_CMOV: - temp = tcg_const_tl(0); + temp = tcg_constant_tl(0); tcg_gen_movcond_tl(TCG_COND_NE, cpu_gpr_d[r1], cpu_gpr_d[15], temp, cpu_gpr_d[r2], cpu_gpr_d[r1]); break; case OPC1_16_SRR_CMOVN: - temp = tcg_const_tl(0); + temp = tcg_constant_tl(0); tcg_gen_movcond_tl(TCG_COND_EQ, cpu_gpr_d[r1], cpu_gpr_d[15], temp, cpu_gpr_d[r2], cpu_gpr_d[r1]); break; @@ -3789,7 +3790,7 @@ static void decode_abs_ldw(DisasContext *ctx) address = MASK_OP_ABS_OFF18(ctx->opcode); op2 = MASK_OP_ABS_OP2(ctx->opcode); - temp = tcg_const_i32(EA_ABS_FORMAT(address)); + temp = tcg_constant_i32(EA_ABS_FORMAT(address)); switch (op2) { case OPC2_32_ABS_LD_A: @@ -3822,7 +3823,7 @@ static void decode_abs_ldb(DisasContext *ctx) address = MASK_OP_ABS_OFF18(ctx->opcode); op2 = MASK_OP_ABS_OP2(ctx->opcode); - temp = tcg_const_i32(EA_ABS_FORMAT(address)); + temp = tcg_constant_i32(EA_ABS_FORMAT(address)); switch (op2) { case OPC2_32_ABS_LD_B: @@ -3853,7 +3854,7 @@ static void decode_abs_ldst_swap(DisasContext *ctx) address = MASK_OP_ABS_OFF18(ctx->opcode); op2 = MASK_OP_ABS_OP2(ctx->opcode); - temp = tcg_const_i32(EA_ABS_FORMAT(address)); + temp = tcg_constant_i32(EA_ABS_FORMAT(address)); switch (op2) { case OPC2_32_ABS_LDMST: @@ -3904,7 +3905,7 @@ static void decode_abs_store(DisasContext *ctx) address = MASK_OP_ABS_OFF18(ctx->opcode); op2 = MASK_OP_ABS_OP2(ctx->opcode); - temp = tcg_const_i32(EA_ABS_FORMAT(address)); + temp = tcg_constant_i32(EA_ABS_FORMAT(address)); switch (op2) { case OPC2_32_ABS_ST_A: @@ -3937,7 +3938,7 @@ static void decode_abs_storeb_h(DisasContext *ctx) address = MASK_OP_ABS_OFF18(ctx->opcode); op2 = MASK_OP_ABS_OP2(ctx->opcode); - temp = tcg_const_i32(EA_ABS_FORMAT(address)); + temp = tcg_constant_i32(EA_ABS_FORMAT(address)); switch (op2) { case OPC2_32_ABS_ST_B: @@ -5295,7 +5296,7 @@ static void decode_rcpw_insert(DisasContext *ctx) case OPC2_32_RCPW_INSERT: /* if pos + width > 32 undefined result */ if (pos + width <= 32) { - temp = tcg_const_i32(const4); + temp = tcg_constant_i32(const4); tcg_gen_deposit_tl(cpu_gpr_d[r2], cpu_gpr_d[r1], temp, pos, width); } break; @@ -5371,14 +5372,14 @@ static void decode_rcr_cond_select(DisasContext *ctx) cpu_gpr_d[r3]); break; case OPC2_32_RCR_SEL: - temp = tcg_const_i32(0); - temp2 = tcg_const_i32(const9); + temp = tcg_constant_i32(0); + temp2 = tcg_constant_i32(const9); tcg_gen_movcond_tl(TCG_COND_NE, cpu_gpr_d[r4], cpu_gpr_d[r3], temp, cpu_gpr_d[r1], temp2); break; case OPC2_32_RCR_SELN: - temp = tcg_const_i32(0); - temp2 = tcg_const_i32(const9); + temp = tcg_constant_i32(0); + temp2 = tcg_constant_i32(const9); tcg_gen_movcond_tl(TCG_COND_EQ, cpu_gpr_d[r4], cpu_gpr_d[r3], temp, cpu_gpr_d[r1], temp2); break; @@ -6255,7 +6256,7 @@ static void decode_rr1_mul(DisasContext *ctx) r1 = MASK_OP_RR1_S1(ctx->opcode); r2 = MASK_OP_RR1_S2(ctx->opcode); r3 = MASK_OP_RR1_D(ctx->opcode); - n = tcg_const_i32(MASK_OP_RR1_N(ctx->opcode)); + n = tcg_constant_i32(MASK_OP_RR1_N(ctx->opcode)); op2 = MASK_OP_RR1_OP2(ctx->opcode); switch (op2) { @@ -6549,12 +6550,12 @@ static void decode_rrr_cond_select(DisasContext *ctx) cpu_gpr_d[r3]); break; case OPC2_32_RRR_SEL: - temp = tcg_const_i32(0); + temp = tcg_constant_i32(0); tcg_gen_movcond_tl(TCG_COND_NE, cpu_gpr_d[r4], cpu_gpr_d[r3], temp, cpu_gpr_d[r1], cpu_gpr_d[r2]); break; case OPC2_32_RRR_SELN: - temp = tcg_const_i32(0); + temp = tcg_constant_i32(0); tcg_gen_movcond_tl(TCG_COND_EQ, cpu_gpr_d[r4], cpu_gpr_d[r3], temp, cpu_gpr_d[r1], cpu_gpr_d[r2]); break; @@ -7956,7 +7957,7 @@ static void decode_32Bit_opc(DisasContext *ctx) case OPC1_32_ABS_STOREQ: address = MASK_OP_ABS_OFF18(ctx->opcode); r1 = MASK_OP_ABS_S1D(ctx->opcode); - temp = tcg_const_i32(EA_ABS_FORMAT(address)); + temp = tcg_constant_i32(EA_ABS_FORMAT(address)); temp2 = tcg_temp_new(); tcg_gen_shri_tl(temp2, cpu_gpr_d[r1], 16); @@ -7965,7 +7966,7 @@ static void decode_32Bit_opc(DisasContext *ctx) case OPC1_32_ABS_LD_Q: address = MASK_OP_ABS_OFF18(ctx->opcode); r1 = MASK_OP_ABS_S1D(ctx->opcode); - temp = tcg_const_i32(EA_ABS_FORMAT(address)); + temp = tcg_constant_i32(EA_ABS_FORMAT(address)); tcg_gen_qemu_ld_tl(cpu_gpr_d[r1], temp, ctx->mem_idx, MO_LEUW); tcg_gen_shli_tl(cpu_gpr_d[r1], cpu_gpr_d[r1], 16); @@ -7981,7 +7982,7 @@ static void decode_32Bit_opc(DisasContext *ctx) b = MASK_OP_ABSB_B(ctx->opcode); bpos = MASK_OP_ABSB_BPOS(ctx->opcode); - temp = tcg_const_i32(EA_ABS_FORMAT(address)); + temp = tcg_constant_i32(EA_ABS_FORMAT(address)); temp2 = tcg_temp_new(); tcg_gen_qemu_ld_tl(temp2, temp, ctx->mem_idx, MO_UB); @@ -8108,7 +8109,7 @@ static void decode_32Bit_opc(DisasContext *ctx) r2 = MASK_OP_RCRR_S3(ctx->opcode); r3 = MASK_OP_RCRR_D(ctx->opcode); const16 = MASK_OP_RCRR_CONST4(ctx->opcode); - temp = tcg_const_i32(const16); + temp = tcg_constant_i32(const16); temp2 = tcg_temp_new(); /* width*/ temp3 = tcg_temp_new(); /* pos */ From patchwork Mon Feb 27 05:42:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656895 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2227898wrb; Mon, 27 Feb 2023 00:12:22 -0800 (PST) X-Google-Smtp-Source: AK7set9A5DNslYtJh91aF5Qi1ICjbvty5GiR5ZBeF+Ez7BrA5yPfqDhCOoGmT4u1BXmqoF3QSqaq X-Received: by 2002:ac8:4e52:0:b0:3bf:daae:7ec9 with SMTP id e18-20020ac84e52000000b003bfdaae7ec9mr3229150qtw.43.1677485542518; Mon, 27 Feb 2023 00:12:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485542; cv=none; d=google.com; s=arc-20160816; b=jYR4PAH5KR0CN2FLhUofogzyuXPz3zfJijNxLyT6VAtGZ0Y2ZKEwcISLRqdnWYV0UM ZY5Z7vdheghTKun3OQ45O0ViogaJf+RcbpiX8uTHgw4FqiDTRRdFEdIwUnqa5VP1N4md ZB2pcu1ncOCvpxF8HCnf54jTvFCl3gHMg2TVbIlIqLrTqcOmbUH0vMAVsrrULEguJ4sh FzR9TacDdrTMNLR10AXf5wDCVXM2yj/t8s8fjn4iw0xu5ZeBEGb+WSmFp4uPbcXkxQSA xVwWxY5k79DZek+1z0+zJM5DGDm+7SIsekaEr83IfdocA64a4C3uyzh2w49RXj6t4uS4 phVg== 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=t+5KFxEM4lJEelpxdqt9pc+tgTO1lJZXj+S0G2tDTgY=; b=sENRutMcMoXWIRnQfs4N+OSa4WwpRaVLybLyS3F0wEX2cC3yXB4dMLyyZnpDRMahmv nNMXGMTli44fQh0DPCEp3UE+IzjbhfMmDyePG5C9sOoHZXoTCo8iFWgGRQfSMf/ZLlHx xp3Bcy2A0odPbxQFXL1h2ihXhKUi8UFlKy8eAaAQ1pQy11sviqpuLMncSoaOKg3HPVUO /Wb3oIQTf1ftxcdzYhfxMOfsMJAy7sJpcG27lQxVSxVc25lAW4684gFl3/Llqj+OBenu ZONjAUknQgorjj5hubitxCoXZOzbr9iZJtl81s1YyllEOI9xbKQn1Zp0wFs9/jqgMl5P 9i1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gwflLolh; 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 u5-20020a05620a430500b00720b402660bsi6096696qko.480.2023.02.27.00.12.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:12:22 -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=gwflLolh; 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 1pWWOP-000192-NE; Mon, 27 Feb 2023 00:49:45 -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 1pWWNG-0004E2-51 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:37 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWNC-0007PQ-AY for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:31 -0500 Received: by mail-pl1-x630.google.com with SMTP id u5so2166362plq.7 for ; Sun, 26 Feb 2023 21:48:29 -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=t+5KFxEM4lJEelpxdqt9pc+tgTO1lJZXj+S0G2tDTgY=; b=gwflLolh8YvPq4+xsyTBSIjeo9lSGPuBFC+o2Rgq7feae4/Q4AJhdlDq9aizYXngE4 sct7Ln+UnM3vYKWxFE23+Y/PmC7y7pycYRXFX+KXDx8J8vqUtZX3K8zDAd3CYxvjWKrN 5WQxVjbvclkLY9iqCe3muD5BN/zMu6f/l82GPrtXbn6SlaCx4zP6IuL5QJVe0yLXBqQD TRyp8zX3tNRZRq0Esi8zK01OkjW907RJH7i7ubUWrVlvthwLJwX8ch95U8O5rXKqg8U3 Y3FrfWF9SMZI9z2q7SozjdHkrxBOxHs1pQ3ByTt+di1v7ndsDNyHdeLRfBij4vbXo+F6 xW6w== 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=t+5KFxEM4lJEelpxdqt9pc+tgTO1lJZXj+S0G2tDTgY=; b=T26INSCJW2R+pDW8nOLHyHAMpM1X4VEgRwIHrvlMTWmhoSeRoVBthK0FKTrw/n6tJK z5hcAgTUWoj63pXKAQFIIfjTpDxUqN62vv7xO66uyOgBAS/gnWrhndbnIbaM6vfhe8s/ WfTOgMengUGiytqPxsshBouB0OEyYVMybDs6B7rk1icPAStDOKcd/hBkRATlBD/8k7aF Hx0FJj5OeAALqW+9c0CXs934IFT7jFrB3yReVS6CL/Fph98l7FCtTKOH3kK49LdxvAJL KTfZP3JW/SszGvpCrpg/xXfkiqAUVE9N1o2+AnI35xtBzZr8VcHTIwD5URTQ2M3CSzy7 M4YQ== X-Gm-Message-State: AO0yUKUOhqhXWynv6jGYtqBKlH5NQB5niUy4zHdj8sD3aTaCoLhJsAlm 1k08A6XGwG/xEaMVQIhyRZ4GuzZXj8RF57MvVcA= X-Received: by 2002:a17:902:f544:b0:19d:138b:7c4a with SMTP id h4-20020a170902f54400b0019d138b7c4amr3097982plf.3.1677476909172; Sun, 26 Feb 2023 21:48:29 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:28 -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 62/70] target/xtensa: Tidy translate_bb Date: Sun, 26 Feb 2023 19:42:25 -1000 Message-Id: <20230227054233.390271-63-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 Replace ifdefs with C, tcg_const_i32 with tcg_constant_i32. We only need a single temporary for this. Signed-off-by: Richard Henderson Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé --- target/xtensa/translate.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 3ea50d8bc3..e3fcd50691 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1406,19 +1406,15 @@ static void translate_b(DisasContext *dc, const OpcodeArg arg[], static void translate_bb(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { -#if TARGET_BIG_ENDIAN - TCGv_i32 bit = tcg_const_i32(0x80000000u); -#else - TCGv_i32 bit = tcg_const_i32(0x00000001u); -#endif TCGv_i32 tmp = tcg_temp_new_i32(); + tcg_gen_andi_i32(tmp, arg[1].in, 0x1f); -#if TARGET_BIG_ENDIAN - tcg_gen_shr_i32(bit, bit, tmp); -#else - tcg_gen_shl_i32(bit, bit, tmp); -#endif - tcg_gen_and_i32(tmp, arg[0].in, bit); + if (TARGET_BIG_ENDIAN) { + tcg_gen_shr_i32(tmp, tcg_constant_i32(0x80000000u), tmp); + } else { + tcg_gen_shl_i32(tmp, tcg_constant_i32(0x00000001u), tmp); + } + tcg_gen_and_i32(tmp, arg[0].in, tmp); gen_brcondi(dc, par[0], tmp, 0, arg[2].imm); } From patchwork Mon Feb 27 05:42:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656902 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2228297wrb; Mon, 27 Feb 2023 00:13:32 -0800 (PST) X-Google-Smtp-Source: AK7set9ojhqrEtyYuhBNXaXZEItYBZsmcomHF8Bq6ao1VBipQOW7i3L/3SE4ebML7r9Ruj8gorIB X-Received: by 2002:ac8:5f07:0:b0:3b9:a5d8:2c50 with SMTP id x7-20020ac85f07000000b003b9a5d82c50mr30927160qta.38.1677485612796; Mon, 27 Feb 2023 00:13:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485612; cv=none; d=google.com; s=arc-20160816; b=A6XPKj7gzvU/Ox2v/EI+9pLwNREPeFLqh22sOqy5ZVoTdJlG8DPrHy4OFR8l942X69 yLUC0Liak6+yxqOQVcKIUQvBEhgVjQ9B+bURbsCR7Hw1LZo6yQiIB8f6hxbBhoVev2rO NVjNa6C+NI/PUY63QUpoyFGk0Thko3lg5lLgJDdjlgnEiGEUKBULzJtD5//+RJp5Decx CqFi0HogA1EgKY/Z+Xy0MWQNPFCRkrONIMTjhNlraEiAd02yUf7Nb0qKEEv3gtH/9hS1 yKu1UC6TcQIZj3B7ySGHc3i4dXkaqCdm++1YtQrU8TZNnTRnP1fGDYV9MhmhWq16uohQ /J0g== 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=I0nuMJ82HVYxh2319z4AOHVFLixzgJR82pq22O8Q0Zc=; b=nL2+OKeQt7JVIHkIqn5spau8ISycByf4mMj4lBC36taiDD6Gk5pg1/CaT5ELXetgpb +8VdmzHtEBET8/9FF3ZGy4pkBrBe+JQHjJosTJVkZ4E5F0k9WgbqlMuErw5aCX0RAnhc YWBbWWPbcYu8jpr/5EKlk1dipd3x4EivOWeYKQMAiXENFHrfnVeX+hnyo8Z2S5Rp2FhY P5d+IsGNSWCzJOs2H06vrrpfXAmf41w5lZbjsMLsWQi5naVUg5dZUtTyHbbo+wnT7/z+ iQH7sfqrmpRxGomY30Fm5OwwljUrcB2NfG0NWVnfFhUK9OJKOrecv4dKtL9Ire/lcbmq xNbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uE51e6SG; 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 l2-20020ac84582000000b003bcd3532491si5349759qtn.304.2023.02.27.00.13.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:13:32 -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=uE51e6SG; 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 1pWWOJ-0000Bc-34; Mon, 27 Feb 2023 00:49:39 -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 1pWWNH-0004FP-G3 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:39 -0500 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWNF-0007J6-Rl for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:35 -0500 Received: by mail-pj1-x102c.google.com with SMTP id oj5so928716pjb.5 for ; Sun, 26 Feb 2023 21:48:32 -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=I0nuMJ82HVYxh2319z4AOHVFLixzgJR82pq22O8Q0Zc=; b=uE51e6SGXuXMjJMflHsSd5YBOdMR66VosqpLIe1cDZA2aXi3VGa4s8rUsKYyaAQUrl +fWCrOP3fVdtEFUfHs3nnwVnVXA3QWJxhlFIe+HCReQHlbNxgEQQUsVl5eG4/0Fyrde0 bboOilhvKgdmlm/K/SPgkDiOtNlrGzKCGJHKThjtGGMhNHr809MHkqH4rEqFF8yQzkAR XwAOMu+bWgGFWBof58EmDypCgKQj4NLJ5Z2WFuNpwy2J9vPDx7ADobSR7Mpewc2YFP05 Zn9xvTTP6013FenPZz78uBpG/SsmlUvMyoS3P3QzjS1joEk6Eckc4/t+lHcWpmhHAF2A iz/A== 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=I0nuMJ82HVYxh2319z4AOHVFLixzgJR82pq22O8Q0Zc=; b=dqmfGLRW+ssd5p05z69ULhYEzSb+ZcFsfEJzhgh54wamjYE6XsBR2wBjC+gaciVrdE ITpCdFLgxMvGJMB3ltLfI8ysSdfZFtXaM+L4enHzkVsHV+Ws30dHrv3QHQ4bDma4+FKO R/+KwDUuxqnbf9fXcrkPsOlBagSE24PonKPcl5pdwMJBZ2vxhlL28e6kdoau8PsowiG0 Q481RqHrBffDWIIPZ/E8pulrAay9NFdDjfn0RuGNRWXNBDdbXfFkIqHIbQVuduQPq0ox 9oU7MN5AeNNNa/GHsn7uIGS0Z9oWFScn6PpmnyplF8Ivm/BIcfY8SjCvbrSR9UwzcAwq G4tA== X-Gm-Message-State: AO0yUKVGjjc4sbjrabNBmgH/F6xybh0O9QtYaDyuTs49bRDWR/AKfaAV 8uBdqAstxwBlyxmkjpY6DKuyUxYmHmXXr7dBE+4= X-Received: by 2002:a17:902:e80d:b0:19a:b4a9:9df7 with SMTP id u13-20020a170902e80d00b0019ab4a99df7mr29397733plg.53.1677476911916; Sun, 26 Feb 2023 21:48:31 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:31 -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 63/70] target/xtensa: Tidy translate_clamps Date: Sun, 26 Feb 2023 19:42:26 -1000 Message-Id: <20230227054233.390271-64-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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 All writes to arg[0].out; use tcg_constant_i32. Signed-off-by: Richard Henderson Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé --- target/xtensa/translate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index e3fcd50691..d727f9ffd8 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1514,11 +1514,11 @@ static void translate_callxw(DisasContext *dc, const OpcodeArg arg[], static void translate_clamps(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 tmp1 = tcg_const_i32(-1u << arg[2].imm); - TCGv_i32 tmp2 = tcg_const_i32((1 << arg[2].imm) - 1); + TCGv_i32 tmp1 = tcg_constant_i32(-1u << arg[2].imm); + TCGv_i32 tmp2 = tcg_constant_i32((1 << arg[2].imm) - 1); - tcg_gen_smax_i32(tmp1, tmp1, arg[1].in); - tcg_gen_smin_i32(arg[0].out, tmp1, tmp2); + tcg_gen_smax_i32(arg[0].out, tmp1, arg[1].in); + tcg_gen_smin_i32(arg[0].out, arg[0].out, tmp2); } static void translate_clrb_expstate(DisasContext *dc, const OpcodeArg arg[], From patchwork Mon Feb 27 05:42:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656878 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2190976wrb; Sun, 26 Feb 2023 22:12:09 -0800 (PST) X-Google-Smtp-Source: AK7set8D4fHQhY4jMx7dQcxFE9ETRz4LrMd7Uxa86SenpQBH3/7G/cUIbfEuhELKR1YHLFp01JZ0 X-Received: by 2002:a05:6214:2aa9:b0:56c:37a:58b2 with SMTP id js9-20020a0562142aa900b0056c037a58b2mr43950116qvb.15.1677478329532; Sun, 26 Feb 2023 22:12:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677478329; cv=none; d=google.com; s=arc-20160816; b=K3jMwcBU+0O+SJ9DiG+oPCWfgldQO5kkAV4/Z4O7axG7weWSzBmyTJYUK4sO1WKEI8 OEp8gZf4ONurEiddXzJOY1lKF93U2yQ9MtzT67HsRcd5K3LFXmfWSS4DJM3GvUGCCcPK gBYynaxkRWCA92xazNUkeDX1wPRpR4VA1fNjx9tkoeqUAWJIW2yp6XXbtIgTF/ewPxO6 rpnuweEdDFd8wxtjwwpE+MbkHF1GWVRIwacuFW9KLb0nqXLf65T7XYrDQcwgUNpWhPJO GDlilIruGpW7kPIm7mDtGSAMKi7yRVs2IURze4yM7HdRAwibhO3w+tEQN0ZgDTQHThkj GUaA== 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=L1GGh7DMqJjXiFDkrXWmx7lkNkzrItdtK7foWMBTyE4=; b=XehGOTLP6u44FW+xuzFz4Cgppc7y06N5GdQMAPx9Wh29lDomEwxlPIF9L7OEWIc6u5 AfXJGKCsNE9RYCIVzMgRTopqWOrWUTQMEkeYUG9/0nHesrGQx2J12ljR5+3p8x9L0Hvi m850oS84yA4HJA9sqkIW7Ct/nPHadjJ0HuYnIZ2H7ZMbFxBE+UyO45oKLX58EhzYfjY7 iKGBOcjLl/6UvAD3k0iOkvBDWKfL9nektSCJg7d+y0Urhkr/NKeiFwe9hIZTL22epU63 BGY+JZ7lXlqONmQu2FTx2vGLFc9luXtC8rK6QXTgQNSOeznyFFNLySe7rHZc7uUlWBVb m8lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GVzzv4mk; 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 ([209.51.188.17]) by mx.google.com with ESMTPS id bn40-20020a05620a2ae800b0073b9e5fb99esi5282065qkb.105.2023.02.26.22.12.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 22:12:09 -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=GVzzv4mk; 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 1pWWOL-0000Yl-A8; Mon, 27 Feb 2023 00:49:41 -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 1pWWNP-0004VY-0e for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:44 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWNI-0007aA-Kw for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:41 -0500 Received: by mail-pj1-x102f.google.com with SMTP id cp7-20020a17090afb8700b0023756229427so8930758pjb.1 for ; Sun, 26 Feb 2023 21:48:34 -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=L1GGh7DMqJjXiFDkrXWmx7lkNkzrItdtK7foWMBTyE4=; b=GVzzv4mkD/9Ikhv7Z96vauy6VKz9nqaW86TpN43eHsBR6JkHepotzv3WUUv1GPPMZC kGDiPq9UqdczFT0/r6K6JJftUhNqrrBxH+pDk1SOwQMhRreFTjDjdkVDxx6ZFQqSjoMz qL4O9v6FXOpaC6n2CNWXVUG7RZfCQurZjovB/E2zD5yq1eZKgGbRnBuTXUeqto8JsbIY cEo9VqMliCy5A8/anLb1GbAqFpw2nX3vy3hqLPWW/GGb6/TwJmkO3lLLj2+Xk317i7/t 6mmw6eE/c7vqKGiPJ26hajB08yULISCduEJ7OkB44vyL0xdmIBw8ZckfZtGhasEupMOL qgPg== 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=L1GGh7DMqJjXiFDkrXWmx7lkNkzrItdtK7foWMBTyE4=; b=6jCjzOvmMo8/4suUSjd4nJac8wopUxE3eD+xJKkLID913qtm0cutLsK7X0WzMrdLGD AxC7wwLMvB43XVoInKf/+JyUY15BUvT+UJAKMMosC7OoaNEyJJ4543xtXg6h8c9Bm9DJ urbgro8xiOt6kZer+OSOd2J1PpjTJiXNgcFax61iyCMhpCLI/n2N+cZOSUowNIyqdc7g njMJ4tYssWO2Gu70vPQUteTqu/eXt7ykoLf6XvL6l35PcORF/lXygjFQ6wAG8V0YnI1P 4ByPRD6C9YdK48yHxHG/nfYF89Oqg2OJ2G8F0756AqhChuZ7q3ONdNbpfo/vcEVYBukg ghhg== X-Gm-Message-State: AO0yUKUeQ9YG4FDbR5a+avXNlyXfiVvTLwAY/E5aCD6DjUtGlfqonJbd kCJqH4tpuF+OX4Nc9paAOqeXvvNY9FuSEiGvCXg= X-Received: by 2002:a17:902:e851:b0:19a:7758:e5e6 with SMTP id t17-20020a170902e85100b0019a7758e5e6mr29462074plg.48.1677476914605; Sun, 26 Feb 2023 21:48:34 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:34 -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 64/70] target/xtensa: Avoid tcg_const_i32 in translate_l32r Date: Sun, 26 Feb 2023 19:42:27 -1000 Message-Id: <20230227054233.390271-65-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Use addi on the addition side and tcg_constant_i32 on the other. Signed-off-by: Richard Henderson Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé --- target/xtensa/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index d727f9ffd8..41b84082de 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1721,10 +1721,10 @@ static void translate_l32r(DisasContext *dc, const OpcodeArg arg[], TCGv_i32 tmp; if (dc->base.tb->flags & XTENSA_TBFLAG_LITBASE) { - tmp = tcg_const_i32(arg[1].raw_imm - 1); - tcg_gen_add_i32(tmp, cpu_SR[LITBASE], tmp); + tmp = tcg_temp_new(); + tcg_gen_addi_i32(tmp, cpu_SR[LITBASE], arg[1].raw_imm - 1); } else { - tmp = tcg_const_i32(arg[1].imm); + tmp = tcg_constant_i32(arg[1].imm); } tcg_gen_qemu_ld32u(arg[0].out, tmp, dc->cring); } From patchwork Mon Feb 27 05:42:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656893 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2227648wrb; Mon, 27 Feb 2023 00:11:35 -0800 (PST) X-Google-Smtp-Source: AK7set9RuHQYvB6zErFLhWu/A3aCJKc6X1HIDy00LL/Dams4gtBszQXrpTb8ONRiJnuqvlqa5cpX X-Received: by 2002:ac8:7f95:0:b0:3bd:ad1:49c with SMTP id z21-20020ac87f95000000b003bd0ad1049cmr45674542qtj.24.1677485495753; Mon, 27 Feb 2023 00:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485495; cv=none; d=google.com; s=arc-20160816; b=mEUkMQJP/kUd1VbJgQxv6rpR5km/gW8vkioS2HBx7y98eYN/JLRci82tgE0qjaieIc l9zOzz10JScyvmOYUiHyxLyIwi14KWjg96bFKnIRSPXa8bqQOLsEtv43AexHpnd+xSO0 CyHidAzIk+pAj7x2VMSAOeUlmrjDHzXjBKm7w0JJlRjcvR9xptqPSvdOxlZc1+FabMkG MgDnVhXMuDkPPziYXnNreAjwv0StkSpapD/8IF41LV46prhpbjLk29b+ewnYvs+bcDnm wlUqjF5X4CxoPLLBDUJhEObCoeFRWIfEPNoNhoyffe/ILyKuDU5b1K4pHPMkSuYC7deP 1AEw== 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=JLbIXbv3c6J31oUDt+65MrM/+9+0ofz54UivRKjyGyw=; b=N1Kp+HUK3E8WjMwu9RSX/yX2XBxn5LJ4kxYqTJFcf8PK9BnHXt5JfUKSFtvrr6kboL h0QY7MaRou0nIfvbCSg0hX5TgmL9g16Kr3eHMfm52lReRpYCGtAy/CNXdV4sRe7Wds35 byHOjopnJswNunqn7RxCK8fMTINRB5D4bLBSR3K3zZlF519rBKVOMeCjbfvLFuGDArj0 EMP2JLxZJJgsdsz3OqNLmVxA8dkAI0rSEfJ7/JHOxv2JOle15ITVm7Dbp2PKXYyipdR9 T9wmCSMe/eu/ycj8fNMsFlClgmEs1P+anz3/7rX5rZo3Qpt+FTBKNymfTXCN5DDWZ3IY kCww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QnidWXv7; 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 x19-20020ac85f13000000b003ba2cb1d4a9si6222235qta.494.2023.02.27.00.11.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:11:35 -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=QnidWXv7; 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 1pWWOY-0001lk-A0; Mon, 27 Feb 2023 00:49:54 -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 1pWWNX-00055F-Sc for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:52 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWNU-0007dR-FI for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:51 -0500 Received: by mail-pj1-x1029.google.com with SMTP id nw10-20020a17090b254a00b00233d7314c1cso8875675pjb.5 for ; Sun, 26 Feb 2023 21:48:37 -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=JLbIXbv3c6J31oUDt+65MrM/+9+0ofz54UivRKjyGyw=; b=QnidWXv7ZWJNKObdzSVc0lCypHJDXCDp27/D8eTGG/43vIpHq9h8xYz5Pvyb7Sgpfc CgsW9z9S21qR5S94+z116PdZ94/XPR9hLg9Xmij0gCR/niXzntOmtudUBdaFA/D6XJzG arfAX+5CcuspWigeaZ3Q7g5cloXI6QZs9WO59jqOwDCqpXJNuwIYzfIJHXwiX8RlWM79 48eWVM6ZqL/3nPce203Qdj0BFdXa6h1bv2XJdIJWHPbDiqL5m/9u/sGYiKVPWvsWafQn diivcANvMdEnNMfzJK0zvqhdss1oYge3ulX9kODNjk6uDp1xiv6Vx/QrpVUXAqbfNcKP tSBg== 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=JLbIXbv3c6J31oUDt+65MrM/+9+0ofz54UivRKjyGyw=; b=1p9hZSqnKGU/+GtdmAP14iNm2rJVImO/rIMXCbgg/L3YU76ML08fGQnCyuwlN1tt+F BUesj+Z6CgCyP0+mkimMauuwzfr1zHf7Gp/wYNKFn7Jd/WQzPyhRHPV8l2JjJ73k/+al XzLCpJfVpzQqFlsfURCv6iRrKLohCjOmignqMIvqvb8+rJakUkVdRD3AblqdYktT/2Qg YQ5g7njsDDHQMrL5mms5XY9jcALTvJok78NIPG4pIQMVQ+hxYSkaKlCJOK+Q1wpqjsqS VfaHGQ/XoJma8bm5oE9hd+TiqiViIY0Wb4+ngYWziEDTNXmySGU607mfl6ao7TAKw4Hf pjkw== X-Gm-Message-State: AO0yUKXDCxSeSLori7nIocJP2LcqaHmqVO7CCRkIvDhaOXRgwp7nULIK Jgu8rei1cnvoQym/jhFCuV38so6gqn2GUBtxRv4= X-Received: by 2002:a17:902:f604:b0:19d:297:f2fb with SMTP id n4-20020a170902f60400b0019d0297f2fbmr4327822plg.53.1677476917086; Sun, 26 Feb 2023 21:48:37 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:36 -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 65/70] target/xtensa: Use tcg_gen_subfi_i32 in translate_sll Date: Sun, 26 Feb 2023 19:42:28 -1000 Message-Id: <20230227054233.390271-66-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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 Signed-off-by: Richard Henderson Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé --- target/xtensa/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 41b84082de..2903c73f8e 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -2324,8 +2324,8 @@ static void translate_sll(DisasContext *dc, const OpcodeArg arg[], tcg_gen_shl_i32(arg[0].out, arg[1].in, dc->sar_m32); } else { TCGv_i64 v = tcg_temp_new_i64(); - TCGv_i32 s = tcg_const_i32(32); - tcg_gen_sub_i32(s, s, cpu_SR[SAR]); + TCGv_i32 s = tcg_temp_new(); + tcg_gen_subfi_i32(s, 32, cpu_SR[SAR]); tcg_gen_andi_i32(s, s, 0x3f); tcg_gen_extu_i32_i64(v, arg[1].in); gen_shift_reg(shl, s); From patchwork Mon Feb 27 05:42:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656888 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2226841wrb; Mon, 27 Feb 2023 00:09:04 -0800 (PST) X-Google-Smtp-Source: AK7set8ymgcltjZwW0QUQ8Bs7YDYvYrPeJHn7I6BCF9bbEe40QSdS2tWOU5cZWL/6vONKOGJBLbE X-Received: by 2002:a05:6214:5011:b0:56e:b427:819b with SMTP id jo17-20020a056214501100b0056eb427819bmr42515682qvb.16.1677485344752; Mon, 27 Feb 2023 00:09:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485344; cv=none; d=google.com; s=arc-20160816; b=pYWWJ7x797hK9tFwRTSDq8Pc/UGAmHajpiIEXsuCPTZBo1TG9HKrKr2I+58z50pu1H nki1lYuBNirJb9tDLHG2AxBWuw36zbsO48D7sFe7p0n4eC+4x6dAffVNWz4kVYc78GhK K+kw8SdM+Sil2+i/IdvTFGo0tW4UDEbrmRR+hP80osH9CW3ZBVrfe/a/xhZsAadc6opr 2gw1UAX8azmXgf6ld1LfYcYndB4dxmyd/KsIT5ucqIxo8ISz/FawNeYxn43kVKveMyQU WIF590OpTbs/pNOzz/P3JhINbj0WWG4dKS87YsFbA9oVTn5goapwlcyFK2c6cGWedJGH MA7A== 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=bY34aIa/D4KZaSYWEDAithLbdY3yc2J0anloDn2pzs0=; b=ThCmgtBxULj6NTNMKPZLgRIChBnvYg49FJCYYOfMzAr4geUoE+v1uTnByTYTUESK0S lyn1AuuvGlSxj6+zMa/PDHetYCscR6z769MVo47Zz4UU9Vx1RlVmykqUP2E8dYk+Vrzh 3So6+TPp+/2TtqCMnkFVCIjNHAqhY2TqGVPkIo/TXyUGzSk++6nV/ynr1tB6p5KdVNWS psbrsgrjUkmuNgs19NwmYUhc8GvBQCmzNhP2PJGVZ5zpphAROvjph0t9Rf4vTynBLfWx 2j3NVM3Ab2/xtceXSkBal28JYtlps0Xp4EMpO2x6u1wpvxrcH7pIPSE96B6S4Uj9dsnh l+Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uPdiN89M; 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 y6-20020a0cf146000000b0056eddf64fc5si5377304qvl.591.2023.02.27.00.09.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:09:04 -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=uPdiN89M; 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 1pWWOr-0003GB-Ou; Mon, 27 Feb 2023 00:50:14 -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 1pWWNU-0004gl-EE for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:48 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWNQ-00074k-9j for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:47 -0500 Received: by mail-pj1-x102d.google.com with SMTP id l1so4916048pjt.2 for ; Sun, 26 Feb 2023 21:48:40 -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=bY34aIa/D4KZaSYWEDAithLbdY3yc2J0anloDn2pzs0=; b=uPdiN89MjVFFEn1dStm/Hpm1ukmsRxs2RDWHMgfwTSBsz8HvLS5YrcuDzJ4m3Hm3as DsLZeMdWHLrQVqg45vKPLCt/En6I98NHMif3xQptQWd4MN9A41BQ30UbjOOXo+orItTU GDzHv+NqRNQ99wOf9tM7Y3gSr2Qc9r4kMdle4wrqUitnpMatPsvWSEXSIUP/Wv3n2MVv fH9hC2rHwkiabAa4Oq19E4D8k8b2RLREVyFxsv5OuDM2WytCpfQxETSp4ZN65rVK29iZ LtlgccIE7B1yxjek0mgBdDrUM5ssobokIl4Xk+0D94XyhHmQeO7PNnF+pAW8rAzvl0tf mXMQ== 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=bY34aIa/D4KZaSYWEDAithLbdY3yc2J0anloDn2pzs0=; b=2bJ/6b4wmiFbvtx1WMlQIz80LiZaNVJyg4yxe4G36pSXGQjmnPYOi9BlmTqVhSp1Rr gXkGeBD2uAhISlnxJmQBAFFg+ZEglVzWOdYWBA0i2kH/VcwQasJwfy4iTLPRBG//jra9 zNzt4Hl0JH9gj2DSYLyYEbaGzbjVPbU6xo5uJzbH2U/iOoAVFhpQpBwHyVaBPc943SWc ck2GA8WYgyhkesxlFyKJ7FClrA0SnJeeDqaLkkcTCEBTheI3OJdVBdqUIiFVzdgD37kl /oTkAtFk4YNA8hL1dKpkm0z+mn5ZrFk5UK9AlYc7RiWnj/S/oZmKCBK7VQjgZmNDrhn2 eS3w== X-Gm-Message-State: AO0yUKXo/Jze66cdE6Sdr8F5FI+nqDY+tFBQGpN0jyQhTipTEGkPh4IG ABQgutGN5c/fIVgtSDXej8jNFBnQOD9FsvbrFuU= X-Received: by 2002:a17:903:2903:b0:19c:d550:803e with SMTP id lh3-20020a170903290300b0019cd550803emr8427778plb.57.1677476919768; Sun, 26 Feb 2023 21:48:39 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:39 -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 66/70] target/xtensa: Split constant in bit shift Date: Sun, 26 Feb 2023 19:42:29 -1000 Message-Id: <20230227054233.390271-67-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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 Signed-off-by: Richard Henderson Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé --- target/xtensa/translate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 2903c73f8e..f906ba7ed5 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -2047,8 +2047,8 @@ static uint32_t test_exceptions_retw(DisasContext *dc, const OpcodeArg arg[], static void translate_retw(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 tmp = tcg_const_i32(1); - tcg_gen_shl_i32(tmp, tmp, cpu_SR[WINDOW_BASE]); + TCGv_i32 tmp = tcg_temp_new(); + tcg_gen_shl_i32(tmp, tcg_constant_i32(1), cpu_SR[WINDOW_BASE]); tcg_gen_andc_i32(cpu_SR[WINDOW_START], cpu_SR[WINDOW_START], tmp); tcg_gen_movi_i32(tmp, dc->pc); @@ -2080,10 +2080,10 @@ static void translate_rfi(DisasContext *dc, const OpcodeArg arg[], static void translate_rfw(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 tmp = tcg_const_i32(1); + TCGv_i32 tmp = tcg_temp_new(); tcg_gen_andi_i32(cpu_SR[PS], cpu_SR[PS], ~PS_EXCM); - tcg_gen_shl_i32(tmp, tmp, cpu_SR[WINDOW_BASE]); + tcg_gen_shl_i32(tmp, tcg_constant_i32(1), cpu_SR[WINDOW_BASE]); if (par[0]) { tcg_gen_andc_i32(cpu_SR[WINDOW_START], From patchwork Mon Feb 27 05:42:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656918 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2230358wrb; Mon, 27 Feb 2023 00:20:23 -0800 (PST) X-Google-Smtp-Source: AK7set/9ToVOvigwDgqiC8YZdZvktL3Af1iNS4UY7ao31Q8IQOiJGIMTjXoBeBKRsYy5EgLDQkBM X-Received: by 2002:ad4:4ee4:0:b0:56e:9986:4fa9 with SMTP id dv4-20020ad44ee4000000b0056e99864fa9mr43895474qvb.7.1677486023623; Mon, 27 Feb 2023 00:20:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486023; cv=none; d=google.com; s=arc-20160816; b=fwHqAa1wDFS0b56emxFuN9rnquCRb6uGOc1DxYu+S44f/Gun6dHXIQoFk2dbgVHZHg ihIe2OVlsamOUJBigD+LEiIh0gBOK+pF1p694EqL4Z642QSaUIH/TmP+kc5J7o9p88QH IQqXjRL/edR/aSJyr3oaGpN5pxmnbdv21xnLnOdbY+RIE2IU4VzY1p7C4n6yvjoX73cA CnA460TMZ/EYIgD+3t9vKmpx+42vCtN+AF3UcLPYPSNiRsyf35o3QgKEQz6dFDOI4AiL 7PYdWMF0SBFxI+ZMuDRXEpO8p/EHRlgdMuENZyJi6Nf2xF6bBVdNV5fNapJ2EHM0Wh21 vXqg== 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=Htwm+E7Ej5o1YDA8ZJwARbX/GtYPS7IcYCg+lmcAy3E=; b=qIgheEeNCkKKegVQW62knIdMGH6zR9GEuWrODV0aVPSKRCYgPopWh4BSXtnq47mB5n noFh4idUS+w+iA54CBM9cuizkpeYsdIhxpXSWYsH2sdSAQSQNhxmuXb8BG+3/ztE0X9l SvGyzldFJI1HNUVVTEFuanvCHxsI7iYptii8uARxIIE9+6tRyDfkuXsmMiL8fAUg8k3v FfbQDihbCAjhNehDACzYOPTzFD8FnW2YUA+c1HgF+RDEXYRu3xoewRxebNHjYjA3tLZk nRPJ2KVHdDH2jJ9y+BhRByeRJk/oZ+FiOmitA8hxianTGxTLSyFxSxKCwZcZzFPI82W0 Tfyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cWwWaOTH; 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 v2-20020a05620a0f0200b007428b22c9d9si5602340qkl.397.2023.02.27.00.20.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:20:23 -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=cWwWaOTH; 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 1pWWOa-000244-6V; Mon, 27 Feb 2023 00:49:56 -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 1pWWNc-0005XU-EW for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:56 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWNa-000718-Cu for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:55 -0500 Received: by mail-pj1-x102b.google.com with SMTP id q31-20020a17090a17a200b0023750b69614so5041833pja.5 for ; Sun, 26 Feb 2023 21:48:42 -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=Htwm+E7Ej5o1YDA8ZJwARbX/GtYPS7IcYCg+lmcAy3E=; b=cWwWaOTHYxiB+KCaN2JEQ0ZC3ql7d3B85FqiSF9BuibjXV+Ju43HfNqGM2pXZa3rw7 WO3lyp5iktpMdSznSB0Lw1aWe09czKEUeYLayyUr+3g0tVSpn2Sr5tzoupcJHJ13chGM S8gqw5zieVM3wE5O13F5vxihvRQEDwvb+3sdiasrUxSdIiX1WffQcgTUEir4NvqkNBMS rCx/tKznFURA0OMUVhxs//Ua4Epw3SbeepGUYxRp3e6AGXB2yIhh4VVsMvUciD9obiV1 Qlw7MV/qzty8/dQiMM9jC0n95K6e//8PQ7UmNwK8usIw+ebhnaG80XNYy+cOy1HyiBM6 Mb1g== 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=Htwm+E7Ej5o1YDA8ZJwARbX/GtYPS7IcYCg+lmcAy3E=; b=TV414E/Qrefotc/QZWUMb/EsqbzWRvpoJ0VTfLHMUdmTVlZJF87u0p5EnOqahNPycd PEKBQhrzHPIsBKKdpkE8lDkA1dtAmm7o6IqIWtREVOzw4zFJdGHtoBzww9bS/iBVvs+G kJ3MUB8VkqNxKJ3Q8jQs1G6T9+nLqe4NnprP4KzSXPBs1wrPJO4CtUTfFbv2UA7rd17m 4vgi4tWJIsmUHiE+PnNpvU9UAx0tumcEHIQVr81MWaNvkYKhSiDleOu+jpllZQ9iEZRk oVuu67VeDeuo7Whsiu8/z+d+w31gb25mYxV/XfWZW4KBF54vE3VN+8kZ0b7UaMNN8+k9 /rgg== X-Gm-Message-State: AO0yUKXY8N6vG1vtTaiw7nrWhTgkJ+H7hZIyphOIzEV+gUHjolskk9kh BDakhlbBj5Wlx/ZbCRDp9ChmeK2cA9CKt5dsMp8= X-Received: by 2002:a17:903:22cb:b0:19d:1897:8192 with SMTP id y11-20020a17090322cb00b0019d18978192mr1977206plg.47.1677476922275; Sun, 26 Feb 2023 21:48:42 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:41 -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 67/70] target/xtensa: Avoid tcg_const_i32 Date: Sun, 26 Feb 2023 19:42:30 -1000 Message-Id: <20230227054233.390271-68-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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 All remaining uses are strictly read-only. Signed-off-by: Richard Henderson Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé --- target/xtensa/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index f906ba7ed5..0cf3075649 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1361,7 +1361,7 @@ static void translate_all(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { uint32_t shift = par[1]; - TCGv_i32 mask = tcg_const_i32(((1 << shift) - 1) << arg[1].imm); + TCGv_i32 mask = tcg_constant_i32(((1 << shift) - 1) << arg[1].imm); TCGv_i32 tmp = tcg_temp_new_i32(); tcg_gen_and_i32(tmp, arg[1].in, mask); @@ -1489,7 +1489,7 @@ static void translate_call0(DisasContext *dc, const OpcodeArg arg[], static void translate_callw(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 tmp = tcg_const_i32(arg[0].imm); + TCGv_i32 tmp = tcg_constant_i32(arg[0].imm); gen_callw_slot(dc, par[0], tmp, adjust_jump_slot(dc, arg[0].imm, 0)); } @@ -1537,7 +1537,7 @@ static void translate_clrex(DisasContext *dc, const OpcodeArg arg[], static void translate_const16(DisasContext *dc, const OpcodeArg arg[], const uint32_t par[]) { - TCGv_i32 c = tcg_const_i32(arg[1].imm); + TCGv_i32 c = tcg_constant_i32(arg[1].imm); tcg_gen_deposit_i32(arg[0].out, c, arg[0].in, 16, 16); } From patchwork Mon Feb 27 05:42:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656897 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2228012wrb; Mon, 27 Feb 2023 00:12:39 -0800 (PST) X-Google-Smtp-Source: AK7set8BIEnNF4BC1MtGw3GsAlYOxH79q7i5+qLjG+0XFoWhM6zgsxv1rkZB4bEOvt3YJcWmSeIS X-Received: by 2002:ad4:596e:0:b0:570:3d41:d5ba with SMTP id eq14-20020ad4596e000000b005703d41d5bamr47087462qvb.10.1677485559089; Mon, 27 Feb 2023 00:12:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485559; cv=none; d=google.com; s=arc-20160816; b=zt8d8JCu/Zml5w/abce0wq72++eWHFIfvWec9JiFxzz/UC1L3HWgubMuODWov4vf0q 0nNB8rSx1aeluE+Yg7jFqKxnQrA2vLQ1Wjh1T7iszZS2YybLbUjQfWz6b/MbxMw/Zk8R uUr320SOEjEOr7q88g1HwXAkj5Ddzj5XzLy51Bey+E1E4LRO7cCHEsydzds4uFfIAsh6 51yOoRWaYxjUCdOE310wfugQB4r0/c/XO+2jNOJSyCoWkK3YBrzLGSjdzqZnh7L6ilBp qrTf0dt7+TOCHtB1aEmncuNlQIHOiB0NYIpfl/Y/+03hV9xHYj0Rp7j9x/9kfpwnOA+R lMgQ== 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=u2rLxWiBoXc5cqrNuTYk7pclm25I7T2ovSFzBdL97lE=; b=Ebegrmcr13AfcZwT9MFKL79i8xuRmaCGenaExqtaw++psPxksFnLdHV3g7YQs6nefB AGIj6tlwewBRE3SU+zmnAAZsipOdGd50aY2DtRex+qVWMRSl1MgcFiUYjCtFOES6hGNb 4zIE7H2lUI9Q+93KR976wunZL1HWRjlJ0jF/fUSZB3bCXUb5XuWfENb0mrzQL2bk3fXd d2xm2NV5tRa37jLbBVE/rHxnREgOGZw6R16SDSok2j+Sac74M2aau/EXRyPHAif+J0dO vhK/oseUkoZHld8ioWcP+l1t4yuBkYZjIgItiBM6EUt8YWYRVxvQF2VTt9Bw4pGT8Lel Ownw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HoQXU/BH"; 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 t1-20020a0c8d81000000b0057264fb27b2si6001645qvb.10.2023.02.27.00.12.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:12:39 -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="HoQXU/BH"; 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 1pWWOP-00018e-KU; Mon, 27 Feb 2023 00:49:45 -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 1pWWNX-00054B-EB for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:51 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWNU-0007gw-44 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:50 -0500 Received: by mail-pl1-x633.google.com with SMTP id i3so5569989plg.6 for ; Sun, 26 Feb 2023 21:48:45 -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=u2rLxWiBoXc5cqrNuTYk7pclm25I7T2ovSFzBdL97lE=; b=HoQXU/BHAs6fJkA+lfnWc1mmXt62N7ZgQsed1Bajm4nRrhAYV/PsLXEMKtTfU4h6J4 icjplpZu5VVYRLF6OioHGNAt6vjPlSYyP0V/1uc4zN+6NPPdU7YtbLQLubX48+V6AAvy lzZDFiZR4q/48aAvXH2gIh0sGIJMU1Xua1HK8EVDRrrT7uJbvadMRWp/EnvCazFo8ZRh 1TjbWUzAhPNcKnHgMju/TYQlrRlNqxIpw5JUk5o3wehkHy36u/7qQQVEDsESu6vTXXFt UKucsp8odwj/ju1VZNq4iR0OVJ/CvTdQu/LIqhpETc07iK7zrFpNEMhmmgKIpEbaLAhv RKGQ== 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=u2rLxWiBoXc5cqrNuTYk7pclm25I7T2ovSFzBdL97lE=; b=xIgFIqPsez3sjF4UBJjDSJEp+UJXcA4pd2sJlGeMdKoSfkVqQxRW7YctUiu6VFVK3S fgOQlReMhxrQyDXO8+uheimbfFQZ2lqlW5M6PRTc+Gulm91xwMMeDCYdf2CVsHXAPDCi MdEJYDdQKB/Y15JmETGYCajb3RbXpDbeIUBEuRHySDyR+4VihMs3lUkjQgSOXVULZIeD MJ2ReeiXIuV1Io1bT8lXcz4q+Y4tA00hMMN52yS/f4ozdF/AB1ayAjPTwBQ9tfZNOquj 0wa1Ifc6Xws/dLN+8uw6eYhC5d0S9iDrVqgrVGKzl5Q05aOqiNAs1Fh0DhgdpSk098nb D8Uw== X-Gm-Message-State: AO0yUKW/685yiWjUmpGjGwZRwvilpmkLiZq/We787kmZUeHmw21mhy5H 9wespJxjxAdnEZMzSMqq21+JFrb6DtbuqWGrMWs= X-Received: by 2002:a17:902:ce81:b0:19d:181f:511 with SMTP id f1-20020a170902ce8100b0019d181f0511mr2158458plg.30.1677476924766; Sun, 26 Feb 2023 21:48:44 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:44 -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 68/70] tcg: Replace tcg_const_i64 in tcg-op.c Date: Sun, 26 Feb 2023 19:42:31 -1000 Message-Id: <20230227054233.390271-69-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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 These three instances got missed in previous conversion. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- tcg/tcg-op.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 53e96b5b69..9753b08f6c 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1547,9 +1547,7 @@ void tcg_gen_muli_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2) } else if (is_power_of_2(arg2)) { tcg_gen_shli_i64(ret, arg1, ctz64(arg2)); } else { - TCGv_i64 t0 = tcg_const_i64(arg2); - tcg_gen_mul_i64(ret, arg1, t0); - tcg_temp_free_i64(t0); + tcg_gen_mul_i64(ret, arg1, tcg_constant_i64(arg2)); } } @@ -1946,9 +1944,7 @@ void tcg_gen_clzi_i64(TCGv_i64 ret, TCGv_i64 arg1, uint64_t arg2) tcg_gen_movi_i32(TCGV_HIGH(ret), 0); tcg_temp_free_i32(t); } else { - TCGv_i64 t0 = tcg_const_i64(arg2); - tcg_gen_clz_i64(ret, arg1, t0); - tcg_temp_free_i64(t0); + tcg_gen_clz_i64(ret, arg1, tcg_constant_i64(arg2)); } } @@ -2000,9 +1996,7 @@ void tcg_gen_ctzi_i64(TCGv_i64 ret, TCGv_i64 arg1, uint64_t arg2) tcg_gen_ctpop_i64(ret, t); tcg_temp_free_i64(t); } else { - TCGv_i64 t0 = tcg_const_i64(arg2); - tcg_gen_ctz_i64(ret, arg1, t0); - tcg_temp_free_i64(t0); + tcg_gen_ctz_i64(ret, arg1, tcg_constant_i64(arg2)); } } From patchwork Mon Feb 27 05:42:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656900 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2228124wrb; Mon, 27 Feb 2023 00:12:57 -0800 (PST) X-Google-Smtp-Source: AK7set+zjm58E+TPE7d/NFMXOsqtD15+/vTmaNszEW+Rdo5r5cn2JNwpIdsSn08YREYYYrJ+5s6s X-Received: by 2002:ac8:59c8:0:b0:3b6:2bbf:581e with SMTP id f8-20020ac859c8000000b003b62bbf581emr24607475qtf.35.1677485577271; Mon, 27 Feb 2023 00:12:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485577; cv=none; d=google.com; s=arc-20160816; b=N/YGNWKgiQCB7D++36Hybjl/DqiPEng2JQkmwh35UZOxEuBi8NavBtlj8dc6mJa1X1 VCP9nItxk9WXiyUo/BJcRhiBJizY+s/89uRl2t3E0uBs0N6hhbjQgIOq7po7jr76SpeO oLTTIj3fKQgzq/SQGont8yD3WJKE5zA/HjF+c4E8kUAcVE26Qr5/JGqlLtZV3GldJy3C IgoRFOxp4FOY3hp+prHFym4SVsRGv4bd2PZ1WR9Dhr0IcvqVz9y4acB4+8tt1So5jsfI B3Veu8oxcn8mF8Z8OoKg68AMwHqsBKGEWK1/RnmoawG2peUc9e2Q8CPYpMXPtXpN+ijV qiGg== 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=iYaMJQN3FS2hLRKLRxWbPb4i2fPMZWZUTwMSKfyflhs=; b=I28wKILlG89Z7FoRggkht15UyUbWTyojVUk4iukGHsFAt1I0ounlDORb5tkTCLrIed QoG14DcaLqLl7lTLHZEuXRi28JtWWeRZkZdHu4izxXQXMp+jU28rZNfilJk08yWFa0Sa tGcMfN85VQC/GK9J+jBkoqDfILh9XJzm3+SIgBwvdAeasmtpudvnAMRGDr+rnRfYz7/j qpMVkyR+Kj226MsW92rCrWwuCe5iLzaRsPYY9s1BhcJizHcfp06jBTQB86yrXDMfUp6L 53nb8xuOE9bauE29pjQ4jkEouSo9z7zop04CoUX8oCF88GbVyZcXkIB7/1TEpTmTkNY0 SQAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i9Pfe4pS; 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 188-20020a370bc5000000b006ee9af422b6si5710090qkl.226.2023.02.27.00.12.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:12:57 -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=i9Pfe4pS; 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 1pWWOP-00019v-QI; Mon, 27 Feb 2023 00:49:45 -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 1pWWNZ-00058r-10 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:54 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWNU-0007hw-Oo for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:52 -0500 Received: by mail-pj1-x1036.google.com with SMTP id 6-20020a17090a190600b00237c5b6ecd7so4403671pjg.4 for ; Sun, 26 Feb 2023 21:48:48 -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=iYaMJQN3FS2hLRKLRxWbPb4i2fPMZWZUTwMSKfyflhs=; b=i9Pfe4pS521rDBdpM+FVZq3a4cMLQFE83RrVP6TzWUipoEBlQds9bWgaLquzrRI3VE J3fF6D4WIuJ4/u0icN+2iYJ1HHQ/KNfM5RJM98wxAkMwUpvsXcTULWCwZZT3eM50E0Ty x7/ajGa/jzS+ALBMFq3whd8KIlqw42EQeg3ks+rBBe13xroCv6uga0mYUSyOMnbh1E1i U0VOVBvaU54yqsjr48618muhN/GIg1xeMXfxJiuPEOxaxHyQ68OFSkwedbxIHmmE9r4W xWxJ+DzfzrMyBVvHrE3kdi59kEcdR0mUVT80yFG33YjzqIedlr9TZCB1+HERPHmop0Zd lvLA== 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=iYaMJQN3FS2hLRKLRxWbPb4i2fPMZWZUTwMSKfyflhs=; b=up21kyDVNlKqwo+CPjJrDTzH7pmAvx4/0DglNxMqqDlzkDLG7mFee08U1EJfIYpeLm xz+UBL/N1ds+Kmu8jAIWRV50NJtHo/a1nZ9cHtRn+RfHYdD6ljSV+XalsWOnyd6s0LHW 444Qd+S0xPnu6sbA65t3bF4mrSfq2AYOcxgyXOqSe9gx+a9VeJYapI3qgeVXA4Zj/c7P 7jZO/CTY6aFgauapECVOqPXFyvHPtRhggco6ioZ74jHUhK6t5QozlJzpiMJeubzube5X v9m5BOfUXJLPAcaLEr2nAFwbWjKotLS4e7VrVVcKp8yqF6lvYZKEAgUQfIv7BTKz+G9J kpkg== X-Gm-Message-State: AO0yUKUNcjGFSQwGTYL9eXj3YS0hQM3ouFkr8DQT6x8rpaILAK1f/R0N bILIJH3zdmzWKumupgdggXaNcSDZHBM2hqTScAo= X-Received: by 2002:a17:902:f988:b0:19c:eb50:88b9 with SMTP id ky8-20020a170902f98800b0019ceb5088b9mr6494626plb.29.1677476927275; Sun, 26 Feb 2023 21:48:47 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:46 -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 69/70] tcg: Drop tcg_const_*_vec Date: Sun, 26 Feb 2023 19:42:32 -1000 Message-Id: <20230227054233.390271-70-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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 Replace with tcg_constant_vec*. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/tcg/tcg.h | 4 ---- tcg/tcg-op-vec.c | 34 ++-------------------------------- tcg/i386/tcg-target.c.inc | 9 ++++----- 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 43ce4bfa7d..80a2597293 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -992,10 +992,6 @@ void tcg_optimize(TCGContext *s); /* Allocate a new temporary and initialize it with a constant. */ TCGv_i32 tcg_const_i32(int32_t val); TCGv_i64 tcg_const_i64(int64_t val); -TCGv_vec tcg_const_zeros_vec(TCGType); -TCGv_vec tcg_const_ones_vec(TCGType); -TCGv_vec tcg_const_zeros_vec_matching(TCGv_vec); -TCGv_vec tcg_const_ones_vec_matching(TCGv_vec); /* * Locate or create a read-only temporary that is a constant. diff --git a/tcg/tcg-op-vec.c b/tcg/tcg-op-vec.c index 0f023f42c6..aeeb2435cb 100644 --- a/tcg/tcg-op-vec.c +++ b/tcg/tcg-op-vec.c @@ -229,32 +229,6 @@ void tcg_gen_mov_vec(TCGv_vec r, TCGv_vec a) } } -TCGv_vec tcg_const_zeros_vec(TCGType type) -{ - TCGv_vec ret = tcg_temp_new_vec(type); - tcg_gen_dupi_vec(MO_64, ret, 0); - return ret; -} - -TCGv_vec tcg_const_ones_vec(TCGType type) -{ - TCGv_vec ret = tcg_temp_new_vec(type); - tcg_gen_dupi_vec(MO_64, ret, -1); - return ret; -} - -TCGv_vec tcg_const_zeros_vec_matching(TCGv_vec m) -{ - TCGTemp *t = tcgv_vec_temp(m); - return tcg_const_zeros_vec(t->base_type); -} - -TCGv_vec tcg_const_ones_vec_matching(TCGv_vec m) -{ - TCGTemp *t = tcgv_vec_temp(m); - return tcg_const_ones_vec(t->base_type); -} - void tcg_gen_dupi_vec(unsigned vece, TCGv_vec r, uint64_t a) { TCGTemp *rt = tcgv_vec_temp(r); @@ -431,9 +405,7 @@ void tcg_gen_not_vec(unsigned vece, TCGv_vec r, TCGv_vec a) const TCGOpcode *hold_list = tcg_swap_vecop_list(NULL); if (!TCG_TARGET_HAS_not_vec || !do_op2(vece, r, a, INDEX_op_not_vec)) { - TCGv_vec t = tcg_const_ones_vec_matching(r); - tcg_gen_xor_vec(0, r, a, t); - tcg_temp_free_vec(t); + tcg_gen_xor_vec(0, r, a, tcg_constant_vec_matching(r, 0, -1)); } tcg_swap_vecop_list(hold_list); } @@ -446,9 +418,7 @@ void tcg_gen_neg_vec(unsigned vece, TCGv_vec r, TCGv_vec a) hold_list = tcg_swap_vecop_list(NULL); if (!TCG_TARGET_HAS_neg_vec || !do_op2(vece, r, a, INDEX_op_neg_vec)) { - TCGv_vec t = tcg_const_zeros_vec_matching(r); - tcg_gen_sub_vec(vece, r, t, a); - tcg_temp_free_vec(t); + tcg_gen_sub_vec(vece, r, tcg_constant_vec_matching(r, vece, 0), a); } tcg_swap_vecop_list(hold_list); } diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 883ced8168..e8e2a31658 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -3651,6 +3651,7 @@ static void expand_vec_sari(TCGType type, unsigned vece, break; case MO_64: + t1 = tcg_temp_new_vec(type); if (imm <= 32) { /* * We can emulate a small sign extend by performing an arithmetic @@ -3659,24 +3660,22 @@ static void expand_vec_sari(TCGType type, unsigned vece, * does not, so we have to bound the smaller shift -- we get the * same result in the high half either way. */ - t1 = tcg_temp_new_vec(type); tcg_gen_sari_vec(MO_32, t1, v1, MIN(imm, 31)); tcg_gen_shri_vec(MO_64, v0, v1, imm); vec_gen_4(INDEX_op_x86_blend_vec, type, MO_32, tcgv_vec_arg(v0), tcgv_vec_arg(v0), tcgv_vec_arg(t1), 0xaa); - tcg_temp_free_vec(t1); } else { /* Otherwise we will need to use a compare vs 0 to produce * the sign-extend, shift and merge. */ - t1 = tcg_const_zeros_vec(type); - tcg_gen_cmp_vec(TCG_COND_GT, MO_64, t1, t1, v1); + tcg_gen_cmp_vec(TCG_COND_GT, MO_64, t1, + tcg_constant_vec(type, MO_64, 0), v1); tcg_gen_shri_vec(MO_64, v0, v1, imm); tcg_gen_shli_vec(MO_64, t1, t1, 64 - imm); tcg_gen_or_vec(MO_64, v0, v0, t1); - tcg_temp_free_vec(t1); } + tcg_temp_free_vec(t1); break; default: From patchwork Mon Feb 27 05:42:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656907 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2229576wrb; Mon, 27 Feb 2023 00:17:49 -0800 (PST) X-Google-Smtp-Source: AK7set/L8FA7IOIPdBORuDkMBeGSQgE1pKpqm49bJob5Xtl7Bsn5nReZwacC+IItGAe5GMImo08/ X-Received: by 2002:a05:622a:1a1c:b0:3b6:3a58:912d with SMTP id f28-20020a05622a1a1c00b003b63a58912dmr40837158qtb.0.1677485869409; Mon, 27 Feb 2023 00:17:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677485869; cv=none; d=google.com; s=arc-20160816; b=qevPUMfnwCIoI5pfJ51O9O91l0HwZh4zFo9CZP6309aO9gprtUFoP+wbHAWNFTUPpr Q9qtlLblFTRxTeX4IoXtHKmG/Bw19ACdm4TArFBQCuWe98ZsSdeoCleqmvfkTqfzhBmz 3V4NdRw9ZDfEeGuYZ4/z8OqcKvHm2oZgPYMBE8d0ULvUmAG1Hti6imLgYJ+RbdBUQftH jg6VPTePIFzZFjKa1xh0uoxBzerP+rYXa7lG5bo0TfpqpnduhJWLwq4nkB/Ih7khaigP 7PvbmuA3X32RGxIW613g/ujaxIgmzwQTE0KtqEeCUMmbXZqohEjbmKTOX8KV4IZcO32B ILNQ== 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=sYsgaqBrBGiI3+Jh2WZEiCq4q19WvUz6hEnSof98BJo=; b=DuOfiiPhyLEN23BtCuNqj/N2cnGNlBOQ9ALfN8DKGBECcRl6LxkiE2r1fhbjTaJua1 llMe4M+JXwFaN7ngmb+ocJbGDReUmMGm68u8BczCfbtWl4Pdh7CRQRbLVFBJna/mQ4P2 /o8lvGWIhq/2+JztO06SKzfsyE/r00t7D8D5WfOHFdbAW7Tk57BEu1BedMuYa1SAW2n2 MkS3BXhyQY45nwgfXImerqg8C5fFNJIZ8euxxma2jkQZca9Kyi0uNB/IRrIM+qLfeVbS xy5O2eAjtB5yemwzRis9AjCPcg8VoEo/MfQy92fRt1ONvV3bQXwSYROwhRQXBABVKuaA p3YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FSrTyzh5; 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 dt29-20020a05620a479d00b006fbdef09390si5275407qkb.96.2023.02.27.00.17.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:17:49 -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=FSrTyzh5; 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 1pWWP7-0004Pj-PN; Mon, 27 Feb 2023 00:50:29 -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 1pWWNa-0005IC-Nh for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:54 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWNX-0007C1-4G for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:54 -0500 Received: by mail-pj1-x102f.google.com with SMTP id h17-20020a17090aea9100b0023739b10792so5092038pjz.1 for ; Sun, 26 Feb 2023 21:48:50 -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=sYsgaqBrBGiI3+Jh2WZEiCq4q19WvUz6hEnSof98BJo=; b=FSrTyzh5bK28sB/luozKktwrAKm3kgVnjqPE8wFy6dO/K9ex6XKsTUfZPWliw3b6KG rGo/RYFt5GhajQKl90pAq8mqK9dv+dW8DgtTWt4CgZkbeKEHbV+yN0vhxKwRBhf95vEI EnXKnyKv3SsR+nOkp/kh2qp9cJF2ONolJ5keSYEk/l9k6VKebaRbNLnu+odihfZVH1K+ ob8yC8PkLGj3PM/w+IqJRWY+8+0uKJtlGWe+Fwc51E3dGobJGs03XwRfSfRuuzX5ENjY jX6DY0JyRXToAmgLWalysPHeX509mkNLmiTAU97bbEke2W1lkulA8zfbvRqywzx9FDjK M10g== 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=sYsgaqBrBGiI3+Jh2WZEiCq4q19WvUz6hEnSof98BJo=; b=6FxEMBIuLpzyGd2bUfcmzs8rOfzEaKCPuLNsOOGrTcOG98UikF3B/1jxArdqpt7jO3 NnKleHM5PDe0N+0tijiQ6oOzegqdo+B4weBLUgt7hsRNL1zqboP1Gk35oCUSFC0udG0/ 9LmAaqBvb8qOSw0nVXmHSwlDX7ALJFEiUR+VyAIy/8IatmU8kjEDnklVCiDFVYyOfN3W 9lwKioe3szFIvcBRSFbHjNnu/UCKffAj1ZeK2B/d4RDZUE3cX6c3v3+rvnrscK1dQ9/9 1dzfoohz1uDOFsQl7uufkMXkiu8W0Uj8tJ+n/8t1zgqwz77RuZhFEUjb40CaHOs6S6an kaUQ== X-Gm-Message-State: AO0yUKW0DGL6//68c12Hnkkn11PuFoZIPwablpAGPrZ2LpQWYJubpH9x mfVdXonOr4hESmwHYQ/bo3wK6CDpD31NIQ+BFl4= X-Received: by 2002:a17:902:e812:b0:19b:da8:1ce6 with SMTP id u18-20020a170902e81200b0019b0da81ce6mr30069146plg.55.1677476929962; Sun, 26 Feb 2023 21:48:49 -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 im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:49 -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 70/70] tcg: Drop tcg_const_* Date: Sun, 26 Feb 2023 19:42:33 -1000 Message-Id: <20230227054233.390271-71-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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 These functions are no longer used. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/tcg/tcg-op.h | 4 ---- include/tcg/tcg.h | 6 ------ tcg/tcg.c | 16 ---------------- 3 files changed, 26 deletions(-) diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index 353d430a63..1d682d0b0a 100644 --- a/include/tcg/tcg-op.h +++ b/include/tcg/tcg-op.h @@ -1094,9 +1094,7 @@ void tcg_gen_stl_vec(TCGv_vec r, TCGv_ptr base, TCGArg offset, TCGType t); #define tcg_gen_extract_tl tcg_gen_extract_i64 #define tcg_gen_sextract_tl tcg_gen_sextract_i64 #define tcg_gen_extract2_tl tcg_gen_extract2_i64 -#define tcg_const_tl tcg_const_i64 #define tcg_constant_tl tcg_constant_i64 -#define tcg_const_local_tl tcg_const_local_i64 #define tcg_gen_movcond_tl tcg_gen_movcond_i64 #define tcg_gen_add2_tl tcg_gen_add2_i64 #define tcg_gen_sub2_tl tcg_gen_sub2_i64 @@ -1210,9 +1208,7 @@ void tcg_gen_stl_vec(TCGv_vec r, TCGv_ptr base, TCGArg offset, TCGType t); #define tcg_gen_extract_tl tcg_gen_extract_i32 #define tcg_gen_sextract_tl tcg_gen_sextract_i32 #define tcg_gen_extract2_tl tcg_gen_extract2_i32 -#define tcg_const_tl tcg_const_i32 #define tcg_constant_tl tcg_constant_i32 -#define tcg_const_local_tl tcg_const_local_i32 #define tcg_gen_movcond_tl tcg_gen_movcond_i32 #define tcg_gen_add2_tl tcg_gen_add2_i32 #define tcg_gen_sub2_tl tcg_gen_sub2_i32 diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 80a2597293..a1b41c1728 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -989,10 +989,6 @@ void tcg_remove_ops_after(TCGOp *op); void tcg_optimize(TCGContext *s); -/* Allocate a new temporary and initialize it with a constant. */ -TCGv_i32 tcg_const_i32(int32_t val); -TCGv_i64 tcg_const_i64(int64_t val); - /* * Locate or create a read-only temporary that is a constant. * This kind of temporary need not be freed, but for convenience @@ -1014,10 +1010,8 @@ TCGv_vec tcg_constant_vec(TCGType type, unsigned vece, int64_t val); TCGv_vec tcg_constant_vec_matching(TCGv_vec match, unsigned vece, int64_t val); #if UINTPTR_MAX == UINT32_MAX -# define tcg_const_ptr(x) ((TCGv_ptr)tcg_const_i32((intptr_t)(x))) # define tcg_constant_ptr(x) ((TCGv_ptr)tcg_constant_i32((intptr_t)(x))) #else -# define tcg_const_ptr(x) ((TCGv_ptr)tcg_const_i64((intptr_t)(x))) # define tcg_constant_ptr(x) ((TCGv_ptr)tcg_constant_i64((intptr_t)(x))) #endif diff --git a/tcg/tcg.c b/tcg/tcg.c index 4d3fb6aee2..3ba0bdaaba 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1444,22 +1444,6 @@ TCGv_vec tcg_constant_vec_matching(TCGv_vec match, unsigned vece, int64_t val) return tcg_constant_vec(t->base_type, vece, val); } -TCGv_i32 tcg_const_i32(int32_t val) -{ - TCGv_i32 t0; - t0 = tcg_temp_new_i32(); - tcg_gen_movi_i32(t0, val); - return t0; -} - -TCGv_i64 tcg_const_i64(int64_t val) -{ - TCGv_i64 t0; - t0 = tcg_temp_new_i64(); - tcg_gen_movi_i64(t0, val); - return t0; -} - /* Return true if OP may appear in the opcode stream. Test the runtime variable that controls each opcode. */ bool tcg_op_supported(TCGOpcode op)