From patchwork Tue Mar 7 18:34:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659823 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540747wrb; Tue, 7 Mar 2023 10:36:31 -0800 (PST) X-Google-Smtp-Source: AK7set/P2WSmnHkH+d/GTECVyMzKrD0cmSteuz3mS0Q0inHToWXQCMqwLSq78SwRqWE2QjY8d3ho X-Received: by 2002:a05:6214:2387:b0:56e:9551:1980 with SMTP id fw7-20020a056214238700b0056e95511980mr28831180qvb.5.1678214191773; Tue, 07 Mar 2023 10:36:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214191; cv=none; d=google.com; s=arc-20160816; b=Zp80V0I5B3vdg0Aq/u3m2W4OSj2dtAaCuQW/RvnTwwDxRXg8d4hscSFpUT6FXn0kgN OGmnyad2/6Oqq/bR5z/GCBS06tPGSi8iYvhLsIytBZptdVfbV2T3BefCQl+dKeWTlopp lp2dKRiaA/N0k7QSFhPOiMGIYp3wst0TsqncFDuE/28F1pMclzgNZwZ8LfhmsxrcXkUK WwOhC/Kfk1Imr9IkHXMb/CtRh/JOALwraTYp/7HUSg9yX1qUrjZLsXt0BuRYdGR1H3sN 6VE7exWd81KLLt/yNOag9YbQRQx+L8PFpmm0Zgt+s1SrlyxAIofTccOXHgY/8OYHQii+ JIIA== 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=vkOcZIkhovadaxOuqag5xwc+XnGtPssFyKztAIN0fdU=; b=FneNNDMOoKU7ZMn+dU4AoZIC9MQUcmWUUqEjPQvZ+nqUqeZ/pxthVjm+a1GJm0XWwn XeshnywlIurVYc6DjrMwmz98xEtbXN2UjupVhbLFs8GoaeuHEDEUgJ6LnSVSxKnqAC9X QYROaEiH4axPux+7SGGTi/i/NoPA2whvssGLTiGk3PvDqNA+VtAMW5HAZKbSg8T4fXgx 2s4+FQZn0iBdY53PP9suW+j9Wx5uTIRj2gITHozqnkunOewGkfQXbwSdMb6sfDB4jywV dRoLhqHoYfJGRpnRPvuSIEim+iY3fZq6Xfl5ya9s/2u1EnWj4RRxPMS2IHqJIu9YVMqh BSOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BBo2LFwg; 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 o197-20020a3741ce000000b0073b83c609f2si9644950qka.659.2023.03.07.10.36.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:36: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=BBo2LFwg; 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 1pZc9X-0003Xp-EU; Tue, 07 Mar 2023 13:35:11 -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 1pZc9U-0003WI-EP for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:08 -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 1pZc9S-0007hf-JV for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:08 -0500 Received: by mail-pl1-x62e.google.com with SMTP id i5so15137658pla.2 for ; Tue, 07 Mar 2023 10:35:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214105; 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=vkOcZIkhovadaxOuqag5xwc+XnGtPssFyKztAIN0fdU=; b=BBo2LFwgxlUm8y/ZkNe9+CTMqsc3WVyP7uNZfNTVBGpsptr3r51GR2DcBLKxaRUNFo 2lZjIv1y/M7ipvsBM7Vs4Xtmq0xOGn5R9ahfG+d1EQOkEbK5edpxisU+8VMBKCwrf/DR CyDkdqpK3wtpsQjvjuyMncBa3NWqs/wlyVGuFoDZsVY2zJtka9++m7ziEQdZ2g53UfSp 2rYkAIp6ryeTkE1lPrSi1xd2/rCPGYXrfu/w8HwtnZ1y5Vvx0eT7clQSSVAW4kI5VHpA CY3odM+8dj1/tOCmMl5ZKfmN0LzZlai+yl2VyJrb8G7kuiF8PHQGtKe2671LvfcmI+wt bLEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214105; 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=vkOcZIkhovadaxOuqag5xwc+XnGtPssFyKztAIN0fdU=; b=VPe1PpVOoFCP8JEV6vA6Rsy0J+xJZLftq8MGaGBzC4LtyC69wq9Ne9sn5oLR1d0VuB pN8VWKyh+Fo6wH/PyxpioMo6ez3lH0cEDmaRRAJpo320u7Pr+9d1qyk/raKBotJT/m/I FbHjkOVzyHpN+S0LTstwWYiVMAeerztDSTndYYvTYSQJ3pI6fewPvleyJ4t+VbTvstlD tRHDM5z2ElG9cVQWLthtF1gTYQyyDzRusoBJWuzH1Oe+hdLK7gLaGeiCy9ECKICejyk1 k3a7jssfvcYfyNM7Qst14duC+6tQL/Y0iYRsTAyiX2euBeMO0YZv0K+wE5jeDC6v1F0U ukZA== X-Gm-Message-State: AO0yUKUtyxrc7iltCp5ZG/LlQjR/ICynQMrf8t5NVUgVVni/mkKKdBHF gVpYU6AzrOYKlYUbiJ1Zk5DRrst2o/J/M+7QlZs= X-Received: by 2002:a17:90b:4c43:b0:237:cbcb:efba with SMTP id np3-20020a17090b4c4300b00237cbcbefbamr16836969pjb.17.1678214105082; Tue, 07 Mar 2023 10:35:05 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 01/25] target/arm: Use rmode >= 0 for need_rmode Date: Tue, 7 Mar 2023 10:34:39 -0800 Message-Id: <20230307183503.2512684-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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=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 Initialize rmode to -1 instead of keeping two variables. This is already used elsewhere in translate-a64.c. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 2c2ea45b47..bef66086a2 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/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 Tue Mar 7 18:34:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659819 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540520wrb; Tue, 7 Mar 2023 10:35:51 -0800 (PST) X-Google-Smtp-Source: AK7set+g7xqWs/8IUmcA4AQZfGTtIJsHacBZdj/mbJ7YFzqcnISuW9GoHxb/Q8CNm2pEz5mzDt1c X-Received: by 2002:ac8:7c4c:0:b0:3a6:8f7c:5936 with SMTP id o12-20020ac87c4c000000b003a68f7c5936mr24815571qtv.25.1678214151627; Tue, 07 Mar 2023 10:35:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214151; cv=none; d=google.com; s=arc-20160816; b=BELu/Nag2GUgd5z2Ll4IY1wE1dzJcY0DaAk2quMTfdK2AkUMcU4Q8luLvmRKW6rn+/ CHriybIKxnsbxzXJlrmoUcxIiO4IPxsNtBZLvkZ8i74YUPHtytb9p4sr6kNBRkprSXHd ATZ2e5lS5fg66Mm93hjiGcGFReZHqZhG2YLMKS3BeLX5EznTeNlJoWYgFEu5q+DG9nMl 27gB0CX3LEWN5t/Xk3BRGJRy9O0CjCxWLF+BwLtTtqtNesNw7vnfb168IEO+03knBto1 lcleQYulfdSCBCmmOJP89SN7HS9uLyfKgiV0REl+YGf0BEm5yv28QJx2i76cdGxK6rHL OPeA== 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=LvRzWvVDOx/4mw8Xks+yN45owXOLBfvuaq+ouOQwf5k=; b=C3gNejqPldNLys/y63IbadlKxhiR4D265AyBISm2FBV0Y/tUhXZMXebm4BD8ZUbzJq j1rZaO9i6mkY/Un6qfUBV89hUZRL47o3maCj7PZPxchInYnNLpCtrlOFmmtht8iDRt45 6Iim3f+fUgZFb+uVAt4I70cDb7SfZ5EfrRKF3YB4HFDGde2hl6ulUjeeuExqHy0nBYX+ 6SAL/wqmdoJFAEm/zHiPbkHfa7SB5s5Mq+vWMbPNm/ENODpMHNLE1010/a5iYMHcNLcK PX4E08fxInyareyDy0rv2+7x+FcoPr2DfY2fdJPnneFkAJdrSKNbi4gNLZCpg9KO4fYD F1fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DLrYTU0u; 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 u14-20020a05622a14ce00b003bbef811bf5si9753904qtx.294.2023.03.07.10.35.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:35: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=DLrYTU0u; 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 1pZc9W-0003X5-69; Tue, 07 Mar 2023 13:35: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 1pZc9V-0003Wm-Jp for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:09 -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 1pZc9T-0007hn-FI for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:09 -0500 Received: by mail-pj1-x102d.google.com with SMTP id l1so14146221pjt.2 for ; Tue, 07 Mar 2023 10:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214106; 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=LvRzWvVDOx/4mw8Xks+yN45owXOLBfvuaq+ouOQwf5k=; b=DLrYTU0uW0rxfmTKIOrGTG7NBWEpH9QlQDGYadQ3j7DQb6GmBqgq0RrdkPy7c48RI8 fig/YstyFwB41YL2wf0d9tul/V6v6nTXgA6emezRblGzoi1Xc9phYFUxOnYz2/fZR8Ul 3mxWB7WevvuxKn/A53nMoqofJHj14zGO0bQ3EtZBQa+TAuFZBxQBUydbq5+ith5wzXC6 pVsFPd8wugYI/lBYafxg/ki0dIGP3NZYEIpVytF1bpzZPzkkBawPVRDNNOwr2FbJmcmW NNBej5s3tZRJN+R2fo1ZlQG6co0IuRITdEfBTbW+mxR0gCY/6rblA80bMAk7X8R1wdPU aXXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214106; 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=LvRzWvVDOx/4mw8Xks+yN45owXOLBfvuaq+ouOQwf5k=; b=PPkrk8LZqfscLEupZ/vZG3QJjyRdknkJENkFUcXfz5kj9VsasqAHHc5ARcDtLACkAK 5ySYnojZ8PLeAH1tVaQDaqpeSgf9//5G68suBrGNlEJsVskzzKQ9Ae4YkhFxn/wFTM8y 5wGWnJUE13SRXwn4BXlpeG5lJIE7luJqzIFzf7Q7UU0YhCk830gbJGQ5+4jojD9HlYrJ KeRLBr3bjGp+6IATOqyqp4fgOkyLWELDCEbqzqOhGHXojDl+A88MbNBSvzN3LmSfW+s4 eO6WcLahOHDwTLprXwKxcJCf18tVHnTwrC1V569+ZYvtnwgbNm3AWpe4CcA7GwMoXAPz vRng== X-Gm-Message-State: AO0yUKVhsyZ3KyGpqAMvNHvj3XYWZm2eRNZBL6zs2sMiSbPBcM9IR5Lr 8uEE5U/p8hgV8YnGj7Qt00BrT7DzyAKd5naEfs8= X-Received: by 2002:a17:90b:3907:b0:233:f447:1271 with SMTP id ob7-20020a17090b390700b00233f4471271mr17353226pjb.43.1678214105797; Tue, 07 Mar 2023 10:35:05 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 02/25] target/arm: Handle FPROUNDING_ODD in arm_rmode_to_sf Date: Tue, 7 Mar 2023 10:34:40 -0800 Message-Id: <20230307183503.2512684-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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 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 Reviewed-by: Philippe Mathieu-Daudé --- Cc: qemu-arm@nongnu.org --- 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 Tue Mar 7 18:34:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659820 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540525wrb; Tue, 7 Mar 2023 10:35:52 -0800 (PST) X-Google-Smtp-Source: AK7set+BP5dXw7h/4Ph0TRAXOVHnrQeJoQ4SjCNanCmkOmi9cf/68I/bxa10F8+u9dpKakVsAclN X-Received: by 2002:ad4:4eae:0:b0:56e:a96b:a3a1 with SMTP id ed14-20020ad44eae000000b0056ea96ba3a1mr24698715qvb.7.1678214152156; Tue, 07 Mar 2023 10:35:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214152; cv=none; d=google.com; s=arc-20160816; b=Q9Ir4XraokGjTkrqY66A+pn9M7HNteiwdUH+T2/YD/3bLzoqGnjkmBkh7pxznpa0PM fyCfTMRkMlSkV/TQ+T+Ts7E7q5ZZiR5TsLeZHJ65p16HDcz38lZka9W8t9quC2nsHhWm LD15gfBo0q4SUWLDGKFF8e2zW/EAYjAW7k8A74e++jkrrivsCiQK5DbCMS+gUagi0EJJ c1JMj/ruiSZAd2lFXhA/bcsxxwyLWi+kjMDqxdN7LyhNXsCreyIpuMNwNIfNms9LLLr3 DtZsz7iJM//VFpCfzOK/aWs9VrIbynC7nsQadGJcIAPEqHfDBpvreCssOY0wgSHiOgmU oEyw== 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=1cudVQ02HiPN679lxe7GeIU6QCBZXBjPIrdLqimdu9w=; b=PEGh8K/LtQxFLtCcCNw8WU8SpBaTeRwVRG30DlOWHKJdPXqMLE3zwdRRvW/D97K4La 6EiRy8jlLWZp4lfgCvjSEbUQpUwXOHyurOz3/Yzbf1QHL1l+Jw/YgVIA6g/AYHKiGmHh uz7ailGzGXzDPq2YlSsfJSDw86X5fEfWEJc0iTH7zzsT62GM3cGe18GE1FV6XPPoF49c NHEE6uL2jT45v0eAMYPgmVv9L/qv+oZ2wmGyfsEkAAUpDQvkijtN5VEoi66T3WuVOBB6 dpfeomqc3N5WOMT6aEV2xI0dHlwXa5C7LwV4ZZpaBqW5fJzaBW/HXYe9ogczxVMVtvPx m24g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hCs5dLm2; 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 a11-20020ac85b8b000000b003bfc38fefbdsi10266471qta.95.2023.03.07.10.35.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:35: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=hCs5dLm2; 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 1pZc9Y-0003YX-5f; Tue, 07 Mar 2023 13:35: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 1pZc9W-0003X4-3b for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:10 -0500 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZc9T-0007i1-VU for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:09 -0500 Received: by mail-pj1-x102e.google.com with SMTP id 6-20020a17090a190600b00237c5b6ecd7so17418338pjg.4 for ; Tue, 07 Mar 2023 10:35:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214106; 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=1cudVQ02HiPN679lxe7GeIU6QCBZXBjPIrdLqimdu9w=; b=hCs5dLm2yjZyYiqPFggW1DTvUd6IN0dtG9EcJAA52dItHZeb42g9NmFzd2c3y1Q8D5 xTfCcVVYIezr0ooitXNH7BFUA9hFCiPeidMSQ+j0ugQOC7mmCA8TO2qWoa21S7uk6CTF R+WtqRwWAvT3QQnunWaigglikcO1ju54JXSq8dlhPiFamOP9mN5pgeFWp+HE3cZ8NIM+ uzgNiPNXI5ZsVcezQ4ve8EELj6P3oLS4orBQaJLed8zXTupiGfaY0YUQFzryUr0njr2F 86a39TpRa2JMyLTvuoj5g3/SfOH/+TAC6NWHYmjm+kpGJ46GdaXXGZHuYzKlrvVuBezX S/iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214106; 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=1cudVQ02HiPN679lxe7GeIU6QCBZXBjPIrdLqimdu9w=; b=zzjcYEZfiWXLp0B3VymS2sH2kjTAsCCM+evM/tjfxQU9xqE+cQtNDlT3tP47hvpk0f LOQr3ZmCxYM1o4QLv4jl7kVOJr6mWGtciZE/2Dx2Xx66763CVU8q6hHGGa4EgXfkdbhk mpYM5bcEujFU6fpPpK+EW4PYNXSsLANE2tNznSRVcbGw+IL6qrUhnh9J4yl8C7VwzLKp n+wkSMQY9InZhSpQ34dnJyX2OmLGYjyXxS9rcsfTrmcSsjHrPzgJ0LTCNKVg7o1+kc66 j+74QnjDQHygAyqYxaHW2uu8pMizD6PG6xT0+SVsQkIAzEKR55TCOorT32ctJBWOcuSN rzKg== X-Gm-Message-State: AO0yUKXNaNrUviBylpFlcr/5Wrr8TnCQPq8vxWBFisYlJoYY6iIIYKp2 +5yBvk2UG7bLIVxXk5upTu6qJ9CcoyhvpValNxo= X-Received: by 2002:a17:90b:4c43:b0:237:5db6:22be with SMTP id np3-20020a17090b4c4300b002375db622bemr15729937pjb.49.1678214106647; Tue, 07 Mar 2023 10:35:06 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 03/25] target/arm: Improve arm_rmode_to_sf Date: Tue, 7 Mar 2023 10:34:41 -0800 Message-Id: <20230307183503.2512684-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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 proper enumeration types for input and output. Use a const array to perform the mapping, with an assert that the input is valid. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/internals.h | 12 +++++++++--- target/arm/tcg/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 b1ef05963f..673519a24a 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/tcg/translate-mve.c b/target/arm/tcg/translate-mve.c index 798b4fddfe..9744bf3de0 100644 --- a/target/arm/tcg/translate-mve.c +++ b/target/arm/tcg/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 Tue Mar 7 18:34:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659822 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540663wrb; Tue, 7 Mar 2023 10:36:19 -0800 (PST) X-Google-Smtp-Source: AK7set9+w16tdGDY3cGYbGb4ympBQEg3eHXxCul2PfhsyvlmJacZeaectvc0R9/1zx6ugszgpjr8 X-Received: by 2002:ac8:59ca:0:b0:3bf:de34:47f0 with SMTP id f10-20020ac859ca000000b003bfde3447f0mr24082392qtf.65.1678214179578; Tue, 07 Mar 2023 10:36:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214179; cv=none; d=google.com; s=arc-20160816; b=yCe2Ua/mpXdQ/z1SU9+7Htkivub1d169f6RPyPQ2NYG/q6qVSm9hb15V2CE4GAJZts 5nyzrWoFBcsPiNa6mimE3a9n5DkESdhCgSAFp9OkGa2II2bzFKk+rx81U8SsGJw/MB3y wpGjn+OvBsu2Ttx5fXSbZKNqk9VqRwp6hne1FDxuTPFINCA+2BRWwh5vN51LlmUld6s/ mexY/UKa5vlRJAsaNYWAJ74lehcwu6vinftwWljDywbcaU+lb/hMbDMUIPp3yIUWYiqX pls3Uivh18h6D33FI2kXRbdot8rd6/sRVOFusmX2I7oywpc1GnjzcNylcMcNZrKMSIpW 9Dug== 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=Qr5XLdhxclJBvAXiN4iaOPbLLOomvFENA35jRJhVgIg=; b=MUxN3LO0p+2oeaoFvuN5LoUtLZMNHW3zCEOPPVGILpB1XhgN5kRrPx9Wmdwh1fkHUf 7RiaUTuuc28BgixwIuVF23Gt4pSQO1wvjqz6NKmpF0Mwy98gQ2oYm9tflSuL4MbVGcRQ 5H6UynTGRVn/sMNOTYAL1Dr0k+6tSa0eQRqeHSI4xwkeR+afzMl4RYsjSHCyalhf/ytv 15Q7IVU9YZ83p1nvq5Gr7DUBMe10Mv58AXGcsHuz317z0hE/MRd6tFMJlq2D8dj/lYbr s41H5dunrfZXnD2pt8XzDFFC1X+dk3MdQN0N6HSCFzciyRAEmDeQ3sgFMeXHrbMBySE+ KSEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vV+MWP4E; 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 a9-20020a05622a02c900b003ba1088cf12si10298727qtx.166.2023.03.07.10.36.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:36:19 -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=vV+MWP4E; 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 1pZc9Y-0003Z8-Q2; Tue, 07 Mar 2023 13:35: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 1pZc9X-0003XX-7Y for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:11 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZc9U-0007iH-RA for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:10 -0500 Received: by mail-pj1-x1033.google.com with SMTP id q31-20020a17090a17a200b0023750b69614so12712181pja.5 for ; Tue, 07 Mar 2023 10:35:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214107; 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=Qr5XLdhxclJBvAXiN4iaOPbLLOomvFENA35jRJhVgIg=; b=vV+MWP4EF5pYRH2PFRleQKs8VBCZ9KIrJTrqHRI3V3WGfT6jfqQM1oOJFPJ37NFC+8 il7HV0j4NGFAq6awb37oTbBqfng/6udZU9atI4bL2BXGPB2Xbqx54EWQMgHy2qLId46I JkM3D7m+Hrf71eSYCRQcQ7KeAJ9fWQlnhuFJSLCvfOubl3lDPqnlt3PE8Z26QBvGZ4AC ewaWcP6pH58TtjevIFgH673I/ysw1FWFKXodMhDGV9VhTpu5tajobLPRjWxNRZLQBFZ5 BIlecg1Uto/cN6sUcqwALH0upSDwBWXAmK4wuMPcM9CkUbZTWQaC+N27anYMW21FZAm1 TVJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214107; 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=Qr5XLdhxclJBvAXiN4iaOPbLLOomvFENA35jRJhVgIg=; b=3xC7TXlwm/xrJHUQ2cRHdpryf1qR7PoOcfS7UrYyoofjP5SsixRVxquURr4fsUXDEa tZRdnzun+YcCmmjLqUGbTrU9oBug2SLOEfxZXQ2LD5wM6cTC/Fpo0nqjE1OdSYY4ln/F foklswnJ+OHAWtBkKbyUtgrnL/2jEWwVJQuZNBvMXdcf/freKu8BMoUV9HzR5LnXn3M9 cwI6UBv/YXlcPciuV4YEu6AOMhFXjRDqRYQ3hffPt5mo/yp9X1Q44TrTSCf5kDbzWsux ULWqahKWfYPVk5XpPMrb/+Yp7/xJuiypw+zMUL2gC5ql9Q/DwSVvD+WSbARV83mrCgQ6 taYw== X-Gm-Message-State: AO0yUKVfwd/8mYSBIo/hh3LLcqV0XXTm580xvJt6NGlv7ueFXUKTjare RYGYs2R3FlAUIbJsWykCEeb9EEF5RoJtQNjJDcw= X-Received: by 2002:a17:90b:2353:b0:233:cea2:dac6 with SMTP id ms19-20020a17090b235300b00233cea2dac6mr15968817pjb.47.1678214107471; Tue, 07 Mar 2023 10:35:07 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 04/25] target/arm: Consistently use ARMFPRounding during translation Date: Tue, 7 Mar 2023 10:34:42 -0800 Message-Id: <20230307183503.2512684-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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 preparation for extracting new helpers, ensure that the rounding mode is represented as ARMFPRounding and not FloatRoundMode. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 16 ++++++++-------- target/arm/tcg/translate-sve.c | 18 +++++++++--------- target/arm/tcg/translate-vfp.c | 6 +++--- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index bef66086a2..210899ff79 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/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/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index 5bf80b22d7..3c65dd1ff2 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/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/tcg/translate-vfp.c b/target/arm/tcg/translate-vfp.c index 757a2bf7d9..e7acfb3338 100644 --- a/target/arm/tcg/translate-vfp.c +++ b/target/arm/tcg/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 Tue Mar 7 18:34: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: 659844 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541244wrb; Tue, 7 Mar 2023 10:37:42 -0800 (PST) X-Google-Smtp-Source: AK7set8mHvH85F97Xixm4Tt2+EOYYCQi2daBRmTJR9CrbWt6tz+4ToLWSWW+QXRDZg5yl9SffxtH X-Received: by 2002:ac8:58cd:0:b0:3b9:a42b:7099 with SMTP id u13-20020ac858cd000000b003b9a42b7099mr23075508qta.30.1678214262125; Tue, 07 Mar 2023 10:37:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214262; cv=none; d=google.com; s=arc-20160816; b=n3Ibf26BuaDRYLQWiC+TUUifoLSA8xsRh0BlQWTpDoyKG6aqBjYCDNEMnqjt7vl5MO /EAtE8lLDPYab4bB6p5E3KMRAxqTto1XAaVfLqN+uusgUSPFyuVz+xDEtCho95ujmdBQ 9A8XWa/qFYtzmRDwPjB2NZ2wCx3OOv+BKXl6jzs4lOheGPLwCx3IjJurJaFf5EPtVE7X UppoXPrvsx4rmTdHV+GybCQ8X+8IODcokyJ8PTLOZ308R6VJcQWwDjwFoVgOG1ophyvX Z07jmTt2DztAo98lwmG/xUVrhE1Dij1qV6+VWyATP2JoJLrun95gr9/atIx9kt27VGUv mASQ== 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=Dt1LrS9/3SviLq9dWaQw8L4G7ZRCNNILvm2xpdb6v0o=; b=mMZNT8B6sbKZevSMRAt/z0SE7ATpFJe2oimlDZsyu/3opUTtGiOAxs1DuiB9yMijSN exbmjaNSkF13jjszc50yrP1XYgSqT0jI78i6dFOYQv/NdxnnumAP2LNYqpSSlMnrROf6 482TnXHeXlKI2cwYtzCSVKdf6o2QPMOLm8CFAJnx8zuMLe9ejk9o0xowL++BDdjhe+rA 7Yf8oabnyeDxekK/aaqln45T6pha9EpNzEuDF80IA0wiV+Lf8qLoT5fVSG3VBrCB9Zs+ GjHCrZsg8fCexS0A1PWfb0DPEGSUfGdg3MB4ANLRJoB4iPxQBTR9VjOHkq1V5t14Pa0z Jvnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o06dry/O"; 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 o14-20020a05622a138e00b003b696ab57d4si10774351qtk.667.2023.03.07.10.37.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37:42 -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="o06dry/O"; 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 1pZc9a-0003Zw-5F; Tue, 07 Mar 2023 13:35: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 1pZc9X-0003YM-VV for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:11 -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 1pZc9V-0007iZ-RP for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:11 -0500 Received: by mail-pj1-x102f.google.com with SMTP id bo22so14125133pjb.4 for ; Tue, 07 Mar 2023 10:35:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214108; 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=Dt1LrS9/3SviLq9dWaQw8L4G7ZRCNNILvm2xpdb6v0o=; b=o06dry/Oj/QXc5qmla5oFi1BoubZl12yBE9BN+Ohr1OgbxyPJjH+686aCTooNinZIJ 9Om5LuoRBlSSPQX6RLdGwM5z+b3ywBeQ15GhvjrHqgD58UsX0sahf/CsfgZjW7wJ9rcr PKHqWgIClVFwfj8X5taxtsYAPdGW1P9cwReaep63CwSyLTGJzFcpR7iwo1PdDzs9eImg 9IYDMa6E+/caygrldWEeMXgYnsY/EIXfv2D9f5YKvd9Ou5eVCBaZG5ZxEqtxoWJrEg2B OeKHZUAw6+jnoGRX8nLb+eRKjzpuN75rdGhsyhuGoMJyG+wUT3BJqY0k07XGcpb71411 +aAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214108; 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=Dt1LrS9/3SviLq9dWaQw8L4G7ZRCNNILvm2xpdb6v0o=; b=lBzLImIpVj0zilyocb5ca6hq6r47jrGwOb8h8rCAAjc09Sie3ht+sFDqJENw5Jgjjq uiuW3+jWkJJiO+4TD8XaP7EDq21hXYUjH8uAOVzQKwTSUuSWfqKbBIZUQ7HTHXhpTPJi 45V1cvQUf/+bbmDyyfcMLD4Srgu08g90Xz1k18mT2wAq5ihWGiE6gcEB3g2Cf/P8d+JG 7JHiYLx9rOuCNtsXSX11s5h/buV4S0Jb6woCpls3A1JGhfHLUpFsr10kaq+2lAvYDW+m UR9CEwXw3vrUZ9qMM6lxyG22lqi5R6pl9N15i+rlRhYKZWAj9FvTko/vT4CJipnpGSSP +ZjQ== X-Gm-Message-State: AO0yUKV9RuEqoRgWXmYWc80HCFscMnBDGVm2xz9dvUgOxz/Oap53I4AT vdr0FWvDJwrNr+HbsfXtVVPQWSgAnEwxy01zQ8E= X-Received: by 2002:a17:90b:38c3:b0:236:704d:ab8c with SMTP id nn3-20020a17090b38c300b00236704dab8cmr17027265pjb.26.1678214108156; Tue, 07 Mar 2023 10:35:08 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 05/25] target/arm: Create gen_set_rmode, gen_restore_rmode Date: Tue, 7 Mar 2023 10:34:43 -0800 Message-Id: <20230307183503.2512684-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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 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 Reviewed-by: Philippe Mathieu-Daudé --- Cc: qemu-arm@nongnu.org --- target/arm/tcg/translate.h | 17 ++++++++++++ target/arm/tcg/translate-a64.c | 47 ++++++++++++++-------------------- target/arm/tcg/translate-sve.c | 6 ++--- target/arm/tcg/translate-vfp.c | 26 ++++++++----------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 20f3ca7aca..f02d4685b4 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/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/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 210899ff79..989c958de6 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/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/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index 3c65dd1ff2..3ca60fb36b 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/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/tcg/translate-vfp.c b/target/arm/tcg/translate-vfp.c index e7acfb3338..dd782aacf4 100644 --- a/target/arm/tcg/translate-vfp.c +++ b/target/arm/tcg/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 Tue Mar 7 18:34: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: 659840 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541152wrb; Tue, 7 Mar 2023 10:37:31 -0800 (PST) X-Google-Smtp-Source: AK7set8cKUVL6fV63exe3ZaUDkF0M1h/VrQCa1GUU48NKm1S5QVEpL6bePweJEGVy/ED3AS/T6Uu X-Received: by 2002:a05:622a:1a02:b0:3b8:5057:377b with SMTP id f2-20020a05622a1a0200b003b85057377bmr27332566qtb.65.1678214251232; Tue, 07 Mar 2023 10:37:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214251; cv=none; d=google.com; s=arc-20160816; b=XYKuAmfYjFLqClkFkrkb3AKqU29HcjDbP2hf4rQSg7BhPvxDWkQvFTFXWtkOSCucns CAm0bRcf4fYXdZWt9MQX5X07jstbNPxsXy2315lMC9XK0UCrMKiEQgmgU0NhkdD4TUxE Yni/c2OH84r0Iq4AJCOztBSWgJLhGp1uzVZp9cz7pPpLsqp8XfAqSNLWgSZX/sOwf5b7 74j/9zZXELUTi0jfOPGLYO3A/uXlc4AWP/BuApDODPLYT8CXxoovPKfWMdaJCfNOJJkG wW6PoM6tNrepniSEBsdf7LQGWMt4KdFTa0ASTdaTaLRqKcmrWjnOW4isLljPpdxbN3YT Y0PA== 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=nzq0HMNTYxPoQdwBr6U6yuEWrZYUhbLnx8E8aaEFjeI=; b=LZVxfnJdEBUwjNaUzK3YAhEFroTX5GGUMqlUiSBAsLXAZGd09yejtfUeKgaa1sKEVO Z6PzWmxjnfopLvcjp+eQ5q2Eay7mOGxwg8EeVk1IcoURMuRGXHP6InNkW/CChTP/z4xd 5Zed/5KkcCejUfT6vYKZ7FESUIOhcuIIb5w+gWe4GsPrEX3uAtLyffPGSibhBjoCb55V VLqIXz3dlVJ1pQJqvCNHiOy62Ox8cEZazPs3YI+wfM7V2zWnnn6/iRIb0BhZhsbnkpBV RAbyuhIVkto+KHc4TIvNmL65HWxey15b1c689mSRqMH/4i2HtPl3cH7Pw8ZESnXDASqH RTsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OIZ6o67M; 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 5-20020ac85745000000b003ba2d09b398si10391552qtx.580.2023.03.07.10.37.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37: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=OIZ6o67M; 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 1pZc9a-0003b1-UG; Tue, 07 Mar 2023 13:35: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 1pZc9Y-0003Ye-EW for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:12 -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 1pZc9W-0007im-5k for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:12 -0500 Received: by mail-pj1-x1031.google.com with SMTP id x20-20020a17090a8a9400b00233ba727724so1846595pjn.1 for ; Tue, 07 Mar 2023 10:35:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214109; 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=nzq0HMNTYxPoQdwBr6U6yuEWrZYUhbLnx8E8aaEFjeI=; b=OIZ6o67M8R0QJvDEdoPtF6358XD0ACF3Si1BSCrgJ4aqA+CEgB7PrtraRvxcGuK0kI hgAo+3G/fr3K8LM14kDsQ3k7ijWRmEeso5g5/Q8yj0tON+K8OCEq+OfHNvf/GsA/yzBb LbN0VeVAwlFHSVBKhTxAo6F297Q2bXTGE5pSYl2oPXwNfX9OXaqRpX5NcB+YDjRnqaOw x5o5hTf8TJgKNhcYEzOTTeG/l3/nmL5v2dV1nOd8ZgS1W91AxyGzWrqdV+iVvrMWD6Oz 4LuCny9uI4Mt+YvEzyNGaroJmGxYwuZIzzQfsl0aVKqDmgR/TfiqJO/ApRin5rXoWxSy ahOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214109; 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=nzq0HMNTYxPoQdwBr6U6yuEWrZYUhbLnx8E8aaEFjeI=; b=69VLfi/Vgu8dfE/GUhN9duAjhalFZ5ddzf2GwlBdIgwfEGQTYIqIwo/0ixQZxFIDQN TuTEjmtc8z0RkPp4ISWEeHjby94N6ErKUpDLMZRYiHQhMeLt8qBgcISWPrijhRdeNG8j QCRPRosHUFbm8Qr+xN9Vo0uGM1ncMu+GyMpo5Jj/vDTTHU10aI/rOpWKN4/fbx4j3FIJ hJa7YlGiQZkZ8Mf7hHzCyfdOXQBCTj2TKDc2DW8QhMjwdBJF8L8yMFnVmqoxb4WSXAlv n29N7O4DC/ItcaJgbVRyBplu0I20JiOHm1bPpBq18rwdFLzzOXOi0OvxHjN8OBaB+QRN GBgA== X-Gm-Message-State: AO0yUKUr1VluH6j/Bxf+NEya7h8ksDYTgWpeh1Jqjx2lFHRATd3rmP13 Y8iJP1NKCk+lm35Yzyc7/2L98n+XUwhVdxaEjJg= X-Received: by 2002:a17:90b:3a8d:b0:235:53e5:8597 with SMTP id om13-20020a17090b3a8d00b0023553e58597mr15825205pjb.34.1678214108892; Tue, 07 Mar 2023 10:35:08 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 06/25] target/arm: Improve trans_BFCI Date: Tue, 7 Mar 2023 10:34:44 -0800 Message-Id: <20230307183503.2512684-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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=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 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 Reviewed-by: Philippe Mathieu-Daudé --- Cc: qemu-arm@nongnu.org --- target/arm/tcg/translate.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index b70b628000..4451aea09c 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/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 Tue Mar 7 18:34: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: 659841 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541153wrb; Tue, 7 Mar 2023 10:37:31 -0800 (PST) X-Google-Smtp-Source: AK7set9nk+iH1247jZ2vx8GfSDdU2mCkloMqjFeHR330AWsbrVb4Pl6UbXJlUSwZ4rrsfDLHXxyT X-Received: by 2002:ac8:5a08:0:b0:3bf:daae:7ee3 with SMTP id n8-20020ac85a08000000b003bfdaae7ee3mr27375734qta.53.1678214251347; Tue, 07 Mar 2023 10:37:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214251; cv=none; d=google.com; s=arc-20160816; b=Kx3ydglwvYyN9tJ7QOKuSND1IisV4DzuQiwfqkYTcaLikKlwsVIbLzK1+ybom7AN9z 6GXwgDekCZs3bS2xOul3nTJnT/ngKlN1SyIHFYtXmWsoOj5OpPXqK9qdyP+GEgIqbZ7C 7VszT+n1ZqcwZFUbPDCpIJG6Ulb5WJDz8B92fpBYfWKMnurmowm/svLJw0IIkx5gH50J WKl2tCkETgWrI76+09er+HWFGebHZ0MIH/8mCovc6GcfYIkSLW/dlgAneTFtEctvkq2o gFDpYvOXs77K1YO+3d01XVX2KtbyAOf0pOzVs3wiypgXjlQ0572UZrQW3p7yr53fcDkS gKKg== 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=yBhN8QlUZ4nucIQSZUIgNxSQjC7OQ+YVg5SJgGHSvZs=; b=kYv240znyOd5CHIIHyPVmh3O0LYVYEdWJnGRmhoRT1sS3rOdipdvc/YUZ6pmxJG/96 0/aJMjW0QB8pVou39xxOO+2km4lWYZ0crvl6/mWKF2BQB9J9uinHu/BI5biRi8uLka6u Ytf+qe2QGwJ9I7MvjKrT5MgJG/p9WE2UgcsoXduibGfm8H4rYRgk7NCicNDqExewam8e fUUJYT1SpP8ZURQni+x6imcnCcHJKI4yVJGlUgj2PaLxAhGZDEO6uyAezjY4xtw6EGYQ wLaNqh87dZZLLegImzCk9d8PHLD67SqGcL/NuEXr3/hkObn781qGEApyO2VbbTAYhPGb Wqiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FNqYGCT6; 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=fail (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 c80-20020a379a53000000b007061b5908bfsi9114133qke.347.2023.03.07.10.37.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37: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=fail header.i=@linaro.org header.s=google header.b=FNqYGCT6; 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=fail (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 1pZc9b-0003bc-Nn; Tue, 07 Mar 2023 13:35:15 -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 1pZc9Y-0003Z7-OT for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:12 -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 1pZc9W-0007jJ-Us for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:12 -0500 Received: by mail-pj1-x1029.google.com with SMTP id oj5so14116940pjb.5 for ; Tue, 07 Mar 2023 10:35:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214109; 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=yBhN8QlUZ4nucIQSZUIgNxSQjC7OQ+YVg5SJgGHSvZs=; b=FNqYGCT694FjqclTICyJ8wdpIIai8xJg9D7/fmxJO7pauqGgZCb3v2rtfc85rMUjJX SOex4xQ9xidAXx9pWm27QH3m46DAgS/l9fW+504Ki/cpPpMkBmvkQ+VMncIF57b1gOfG OBlxnbHLAXL+p+ChVijVXdiNhVSz4GBTbcIky6KcWaRkSTKErMS08LV4Zp5OD8bad0dv KOOc1YEFU+0hSn1oz5Jbqe9/tjiFl15BN9+6A2Xq2YhLB4gdfjGCuBbAvfaPz9HAMG8v 9Zow8MtL0Wvf+CqVZEdey5N9QmIXW8HoJMwpg0xyls8ZkzB+QQ+JYAdpb4iRDTXOvF5i /A1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214109; 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=yBhN8QlUZ4nucIQSZUIgNxSQjC7OQ+YVg5SJgGHSvZs=; b=zsskN1QEak5KsANXXG6I5KVCZdUYuWFLSnbVnW+oN4/COp6iHrXQMxMwWo0sssRNKr SGO8eGMaxLyB74PLOgqgcoLAmtaaC3F87Cev05gRAVifLO0TvUMEHQ9MasMp4U3E3Pwo mxKKFQ1XRUEs3JHO3XrORS+IWnFwi4kI2iSUhR4SbRslamSIlGFDS91scGLJIDipZr4D YVxJ3KQi0dVubnjCrAcEltvGe+FQqsY6UzCW8tkcc3aDNMLefN8XYTUDfgycIJW3N9CN mCG1JM/WnIA7Cbryz5lQg6k9NCR83IY+mQY7RVipV9BZzUgu2Pi6fby4tjHmGvxG3FVB 6qJA== X-Gm-Message-State: AO0yUKUIddGsYCVxABzkirYU+l4KjxVPfATpoiaY77s1jTDSyVa7tbe0 YnbGjqnxJBJd3UGw/HYll7s9DZEK8BayNGRltwQ= X-Received: by 2002:a17:90b:3885:b0:234:409:9754 with SMTP id mu5-20020a17090b388500b0023404099754mr16066674pjb.45.1678214109604; Tue, 07 Mar 2023 10:35:09 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 07/25] target/arm: Avoid tcg_const_ptr in gen_sve_{ldr, str} Date: Tue, 7 Mar 2023 10:34:45 -0800 Message-Id: <20230307183503.2512684-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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=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 This hides the implicit initialization of a variable. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate-sve.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/arm/tcg/translate-sve.c b/target/arm/tcg/translate-sve.c index 3ca60fb36b..92ab290106 100644 --- a/target/arm/tcg/translate-sve.c +++ b/target/arm/tcg/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 Tue Mar 7 18:34: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: 659833 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541031wrb; Tue, 7 Mar 2023 10:37:13 -0800 (PST) X-Google-Smtp-Source: AK7set8UWQ55SgzXN02eiU+07jkSbhVNOFN3NF1AGgT50sTe2Ac1GC8Q4IdiD+UW0FxNc3aUu9wC X-Received: by 2002:a05:6214:20ab:b0:56e:9dd8:47f1 with SMTP id 11-20020a05621420ab00b0056e9dd847f1mr25591358qvd.23.1678214233148; Tue, 07 Mar 2023 10:37:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214233; cv=none; d=google.com; s=arc-20160816; b=ZZEmwKMO52uul8LahaBNPWEYrlJT9JhiO9f2GxqwSC7C0uytF/A85LviBtkK1iFai+ lxxjkW4VexGtEojv1NnbcvdZd+6kP6zdy+clOUlgAvWkZ7ICQSHRWRoi7wiixO4rZmEb TtL3IzSFlNEs4KUplML+8mIeiCE3OYQPjrGw5Zve8K+mtaGBSUdGvjGbzR302eiXym8U gwNbUxQkPf3Svh4wp+8Gsrh7Vo+TQP3pc0p0J91dDX9kKs+/uJafG/E3Wunze6P7MFvc 7bSc0DDBeOOk03M3efstIWFJszcIZI3/eskMEBaTaVvJiXTt8A9BkOdX8du44Auv4noz oNiw== 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=kMT53egGb5FZrpdFSM78/KYr3JkgK3hMxF5PhcHm6Jw=; b=c1w0eSTXEZeOwNBE7Aub3MMfqf71i7pJ2+59WDvHunih+gyWKFYpqE5fFk2HBWNW0I zgw4nzO7re3ZkjsmPI8TjDH6bG9hna8FV6bYj6SQx4mNuCDtGAUMGxT6iB0/F5LxxCh5 idE3MTSk1bOS+8SmNnkYRQGWTo9vLmg0iGndR6mhw/jyrTmraPnSl7i8PapzT5Ckp4A7 yx2udJrftgqXDxeQl0M5NbvTi1kmWKrJtWaYaFW/qNJh51jyvAvd29Bc/WQNgYupMafg dwqTWv3uTFCPAy8VmlNnckBy3LX9xdQCIqEmuZnS9c20zTCvMKoT5VOZyCfujUsHSbme wYrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wkTzyJZN; 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 x20-20020a0ce0d4000000b005377156456esi9826497qvk.329.2023.03.07.10.37.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37: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=wkTzyJZN; 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 1pZc9b-0003bY-Kt; Tue, 07 Mar 2023 13:35:15 -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 1pZc9Z-0003ZO-K7 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:13 -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 1pZc9X-0007jV-PZ for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:13 -0500 Received: by mail-pj1-x102d.google.com with SMTP id x34so14180475pjj.0 for ; Tue, 07 Mar 2023 10:35:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214110; 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=kMT53egGb5FZrpdFSM78/KYr3JkgK3hMxF5PhcHm6Jw=; b=wkTzyJZNnw6svbvJG9Nqyc3AK9ZsaAX+uSR7sJ2zdjUelleKA0vwdWAgGDj9Jy3BzV YzjW5ahX6AqhbbQ1xl8NDeDBURayViR9HeV6mPSpF1qnw96/XGUU2m+y3gYt9H2WoSml VQFSIQuTMyIvfXHSye1+GLhRiF9y6nbTZ6Xlt84yUZFbpkamZzPzpb3wEcwY4biyma8u bDh74j2EhQp7TB8HAtAqzO4d8yy4uNWx3Niatl2pnL2H3l7ZbcS29q87cDmE6auZO/Wh lvPItNiCIO/W8m0CpqG9KcTHMiSom7WwZ/kL5/prSB6IDo/AH3KG6eaZyEbFL7Ssmqrb ZYFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214110; 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=kMT53egGb5FZrpdFSM78/KYr3JkgK3hMxF5PhcHm6Jw=; b=HTMPWZNc5jeEGk/AAt3BhGYx94lF7oPK2ljkjmUopsUVVgHE+SX+/fJ6IJd9A97lD+ qcVaYaIpknPe+0WM4ySCy+464VEQWVQ0aUjsoCmVFJwnpi1qRuZf5tMH80yPzeS+Clsx xAGKvwmKb54pP9IO0mXBBm1MxywKnX4n1gUcgQffMgZj5gsVDBp/VaA1tajDDut8KZ0Z s2RGvtsxgD3pO15UQPgtIhTtUY+Ki+94Dmk6eXm2MufjT/T94STaA4qpYxw6VRh1vl0F 4GlMSALbpoATgPoGB4AJ3wW40CqJdRjqK2BUC0UjBMykOpom2KZdObImT7cY/cI4v2HM wYZw== X-Gm-Message-State: AO0yUKVsqCiOU8/NLgaYJQBxjMcx765uCcLZ+ku+rArlGsdbEUPrDd3l EnXHG8y9KqbusRczHnSJ+gKOVsD2FNSQkJ94tS8= X-Received: by 2002:a17:90b:38c2:b0:234:2807:55e3 with SMTP id nn2-20020a17090b38c200b00234280755e3mr20179810pjb.7.1678214110527; Tue, 07 Mar 2023 10:35:10 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 08/25] target/arm: Avoid tcg_const_* in translate-mve.c Date: Tue, 7 Mar 2023 10:34:46 -0800 Message-Id: <20230307183503.2512684-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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=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 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 Reviewed-by: Philippe Mathieu-Daudé --- Cc: qemu-arm@nongnu.org --- target/arm/tcg/translate-mve.c | 54 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/target/arm/tcg/translate-mve.c b/target/arm/tcg/translate-mve.c index 9744bf3de0..31fb2110f1 100644 --- a/target/arm/tcg/translate-mve.c +++ b/target/arm/tcg/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 Tue Mar 7 18:34:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659827 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540885wrb; Tue, 7 Mar 2023 10:36:51 -0800 (PST) X-Google-Smtp-Source: AK7set953quR3dO6MclRHfpXZJV84PWD1ruZhNVO2C12SacL9+YHu+d6IMuDcbBkVGj1HWmm43s5 X-Received: by 2002:a05:622a:1a0c:b0:3bf:df2e:a494 with SMTP id f12-20020a05622a1a0c00b003bfdf2ea494mr4895937qtb.6.1678214211705; Tue, 07 Mar 2023 10:36:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214211; cv=none; d=google.com; s=arc-20160816; b=ptd/iEocOCBOOKiLAS1s+OyHQd3LHrwokRKSVfjMfsHUaT98JfnXEUg10GmBn+4LjW gQoBaCo15azoxvIGKuOuHG6R6/AEDkoRUOrOLRWv6s4vJe+TzTRavs/KFcfcmHku8I69 Fk3A140lPg0ngnoTpMtL2TE+KeAHPjk53KkUbJOIVhTfhNnS3R5tLGRFWL0OmCoigtS7 hMU6q3zAJc85zJ29RK3mIwk0qpMWHL06lQBlM48VtQqDaFVfB49TKpet5w920V2aKSMI fKUkSo+tkUujCShCudrD8qbP07D3kEqAzjfPFSlIZmYWjjrbse/O/OG2RBVYPiRsHq3A 0sKg== 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=BlLYr3YHV/IKgF5NqXVisgWgoHCRdTJrLZVxaTb9ZNw=; b=tWDf4sxiiLzfeciBxYdhSv/Lt6zLVf1XJbE0VWbFHXP6eqMrC9El/CatpO0e+DlnQm ENLGNSFWbl77Il/exn2fXuoEBbdSgBsXyDIwm6UwotgaKcAfB/dRjuNjr9+UOdlhxLea SZ58QHYSyDXjqN3VsBmcx4zzmn6C1oCOd2Gu8rHj5oAMgL02esvXCwRsa1I1RPHSOBDc 2+6cng+PP6FGs6naPUN+1SXAo3rsEvKXySYeaDVYwIRoKv4M/2pKS8/Xgze56lH53zjr TpG9uRw63W24lRIFUVaLICTwaiSKm9T7IjXXM695/gvkHBMDmg25gi77dMjRmWRiPrbI RbAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XGNP3fZL; 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-20020ac85854000000b003bfb0f0b695si10604815qth.742.2023.03.07.10.36.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:36: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=XGNP3fZL; 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 1pZc9c-0003cS-Dm; Tue, 07 Mar 2023 13:35:16 -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 1pZc9a-0003az-SW for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:14 -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 1pZc9Z-0007k9-A0 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:14 -0500 Received: by mail-pj1-x102b.google.com with SMTP id kb15so14152359pjb.1 for ; Tue, 07 Mar 2023 10:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214112; 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=BlLYr3YHV/IKgF5NqXVisgWgoHCRdTJrLZVxaTb9ZNw=; b=XGNP3fZLGXwKxJ91eGZuiK0wbrcXpXQKQF1L00BF1oIcaIAu+lfwysHGXj6nGCCvxd eLre6gVKc9OVWSuWQI+FQqAxjt2lqdqz5LKZPNE4yAx+/V96uYxxvc0yNsnPAvfzzXi8 +eyY5RbYspzpmBGjbKlNBV4Tv+ELGjwQt0ahfxn5rRlnRTjHamcTGM5LRReBUeS0S0EE cNtdFpUL9Gxa5LQpApnVGjiyqaPqtC8TfwHEvkuIhRH00XIJgWQtGdWDrtwiGHZnakpF YwAsF581Q43xHs0La1E0oG5/YkmBtHSThzBmOeDPDKkMkKkUtIWZA1OCd4ATvCRnBocW 4H7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214112; 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=BlLYr3YHV/IKgF5NqXVisgWgoHCRdTJrLZVxaTb9ZNw=; b=ekiKBSsdYBlBLrbqIAGIugVCspiuu0jUwJiWpgCQC1WlggISHJnqodwEsnZT8smgcp wDEFkd5Vg3LKtmrbE0aYwgxw2BTxyC1tPC4WP4L3tnvbl9f4XiSghEIviiwnchNCj1Yi 4JuWNG12anePdE87X+zn6G416zES9eY463VlD2xjdNfGgyHzaeWhdHb1rwBwPgwlX0AS KPfrM8Uy5t9cDdcp9EtATmiJBZ0LRgFOetsJ3l5fCF8TfyM8A7Oi+Pg3Jkaeeyy68qCf gwS3IT0U9wUqVj22M7HyMgQh9zJAFGbVsR4t1wsJNSWbiVAU7GYNkqEw1koupXr+5sSk MCRA== X-Gm-Message-State: AO0yUKXXbYrdHqHHcLeHt/kAVOpFQ2n34oolOSSuvgQ2Yaad1Hb/QN0P Xwu/ti31gi5/fKt4V1pXhr2qwXMRdW4zAmeWaSc= X-Received: by 2002:a17:90b:4b41:b0:234:f4a:8985 with SMTP id mi1-20020a17090b4b4100b002340f4a8985mr16506698pjb.15.1678214111381; Tue, 07 Mar 2023 10:35:11 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 09/25] target/arm: Avoid tcg_const_ptr in disas_simd_zip_trn Date: Tue, 7 Mar 2023 10:34:47 -0800 Message-Id: <20230307183503.2512684-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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 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 Reviewed-by: Philippe Mathieu-Daudé --- Cc: qemu-arm@nongnu.org --- target/arm/tcg/translate-a64.c | 41 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 989c958de6..2ad7c48901 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/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 Tue Mar 7 18:34: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: 659826 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540880wrb; Tue, 7 Mar 2023 10:36:51 -0800 (PST) X-Google-Smtp-Source: AK7set/Ovhnq7UPwf9i/mehXo9Sjhn1WeiW5XaSawRgNrQk85rvfJVQltowE2m3QZuxD0O8Qouwx X-Received: by 2002:a05:622a:1988:b0:3b8:4951:57b8 with SMTP id u8-20020a05622a198800b003b8495157b8mr5985838qtc.15.1678214211158; Tue, 07 Mar 2023 10:36:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214211; cv=none; d=google.com; s=arc-20160816; b=PqhiVnInUFS46+UsgjE9ORCR7l5E50v4iGw48snSgt3r9BggS/tOonM/idvC2ObDt6 UEXkoIkRvI3UouR4PjEnjPmPXE654Ud/M0oBzwqLrLBqh7++K84rx2SvvNVczQtqrOeV kRsw60dUToxJUVoYxwe0Y0RIMF1hbUpUVxsuAt51rSKwtcCrNue4yK2aisxHHaVFPub7 jBq63of4owoDq0uVtRWu3wzZDcqofWT1JYHQ+ZwwPoRme4kzMeV9zVTpXvvU8GBXgPoE 2HRqAOLjg9uPIHWOVYk0XgHnxYtzUQUaMWFnM9iinv2sj/GMzV26ysaVxrOvFaXDtTeC tH0Q== 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=qxgDTYXHfeCSjrJ315R2/sC0Bf/gryvtVm2qasIqXas=; b=szqzNGnj5azfIk5iqgOW94anOc50kcJZymZrihO+4qTautugHs5UD5De63Z5zrWjZv bte6KkBx+YdJdwFztlPmobIQl3cIJZuWyfnqS+dkHuMVyfGakSr8SI0ZZP8OX/bItn6e R6jQVEpCZTM+WlJDhXLUtKGotwo/A7mLV1PokavOO2EPACRhrryx8l/292GBJ0uzHohK GcG5XDkJYFsgpnz87qbIFrCjLoFv4o8ozMEGXiSpYdgMn2Pdt8eQRSSgkAzwOy2XtkiH D8ZL54LiDnsslNKBo6FaoXj/yKUsmpPwKwc3bI1N4f+w9bMI4xtYHUsNPxoOZXxnVIZN oFwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JBlSMtO0; 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 c11-20020a05622a058b00b003b48f4a1cd7si9652032qtb.197.2023.03.07.10.36.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:36: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=JBlSMtO0; 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 1pZc9c-0003cU-Ix; Tue, 07 Mar 2023 13:35:16 -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 1pZc9a-0003b0-T1 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:14 -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 1pZc9Z-0007kC-BA for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:14 -0500 Received: by mail-pj1-x1031.google.com with SMTP id x34so14180532pjj.0 for ; Tue, 07 Mar 2023 10:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214112; 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=qxgDTYXHfeCSjrJ315R2/sC0Bf/gryvtVm2qasIqXas=; b=JBlSMtO0Q6li5r8PqzhUVH1ygRixH0eXpzeSeCzBMbIF8uUGzgrCnjEEh727j5pKZV ENNCp81svbBhzZWq+atvYgrvVKOS5aAE4u1Afrg7HTsdRHElW2dmhu5Fj+BlxoZi0ZRD xhkDalDVrxLyZN35XzEwcm5JFx7sF0Jc93LneyyZgETDb+Z1Id8hUNWd9LhuEZpooLX6 lMH4XoAnW9AMjJFvH1UigS4BSM/wSf390edrK3whT43iO+HOymIf3urJyGlDJorVHq5S VOIGSslzlKtyVLiyMyy0v2cmLbrSQSfZXK327VATRO/i7xWDowk2Cm9Vh0trHJQl+6rm G24w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214112; 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=qxgDTYXHfeCSjrJ315R2/sC0Bf/gryvtVm2qasIqXas=; b=1WzL/rsyNvpigFXOJ3bQHnbZoRasRh95zKepCpsPxIWKR5ze7DcylTFKdzAfHF1f1N gA2Cur/GUZs3yKL+mBjaEq3ijy9aP5kJYTHdpeUf9MmaRgu9epMbCDKj7uaiS+gjKIBj RkZLoaPV0K1HZkvHVS38xjU2ZYZbE/yJHaVX9Nmk9jKSH1FwPMCvxmDxHZGUQkSYxFES PYO4HOLEA3gKo575P+o2tXLg+BopbwUU3s6NDEabyyJdrh0jCXfPQ/iVt+bHxXnC/orK Jyf46odqOf9srBe+xPg3UldtuvQs6VLdxtbPwI3IrqE/QbgtjkNpdeVI/fm5jUsFRVrE tO2Q== X-Gm-Message-State: AO0yUKWKcZxH6jryLlAjT+uSlFFMtrAu6SfQu3bFSi+Hs0y5nQwbA8/q oaDGZUbe+UnZ+Lgx+zmD0sZPvxmA4K3cA2NgNUk= X-Received: by 2002:a17:90a:6485:b0:237:461c:b44d with SMTP id h5-20020a17090a648500b00237461cb44dmr15703734pjj.46.1678214112102; Tue, 07 Mar 2023 10:35:12 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 10/25] target/arm: Avoid tcg_const_ptr in handle_vec_simd_sqshrn Date: Tue, 7 Mar 2023 10:34:48 -0800 Message-Id: <20230307183503.2512684-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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=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. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 2ad7c48901..082a8b82dd 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/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 Tue Mar 7 18:34: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: 659835 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541064wrb; Tue, 7 Mar 2023 10:37:19 -0800 (PST) X-Google-Smtp-Source: AK7set+r7tVQIb+ikCgBRVuQ2dJn6R8co36T/lUvf6f1qGEMCg+Z6mp19U1JoOs3mQlFJ9YKUUtB X-Received: by 2002:a05:622a:206:b0:3bf:c86b:3d34 with SMTP id b6-20020a05622a020600b003bfc86b3d34mr1483486qtx.22.1678214239160; Tue, 07 Mar 2023 10:37:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214239; cv=none; d=google.com; s=arc-20160816; b=lJDtAItFf9fkm3AcJ0ZLBioiMQbJjAVzOwk7ckx0of1subOhFidoIK40XVT3fwSEDb u+OBYnmTrhNo4+oQVLC/ypKCGfQQyBAgXfOfdPAigyIaQdV9yimEKpihwlJYsY6PEBNN OUgRrYfy7qHImoeq1fK+Qewqvn3/mm9rLCDvQYc231R/AiLSSNqcboTMRjAsWzrTzcvw gxhpLLnT0dU8iMuxeqVwN2dn7cY3Tkqeddje0YWcswB99FZjSuEP+LpAafG7tP/CmimY I0BG+bF7V7Q9F1eyJmPEifEyXdlpzijihImjJ/9/8clMpjtvAb7lGwBCPIz78+8Aph1i NWsQ== 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=ldBuLbcQb0n6Aye54OPPs45YCet33rD06BKJ9Zw2Tyk=; b=tqUyVSMxuNsN5ipqC1hE0sPX3NsVTCL7NEcs+OP7C6TiduP0zU0Sgkid4y2ER7FWYA XT66ZggZu/dzX0NCC7jpm1LgHssr7GAEriIGn9swRqF75jaL5Cpv3mQ4AXoCbgGM1AZJ CL6oUGKJBIwZZGQTMicJCp6/Ps/0Th8vf7OW36J7+BEiwKd/9wTJGuFHcvKcROtDKlzm 8x8o+p7ic9inCWRGqktLnFulGs+gIRM8AcSyoVa6TV2wct5tJBQ2N7/gPi4r4ehFTJRA 7CYU+5pkQOBnIIRY6v9NRYiJgbs0bjehBLdVIN3mEIQi5Byk9yDE5NpyiHZvGPZjw6sL lWnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x4CbDx9e; 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 w13-20020ac857cd000000b003a51b82f290si9809467qta.495.2023.03.07.10.37.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37:19 -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=x4CbDx9e; 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 1pZc9d-0003cy-BT; Tue, 07 Mar 2023 13:35: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 1pZc9b-0003bZ-Ks for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:15 -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 1pZc9a-0007kV-2X for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:15 -0500 Received: by mail-pj1-x102b.google.com with SMTP id y2so14128837pjg.3 for ; Tue, 07 Mar 2023 10:35:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214113; 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=ldBuLbcQb0n6Aye54OPPs45YCet33rD06BKJ9Zw2Tyk=; b=x4CbDx9e3bwqq5dgzKAMKuwnpKEblf0SM+wLi9Nj79OGd55r1r+/qta8as3XLEMsfs jXS3WjpT+00q0S7oPchyLYe4SMukUVINh7gI+5ALqkRj54142O3koo2qAcv2cghIvsrN KnZKCshF2CGyT+0N/476LSrFOCmLMQH+rsGfwx6HVI4lZlByb4Ld+okpWg4YEJQkMj/k NwP32wj8vZiEDaMOxmJ5jiLab9hToFNO0HZI3MjcC/+edxC+mbKyhGyOgkST3J+r67FB BIjSTbA9ZmVjm2tnwYlrQKa+VrxSnqI8H77Fa5aFH94w/wWEUkkV5muK3xSfeZZ1qdqs /VOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214113; 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=ldBuLbcQb0n6Aye54OPPs45YCet33rD06BKJ9Zw2Tyk=; b=c7NqFh5Lf+O/YKd/+Gh2p4uyy2oktuTe+EZAEbuAlSmgcN87lkhh2sQO5gGkqCg539 JzbUjDw9rQCblquL1hujTMkHfZaJAGqF1p57rTSnjh2I045qLzUmc56ja5dOBlKl0aEg zXyxBtgwHuOKLgW+4xpBXgh6p8hl0UcuYk1MnZgJFfcBcw8B14IN0ytf4ItomzQlIUzK 7qHDCasFMjktjK2vsd53rrCo0he1EtmdZhqNJhAKWjX9zkDstEiHrFNRb6pOBRRyvF2I yjSFaIr8wrI5U7WQrbs7VbYAWGJXTD7QwsZmbs5kH6JYZ8O1zuzPVwgbnzaulvmLD9Ep uN7w== X-Gm-Message-State: AO0yUKVrlGNSOBe+0F893Yf+85SctU4pBnOFM0CuPQJShL+JlMME6uFG r9Xb6UL4ao447fLCrJjQCzqNyUGHPRJNhkq8pWo= X-Received: by 2002:a17:90b:4b41:b0:234:f4a:8985 with SMTP id mi1-20020a17090b4b4100b002340f4a8985mr16506764pjb.15.1678214112817; Tue, 07 Mar 2023 10:35:12 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 11/25] target/arm: Avoid tcg_const_ptr in handle_rev Date: Tue, 7 Mar 2023 10:34:49 -0800 Message-Id: <20230307183503.2512684-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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 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. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 082a8b82dd..dff391bfe2 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/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 Tue Mar 7 18:34:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659831 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540958wrb; Tue, 7 Mar 2023 10:37:03 -0800 (PST) X-Google-Smtp-Source: AK7set84SLr+Bq2SHZItNOJ7GjWGKqg9mqzuhL/u/ofGC6euOwDekceZk0jUDrIwVD9G9QvphMmV X-Received: by 2002:a05:6214:2586:b0:57d:beec:9f77 with SMTP id fq6-20020a056214258600b0057dbeec9f77mr27113677qvb.35.1678214223479; Tue, 07 Mar 2023 10:37:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214223; cv=none; d=google.com; s=arc-20160816; b=KpWT88YJKvRqCLQau+6x9gZzmXsfzJn26YAGAUVkn9WL/hlgJKaZzE734v0S9GbCTg /G8wQFtsu99fckylrClM+6Q/HhgvEm6HHjxry13yAK+BhJVSWl0m5WrUNr2PV8jz4PBl z1XTuwR+OwH/zD/9S70hd+037ZzWUoRHWIn/+Bqp5J2GpGgbKRjb+UKYJJi62oxcXC+3 rPWbKHI+y6WZMUn4gdxw4BzDgtumFelDKXxOOVx+CsHQ5aAjxUUKfAyycBPpGfuXMI58 s/eQPqvbft40pAmQ5WL+omp88K4on5R8PZ/T3VbTkag6zJ20pa89H5q9vzWu/zuhmbyB /QZQ== 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=gpKNIHDff/Si/rvKhy6WY0gB11IUIaDAfVrzJbPyus0=; b=wOmgGN7VX+4EfY6Jp0t/v0/AsuRLSw+LKmMpV9bGE9PHbvNWlLzLs1HUcgE7oQHS6B ZlaXNJxrSDIh774ZPyCSy2k21fIIO4GEI5ZVrrIRcHkZECXO9Ts/S8s0XAylOyZ2r6Ai F9QJUSru1XdGXayRVNi1XAWhatdRnpgIFGgRgDR8LEuF4aoHf42byxxsdMm0l2qrRQNS 4CASTv0Xml4githRY33BBFgy6V1angnfYkRF2ziK06osZ24Pngm+8PKXy+rIYMjo9WRT VlAlU0skHtosePkhp2I+JdS1dBsEBYlnLjHkF94as3UK1+Ul9eoamONya/WybGjFcCtN o4BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MGkQlMoZ; 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 r23-20020a37a817000000b006fa49f39423si9770174qke.485.2023.03.07.10.37.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37: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=MGkQlMoZ; 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 1pZc9e-0003dV-5d; Tue, 07 Mar 2023 13:35: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 1pZc9c-0003cV-Kk for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:16 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZc9b-0007kl-04 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:16 -0500 Received: by mail-pl1-x62f.google.com with SMTP id x11so10583047pln.12 for ; Tue, 07 Mar 2023 10:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214113; 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=gpKNIHDff/Si/rvKhy6WY0gB11IUIaDAfVrzJbPyus0=; b=MGkQlMoZw2UppWGiM0FBFEnrveliHV7/IPk65Fx6oinSz1HxQJ60yw/mELCsJzqV44 VWGqflqMQRBEx+m3B9zuU7XLcTEiKrqXUvnPQW//tHHPtkR6JFgojF8i58XRPharo5kl 85C4C0el6wNSwgC4Rc6o2bpFBpG++aKVmOvV/hNicfxLtf+1mmmOB3FCFrloSm875txE EmYox5rKfvYRY/8MAN8oJXeYag2ShoMx+vxwOFF4T2YiHaBOIMpcVl2uDGWlfrY6QPtV MSGeCZbj2Cy81Eck7bC/0Snt3IxR0lekb5UN50UnzvG9mCH0C4zc7VYUSjf/PT3Y979A vINQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214113; 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=gpKNIHDff/Si/rvKhy6WY0gB11IUIaDAfVrzJbPyus0=; b=lgA/iRL+LucS+AYzPwbRgrQ/CoFsRwpoqkqLUG5XZvoGIvx2xlcxgpz6doISDPNYfv 0CDawm9fjbQNqV+twjbEdCwuzUtGbwcHLh3AfvUF1oOgIQW0n+ii+n2Y5hoNMaMEPBNF z3dlMB2ZVDGAm9IQ7qGvgr2LyirxZ1LV/OBgPNgzygtRkL1sJH/moMmwqafEMf3vNjnH OFMwTUGu934VDRStI1M8V3QRcHkm9Lq0rVK/PgGhXWr8aJnUA+0XvgQ8jspP86hXZ+Qe ve4Yr0C3DiQUGevGE2TKGf3Cc9rENweFhCJMysB8n1JjWMF3x3wuGWIZz72rYJbbxRm8 vD8A== X-Gm-Message-State: AO0yUKUDZHuHYJz199elJGFeJ6MwTU1Clc4cn71O2e1H9kHWCsNFpOvK FnvUY3Lpzyq15tbVOcjyJ1NqfdNQchwD/YbS3so= X-Received: by 2002:a17:90b:4b4b:b0:233:a6b7:3770 with SMTP id mi11-20020a17090b4b4b00b00233a6b73770mr16106109pjb.14.1678214113699; Tue, 07 Mar 2023 10:35:13 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Laurent Vivier Subject: [PATCH v2 12/25] target/m68k: Reject immediate as destination in gen_ea_mode Date: Tue, 7 Mar 2023 10:34:50 -0800 Message-Id: <20230307183503.2512684-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 --- Cc: Laurent Vivier --- target/m68k/translate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 44c3ac0bc3..fc65dad190 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -894,6 +894,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 Tue Mar 7 18:34: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: 659825 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540864wrb; Tue, 7 Mar 2023 10:36:48 -0800 (PST) X-Google-Smtp-Source: AK7set9s3HeZ972hnQ516EpLK/9yfXdgZp+zO7ZTagxNtNd95U5qZtx1nxcLGw0ZBI76crFzwRzC X-Received: by 2002:a05:622a:349:b0:3ba:265d:6793 with SMTP id r9-20020a05622a034900b003ba265d6793mr27978615qtw.42.1678214208749; Tue, 07 Mar 2023 10:36:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214208; cv=none; d=google.com; s=arc-20160816; b=xfRFH85/yt7RahyO1/U6x0PLaJxgaMAQizMRVAayiqAaYYuPoB6idRL9AW3FbQH3Ko FBwD8d8qtJ7yZ+jCbrOQN88jgAZvecjBUkwNmhLUmo43iUI4pOCSP5p5xn1FzEJAQLZw 5bm4oDyEOamnafsrDq/ywR/8bl06mw4rq7e4e1pBvh8glq8xqezAg4eWKB4wvF9pYb81 9A3VBDG5ReeUWa2A0VH116kXcWIswQU488SoWJluI+qr8SaejIh05t/O6Ot16AlxWSoD dfm6q1aLptY7e13D4TTX954buKMfj7j1ePTEOyVoMMmJfXuKf8PHvaJ2J878MN1cYFe4 GhrQ== 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=yOlCe3APQzaMifrnuMKC34pNFHThuNfr2aJxx+z+UxQ=; b=ZNXQjMFUhk3RFNFxzGtBXAjjSGNglyUoZx8AzvhnQtSkfuzOVC8sY2wPh4MZjGx+tq Oh5FRC2OCLxcFaIFrCmxPUN1/6rh9oozl4T8FUZl38+F15YjTGkW2xia3q/ZlgNvqe4a 6yFKS+rQjcCyj+oZqV6p0m6cyevyAMICjP6jg+VPAVYWokUsq6MYrbzfLeorNMWlCqBE SyVIQW5zpDe+r5VcyykWGWBVo9Ime+glNxJTXER1vylBtg/iP/wJwbNVxraldGbRr6bS BLO7DPj2XlAH+WUjxznw6sZ4U0695N5Jrpf9RxVhudZng5L+3gcHHpwhIx/ndMLIFBGr Xflw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EWUXePfF; 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 a63-20020ae9e842000000b0073b6c3f3ee6si9443134qkg.193.2023.03.07.10.36.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:36: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=EWUXePfF; 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 1pZc9f-0003e7-ED; Tue, 07 Mar 2023 13:35:19 -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 1pZc9d-0003dA-F1 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:17 -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 1pZc9b-0007l7-Tq for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:17 -0500 Received: by mail-pl1-x62e.google.com with SMTP id a2so15135914plm.4 for ; Tue, 07 Mar 2023 10:35:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214114; 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=yOlCe3APQzaMifrnuMKC34pNFHThuNfr2aJxx+z+UxQ=; b=EWUXePfF7Q/AQlF6njxH/4RDlMaUoSFzf+2boefMNUwL7h1ClMpcV/mnSedOvEhjCp 5v6edqS0o1uGNLNbUGzCx2lTJmWtQinEeh4lysGDgqbLFJc0ORYGm0Ba0wYRt5EqzgVd 3QSvJdkcd5pCEH8/2XJEOueh7XnrzkjDK7Sv3L8msmARnFjUcGpfnqK36UajMajPkxbs yZCtD49wI8tQVCtzqmUIgedtAafhQ06kXoojtkxuN3rHHXMbfNCuJLcoVbcsRCvbB1Qt I6AcmozBNj5AU3pY246QvhsuHm4l6XD89k1f58hKg3iYQHHWbwFE7zVvan4ZquNLPTyK XEvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214114; 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=yOlCe3APQzaMifrnuMKC34pNFHThuNfr2aJxx+z+UxQ=; b=00SE5vWfe2BdZuZG09XJZW6ZBTgusi/QJrlTQV+Hhcn5hbkSi+F+1Q3LsvcLmWfuBM qDRrKlTlVOZLDoLC9Xnpt8vmOLOrsmMnPvCPJv2bQiK9V4g8b3Yv6hVkPHlr/sKBwQEL 3OVo5JcGBvP4jeIa1niZdc5uaopG0WMb2ae0mZhtNVggHb9E+g0zB5xCEYDmlPMfmEET RAQLrE5MdKqYIKqod5/h9g+gCBpwV7P9H30ihfVtaAlsACAQQS3bnMf2NWB1FLsXluVs Dsq7+xv51sSO2uR9w7XXtZKyXeKl1RG5sNqQi53g940JsJpMHvScLrvzpd4bhxTgZeqQ GpEw== X-Gm-Message-State: AO0yUKVvTOYavjV/RqR1RDzyOBQjTztU+fvcCASMG9oKFSt5YBZ5PrsI 71SUcVb5uBslPrBWFNF6ygOjcYr9N5EVaZfy8fk= X-Received: by 2002:a17:90a:fb0e:b0:234:13a3:6e67 with SMTP id it14-20020a17090afb0e00b0023413a36e67mr16396946pjb.12.1678214114618; Tue, 07 Mar 2023 10:35:14 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 13/25] target/m68k: Use tcg_constant_i32 in gen_ea_mode Date: Tue, 7 Mar 2023 10:34:51 -0800 Message-Id: <20230307183503.2512684-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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=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 Return a constant for an immediate input. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- 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 fc65dad190..e16c608ef8 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -920,7 +920,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 Tue Mar 7 18:34: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: 659843 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541213wrb; Tue, 7 Mar 2023 10:37:38 -0800 (PST) X-Google-Smtp-Source: AK7set+BSGzILj3Asu0g3DyRQWBE3FtTKP6N3S8s16GPscNHdmEc3kPM1YlrWOCnmdIISBM1TS2R X-Received: by 2002:ad4:4eac:0:b0:571:f87:a665 with SMTP id ed12-20020ad44eac000000b005710f87a665mr28803660qvb.35.1678214258366; Tue, 07 Mar 2023 10:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214258; cv=none; d=google.com; s=arc-20160816; b=MrPMCmVdwamIRrvXncDVbsfj5S+XUjpMC3TyQPWKJOLPYI8AB6rpZzUUqdN3qiSlcT RkRhlNjd8t436FMQA6YvplhOm7vHV5eGxD16rJ6tkeAbcgm4ZEXNcaCVXDipcNJY3Tf8 Ky2rsWWS4FUjyCnGIB39t5XOi4cT/NXoclBpo9VYBzfeW89MQ9JwMZTYujMg2wf4UEiB ITfWJ1EXSseqh+TE+QYeF+eXGCv9s3khn2yPMA9f/DN5Jx8kAGsvn5sUdp9HHMi7ihke IcyjtD0x+CVJu/PW91yU7Mcx9o6eTQ718rYjHJ0XadC39eiwp8E9pXZm6NEfZZX5f6th 9aTg== 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=Jq9KoSyW2mIrQO7O/lR75k8qpkz+hVmZSfTa0f3eIeM=; b=lTB9PQKGExeZgGwSUv2QjDH8G2gVhrnxQszG5xDPKJPVDiesf7JqjIbnaxh0h0W8nH 33bsUPsuMRm714EQq13T/5gHtTEJNlQ+DCsAz50MaAaGXC6M0kuD9PuqcVXDTaXvrDOJ xQr/g3c88H6QE2TFwvhJXrjlFHvqaxS1cYUM3eB/jK86P4NQlVEUK3vYKXRGlhy9m/D7 r2GqZ2UL1HR4H2DWDK6OJ7KnKbxe7krXYFBlzT9ylcSN+kfHtBVHN5QPLqc6c1dOa8io Ua5t+y5oj9Ky4lcAtgpptIHVJU0wYAHLfISs/ln2GK5UkYIAr0438elRZ8TpkNcJp0CT 6wpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DpqwGgpU; 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 y3-20020a0ce043000000b0057111221a51si9460927qvk.332.2023.03.07.10.37.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37: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=DpqwGgpU; 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 1pZc9g-0003fq-26; Tue, 07 Mar 2023 13:35: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 1pZc9e-0003dX-7u for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:18 -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 1pZc9c-0007lJ-Mm for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:17 -0500 Received: by mail-pl1-x62c.google.com with SMTP id h8so15088079plf.10 for ; Tue, 07 Mar 2023 10:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214115; 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=Jq9KoSyW2mIrQO7O/lR75k8qpkz+hVmZSfTa0f3eIeM=; b=DpqwGgpUrmtWLimRhHciBDOZzi2+QW7Q1JhvErSpAZMlMEX5NRD6pIza+X9AlQM6Wo LiSKzZWoqi/TlDbVTlAKh4G1u361EDcOh2fbIToOM0VMg6zIbkwAY2qOBUgLYCB2UPyE Px5gZV8mS1eqpAbyvNzFbnFtzic0XvsU7ygJc8GC9KbGFq0OHvuYT8N9J3wUObAVgRh3 qe7eJPW3Kxx8Ak+gjjd54WhQvqAfczPRGDuNo4c45qXtD2N3GodSjcjX7I/8Zvey9V6r a6FPYy2cHgrGTXPpEqgqRoHBsh1JBbHUA390qbgGLdjycny2wMZ/sS3RLzQgqVgroM8/ 2Gjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214115; 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=Jq9KoSyW2mIrQO7O/lR75k8qpkz+hVmZSfTa0f3eIeM=; b=HgI602oXwGxKZM4KlanQ/QQhuZ+YLiCGKZ7Qr4Hw+1Uh5UbL9qhOv5u2f1/tHdt+EF iysKVyG7++WS8Q2AayH1PIimPkuLOEPg+iirBOAigBex5mOeAnbYa4TKGcHcIaaWTJK1 gXBGCxMX4TTYJw5r4DNocOCumQuKSAdJrYM5Du7OdcVixI0w2DCHppeRXKE3lpUeT9OU WTKpEsARZrXk+hyl+EcsdLX+xl2dreIboRz8bHKZXgBHwguit6rSBdOb4GdX9eGqDeRx GWBSAw1W+wAAaKWMnXbkcb9pfN0iZq3JwfE39hedUMaaj5iQodXFxR27rw3T+jzlJPJr Dxag== X-Gm-Message-State: AO0yUKWq30BQfSKDCTO+fJjHWSQmno8uFyjCTQ/K+VGip9Z5cSSZSCJ1 14A3AJMMjsEefp4ElqNSye6gENnWYxLSoxRr1q4= X-Received: by 2002:a17:90b:4ac4:b0:233:cbb9:9682 with SMTP id mh4-20020a17090b4ac400b00233cbb99682mr17275839pjb.24.1678214115418; Tue, 07 Mar 2023 10:35:15 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_L?= =?utf-8?q?e_Goater?= , David Gibson , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 14/25] target/ppc: Avoid tcg_const_i64 in do_vcntmb Date: Tue, 7 Mar 2023 10:34:52 -0800 Message-Id: <20230307183503.2512684-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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=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 both partial results separately and accumulate at the end, instead of accumulating in the middle. Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé --- Cc: Daniel Henrique Barboza Cc: Cédric Le Goater Cc: David Gibson Cc: Greg Kurz Cc: qemu-ppc@nongnu.org --- 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 Tue Mar 7 18:34: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: 659836 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541100wrb; Tue, 7 Mar 2023 10:37:24 -0800 (PST) X-Google-Smtp-Source: AK7set9mW+LQvd/V/cLCGISvRCwQ59hsU6RvO+omoNVTYUpSpQaK7vOj2k/YaOAfM/Vd4WaPkVmf X-Received: by 2002:a05:6214:29eb:b0:56e:964d:3662 with SMTP id jv11-20020a05621429eb00b0056e964d3662mr25688703qvb.13.1678214244394; Tue, 07 Mar 2023 10:37:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214244; cv=none; d=google.com; s=arc-20160816; b=jYbadY83x5QCMszRhmgS9tWsk3evC2oOWEFysqsuL2t3mtBbbmbkAcR2Hf/nTNNmO3 DTcCoutOR5xzUNzlOCGGrloXpWAxS4w2+bbL3qQxcGJ9zO+m0nM5g16D/TwQuVh5kRYN uBFJQZg6wQupQmapxhwjmF/++k6g1gxyVrcouTcqdH6qRaCH8HNtNg0IJdZgfrX2RvnS vDpvS2a8NGoljZiIi4lUG5bYCuzWFbfgUKF7IoQ+runSl21IRPHO9JnhqaVXfEDBWW6+ WPMZb8vaI08cJCDgUZiK499FSKIc8rBwc/xSGcNiIfph03O1M/zvyQnvTXlcCrtRON01 auXw== 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=bHCGQCESVEEPvC5DOWFLFs1NM0Z82tHvGWwm98O3W3s=; b=QZlAgcu6FlheH6REOazI0ORMIxoM48UlKSU9YxQI5OY8l4UdJqU1QvE9ciZFICsd8y XE2ozqnOwCgFaEAVr6Ft2KNTA7YQqRgVzF9FzBg7uhr7A2bbiPFFZGZDH+cNwNteTLKO 9Ct0Z2nuG5RKjb6RW5twIxTfXjO292lmOrEeiIPQ9p3c/52DBXJToPMku9wLgf7bjZ9q AGtYKqeU1uC+BJCV71ZhPVG0GtPbHcFyRrQasjKFW4uZZRSWfhw+K2Yb5MtmHAaBUqsg iPiLyyYT8mkc6xZ0Y6SK8XwkSalLPOsDJVEMWekcjM2NFDdcLtBi0sSA6Y9Gi4vnNxit QVrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DKK+aJnu; 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 ay34-20020a05620a17a200b007051669f37esi10459534qkb.257.2023.03.07.10.37.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37: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=DKK+aJnu; 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 1pZc9g-0003fr-57; Tue, 07 Mar 2023 13:35: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 1pZc9e-0003di-Me for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:18 -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 1pZc9c-0007hm-TZ for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:18 -0500 Received: by mail-pj1-x1031.google.com with SMTP id u3-20020a17090a450300b00239db6d7d47so12707867pjg.4 for ; Tue, 07 Mar 2023 10:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214116; 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=bHCGQCESVEEPvC5DOWFLFs1NM0Z82tHvGWwm98O3W3s=; b=DKK+aJnuwlR0gfrMcVLJY98e7rsjtBMBZIgiaVfEiHofnzwRX3XKGFk9pToc7oiqeZ oxboSstg/Ui920uyCF4G38IYjlb9XRMq96p+lQFBqQqIblKgyCo8PRjZgIUzELo4GeH+ nXdJ6V4XA2oFtchq1hij0BmppJI50SsUNKjQ5Sln2TGOuQos7NU6Nz7CwYa5FhGyJFOi 6cjWovoBFN+MvQO7GhnFEWetHGLGegjgc5M4cGUmkBGwayc+5jCPSH0l/D7B+1MwlzRl 3k5L3eFhg/giDXQLSmAEjt2/hHQ0UdVZI1WRI8YDN8egZUVAy1qNzuWov9jK1FWMz0pT 71AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214116; 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=bHCGQCESVEEPvC5DOWFLFs1NM0Z82tHvGWwm98O3W3s=; b=O1ON7Um+oHFt2EeaOAIno/GL0X/jvaWO31RF9zhHiwb6vfAG0+h5Wq840iezNGKcAh VgnU0tLT6pTl/XDRS9XsbxJoeKT5fpuNASmwMIHjGVy8MB0ypozVTI3aifP2xu+OcmUs DGAUtAd3w6Et9gZnSdcBy21bemA6QJvNOiIOEh9hSLRap9aJ1L3bhgmnPY49fPD0KcG0 d+XJsCQdcYOVyH9+/XCaJyZ+GWPhcf9cQjHSn2b9tA73OiWm+p0wPycQ+nrBq2iRkPQ7 5PPQ1TLNJ+9GcMGLz709NXTdpRvuN25rIRTQ7M9mMeCw1dt2Iv6B9XRpKHT8iZBgn+aD Lbsg== X-Gm-Message-State: AO0yUKVEOW3xbYgpMse8hyVslszjMHFjBOphu1DDayUMJJcTV9wLAqHA mlDIP8MgCPfMhuo4q+VsM/uAHls/pVRiav1tsDY= X-Received: by 2002:a17:90b:3142:b0:237:39b1:7b7 with SMTP id ip2-20020a17090b314200b0023739b107b7mr16188720pjb.11.1678214116203; Tue, 07 Mar 2023 10:35:16 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_L?= =?utf-8?q?e_Goater?= , David Gibson , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 15/25] target/ppc: Avoid tcg_const_* in vmx-impl.c.inc Date: Tue, 7 Mar 2023 10:34:53 -0800 Message-Id: <20230307183503.2512684-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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=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: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé --- Cc: Daniel Henrique Barboza Cc: Cédric Le Goater Cc: David Gibson Cc: Greg Kurz Cc: qemu-ppc@nongnu.org --- 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 Tue Mar 7 18:34: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: 659821 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540618wrb; Tue, 7 Mar 2023 10:36:09 -0800 (PST) X-Google-Smtp-Source: AK7set/9Jyxg0atad9kVrwSttAsQuC/zqpUC7gnaPqA7+5eKEGfV4A5YkaCm0E/ISwYJhMMiMlP7 X-Received: by 2002:ac8:5f54:0:b0:3b9:bc8c:c210 with SMTP id y20-20020ac85f54000000b003b9bc8cc210mr33118035qta.27.1678214169295; Tue, 07 Mar 2023 10:36:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214169; cv=none; d=google.com; s=arc-20160816; b=KlhmwdL7iUjiRWnoyn6VzHpuGMunNL+XwcBbPa0OlDTatUaGgax5fZr09ptFy4FOJY wKO3M1T4pElUxe5LcT37sq0lEH3sgmXsywETWGfvBAWwRdn1KeFWdEvyXj/au0Q6NsEJ XvULA6garBrZ1Y4sAnAUb4H/SNEpiCdv4IqdN7JvzM2KO8h11JjcOZHcxs9pRStQhMzx Fk+/MisDvQUB+sDgUonvU1OcfnMlIZS7pDbV5pMKaYk8ScMPjzL0mDPCunikgdRgeUm4 MH4krQC6X6BdIiNh2HvkXmS/lVA9DeoJgIZClE5BOpC0wCtIRW8vR87z760tytA7xMND QzZA== 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=Ob6o2+PyWVMcZzAwGqvOjE3dmqAG4vSrJnMbHtf/LLI=; b=Hb6qmbmcqKlAImnwnDhM5THT4OlZ5+VBG+lh1lU5BZ4RxorxKiE0ZrplNvEZSqswgT nTyZV28kPJrafi3fknlmhP1ZQoTC1lpiycfRnzcmeCy6AVxlfXYH416v5VTN4pU9sM4w JVplW73ZeF659WT165hvs9/MfAtqCHAemdKu/wzEfQWVrzfu3Kmn9B7Ml0PltxI5NrLr ogwfNqD64/69AgrPEZF/KX9lf7900wKOCiPlNwqNk1dCyhWNrFrlnmcyzsvuME2U3vVH 1WrfdkmpMt94iftBXFLjKwPuhgNCJkV/41yX4Iry6j9kj8wFv7mwygUWoEDmEOOPLIpj cykA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d5nTPWYo; 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-20020a05620a0c5300b0071eb8581636si11331946qki.666.2023.03.07.10.36.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:36: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=d5nTPWYo; 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 1pZc9h-0003i0-0z; Tue, 07 Mar 2023 13:35: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 1pZc9f-0003e5-Az for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:19 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZc9d-0007jU-Mu for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:19 -0500 Received: by mail-pl1-x62f.google.com with SMTP id v11so15108294plz.8 for ; Tue, 07 Mar 2023 10:35:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214117; 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=Ob6o2+PyWVMcZzAwGqvOjE3dmqAG4vSrJnMbHtf/LLI=; b=d5nTPWYoN300jTLNIIwcf82EgaX5/2v79sfJm8QFadwHkc3uDP2sqmPf3KIEi1I/24 6cOYQpUgWgpRDJqbR3lrIT9Hz0PNx8IBRkPbXEFzmv9/CmY9+yAnNGwZfATCjm2y5ozP souiqp9TKYnP/qdyvIAxk4mLrf94JDxQnaUqA/YOmUkCFzGN1xto1iAkCtnNhmqU1Gr/ 2HeqhgpB3TwShB0s82wHBZu2scrR6ya3nFeEou6XSmAOCmnA94UGakI8KnNhRnl5Bjo1 COwnPlb8vx1OTOJhg4SHRggk08jOSoAuPEIK4WS2GzRZqDwwmgvhce9x+nIp9UaUsrvY oeCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214117; 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=Ob6o2+PyWVMcZzAwGqvOjE3dmqAG4vSrJnMbHtf/LLI=; b=SAwkVyoxK+YCMpMeQJlQz/YrzEhk5Xmh9oJ3dNXueKTCV6wL/0w54igqIzpEN+WlnO OvAjrLyWkBDWY4x2Uhbb0JSGEFgeP8Mti7MOMT7ZGXss6z8msmyO7k8tCddW/+v+5Rhg Cp0qwnxM9RbcUsVB5ZX8f31rnwZ3jUSIiDyThFyv4ZWJOX8026HnKe2MWsiesim+A1To SOi/AW78D1qyQDQsIVPIofAW5jD3+jeTmQqeXsJVIhdqEc5lecluz25zIzoSqhXDSZ6i NqiG0N/t1YgIfN+X/mqamIkiOPijOe2opCs08X4IQFQBULPkFGT7YYkoLsiVe7+M3nuy 0HUA== X-Gm-Message-State: AO0yUKVoNQK/U96yU6EdyJ+8D2NJIgU+5emBT23lTwFY2Gkq4c7VNntI QXvCfrDHhhsYVILHxHr+RRKf/MHlWfbVe9BWzD0= X-Received: by 2002:a17:90b:1bc5:b0:233:affd:a96c with SMTP id oa5-20020a17090b1bc500b00233affda96cmr19382846pjb.16.1678214116915; Tue, 07 Mar 2023 10:35:16 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_L?= =?utf-8?q?e_Goater?= , David Gibson , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 16/25] target/ppc: Avoid tcg_const_* in xxeval Date: Tue, 7 Mar 2023 10:34:54 -0800 Message-Id: <20230307183503.2512684-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 Initialize a new temp instead of tcg_const_*. Fix a pasto in a comment. Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé --- Cc: Daniel Henrique Barboza Cc: Cédric Le Goater Cc: David Gibson Cc: Greg Kurz Cc: qemu-ppc@nongnu.org --- 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 Tue Mar 7 18:34: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: 659842 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541188wrb; Tue, 7 Mar 2023 10:37:35 -0800 (PST) X-Google-Smtp-Source: AK7set/sp2sK04qU+6VctDGIek/bwOWgBTlWzVjr2RdersZW+1LxbzaV1lBdAgK/snWrYkod0cPt X-Received: by 2002:a05:622a:178b:b0:3bf:daae:7f34 with SMTP id s11-20020a05622a178b00b003bfdaae7f34mr29166827qtk.41.1678214255377; Tue, 07 Mar 2023 10:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214255; cv=none; d=google.com; s=arc-20160816; b=bU3fBg0zPjH+MTexeZegGb18JGWolLU1yWuq1XEWFAXzqWQFFO4TGB48YUuSc/4CZc WlODE90uNaKybzLOU58aoJxuBOIReB7HM//QR3A+gJLDElt/hOHSGWhtn9skhFOVlQHp 1XfSrFDZPjcIdYm0fL0gPOegF+x8yIMNfOJNZmHghNZwEjAdUmonTl9IrcA1QCgynBuC /LwDzw0H8CJUK1ZKDjPNGJj4BGzwPC+08QsH8Jvo/uQKMbuu3wMfHGV9qCIEuN3LxMda cRtJF4MfuCTv5Y0W8VuFHW4lyP44bbCNNwAULBJN40c3ALdRs7rtU1O/thw8U7/YKBbY 9zUA== 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=CpYXE3rWCu2KbWEioPzYgbPFHINqSc7H2uYvcHXK0eo=; b=krG/FDIKIRkqauTpZo5RcGqPjMBjAYjT6TIvTK9MX4BwJGyGTxD9hq3gLQe2CdmkQO WldxCzilDh5VTtw+T7nT9p/5GWPFFhUlaxly+OGZ0jZdURtHb/WWIDhnjdXbjTgw5N72 zjNcWa0foDX8CSHdh5mqVILjci+TGZlE8tJNWLi5Oyl45OMfnQmQa0dR91HbsBqD3Y1H QbzwbDqtrvjmq5Fe7Z/rHWT2aQr8E1qzMrWY9v8tv5pPRDT0K9+rTn9caeQflnAvHUEl 6+JR9dgtD5JlKSK7i2pdc78y3al7F4gEQltwRCemQjTyVjqPjlzrlGIprOxbhWU/IWcV 8/3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NMkgx4Ld; 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-20020ac85852000000b003ba31dc6246si10356970qth.736.2023.03.07.10.37.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37: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=NMkgx4Ld; 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 1pZc9i-0003lt-Ia; Tue, 07 Mar 2023 13:35:22 -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 1pZc9g-0003hr-Ps for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:20 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZc9f-0007nq-5u for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:20 -0500 Received: by mail-pj1-x1032.google.com with SMTP id qa18-20020a17090b4fd200b0023750b675f5so17432089pjb.3 for ; Tue, 07 Mar 2023 10:35:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214118; 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=CpYXE3rWCu2KbWEioPzYgbPFHINqSc7H2uYvcHXK0eo=; b=NMkgx4Ld0ATd2AqtDTJZgfElu2xPdGuvDFhAwrf+wwzjalfg61x5UGR/NhAPN2cf34 X4yQ96yITnfbS+F+PWItSgNAM0d1SiooyQx9GyFWK0NkSPrBLnKVg8YCDB0YHvh0JdSQ 1+hmjoynyYvRssUmnf1UWaigd5D3IkkiGnjdZC7PytBVx5xL3vKgmXVz7OpeqzDWcytC BXBze4e2aWlTPKixgPrynS3EqH1sIFJhxP7W6qSDoY/8O283NHPUmxQfUokKnhobpj0Y BBp13daASeM9VWERUqf+QDrhlvtIoZ1B9R53TwvZ5hUJ2Qawx20cg9g3k8IOwBu0DVU5 yrQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214118; 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=CpYXE3rWCu2KbWEioPzYgbPFHINqSc7H2uYvcHXK0eo=; b=RpF+6B5iXIMRC4G4OUPiB/3H2HESQvvcvph5bozn8r6b/oJBtWf1B23X0t+EutW/PQ NUY1WvCobJ4IOjszXFqO9DsTH6dRyrZbRWuTw5FcAxDAeT3I41M7BWE4/CGWCfxr7F6y MZy3HGXEcfxgVcN+6FAOxrC8hUKry7OhDA/9BTIfaGZ5ZKLwxmQz7/gesPM5zRyhdhMH TNfwSMWPFoWBmqDZDi7UmgGdPM2BitvKv5PoSNEsBmow5FO8u/YMxvKlYkMFjfWNuyeR ZCBraCQjrpFa++rcQzjPYcngQ8B5gStYZWztdLhYApYM2YacZ/i+SUDgzF/QTZW3zPUp 4x2g== X-Gm-Message-State: AO0yUKXYIDLpMSpu9l0QfWFID7t8aSg59G5c0jbLti1v5GB7e8UJRW4v ICUUsg4uHXbYn9lIAVyaYmhuHJ3WxA1P0iSLCfQ= X-Received: by 2002:a17:90a:4bca:b0:230:a195:b8ac with SMTP id u10-20020a17090a4bca00b00230a195b8acmr16147459pjl.7.1678214117905; Tue, 07 Mar 2023 10:35:17 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_L?= =?utf-8?q?e_Goater?= , David Gibson , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 17/25] target/ppc: Avoid tcg_const_* in vsx-impl.c.inc Date: Tue, 7 Mar 2023 10:34:55 -0800 Message-Id: <20230307183503.2512684-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé --- Cc: Daniel Henrique Barboza Cc: Cédric Le Goater Cc: David Gibson Cc: Greg Kurz Cc: qemu-ppc@nongnu.org --- 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 Tue Mar 7 18:34: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: 659824 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540780wrb; Tue, 7 Mar 2023 10:36:36 -0800 (PST) X-Google-Smtp-Source: AK7set+xwmDH3vs140fUlvPj0t9vZD5zQUsEF9HyWv9CotIOtNgj29eV6tW7QCCQ/5p1ZR1p2RnV X-Received: by 2002:ad4:5de8:0:b0:56a:b623:9b09 with SMTP id jn8-20020ad45de8000000b0056ab6239b09mr23664198qvb.14.1678214195820; Tue, 07 Mar 2023 10:36:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214195; cv=none; d=google.com; s=arc-20160816; b=Wk1vPdi539Y4PQ/ZPgIXz0VzqmdzbwC11HxkV+/DOsnC3Ytpu4SzGZXF9u+7Ejsrdw naWvnmL9Had3W1NP3XgLyt5n3ls/2hbyNRaSvCEDQjIfIBkgVMvBVc3bHBSmtcSVTCOm wD9//EH4Xgs8d0mrwK8jTOLHoCQaxHiCORdmBSj2ICJIKF4LfhP+d2U3ECncQUBvCgMc cNF6ueTBDKKl4okeTT0Q161uLsOkzCJAAzFBlWEX9FlfCiXhRoGiQpCe9MoWGaPxkJRU o605rj/MPC66rB4+DvxaF3BenIDVSjQHxLY22kLBGhMQ7+qQrj80grQbrqZuTk+OW02M y4Jw== 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=YlBTOJV1hh3a1cn6MWiBu2NRUMEpbWBiiyC1zmA0wSE=; b=RyYU4rtiW0xteBDpjA6xtVxXXYLa/KP0hYXdrG2yq1nBXzi7gz9mUWtZtlo4p1GpV6 U+99+aAEV1XNNgKrj450OAFtMNsvHz8HV5PyNylojUa+jHXt8Xnoa7zMouXwkdkk11yf lPDdEYpr0F/IiGmcT5q11vKf2cZd7sASDhJmFP09Uj/9iAOLZWmAYKhzj391XgooOHag hH3k3cLzUSkIt7+O9JTQXKtJ4RyKGDoXsdqY1vebsVBDoTgd5KPAGzvSzwx4OP2qglP2 /D6Nej+UTAwUz41BhDztSiGB/BGWqnpXuQJha2UfRIcYqFryaI1v3ChD9h33Ua2Duj0r DFsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JrruKltr; 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 z18-20020a0ca952000000b0056ecfe1e0c1si9948499qva.466.2023.03.07.10.36.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:36: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=JrruKltr; 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 1pZc9j-0003mY-Dm; Tue, 07 Mar 2023 13:35: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 1pZc9h-0003kJ-OJ for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:21 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZc9f-0007pH-VC for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:21 -0500 Received: by mail-pl1-x62f.google.com with SMTP id p6so15187255plf.0 for ; Tue, 07 Mar 2023 10:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214119; 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=YlBTOJV1hh3a1cn6MWiBu2NRUMEpbWBiiyC1zmA0wSE=; b=JrruKltrnD+ae4XwiJQD3PQd18pWL5Og91XndComSmIDLI7B1snFk53BKt1iUT2LKP PZhCrxo5RFkbGYglEIoLdYGFBDvNAen5MVZ3kq7eMpdmuQ5lzSjfqwFHcOEO83NW+mRH dqtUl369S0x2DMMbuhGJGntKQ+L9ZeolkAqjcIb0gOFOtjvMPXGNjwS2cxgW9dka+hPy JH5JUfSU4+zUwqIrEfq2FJ2faYNCWZbP1pSHf5+wU6bqhMsXlKONTzgZt74oFNkFv9Nn pTYVDSiLWcLnvkDoViAmqsik06LIwDD2DmGvTi3ymNJgKwRbJCVHI0B/SBCNxYU4Zwit 3VBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214119; 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=YlBTOJV1hh3a1cn6MWiBu2NRUMEpbWBiiyC1zmA0wSE=; b=PpJz3Pa0oaUXFqslZX7x0aTBnznpraZPRjVfXCLYT7IydxmDUaWRNDXD1tlyFfRIVr nCC1mCH87Wvs2enhTm/kj2YNaM16R9bNejycKzDJ1t1LCNIW32uJM0zsYYMwmFvzrbmC S27kVJh7ZBnF3hJqRsvNCRAPNJFEYT20nywiSufGreU9PK85XfHm6bZBStMgcaRwDSYZ 4cUmKUBr9t9IcJgOndiJGmcFJZw/rrEwFtJmiOMAPFpPUl0vYnuuwUXPTQNHmQuNKG7l FD073XlFjUyPyz3qQcpIVCDVQwwibw/NKzJzvpiSqAL9k41+OsbhqOBpSHUAppDifCbn OfpQ== X-Gm-Message-State: AO0yUKVee7LWCmfM+epwbYgBTI6RLHVmpEQkHp/Hw4DnHYabC5+BW6l6 FoTMqoanJr7vtmyLH3GyO+/NCK/NVN+gqDH2AbU= X-Received: by 2002:a17:90b:4a48:b0:234:106a:34b7 with SMTP id lb8-20020a17090b4a4800b00234106a34b7mr15264079pjb.46.1678214118680; Tue, 07 Mar 2023 10:35:18 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_L?= =?utf-8?q?e_Goater?= , David Gibson , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 18/25] target/ppc: Avoid tcg_const_* in fp-impl.c.inc Date: Tue, 7 Mar 2023 10:34:56 -0800 Message-Id: <20230307183503.2512684-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé --- Cc: Daniel Henrique Barboza Cc: Cédric Le Goater Cc: David Gibson Cc: Greg Kurz Cc: qemu-ppc@nongnu.org --- 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 Tue Mar 7 18:34: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: 659829 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540918wrb; Tue, 7 Mar 2023 10:36:56 -0800 (PST) X-Google-Smtp-Source: AK7set/qP9fnASEuLGnDjUV31MS0XAjW8jRcMMGYgJJ8hIaLqkwi3Df+GSit/p6eomrqxyTWxx1w X-Received: by 2002:a05:622a:1101:b0:3b9:bc26:3349 with SMTP id e1-20020a05622a110100b003b9bc263349mr1927903qty.37.1678214216592; Tue, 07 Mar 2023 10:36:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214216; cv=none; d=google.com; s=arc-20160816; b=Lqik1GzjIFjz+fAaEZjbOlCSyCcDIbLosrAdyyykIbHACMrPNMueSRzjNq0WGRm6ZK yQEIbs1W5/bM+KyG83tYEl4kkHTAvctygNmUjC/dwLKAn4v1JpqRgePc85qDm5Oc/oqC /t1Q6+IFGe/fCbqM9RJvhLQ02UjBdfgiXlK6JoqapU9r18xQswt92NuKJT7D9HSfPbJY OgsEMrfnDzIeriBQovzzWT9hlkGJg48jxYl6PcofbfJi/JPztE5ubmufT4G9op9luaP+ OS6zCrpNut/EXdDeXAwkP1I/kW+nZvVMZXIiZpQcLmOXcGpbN+9y0iHoFKsxsMh7KYjz K84g== 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=gzyJzA22uKXasXpBwzGrbKyMSGaVktQVzvYxO4YCmRY=; b=MKXTkPl4nI2DnVIimh1H6gQqm/Mn6dBgsPRq77R5GXBz4AQTfXQ5nZVvObiMaWvHwQ xEyAWhKY9MnrhyUAz1fG61YkhSAMAse5PcyagfcBsghd3rQlDqVEygP3G+VZF1UVkY1f pxQDKqVVORzDhFVVl++9owar7IL8mg7+Jfql8Nd2uphoSjsvsjoqktPKMRuct7v5X5dB DURRAzOFHqT2UT4QR67njKeWczNzolYZJGyrsWXPfnxrRv7maYRc5WHVm+ZP9IMDdQjv 1GeLLKxtClIRLL5aPpqkSE0qHNT8KcIiCVhLgEHNFIrwBHr9q1mH+On5A2p1ssH5TXNn +IAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hBlPTyq4; 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 c8-20020ac85a88000000b003b9b98b3c4dsi10016559qtc.200.2023.03.07.10.36.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:36:56 -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=hBlPTyq4; 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 1pZc9k-0003nh-CH; Tue, 07 Mar 2023 13:35: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 1pZc9i-0003lT-90 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:22 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZc9g-0007qE-MA for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:22 -0500 Received: by mail-pj1-x1033.google.com with SMTP id ce8-20020a17090aff0800b0023a61cff2c6so2129124pjb.0 for ; Tue, 07 Mar 2023 10:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214119; 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=gzyJzA22uKXasXpBwzGrbKyMSGaVktQVzvYxO4YCmRY=; b=hBlPTyq4zC2+gmIlJj8HfszcqrVQS0oA6t2kSBsquddhHWQqqunJyRdR9IXx1RFhkR OJ55dV/CEGU+2uiOah+lu2+s7RMgb88sqxUanTOJTTdT9hrU8t90nDkfnJ3GaEJ9DWqv QW3aLdy4KCNKAGt8MqngOmLAJcwbCWwl3cQK/zIFCKCdIyVlM+DLRSTWETAAqVOGvSC9 lcOOgR0YkWmB7izep3ATWfdHyeo3wzEK7D9rFmBPvqWJPyyFHGymsizVWKKMRUB03eRI MvrSJVj5AaQi9oSuiE4W/NI4N6y4ScOVJd5ba29YDjeg83+4O8fGm+bDq56eYqbPXDCd 2MFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214119; 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=gzyJzA22uKXasXpBwzGrbKyMSGaVktQVzvYxO4YCmRY=; b=XECSkm3W0jQtJGNMDPFNYyKQegX2POFGfa7OpQxXHMU7stjaP4cwwINBASbnBCVTGF hW4ZuaWDhKsKKZubEI+xWaIXuMFBLAbez7oTXn8JuZ/iw87uK61RyN8i/ekXYVkQH5pM d/xR2EHMRBGo2vmxzNrnFp3zfyaYpbrxUHPpzOhRYhbVqNB7w63twjqtPNmDznvnEX3H PV4KLiy/XDNqa7md2GleU/nfjBs7MUgMdq80vZ5C7mgCswNXH1CVTdK2tkbbpKixHs/S q5oJHzGRVu+HV+CUHmLPv29vmzKir4eQoj9DkslyAWa9g1aZjl9a9Zc5CjJ5ZCF3Dw6Y zSwQ== X-Gm-Message-State: AO0yUKVwZLOIpEGny1ae+1CtT1wJxHx8aiHQN5Jxqi9iv4hQf2ViTXpa W3952MXWUoK0jQWgF8hqKP+u0d6pw5YIA3CgrGk= X-Received: by 2002:a17:90b:4c85:b0:234:b23:ead3 with SMTP id my5-20020a17090b4c8500b002340b23ead3mr15739211pjb.3.1678214119429; Tue, 07 Mar 2023 10:35:19 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_L?= =?utf-8?q?e_Goater?= , David Gibson , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 19/25] target/ppc: Avoid tcg_const_* in power8-pmu-regs.c.inc Date: Tue, 7 Mar 2023 10:34:57 -0800 Message-Id: <20230307183503.2512684-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé --- Cc: Daniel Henrique Barboza Cc: Cédric Le Goater Cc: David Gibson Cc: Greg Kurz Cc: qemu-ppc@nongnu.org --- 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 Tue Mar 7 18:34: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: 659832 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540968wrb; Tue, 7 Mar 2023 10:37:04 -0800 (PST) X-Google-Smtp-Source: AK7set8kVIPDMwvEDh5h7XDCcCBUj7bvcElkXyipUCVpR+PQInBybJXMVDr+vTRTmv1V7SG0Cq4o X-Received: by 2002:ac8:5a4b:0:b0:3c0:3c0b:abdc with SMTP id o11-20020ac85a4b000000b003c03c0babdcmr3363194qta.28.1678214224412; Tue, 07 Mar 2023 10:37:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214224; cv=none; d=google.com; s=arc-20160816; b=iRr2JkaXJDrE6BgEwFl9fx7utb92vDTDit3VINUTwvj+dcID03cB0QP4fh9eixmQht oXtRaLmIu/eEqCvkhDX7UP6i6r8Q/dPARD7u32p1COm3mhTW/j8joWn2ImMyJYFc0tba nDeUX6zO4/JsJEk2LCzUelp423FPR1m3aulFxupmjiWhZ0EHuF7kSBuiz5Tz+mNjqIzH GMmX9h74V/242cKsv+tHN7Hoglg/HXfLyKc8DneOpb9IX+NFkHNH8DTPvjucgyEuVMFz yCHVI99346CvLiQnGETLCBJomhWWeeI1d2RDOzQqy7OuV41SFBX00WTBjwp4ghjzEl0W D3fw== 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=ZdTBDl9nXXjMgu9i8Non2f0+ozz7fi4hp6Tet75Z0Y8=; b=U64jz1fJTdsMoBLROsXSymqfpIDmP0G9wj7eQGRF5908nj5mb/EQ+Q9vOcaGT+Awf9 piofteMVCKawYhIe2W94vbLyLQJSV2OSg4GN4L9NRdKzBkjLBb3GvOHDWg6+V1+vNN8G sH+LHt65a0NzqOIwxQx6FNR3i1ezRPns9sMAIZaR49VOn3kCWm3EsCmHIj6Pp7fjvx2v F/FGni/Lio/gvqNx3EoTAayizV5OtXRPC/ZRILtB71M7ptkzE5dpx0AcP9k3och4KB7u 8pIsG6pueciKQUExu2v8YAeN7G5AvlM87PoAWOMeHtXuuyRNpr2QXNRMz6wr+7VP5cfN 7srg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g3A4JmRi; 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 de39-20020a05620a372700b0073128e8f63esi10042687qkb.534.2023.03.07.10.37.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37: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=g3A4JmRi; 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 1pZc9k-0003nj-Dt; Tue, 07 Mar 2023 13:35: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 1pZc9j-0003mJ-4c for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:23 -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 1pZc9g-0007iZ-VP for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:22 -0500 Received: by mail-pj1-x102f.google.com with SMTP id bo22so14125703pjb.4 for ; Tue, 07 Mar 2023 10:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214120; 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=ZdTBDl9nXXjMgu9i8Non2f0+ozz7fi4hp6Tet75Z0Y8=; b=g3A4JmRiOVNhK5YMW1Jja+R2QjcLfEUH9yoi7aMbX1t7LNuXsMVy37EXyt1V5KtGdm ERBw7uEKqyMqBEfZrH7+lXBZRt11OwchOF2zKgFbXtfOyzFdI5PAWFEHH03UWlvt93Vj ycUxReKvkDogIZ9hY/ASs4U72Si9r4ohVlGPdqwdvzWZjNXSLKLcHNsFY+5pvEB7xvGE hbmWYVA9T+3hCUCQf2LQqnoRuNNh8UKQ/v982A/357LzVIVPPdQrO77WWcvNqyQd+RZ0 gIXM1UsKLVwTWxwEAO+wqm8NDIWmtJvLjz6COsmNh9Tbw/Nv3RdxR3ipgz0GcE7saN1w wRoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214120; 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=ZdTBDl9nXXjMgu9i8Non2f0+ozz7fi4hp6Tet75Z0Y8=; b=uHCbo3W5CPS/YGRvvub+8CZZE9lAVNLZzGcbKrY9AvaqzkMAQSGs+bfgA0wvYefha8 y7EMKyAvXO9tCqtb1trvyId56FocAbTEMaK20G8IkiB6JLGAzrwO5Ji4AF3M9j77LxAf mHZUh+Jrfh3QxUo+o3qtpnKITTVcIAClHt+Fh4tdncZGVjXekxfCosRn3rwvxQJ1cDGb KEQzDraqpzMDvuR0smmC7R6FKtXbKdH5lHdLvyOIJBbf5FrUK086iOJ/iZY/BpDqohJ4 LMjZ9mOEfWOzUsdpkSlkCD/xXiRcU5KFxz1lc5Jjfwz0SKywZrzmR9hbTDzXI/I6SyBi B6/A== X-Gm-Message-State: AO0yUKWz/pwJH+FmvWBZvzCf7tWPmBwtNZJKGU6yF1NO5BiUKT777AQ4 gcM08HnyFMlSGyZHN26mAI7lXBJ56Ey83/mHdig= X-Received: by 2002:a17:90b:3e89:b0:237:8617:b5a4 with SMTP id rj9-20020a17090b3e8900b002378617b5a4mr15413201pjb.21.1678214120252; Tue, 07 Mar 2023 10:35:20 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_L?= =?utf-8?q?e_Goater?= , David Gibson , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 20/25] target/ppc: Rewrite trans_ADDG6S Date: Tue, 7 Mar 2023 10:34:58 -0800 Message-Id: <20230307183503.2512684-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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 Compute all carry bits in parallel instead of a loop. Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza --- Cc: Daniel Henrique Barboza Cc: Cédric Le Goater Cc: David Gibson Cc: Greg Kurz Cc: qemu-ppc@nongnu.org --- 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 Tue Mar 7 18:34:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659838 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541128wrb; Tue, 7 Mar 2023 10:37:29 -0800 (PST) X-Google-Smtp-Source: AK7set8sxf8gkO6RoPqV/i0/zZU9VSc9hirdzAjdSDdj3RRSDwZvkVlU3AwAqmWCCqL9YN7SslXn X-Received: by 2002:ac8:5952:0:b0:3ac:1bd5:b7ad with SMTP id 18-20020ac85952000000b003ac1bd5b7admr24912548qtz.33.1678214248814; Tue, 07 Mar 2023 10:37:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214248; cv=none; d=google.com; s=arc-20160816; b=gP72OKBQTgNAkz6ksRRlxecXKoSx8VpNttETiQ1mTui1+33Ae1fqq0K3mfjVAdJOoB Yogp+D9tt55mlmo0QGPhUPsRYMf9oinSonUcy/EL8GMAHpMNFV70+YkMC5KLDZ1JZpa0 6xqMC+eMG4fOLO/9ETIO2gxNQhoHfvsYc2jH38gY6YppeqCcQLqL1486FKG8hTJIDJCh O7Aeks6zfvbXEYciWsjSAfed+lsqeny5ZrC330qk9t2GmHOW0FEntH0KJB4VBNTQeCji R+dYIAEefVblLsqW811wHIWsu0R9ENNZB9yiL76O16btngr39rP7O/yTfb7wSHg1FC8I 04KQ== 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=GrumRIwdVV1Jr8GCRA+MA8lhjBsXMqt+Zj+Dif4zEFE=; b=T0xYEb0puxBCANW9rQSyWliBlkhDKpxgX66MAghw14Ihic8/Pvso9ba/kRBir/fgTr J0w3hXuvWdekVdXBq1kzAjYwzQA/mQPP+wJN8Rj1XzSff/ntv3lXBBELzFyBjy6J6fGa wT+GCmx90INz9pwT5TLGIiVOhhfCYx6WMc7kB2B8w03OVoDKU3d2DA/OGJFMNBzWwGly 095Blb3Q0zP+cembC5gaTnyeCbOAjpx/Hylh9MlQFT0FCmT4GaXhVqzMECzJjtIFjN71 MRxRGDNnJNU45WOn0z1OOvwPOnhMHm8UUyVwJ3WdccOcrngceaOqShKDLbDALJEUbuV0 s+gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="I/XFRR2t"; 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-20020ac87e82000000b003bce12b291csi9839538qtj.320.2023.03.07.10.37.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37: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="I/XFRR2t"; 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 1pZc9l-0003o5-8K; Tue, 07 Mar 2023 13:35: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 1pZc9j-0003mz-MP for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:23 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZc9h-0007nq-U7 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:23 -0500 Received: by mail-pj1-x1032.google.com with SMTP id qa18-20020a17090b4fd200b0023750b675f5so17432236pjb.3 for ; Tue, 07 Mar 2023 10:35:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214121; 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=GrumRIwdVV1Jr8GCRA+MA8lhjBsXMqt+Zj+Dif4zEFE=; b=I/XFRR2tDNSGqeRNJhUx2b1vKxcet3+Kbn0D0IqFfArsCAJeFWOsRBC1PSuXtbSw5G iaSn5C5Wog8XFrhTqMkIa4ju2Kw0RWBLAPO5xJpk3Rwpx1Zmij7FKGZTvyS+MQFGb6nH vH0vNPeFHRHwfo/wpf4l5wUk3FgiJ5OLSybGy3d+g8gOfPs5RtBXe1YV/ahw5FL0M+km AE5QqVduIaQdpM9DHeBV0vDTvyJVRDtfd9eHbT6ziVSh5g0SXohdMPbzE3E1m4wVOMiv lQhbOSLi303XwXebYWgqmKmrtKiW2D8Ud1xeCe+klLfwwE6blMUz0jrnt58joCtOoQyV HYWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214121; 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=GrumRIwdVV1Jr8GCRA+MA8lhjBsXMqt+Zj+Dif4zEFE=; b=LIA5lyu72UoyktRo5ZZHrbWGZ6mRLBfl4g9SJxP0V7m00+cK2s0p6akDSnSsLR6J2Z pifHNR2FyeJWLOsjdpMhSO3Y5SEyjY+vtlmBStAT8Ps+WTXcAYv+GSuhYrm71Kr2Es+c dTXqTMCyr7g1PiN016Om4uwMg4CXRhTjUhxWGeHgX2mFSb3UVYI/RAsIwisgWzL/f6zu dY4/uOqd7/f9jSGcj5F6VOSv6WjA3KqF/xwurvuw3UALfgwpyLWP8Fbn4VsGnwmhfNga Nf6KyUhQBPcpf/RHeF1Rkf+GY4EbepqVXkJOOT0PttdARfDYHDl/rHXSpYhzT8Dtnl+g 0t/g== X-Gm-Message-State: AO0yUKU92ulvQyEBKRFHe2PMclQTEEtYSiQLRKDmk/AjP6V87HqedwFU L7NlB7+1bpeNe+pPn/N7LkQLdKULICAEBK24KuM= X-Received: by 2002:a17:90b:388f:b0:23a:63:6d37 with SMTP id mu15-20020a17090b388f00b0023a00636d37mr15836598pjb.6.1678214121171; Tue, 07 Mar 2023 10:35:21 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_L?= =?utf-8?q?e_Goater?= , David Gibson , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 21/25] target/ppc: Fix gen_tlbsx_booke206 Date: Tue, 7 Mar 2023 10:34:59 -0800 Message-Id: <20230307183503.2512684-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 Fix incorrect read from rD. Avoid adding 0 when rA == 0. Signed-off-by: Richard Henderson Reviewed-by: Daniel Henrique Barboza --- Cc: Daniel Henrique Barboza Cc: Cédric Le Goater Cc: David Gibson Cc: Greg Kurz Cc: qemu-ppc@nongnu.org --- 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 df324fc7ff..7ec940b7d8 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -5875,12 +5875,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 Tue Mar 7 18:35:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659834 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541059wrb; Tue, 7 Mar 2023 10:37:18 -0800 (PST) X-Google-Smtp-Source: AK7set/P+liYPM+o3NTNSqEtFGNJ4LtwuHQ+FkzUyRPw/f9Iu1GRQoVuvUeH559N+kX6ZJsprWEU X-Received: by 2002:a05:6214:2264:b0:56e:b124:156e with SMTP id gs4-20020a056214226400b0056eb124156emr27510514qvb.10.1678214238366; Tue, 07 Mar 2023 10:37:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214238; cv=none; d=google.com; s=arc-20160816; b=XE/oec6WjTfnGbmNZ/YPXpkvAl0HpWbHwlc1VkL1BExWK3JfdNfuFlRczxpfj0HqwX dxj2XGikvpHQ0JTPMBDIk+XXLA9g/0qvocVmnSHIygsxviegAjD5/4aAt64W0SwI+cSH ND8vnKkPDdYzojVaPnvOg4KqeRg03fJmdtbPPRAQnBbuf8L0phc0q880PpBOI1cN6bjX f96LkVNqXLq4YtdNx09XAsgBKRB8YLKZgfapPkDypZlczWMY4GCVun3Ss0wAivk5wrCq R662mjycR6f2QoJzYumQvVaFiJwRAO7cQ2Es9pcNFylIgA1WJ0FX60UqOoJTJ/PJgwOt w5Hw== 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=uEfiU2wyDHNaxnw+2qXkOFg3sGk4PBVFGXZQ1fN5hcI=; b=Boyq8qBpNdY+nkOek99o35m/FCOf2a6WXOtM5evwY2hmiS1D7al46FmLrOzYBw7UZu anbPycPyRymo+mFUh8QdSIq5H1Q+guvmjvq9FUoasDi+2SiMEZt9KitbNq5X6xNory6H N3tP2wkuWHOeVkshfkM7Ir639sTLNvPVUrxY7TNH3ivWsM7mDdYE8vuoxRolMhtfHLqL 9Xa+81ivE2P/AJwqiWEL+lsxnC0kQKmH5ZMzufQnbvi8rdS1or5ocUGtPreNMR0h+Nhk 5RHcZ2InOHsCQylVTgFcsEhJSy6R27j21YIbTrVI5mHQycjeWDz4mZzMX2eEfCsnq1mx V8Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n0mqD5Mt; 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 c19-20020a0cf2d3000000b004ad5edaeeb5si9806540qvm.357.2023.03.07.10.37.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37:18 -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=n0mqD5Mt; 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 1pZc9n-0003pQ-3h; Tue, 07 Mar 2023 13:35: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 1pZc9l-0003oE-MN for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:25 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZc9i-0007qE-U7 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:25 -0500 Received: by mail-pj1-x1033.google.com with SMTP id ce8-20020a17090aff0800b0023a61cff2c6so2129207pjb.0 for ; Tue, 07 Mar 2023 10:35:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214122; 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=uEfiU2wyDHNaxnw+2qXkOFg3sGk4PBVFGXZQ1fN5hcI=; b=n0mqD5Mtqg9iZG2g9+5omC1YEh587vQAfOelitLUktMO1tJ3huhvEjq3pAJD5R0+TI FSRZk/Nz69RvExKhpjzydwGcsWSyuRCLrWWmdCtwEwzrWZblb5KsSaeimgQkJCA61sQo oRVT/ThP8NvxYtB04ToYuy9NuuvFyWuh7XrSALEQ2kO/CDH3hdr1wHIuOMbWHuTwYNOU MaB2dCSUmlZ3uN/ACXMJ8IQXoVUh6rGBu3HltatRRYbX7PjtK50BLpJvxScASmSAiAPl WSfSrerFyeOflNT85iv6ZW0x4EivNYqyhOXjtjfgZ0CebqgTASwfVwEtBDHIxPrezcJq 8DIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214122; 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=uEfiU2wyDHNaxnw+2qXkOFg3sGk4PBVFGXZQ1fN5hcI=; b=NVtvkDfEcTs+NaJ+qcbXDsRGKxoEIp5dET+RZqz8A6TBgXxx3Za5pE01UpwbRavMIE buGLi42+VbhikMt0+sWyYAlu1OKzRR6lQ+L80xKR80H5/EiFMZ8x0PG5JcAXSP2ioflm Q2TSLkC31Dy016mu8EIsC7EpeUtrbk9gGL0v/UbnWpBltUsYsuMXbfS7CYZTnhMlYZcc 2CGyQZtuyzBgv1+T2sXhLmEijGWFSdzN1e5ehGglIgSG4BauhmdeFIMMtST9qreBhxCY OOXHXutiCxSxIkthmskHP+5VKy0uUjlvWAyasvkLf34kxlaAraX0hDy2ahhIuGxKmK+w 44xA== X-Gm-Message-State: AO0yUKXXqed8Qr9esiA5z6gUQUh1ItEjBPK2PtqC9tzw4akkqaWDwIRK AgUgbzsiBAvE4llNLzPpZG3oeG6Fnq4PovXe+IA= X-Received: by 2002:a17:90a:52:b0:233:b20f:e646 with SMTP id 18-20020a17090a005200b00233b20fe646mr16022659pjb.0.1678214122008; Tue, 07 Mar 2023 10:35:22 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_L?= =?utf-8?q?e_Goater?= , David Gibson , Greg Kurz , qemu-ppc@nongnu.org Subject: [PATCH v2 22/25] target/ppc: Avoid tcg_const_* in translate.c Date: Tue, 7 Mar 2023 10:35:00 -0800 Message-Id: <20230307183503.2512684-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-Daudé --- Cc: Daniel Henrique Barboza Cc: Cédric Le Goater Cc: David Gibson Cc: Greg Kurz Cc: qemu-ppc@nongnu.org --- 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 7ec940b7d8..9d05357d03 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 @@ -5026,7 +5028,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); } @@ -5039,7 +5041,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); } @@ -5114,7 +5116,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) */ } @@ -5143,7 +5145,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) */ } @@ -5175,7 +5177,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) */ } @@ -5204,7 +5206,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) */ } @@ -5558,7 +5560,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) */ } @@ -5572,7 +5574,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) */ } @@ -5793,7 +5795,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)]); } @@ -5839,7 +5841,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)]); } @@ -5981,7 +5983,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 Tue Mar 7 18:35:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659839 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2541142wrb; Tue, 7 Mar 2023 10:37:30 -0800 (PST) X-Google-Smtp-Source: AK7set/aZJjqflzbI7hc1K2OUAuXRtPJP+6eUuP96M7wMP1D5pGe4zOwRVN/zQKrxg4J8pGiUfDQ X-Received: by 2002:ac8:580c:0:b0:3b8:5a96:166 with SMTP id g12-20020ac8580c000000b003b85a960166mr24735625qtg.35.1678214250144; Tue, 07 Mar 2023 10:37:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214250; cv=none; d=google.com; s=arc-20160816; b=xRKi0pBRJQUovlSXf6tFa5CMa4Vo/pW8WGEQ1p44SsOJPXum1p5tbtl3LhPzJ5xdPN gXxXW+tUase9OHYVR0sD13Do7dpOPNwlRVBoAVdS91oJenuQJWO4BnRvM+RFplFD67N+ BdNeHQENp4XLqIyxLVt6seoT/yjpjm+4klBF6N1nt0bgiEnhLXz8lI6BXboSJthLUoVD GDMHANC0FXE0JunjbrRtIFfoqtbJM2tbo0ELo02xLXlWpC/81ZBIKmTzX+bbGhOWu7N4 09dtBxpGVd/e8pCCaqKmMvd8nihWhUdzdnXfRdeWVhihpCq9za22ZuOLg+FDpw8z0beZ 5OEg== 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=/kqb+FJ785WyoATSXgO6HwVDPJoq2Vijw5MdWjgOOw4=; b=BW62WArQeR9FCivz9LGzwpNmgPckac90wqfm7kTS7nS7cOaCfbQ5V44ijQt2El/qye Ek5LRltsV3Q0BNpDa6eayusnr5hc2d8n6rdjv/hVHTX2putLTYHIkCckWVZvEv8qlvm5 ybauS310t5pK0eYnk0pcaCeaLCG1lAPeN78Y+eK9GfXsF2LP0CTxJTQ209ePMp3RisoG 0Waos7YEVxPseyUVcpjG/OEhAzJLNbe6A9by7C6LNzKxNY6JBtDJm0RD15M9qsmCO6Ku VqfSkFYQLAkTf08Mifh8ufRIL3gmL/UhXptxi8wxCRPixBEz53KHBU3epjXYuOi80ue2 WQVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PLyTn2DP; 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 x5-20020a05620a258500b00708084c79f3si11382845qko.610.2023.03.07.10.37.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37:30 -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=PLyTn2DP; 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 1pZc9m-0003oi-8C; Tue, 07 Mar 2023 13:35: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 1pZc9l-0003o4-78 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:25 -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 1pZc9j-0007n7-I6 for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:24 -0500 Received: by mail-pj1-x1029.google.com with SMTP id h11-20020a17090a2ecb00b00237c740335cso12716170pjs.3 for ; Tue, 07 Mar 2023 10:35:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214123; 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=/kqb+FJ785WyoATSXgO6HwVDPJoq2Vijw5MdWjgOOw4=; b=PLyTn2DPGX1LbvfwpQVKnzRmMw2pVKbYayXcBqIIjzdY9OtE4f2TULfb0yVHOA+Zm1 BGLaxbxA87a0oNZ7F05UfBWUtsnJYpwOg4BCuGgnL0l7qZSOA4scyiX8Sa3fRsVIh8rV V8smTHgYiKm2o4IXw6brW+gT/Q1kHyd2UjZLmdtBDjJG41okpdSGaALfJBAPpeiYBVZO qIG+DrEH5EGY/FaVvz5sn40O+4mkVcNj83FjyZQyMxH2ccaoUegd4EL+yy1ll4u0U136 /OuIiq/8sQjraxW1ffgz2tZhySwz3kcYbafXgAMHPDTPDx6GcrIa34FgyCvvkQQgaaIC ULXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214123; 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=/kqb+FJ785WyoATSXgO6HwVDPJoq2Vijw5MdWjgOOw4=; b=UOOV2qxJ1w79trVapl0z9PWB+bi2lDq4SzsD6fvnXkQBdvbODmqeXoNYoLlfoI0U6v wMFn+6tBsTCMJmJrHr8MygQ2dKIAaXlNHfsqpML85UftjLYoMuzYYiYQTsYtHd4g1dRF She5rPU+PG0D3x99t5VnDdTgVChhT13AYJfzWWy6ndWzJvvcLN6YLx4AZAZlFOUEBrQn 5QIUihCsCQ/S46t8gS4XlpFtQJNkhCpdsutMnNbJWYE7ObBZP1a8W8LcMdLAJ/pDzsUt pSnYDJLp6NwnwLPqmCHBHt0neJp1QlsM8UAv7k8CxuazlVQZyhWTOHbZ4Sgv6XHsRMuz 6CTg== X-Gm-Message-State: AO0yUKUik9GZCg59vXpMmQhLE548L5ezFiz8c6fC2dmMIp14REibj/7r EFZSLiMNs6VzH+J3ZKcxmc7NWslPxr0et5qpCV0= X-Received: by 2002:a17:90b:3a92:b0:233:b5c2:7d17 with SMTP id om18-20020a17090b3a9200b00233b5c27d17mr16025402pjb.23.1678214122749; Tue, 07 Mar 2023 10:35:22 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Bastian Koppelmann Subject: [PATCH v2 23/25] target/tricore: Use min/max for saturate Date: Tue, 7 Mar 2023 10:35:01 -0800 Message-Id: <20230307183503.2512684-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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=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 tcg_constant_i32 for the bounds. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- Cc: Bastian Koppelmann --- 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 a3a5263a5d..2646cb3eb5 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -2443,21 +2443,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, arg, tcg_constant_i32(up)); } static void gen_shi(TCGv ret, TCGv r1, int32_t shift_count) From patchwork Tue Mar 7 18:35:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659828 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540890wrb; Tue, 7 Mar 2023 10:36:52 -0800 (PST) X-Google-Smtp-Source: AK7set8hbWvUfcB0BSZWxiBuK1dVr48tHwCgTlYsBFd9Z6TX44Xawd4PbwoKtcjB5F9Oml8NpZCL X-Received: by 2002:a05:6214:1c09:b0:571:13c:6806 with SMTP id u9-20020a0562141c0900b00571013c6806mr30385045qvc.33.1678214211985; Tue, 07 Mar 2023 10:36:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214211; cv=none; d=google.com; s=arc-20160816; b=qA4+Ln1p6mtPF8hHynvOW/j2tzizjbX4Lv9vytuL6A8ExRGkCjNN7NnWprhZl4eFmV X52ALmDBjcOr68X9pjdrKHgErVCN2X1HRC/fLCqfNzcynL0A5zVD7wQYlYd03qNCTpDf wYyQRMgRWGlaF4Tqb6Gr/6TZijLoGUSmqvpRyMxaAe5Ut9NdZ80i/A/kB+MaCMIHRfXJ zgzgY7DuQHJE6eYd16KdwzsRm8uGefWEyt8z6xBWd6ckyZZEuhSTiTy9kbvXycVWW5N+ +OWqFIyvSPwgAev3LBM1u9bb655Wm3fuCObXaTJBhu4POmQAp3GP7qaLph2ZAP3fyMkn 6DdQ== 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=VjOIZ5EQv+mPJcXiKX0Fq4Q7ChwmAlVw5eKwrOnmib8=; b=PI3iaS9SKjEGAjdjcAZLd26gIrY9hX52qP7wMH+HbLhzSq5C26r1t2hdkrIfkwG3Mr 0wr9cQP9Ceob6TcpjXg2TD6rrUxEfGsjIAxPRc7LlPz1hnaPnhJLO+1KoszDABPbvgaC WsgJSmS1O8tUHeynVAek1XJiOAG0QPvcx4YSpBbfeWpL3kXKUrEWE4JXjyENLdQuTWdp DwIC8IcW3+kYvKWrqd3L8656VbGX1zvTC9C5SiVfIKD8nHNt2dK+Ntl6EHaaa8CkhKBA dyAfc4ahDwhBAAbKZ33iidXyH6qPQvv5T2mlwaA6oXHOYkKaD4H/tBduU4WApHr0D1tw jHDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OS7WBG0c; 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-20020a0ce046000000b0056d4e09a303si9638082qvk.327.2023.03.07.10.36.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:36: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=OS7WBG0c; 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 1pZc9o-0003r9-KD; Tue, 07 Mar 2023 13:35:28 -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 1pZc9m-0003p4-LO for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:26 -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 1pZc9k-0007t6-OX for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:26 -0500 Received: by mail-pj1-x102d.google.com with SMTP id y2so14129344pjg.3 for ; Tue, 07 Mar 2023 10:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214123; 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=VjOIZ5EQv+mPJcXiKX0Fq4Q7ChwmAlVw5eKwrOnmib8=; b=OS7WBG0c8TQ9K4UQDDJuqtfzys+33+GL1RxqUhBJH2sW/XbLnpl0ryedBAYuXnZg70 o3n1e/ePMy9dfwQRMzC+BKTJ3MB13b2qwkWTPTH7lEepkdoNK+5kpCLZBBgmxMZV6TGm pdMwm4fBcM/xR1em6iBn92J0KlcwI1cPGcW/WeRlZ7KOnCTEyHpTFFGjTIq58OE/1HZc pMQICVWvYCYoPGfv3Edl7Ik3xI5YBQugA7hSNRay8/E1UT0n7FItJmvfDbIMT3Ot6uy2 31gPHjrd+qpVj/J69s5Ld6cvWcj/ZEspHXx1SppSc19Cwdk5dtLVtFDIpcMwmM3wAaQ9 mo5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214123; 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=VjOIZ5EQv+mPJcXiKX0Fq4Q7ChwmAlVw5eKwrOnmib8=; b=RLe/M2i4RH8+DbszhJITYq54JPNt5hY3jfked82XMivlZhDhxSa+xNhQqf6XqSWnDh 2AnLtK23HFRq3B7rnA5TJWHyxdnB00uri4Vq2UDGxOip5s4FgK9YKE3/K5CEJHc/Wzdd krXn4mNg1+ZvFSs/7BbZxcyUwYmmg54d/oBGwS4I1utMLBR0g/exRA42TcSs2NSs79AB KTwhq1trQ6H2RmZbUub4qit8J/hz+pE42qrqzB8O31tsGz0mf9Bbw4ldnYFEsH+g9SxC VhF13G8Cv4GHNmqUnU4EbLnocQs0aDvxLkocYPx9q2ycL0xWb5HCOEqJLbEaENECntH7 OR6w== X-Gm-Message-State: AO0yUKWEZ6fvdozXIqcMrIIGqGihqRn3MQiACXThbXEcWpEJscupKy2m AxKNlZefJBsxL1DfAiHbDj+ULpdTaJeAEc/iOBA= X-Received: by 2002:a17:90b:1b0f:b0:233:ce0b:8655 with SMTP id nu15-20020a17090b1b0f00b00233ce0b8655mr16117964pjb.28.1678214123437; Tue, 07 Mar 2023 10:35:23 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 24/25] tcg: Drop tcg_const_*_vec Date: Tue, 7 Mar 2023 10:35:02 -0800 Message-Id: <20230307183503.2512684-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-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=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 Replace with tcg_constant_vec*. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- 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 00c4fbe613..d620012c48 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -999,10 +999,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 4060a35cf6..4444eb9234 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 Tue Mar 7 18:35:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 659830 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2540949wrb; Tue, 7 Mar 2023 10:37:02 -0800 (PST) X-Google-Smtp-Source: AK7set8dn3E4u+VoVfe4gOY0EbEULEY4DXtCB2YzeGBrmZ2gLjEMIIkdl5/5unWQwibTnXoFpNEU X-Received: by 2002:a05:6214:27e5:b0:56b:eb95:9a52 with SMTP id jt5-20020a05621427e500b0056beb959a52mr20137759qvb.15.1678214222344; Tue, 07 Mar 2023 10:37:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678214222; cv=none; d=google.com; s=arc-20160816; b=CzavMcep5KKHEvLhaERS1PYTdKY02eQAFW4dAYm0kHgnSgMkqM2crkuCE+8qC6SKHE vCw+2HnMKKDPYFiIJ9PzSZwg4C0K6pVkK+rvbl8ohavVxsCwko3y0HV9MA+fS5o3zOi0 +xwzV+l5BkbdoDKSYKjhk/pOZbIJQt26Dy0SIV/V6o4mDkBUef1oS/TGaJ9T60IMiQsj S0uDcp49u7e9c0q5XT4Bncveks/m4tApwDogkswIB0QjGZ9GfFzeuY3y6f15jm14amuC uaw4z+LnCHUYGt775B90q0mh2jbMN2N5fWX7NoLAcUoLBaC/iG8FBx0uKWTGYJIhGnhn 9I4g== 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=XyxL9T8UjZxQ4CAYfGW8p+3sQmOt2OC3gGYPJjY7kcM=; b=qMYVCYZeBZlOFB9wbk3H07QWtKGBPtXnhc8bWwELajRYTLTkWvXIxIzsBDp/sGj/im Do63IwjAuV8whK6EbtYC0C8Oh/KSPVr6ikh9xxjn9g3nNpjsGzJLEfnOj0BhVog+rxvg yNYc+DqygWrejTm8687t5KES2dBFBe2n8EzPmQu0WXK/K5bLZ2tISx5IswIs+rHVPiHJ K6sE1y+zhGVTVrXsWD/ZhF/cvJk+SZHz+PNJikg1LnyjqXPZEDuo8qIYfpQTf6etbEpE lfA6LN6uKkRMiLM8kGrCrX6+tOuXCImDVzJobtRD2DhKaRwmuC4hqy9Les9P9CYieBQc PRGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lB4KlHso; 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 f186-20020a37d2c3000000b00732f8b09521si9522292qkj.663.2023.03.07.10.37.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Mar 2023 10:37: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=lB4KlHso; 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 1pZc9o-0003qC-10; Tue, 07 Mar 2023 13:35:28 -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 1pZc9m-0003p2-KW for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:26 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZc9k-0007nq-UK for qemu-devel@nongnu.org; Tue, 07 Mar 2023 13:35:26 -0500 Received: by mail-pj1-x1032.google.com with SMTP id qa18-20020a17090b4fd200b0023750b675f5so17432342pjb.3 for ; Tue, 07 Mar 2023 10:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678214124; 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=XyxL9T8UjZxQ4CAYfGW8p+3sQmOt2OC3gGYPJjY7kcM=; b=lB4KlHsonoaXbms8du1y0UkntDeDsFHTwJYemIHSuNZKijdk6JsetMPYsDauhxghv9 m5e4KJbRvczGt2EMXAujKDCLpJUFTimJhx8uhQaXWoKPbPPvRkYl1mKj7If/7y6D6FMD vf4Pa20npeAaWXiBHqH5pNAZxiJ++W/4VUEAbnlClFDySW4aKJTR7lxXeKLpwBTmZGGr 0QwOdRG/JU+qa3oGScXylzdCZXQWwBIAqW/8l8AgUItBkiNfXJRxE51Mu99OQT9PuQsQ 4bmEkbVeTM4J8jC3QroEZGuf8+wiw0CnpVK+flCheG0kyXIUVDu3K/yO7rc15nXgo7LD 1mUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678214124; 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=XyxL9T8UjZxQ4CAYfGW8p+3sQmOt2OC3gGYPJjY7kcM=; b=a8ehRb8r5FwFNqv0J52rKsTmXsFqU1IO4h3HpPLAScC7JvoVeytFAdZ7EolE2IITql IUSpV4TuYj1EtjcQgXLbRzIJDtakj14lCMHBMEkrWNvsLTJI3bQ/CeMoNDK5NsHT2fet lxpgS4Fi3vGn0OT+oR04uWPKk6WuNdIhzutW2fKnQqsy9FHQWR0fE2ctx0bGJZEBfWMA 7HZRjwW6/kn0CP2G6vCW3yH7WHgmgS1voGhprlJKtcnVbV1DYqrHJlDx8kOMriDrhPX2 d7fHrgAXMFfvyXAUZ+lt4RP1lrijx6hVylRIiewIM3zLoWCWD8eHArJ03xDGeRXyAC4g XpCw== X-Gm-Message-State: AO0yUKVi6stOcBzClndJJZuLcSy21PupkW8ivo39gXr4wkB3i7x4e/pX RQoKj1ZpZQEeQlFFKix74z8aXE9qIqOLypgVJXs= X-Received: by 2002:a17:90b:3883:b0:230:1acb:191f with SMTP id mu3-20020a17090b388300b002301acb191fmr17254853pjb.32.1678214124184; Tue, 07 Mar 2023 10:35:24 -0800 (PST) Received: from stoup.. ([2602:ae:154a:9f01:b1e0:bfd9:8b1a:efeb]) by smtp.gmail.com with ESMTPSA id q1-20020a17090a1b0100b0022c0a05229fsm7757940pjq.41.2023.03.07.10.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 10:35:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 25/25] tcg: Drop tcg_const_* Date: Tue, 7 Mar 2023 10:35:03 -0800 Message-Id: <20230307183503.2512684-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230307183503.2512684-1-richard.henderson@linaro.org> References: <20230307183503.2512684-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 These functions are no longer used. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- 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 70856147c5..dff17c7072 100644 --- a/include/tcg/tcg-op.h +++ b/include/tcg/tcg-op.h @@ -1089,9 +1089,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 @@ -1205,9 +1203,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 d620012c48..5cfaa53938 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -996,10 +996,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 @@ -1021,10 +1017,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 d2993826c8..bb52bc060b 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1445,22 +1445,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)