From patchwork Fri Dec 15 17:07:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 122141 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp740928qgn; Fri, 15 Dec 2017 09:14:52 -0800 (PST) X-Google-Smtp-Source: ACJfBoto9yZtwlwv1tvKyoZyqgj9J0/lYMnhN/U6vIokU3eBgg0kQg/g8BuNFHGfZeTTFh1HtNwA X-Received: by 10.37.175.146 with SMTP id g18mr2634022ybh.81.1513358091979; Fri, 15 Dec 2017 09:14:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513358091; cv=none; d=google.com; s=arc-20160816; b=xDIudd+Ur9hpXIC4V/ibCnxB0GZINa5Az5nPZXW/BBnzaR1/ZJbKwHOCtGh0BIr7Pf yZ32f8rUEQEjdu38wZMWwAdgCurvzPmaTh0AoTkdW77fiPBsnjoaGxTAsBfnYC14BMTt b3gSaUBu2X2NL7f6uaTgybEFCSiiO0gRDXWusY3Q9YBMYJIkO3zMIxLYHSUCtlVHgz95 ZZIHk6xlxnIzj7W0DU8VRZEVMfvCBJ2JN9kad46nEcn8jNiXBDnTWwpMkK1z5VX5Q7JC ljzWRZDY2cpp/S+6aPh+FV7Yv++6rwg4roogf1x12cCQaeqkquxEkY0stYOIcXXt6JxH UVLg== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=/YlH32H9tYHZq9RETQ643K/J2do610JFBVn7ZN+NgVA=; b=rCi2Qp1h7mzCdCOBUp5JJG1qoRrp3o+WPAmWkgEgpXaALpiBzA/AePZ9YpvsR4JtOw DF7AUL0kJWYlRRkAKVyLa+5H1+gkmYwVo/21nG31y7Z6EZqdh5XT7bnf7NPYSXdhBeBg CR+TOjsiAOO8Wl5Pn38DC8ifMlEImSGlxUbt0avhY/F2fLfmzoSxDwTSap2dogd5C9ZE KcmoynNQQySrMi5yf21qXiWooCbKlrsoAne7mYZQQKeBESuHpciRlPinfQ047T5TyGqO Jz1kilZnbeDj2RfZcJ+xAzwTDoVzLBiq8afDw4gYpQMWjmGDf/difoQj9wJ2nPxnS6Ww N38A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JG3umnsS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k63si1346669ywf.34.2017.12.15.09.14.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Dec 2017 09:14:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JG3umnsS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:47810 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePtZT-0006Zv-Gx for patch@linaro.org; Fri, 15 Dec 2017 12:14:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePtSg-0001XX-LF for qemu-devel@nongnu.org; Fri, 15 Dec 2017 12:07:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePtSd-0002z2-Kn for qemu-devel@nongnu.org; Fri, 15 Dec 2017 12:07:50 -0500 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]:40225) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePtSd-0002yY-Et for qemu-devel@nongnu.org; Fri, 15 Dec 2017 12:07:47 -0500 Received: by mail-it0-x241.google.com with SMTP id f190so20452322ita.5 for ; Fri, 15 Dec 2017 09:07:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=/YlH32H9tYHZq9RETQ643K/J2do610JFBVn7ZN+NgVA=; b=JG3umnsS1VPan+LvmyTa81SQYZJg9++Lhx7gLH/eWPcO525nm7urMMmRxIjI6CYAXG yeyB7+LQ1FpclN1jGUpYTGM+P0QqmwpFs/xpO79Eq3nt034hE1wnFP7sgkgb9fhURAZd lI/BGBG5Qn8sRYMhoHpM53Ug/097jALQ7qxEA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=/YlH32H9tYHZq9RETQ643K/J2do610JFBVn7ZN+NgVA=; b=DaFw3w8jRJxPrT5Gk6DZfzhVmaSyS4lBDCOxO4DDbHfyiayJnVgnjJhIV6WSeP+0Ek y3IrRaV1+VGJlRu8tgGoi0RC2o4nd3miraeTXBAUFUgGsVIqSoYYKo8Z/8ORMxVvGlmJ T/uOvLn7GmFOQM+KTQDFwd4c6ycp/1IF+VoenC4w+Wf3i5ER1wa42tvp/1GGJohr0Wfw JEkxef4i+Y7Mk9PF7lcjKnfFmSeINgvSq/WMCs9S1x+NkzSOj7uAsUXyp8dCaskyd47S 9mgnQe9fO1Z5Ly2vXRByF06Go6p5g0lNaraaQr8IfImCA5Kl5Nn34dIynvT4Q83HEUVm leDA== X-Gm-Message-State: AKGB3mIZ5ImELyINVGsrrPuQqkMiQ7yiTwrzn4VFbAdfWw0bKtk6f0Lh 3eH7iZKduVgTaCDWaKOG79tX7j59FtU= X-Received: by 10.36.206.130 with SMTP id v124mr8925704itg.81.1513357666676; Fri, 15 Dec 2017 09:07:46 -0800 (PST) Received: from cloudburst.twiddle.net (141-126-166-226.dhcp.chtrptr.net. [141.126.166.226]) by smtp.gmail.com with ESMTPSA id k23sm4012974iti.22.2017.12.15.09.07.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Dec 2017 09:07:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 15 Dec 2017 11:07:31 -0600 Message-Id: <20171215170732.31125-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171215170732.31125-1-richard.henderson@linaro.org> References: <20171215170732.31125-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::241 Subject: [Qemu-devel] [PATCH 6/7] tcg: Add tcg_signed_cond 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Complimenting the existing tcg_unsigned_cond. Signed-off-by: Richard Henderson --- tcg/tcg.h | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.14.3 diff --git a/tcg/tcg.h b/tcg/tcg.h index f25efa9795..8c45f7edbc 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -488,6 +488,12 @@ static inline TCGCond tcg_unsigned_cond(TCGCond c) return c & 2 ? (TCGCond)(c ^ 6) : c; } +/* Create a "signed" version of an "unsigned" comparison. */ +static inline TCGCond tcg_signed_cond(TCGCond c) +{ + return c & 4 ? (TCGCond)(c ^ 6) : c; +} + /* Must a comparison be considered unsigned? */ static inline bool is_unsigned_cond(TCGCond c) {