From nobody Mon Dec 15 01:44:49 2025 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1677485917; cv=none; d=zohomail.com; s=zohoarc; b=EFWQT7ilXmtE8TFv3PbDNcXsh7xoC96WJC7x2wQepKqa/Bnw6Z6jDW/7JycLjd9OwtzKCEFUAEe9SURCvAatMHK2RPaV2uF4Exr7fun2XGQxo72WkDy/34eH79W9Cl+Kd5/2ccNmwVRIHcpFd4ZzQzQ1HrjUheT8VMIC7K68ss8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677485917; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=G0WkLijhWCE0+Z/H5Y1BqFs6QzftCoo9iI0aU6IJMxw=; b=luFM+Mbqd7d/1PQgwHJWT7YoRx7yFPmibICTmqh8OEBeEhcABa938ekfsRDlyQcTP2CFiBahzRwPmxowyybJ9ZXvJUE95GoTYZZiG3MD6GyEQAChnRxvkhHK3pvkvWBBAR5oVFC1CXN+EIuo/eu1qZj0bBYtMUco1F8QRCJGUrY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677485917569695.6052517045082; Mon, 27 Feb 2023 00:18:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWWOG-0008AO-Pk; Mon, 27 Feb 2023 00:49:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWWN4-0003Re-Hk for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:22 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWN1-0007Kh-HW for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:48:21 -0500 Received: by mail-pj1-x102b.google.com with SMTP id gi3-20020a17090b110300b0023762f642dcso5046025pjb.4 for ; Sun, 26 Feb 2023 21:48:18 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id im16-20020a170902bb1000b0019a983f0119sm3553986plb.307.2023.02.26.21.48.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:48:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G0WkLijhWCE0+Z/H5Y1BqFs6QzftCoo9iI0aU6IJMxw=; b=qTLINJSMwcZZs9C4/WJG0zmh82SMhiY0ddaX7junmta3NiQCD8f3b1pA1wfV+fNn3E 35frLUBGbrxCVAiRROv5B1CBaA9kkJXZx7l31R8KLrMunmao3MW5/ty1njnXiCacDPDK oAEEy1XppUpv154kHIxRtXdu44Qdik5A266WG7AU+rjaXGUAlmyouH+MU4QqFHdwj8z6 /dxFmFBOJtJaPG5pa05VRaAFQ0FiCQmrPtJO9I5GHfzwIPD/rWIunrVwp6k8Puhqrwjn W/0bbzRZAjS8hB5UxSt+XLdxMTINBO+x4pa/8JNGGSKLviIWGOiUJ2n/udU9TuCNyKzs A6aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G0WkLijhWCE0+Z/H5Y1BqFs6QzftCoo9iI0aU6IJMxw=; b=Fh7eWgV5XvQNcn/tfRAF8jGuE3QkbRDwxA1gR35mX1Vu+tvG0Lp50uKgYZOwEvdIRd HRNCr/Ls3FFBvAejvSc24ihTx3BMDYIlF+eCv35P8Sr8gtchZDNA8ziel2Z1aRpjLG/X ioSxQUSOPvx7u2mRAfrK2DWs0VzGvZ3ocpLPdLcV6TMv7yIG/u/52aL1fALWY36841ck RQiEP1X3tIW2FcNu1TG+W771WUpmPMfz26lkaGdyWO7nmJ2XDNwDRP/eNk3J9u1mPUUS VmisDW4GQ80eg/IfzVaojBpnH2lvafj1kRSn/tc6JwxvZ+aH6eMk3S7nq64JApYyHxqY qS2w== X-Gm-Message-State: AO0yUKX/EJ/GV8fSk6TijFAjj8RZZIwz22H2ajOWm0MFhCMQ8y7BS2uK BMWyI4EZIJOLVaTKqlw6WK4KWIdYx9ZGOHb8/mE= X-Google-Smtp-Source: AK7set8e0GTXqFP0MZyxwsquo/HGWHe4ycU9m16shFTivxUWk7OcDo1Q9/HqH3KwNMuch/BtDP6XlQ== X-Received: by 2002:a17:902:ec90:b0:19a:e762:a1af with SMTP id x16-20020a170902ec9000b0019ae762a1afmr7575732plg.33.1677476898459; Sun, 26 Feb 2023 21:48:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, jcmvbkbc@gmail.com, kbastian@mail.uni-paderborn.de, ysato@users.sourceforge.jp, gaosong@loongson.cn, jiaxun.yang@flygoat.com, tsimpson@quicinc.com, ale@rev.ng, mrolnik@gmail.com, edgar.iglesias@gmail.com Subject: [PATCH 58/70] target/tricore: Use min/max for saturate Date: Sun, 26 Feb 2023 19:42:21 -1000 Message-Id: <20230227054233.390271-59-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227054233.390271-1-richard.henderson@linaro.org> References: <20230227054233.390271-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1677485919573100009 Content-Type: text/plain; charset="utf-8" Use tcg_constant_i32 for the bounds. Signed-off-by: Richard Henderson --- target/tricore/translate.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 19cf4b6cc7..d5129f22f5 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -2442,21 +2442,13 @@ gen_msubsui_64(TCGv ret_low, TCGv ret_high, TCGv r1= , TCGv r2_low, TCGv r2_high, =20 static void gen_saturate(TCGv ret, TCGv arg, int32_t up, int32_t low) { - TCGv sat_neg =3D tcg_const_i32(low); - TCGv temp =3D tcg_const_i32(up); - - /* sat_neg =3D (arg < low ) ? low : arg; */ - tcg_gen_movcond_tl(TCG_COND_LT, sat_neg, arg, sat_neg, sat_neg, arg); - - /* ret =3D (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)); } =20 static void gen_saturate_u(TCGv ret, TCGv arg, int32_t up) { - TCGv temp =3D tcg_const_i32(up); - /* sat_neg =3D (arg > up ) ? up : arg; */ - tcg_gen_movcond_tl(TCG_COND_GTU, ret, arg, temp, temp, arg); + tcg_gen_umin_tl(ret, ret, tcg_constant_i32(up)); } =20 static void gen_shi(TCGv ret, TCGv r1, int32_t shift_count) --=20 2.34.1