From patchwork Wed May 1 05:05:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 163205 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp4135413ill; Tue, 30 Apr 2019 22:29:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpv/S8gZQwv6c0jzIZU/Q6vZGkUb8vRE2Cj02wzEKwKuRdIQjSqme3+F+Tmq+l8mubW0Oo X-Received: by 2002:adf:b696:: with SMTP id j22mr27760331wre.85.1556688550096; Tue, 30 Apr 2019 22:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556688550; cv=none; d=google.com; s=arc-20160816; b=OUgyTPbGr4JFnT7v8aSe936mqHYwzS1T5XmJtSQTqETBoop63XTGowMa677BPxVTCV ix1IymTPghbqej6Ddv1vKJId7wtR2hX/keROs3yMMSIoN6S8wkTDAOLoPc4VTRrIx5K/ Rt96wI0LOYw/Rl2DCDY530rt6eqxVlGmhE+8arQVeFxLLJTFT8e/R73Rq9fIcuHiL5cE FF4VPWGpVWxEpWRHoaZmgPGZYjQS0In0CIdCeqZ8f0gahTsSxyWArim7+av4wr0FNRm0 ktqHFQuYsgWkmMltJoXXiueR7SMAZXCCxAx50FkAaB26qKZ4nVqoNqHl2leAsLmpzusO 4KZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=a21zCVCqlzAtHHyCClfYkOw1IN8eWmtRYOfzkfNSAPM=; b=wnRuVcFddzLGYQJARwwRJv6UEWhUXwz9JERDfuRZgMTd91FPgex1GAq9oU0gG/YcDk kmeEyvXlvB9oDYGLpdf/O4WwfaqEWHDRN7PiWUb3ddraja+59fpfaHenl9tDd+j+dGXo hxj2fczF5kPrF6elhkvYsUR7MzwImVDLbGWXWV8HtmmAWysFgifnpIH5GonHMfEz6+r5 Kzu4xOmwQudka2PBL/Koiik4ttLnZIG5zOKZ0OQ60bsMlIr9A7MEQe7IyYED9QrMJc78 EXyJ6MNB836TarBFYeiwbcpkxVl1GZ029PI55eThozcmAduNX6VVIEjN/yxtFqejIMJZ 4qOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lI+ZCsSC; 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 x6si26865308wrw.188.2019.04.30.22.29.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 30 Apr 2019 22:29:10 -0700 (PDT) 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=lI+ZCsSC; 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 ([127.0.0.1]:36655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLhnp-0000YS-2Y for patch@linaro.org; Wed, 01 May 2019 01:29:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLhRn-0006mf-5N for qemu-devel@nongnu.org; Wed, 01 May 2019 01:06:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLhRk-00036B-4k for qemu-devel@nongnu.org; Wed, 01 May 2019 01:06:23 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:39747) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hLhRj-00035g-Uv for qemu-devel@nongnu.org; Wed, 01 May 2019 01:06:20 -0400 Received: by mail-pl1-x62a.google.com with SMTP id e92so7750733plb.6 for ; Tue, 30 Apr 2019 22:06:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a21zCVCqlzAtHHyCClfYkOw1IN8eWmtRYOfzkfNSAPM=; b=lI+ZCsSCRXehjcQIaioXtGb36Bh1J7W4lYamcvkF6MGQM0OCr4osxnh4lQ6zoj22Mr LMuq8PUhEJD0nTjBd30SvLPhV8fcS2nqPZfkdkDCxtLYJdUk5vl+kua/PjIpTsvR7mX5 wPERvQ+V3FKVXHo9vSLNiBPLWPHYguF8HCIhiY3J9iuZQm5SF+rh5bWuJBkpVQNu6Avt OvfveOpBJdMnXFO5Tk59FXnttk3upPNSDhsnGb/HDk3PIDZXoeGMbFL4iZs8V/fSVHpa fDtT/VV9SIpsolsIUYL660lFtsgCvV1qAAYKyip1M82f8LL+cgIr6srnSy8PUsvke+Kl cplw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a21zCVCqlzAtHHyCClfYkOw1IN8eWmtRYOfzkfNSAPM=; b=TCjCbPBwUN1Kt5oL6bzC9jxR56IwCy1yhEKlJv/Mzuvmqj6NaGjzxhq3OItYbsffln IGrwCzFsfUp4EaX0xdzyMznlyu3uVO3SUhiMN2J/m8wx59f+ibbdfW6hYm3W3e4WN1iK EtUmUz8zvMG1eA8HTULvNibTRsSlXJHKC+d9avcgeGDpyTsIagsBt4x8ZNUS5yg6E52/ pb2blgsnLa62TcXkFaN4ozWibHCqhTK0isDV40eMSz5+hFz/5NGm9lkfuuF/YEHj9Sym rIo65/Vyg75l7l0ETnAftwnXp+Hhv/STmfEF8tzSGkdyi3wzmnnS50/6ywvhv25YFPM4 Ut8A== X-Gm-Message-State: APjAAAWDWDcF4EfBKZezTqFo8C6V1Ji6L0fJOrpNJdTx8sdZEFFRHYo3 G4aHY9lGVP+Azy5CyJWTvUhT00HPDKo= X-Received: by 2002:a17:902:4101:: with SMTP id e1mr77183560pld.25.1556687178692; Tue, 30 Apr 2019 22:06:18 -0700 (PDT) Received: from localhost.localdomain (97-113-189-189.tukw.qwest.net. [97.113.189.189]) by smtp.gmail.com with ESMTPSA id t127sm9687251pfb.106.2019.04.30.22.06.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 22:06:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 30 Apr 2019 22:05:35 -0700 Message-Id: <20190501050536.15580-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190501050536.15580-1-richard.henderson@linaro.org> References: <20190501050536.15580-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::62a Subject: [Qemu-devel] [PATCH v2 28/29] target/tricore: Use tcg_gen_abs_tl X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Reviewed-by: Bastian Koppelmann Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20190423102145.14812-3-f4bug@amsat.org> Signed-off-by: Richard Henderson --- target/tricore/translate.c | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) -- 2.17.1 diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 8f6416144e..06c4485e55 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -2415,11 +2415,7 @@ gen_msubadr32s_h(TCGv ret, TCGv r1, TCGv r2, TCGv r3, uint32_t n, uint32_t mode) static inline void gen_abs(TCGv ret, TCGv r1) { - TCGv temp = tcg_temp_new(); - TCGv t0 = tcg_const_i32(0); - - tcg_gen_neg_tl(temp, r1); - tcg_gen_movcond_tl(TCG_COND_GE, ret, r1, t0, r1, temp); + tcg_gen_abs_tl(ret, r1); /* overflow can only happen, if r1 = 0x80000000 */ tcg_gen_setcondi_tl(TCG_COND_EQ, cpu_PSW_V, r1, 0x80000000); tcg_gen_shli_tl(cpu_PSW_V, cpu_PSW_V, 31); @@ -2430,9 +2426,6 @@ static inline void gen_abs(TCGv ret, TCGv r1) tcg_gen_xor_tl(cpu_PSW_AV, ret, cpu_PSW_AV); /* calc SAV bit */ tcg_gen_or_tl(cpu_PSW_SAV, cpu_PSW_SAV, cpu_PSW_AV); - - tcg_temp_free(temp); - tcg_temp_free(t0); } static inline void gen_absdif(TCGv ret, TCGv r1, TCGv r2) @@ -6617,13 +6610,8 @@ static void decode_rr_divide(CPUTriCoreState *env, DisasContext *ctx) tcg_gen_movi_tl(cpu_PSW_AV, 0); if (!tricore_feature(env, TRICORE_FEATURE_131)) { /* overflow = (abs(D[r3+1]) >= abs(D[r2])) */ - tcg_gen_neg_tl(temp, temp3); - /* use cpu_PSW_AV to compare against 0 */ - tcg_gen_movcond_tl(TCG_COND_LT, temp, temp3, cpu_PSW_AV, - temp, temp3); - tcg_gen_neg_tl(temp2, cpu_gpr_d[r2]); - tcg_gen_movcond_tl(TCG_COND_LT, temp2, cpu_gpr_d[r2], cpu_PSW_AV, - temp2, cpu_gpr_d[r2]); + tcg_gen_abs_tl(temp, temp3); + tcg_gen_abs_tl(temp2, cpu_gpr_d[r2]); tcg_gen_setcond_tl(TCG_COND_GE, cpu_PSW_V, temp, temp2); } else { /* overflow = (D[b] == 0) */ @@ -6655,13 +6643,8 @@ static void decode_rr_divide(CPUTriCoreState *env, DisasContext *ctx) tcg_gen_movi_tl(cpu_PSW_AV, 0); if (!tricore_feature(env, TRICORE_FEATURE_131)) { /* overflow = (abs(D[r3+1]) >= abs(D[r2])) */ - tcg_gen_neg_tl(temp, temp3); - /* use cpu_PSW_AV to compare against 0 */ - tcg_gen_movcond_tl(TCG_COND_LT, temp, temp3, cpu_PSW_AV, - temp, temp3); - tcg_gen_neg_tl(temp2, cpu_gpr_d[r2]); - tcg_gen_movcond_tl(TCG_COND_LT, temp2, cpu_gpr_d[r2], cpu_PSW_AV, - temp2, cpu_gpr_d[r2]); + tcg_gen_abs_tl(temp, temp3); + tcg_gen_abs_tl(temp2, cpu_gpr_d[r2]); tcg_gen_setcond_tl(TCG_COND_GE, cpu_PSW_V, temp, temp2); } else { /* overflow = (D[b] == 0) */