From patchwork Mon Feb 27 05:41:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656931 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2231906wrb; Mon, 27 Feb 2023 00:26:05 -0800 (PST) X-Google-Smtp-Source: AK7set+1efT0iN6ZaX6PTm6d+kGyWZDRJYemBky/frFxo5f5AEM5LxtUhXr3e+as1SI7GQRmwSNr X-Received: by 2002:a05:6214:da4:b0:56c:659d:435c with SMTP id h4-20020a0562140da400b0056c659d435cmr42438851qvh.24.1677486365174; Mon, 27 Feb 2023 00:26:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677486365; cv=none; d=google.com; s=arc-20160816; b=b0mkzaJ4wOBaTG7HkiZjcH7BcCjTVRXf58gclM+h7cZ17xOfbU5XQfXTZDlmmEHN7l 712cK8CbcbAqSJiv00MI4WmUBH3UNyw8h+xIzt6h4xe0/hChTOPwdPRh2MhKBTD37FYN g+DkR33awrOjZOIJjLjeGPbXOuhLm/s/SWgXNtejdAz7/GnMjgVkoeqA7DYTiu0uxfCp vkA3XR1VUD3vBaA7O5RsZiw9rukrI572hZQg3HqKRT7xlkUy+5Oo1rTG/O//ks/GEWtS 7NRhL2E5BZD36mVTmWwea16QfnEneE923sfMYsnhnFIOYuj/paFD4UTxfVE+s3BxTb6/ XGsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dFwp7rJLT3ezFoTtdpkm7g7WVshe2Fl4tPXf7GfT8CY=; b=hT64QL/2pfaOvqxp+U6MD3yH+VUhUYfTKX5o8MJqisd4gc4A712bM1eN1XpO7gyUHX 3BRTsJ9bku39FJ/UfqPoIr6ql66EVkzLG0odQOn7PkLFzSO/mMyLHS4DExJTcH2s3ryy 8iyzKOvMEGLgJiPlvgjKnRHZfBVfW7BraNvJO3O1brBHY1+TfptW8FVNRr0itdZgQvRU +JzavqyNW9qglR2WhRj/sv5S5CTpxiD7O4NXP0eZ0omLvDF4LTTxYd2ji+B2H3i1Lc24 BRAIHnRXRc/uMGOWSnwMZ5+vIy7LubQJWusLXh4pP7scgeoI6Nxl28vhoRQ9JIIfuVMN j+Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Xys5m/Bh"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s18-20020a0c9d92000000b0056ee5ebb3c5si5984720qvd.284.2023.02.27.00.26.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 00:26:05 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Xys5m/Bh"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWWIm-0005OF-8r; Mon, 27 Feb 2023 00:43:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWWIU-0004bO-UT for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:40 -0500 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWIS-00057x-W2 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:43:38 -0500 Received: by mail-pf1-x441.google.com with SMTP id b20so2798531pfo.6 for ; Sun, 26 Feb 2023 21:43:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dFwp7rJLT3ezFoTtdpkm7g7WVshe2Fl4tPXf7GfT8CY=; b=Xys5m/BhbJaiCezwG82ZLYx/sXlKRyOWp1V43O+ESWxJ3q7z7L/1IWSXsz/lgCVpB2 I8KNFl3Fu088dUar4wziVBNBRYCKoU3hQV5TH+h90k7dGz6S/tMJLB3XJqDSv8qh/E4f ghr49G7CYMIg+goESjyPWoDAbhfvQq4mCgU1R9EPILtsWX/UcB3oBtFaILFttPoHz+sY TMEHDTSYROdZv8CIOiqtdgN0wOHReaW9Y+WFNprr4rrDSCnOV9CTtkKDMxTEfvM45a89 97D1MlecNJU0s/ZlDE8qVbvid6Z0MBRFJLDXUN7k5m586rIVYX1dkRRjtf2eryG8N77y QxLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dFwp7rJLT3ezFoTtdpkm7g7WVshe2Fl4tPXf7GfT8CY=; b=EM3/9tv95qWClcOTubnWKgNRRS6q5QyiSmWdpdlDMfz9YQtm19oUaqRJhdGCla98v0 1S+tnqnzqBCWOLYUSfxVBPtle9UUIX5gkvQR0G6gaRdapeLXMPEoZevCbT+NmepdqzAi ilatXD4qD9uaoOv0N2ng6bvO4qwOfd8Ujl3Ia2qknf2r3X6qdFd74CDjjKu3hcGkfupV /j+PwKxXY088hIHNeYMP3HulTcEvFZvh5HWO0bwSvE3nKmaEKUxGUeGfNUnyA0SSGJIK 6iOOJbm+QDVFzeQiWIEEJmqaGvhpjzQE9ZPw7Uy+YiLsXX8/dKIp5laZQ/4WpBAbUcQO Lh/w== X-Gm-Message-State: AO0yUKW9reZRk+YR/ucdlLq98M++vNRgyKgW0Ql48TNGK+uDcsJc5heU 9maRcHT14790rvmFcUF39fy8ZMOfgBxyjTPpVCmxCA== X-Received: by 2002:aa7:9a1b:0:b0:590:921d:5740 with SMTP id w27-20020aa79a1b000000b00590921d5740mr20538709pfj.13.1677476615305; Sun, 26 Feb 2023 21:43:35 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id d10-20020aa7868a000000b005cdc64a287dsm3317137pfo.115.2023.02.26.21.43.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:43:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, jcmvbkbc@gmail.com, kbastian@mail.uni-paderborn.de, ysato@users.sourceforge.jp, gaosong@loongson.cn, jiaxun.yang@flygoat.com, tsimpson@quicinc.com, ale@rev.ng, mrolnik@gmail.com, edgar.iglesias@gmail.com Subject: [PATCH 19/70] target/hexagon/idef-parser: Use gen_constant for gen_extend_tcg_width_op Date: Sun, 26 Feb 2023 19:41:42 -1000 Message-Id: <20230227054233.390271-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::441; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x441.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org We already have a temporary, res, which we can use for the intermediate shift result. Simplify the constant to -1 instead of 0xf*f. This was the last use of gen_tmp_value, so remove it. Signed-off-by: Richard Henderson Reviewed-by: Taylor Simpson --- target/hexagon/idef-parser/parser-helpers.c | 30 +++------------------ 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/target/hexagon/idef-parser/parser-helpers.c b/target/hexagon/idef-parser/parser-helpers.c index c0e6f2190c..e1a55412c8 100644 --- a/target/hexagon/idef-parser/parser-helpers.c +++ b/target/hexagon/idef-parser/parser-helpers.c @@ -305,26 +305,6 @@ HexValue gen_tmp(Context *c, return rvalue; } -static HexValue gen_tmp_value(Context *c, - YYLTYPE *locp, - const char *value, - unsigned bit_width, - HexSignedness signedness) -{ - HexValue rvalue; - assert(bit_width == 32 || bit_width == 64); - memset(&rvalue, 0, sizeof(HexValue)); - rvalue.type = TEMP; - rvalue.bit_width = bit_width; - rvalue.signedness = signedness; - rvalue.is_dotnew = false; - rvalue.tmp.index = c->inst.tmp_count; - OUT(c, locp, "TCGv_i", &bit_width, " tmp_", &c->inst.tmp_count, - " = tcg_const_i", &bit_width, "(", value, ");\n"); - c->inst.tmp_count++; - return rvalue; -} - static HexValue gen_constant_from_imm(Context *c, YYLTYPE *locp, HexValue *value) @@ -1120,15 +1100,11 @@ static HexValue gen_extend_tcg_width_op(Context *c, OUT(c, locp, "tcg_gen_subfi_i", &dst_width); OUT(c, locp, "(", &shift, ", ", &dst_width, ", ", &src_width_m, ");\n"); if (signedness == UNSIGNED) { - const char *mask_str = (dst_width == 32) - ? "0xffffffff" - : "0xffffffffffffffff"; - HexValue mask = gen_tmp_value(c, locp, mask_str, - dst_width, UNSIGNED); + HexValue mask = gen_constant(c, locp, "-1", dst_width, UNSIGNED); OUT(c, locp, "tcg_gen_shr_i", &dst_width, "(", - &mask, ", ", &mask, ", ", &shift, ");\n"); + &res, ", ", &mask, ", ", &shift, ");\n"); OUT(c, locp, "tcg_gen_and_i", &dst_width, "(", - &res, ", ", value, ", ", &mask, ");\n"); + &res, ", ", &res, ", ", value, ");\n"); } else { OUT(c, locp, "tcg_gen_shl_i", &dst_width, "(", &res, ", ", value, ", ", &shift, ");\n");