From patchwork Sat Apr 20 07:34:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 162578 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp311947jan; Sat, 20 Apr 2019 00:57:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRFL9uEJummDudj2rYbbEMmliLwdKxJJysGuXALL1pLDcyX0waH76vbbaGWS5wm3n/t78B X-Received: by 2002:adf:fa47:: with SMTP id y7mr6153059wrr.27.1555747075484; Sat, 20 Apr 2019 00:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555747075; cv=none; d=google.com; s=arc-20160816; b=xM1OvArCKJl3I/U1VstMxekulO9bmNuNQoxmkILDHp2EUWYLUuetrgYod9joDMMZLm crYhxeghE4eaJZbgzibBnizhoifiH+jWDvoKpE4pHgpjLqeoKPOGV+I8lwDRttwDDtEy cYHAzygsw8ZVzYDaaWouNtHxeLLrLww+ZlB61i5u1M7LRz7IpVv4/z1ZznE2URkZeAdt M9pnKHfwYOM/y2lEx7yfQUlUks2E8b2Tc0G5yTC7qqhW7XGLxUzhO5GQE08bnsKeQ+wx JO30oc02eVKgQOygDQobR+qgKtLj0fahd0g/RPB1ZA5Th17Fqc1Ja8qnDJH1bIPJav4a AwFQ== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=iaXmBLRJ4AetvIw8U8LEOO46+IUqp272JP0xIL80EUs=; b=muYLc1w5ApiMx57ko/kESPp4qEokbK5IBFfZJJtAp6qAq+na1uic5roUxP6JaGPgOh Y6enko0FKjmFP4a9tst3l74r0VolBLt3PC0bbQ2/gYNt/FpX03O+V2j77Vu9qigp1q0B lN34d+iXg2CItecQcGYmb1q5jb3DlULYMYNpeimUd4ac8DCex38mUinACtyuk527h+EJ WZIy3JZKei0AGMTtno7NCo2UGJcw/pV/avFk2YMJxGUDwulgN58erIxeltqMYf6aOAVx ntU0si85+4zGEr8LI+4NvlQmf5q38gbsVOKIVTkACpwTEorlg7PKwEVm3Qa4ohBDCf1i lJFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gOoNgjHu; 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 d21si5259101wmd.85.2019.04.20.00.57.55 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 20 Apr 2019 00:57:55 -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=gOoNgjHu; 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]:38381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHksk-0002te-Gj for patch@linaro.org; Sat, 20 Apr 2019 03:57:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHkXN-0000uN-Rr for qemu-devel@nongnu.org; Sat, 20 Apr 2019 03:35:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHkXK-0000Ve-3u for qemu-devel@nongnu.org; Sat, 20 Apr 2019 03:35:49 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:43449) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHkXI-0000Jh-7g for qemu-devel@nongnu.org; Sat, 20 Apr 2019 03:35:45 -0400 Received: by mail-pf1-x441.google.com with SMTP id c8so3458979pfd.10 for ; Sat, 20 Apr 2019 00:35:40 -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; bh=iaXmBLRJ4AetvIw8U8LEOO46+IUqp272JP0xIL80EUs=; b=gOoNgjHukeRlvISeBnypWZmGThCjrKpAFA9VJde2eH4r3h58nQRzbELCV2hG/LMJXa VxwKP2n0q9gt5YlgVBLzmrrNPnglROvKNvkPimOAudF2fQP8Q9o2K0EN9aS1RtoOEUPY R6KR+lNyg6hwtFsloSPiti1L3tqfg3OpcDtS25TH7VS6nUyKd1TnuxWZYwuPQs7vX0i7 m1GaIVUljizfwxxzTJ6YMT5fOG1eeYUETuKg9Ynn4yOP+0FKhNH4M3Jv+KDuaxqVtDCt 9HEtgTMDk3nKSCwGXXyV//3nsorkXQR6ybwmz25dq10y3jgr9iKD9YqdFgKNwK1sr0Qi x4gA== 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; bh=iaXmBLRJ4AetvIw8U8LEOO46+IUqp272JP0xIL80EUs=; b=JeK64MMKrYutltM/uG7DSaLAt27Dg/weI/pt9CAqRZQgm4vUNF6Lmt+EUZQFb8TwR8 GgnJaVRKySv9P0+iornc7kJkqC/6xkh2zDtnAMwtjyfXkuD6Kow8OQGoLb6/XRHjqyq7 I8/1qgB0O5vpoCVsITjmG2xL0JPIE4tByaTL0A/1hGwGrt/iFNqru9mNYSLwf9rkI8Om enb5uT4N1DdfreYSMsPkL5nKhb/F4MyL6IMvSpf2La2d0I2JcbuGYc0txx09DAH3TZ3m dweoI4U1kpOqNQY1JehBP+mzwjgdFnT32ZH/VpMzj59W2gmPjQ6ME3o4Ut0Kl44JG2Mn LJkQ== X-Gm-Message-State: APjAAAWoW0hpmLm8plqZ+j7K5R1Vi8yFf6W1S/d4HOZJhM7eMxssi/9N 8RAnLRsMCvnntj0t3Aq9cl65NqfI4qk= X-Received: by 2002:a62:4115:: with SMTP id o21mr8453186pfa.153.1555745739569; Sat, 20 Apr 2019 00:35:39 -0700 (PDT) Received: from localhost.localdomain (rrcs-66-91-136-155.west.biz.rr.com. [66.91.136.155]) by smtp.gmail.com with ESMTPSA id z22sm7025492pgv.23.2019.04.20.00.35.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Apr 2019 00:35:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 19 Apr 2019 21:34:38 -1000 Message-Id: <20190420073442.7488-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190420073442.7488-1-richard.henderson@linaro.org> References: <20190420073442.7488-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 Subject: [Qemu-devel] [PATCH 34/38] tcg: Do not recreate INDEX_op_neg_vec unless supported 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: david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Use tcg_can_emit_vec_op instead of just TCG_TARGET_HAS_neg_vec, so that we check the type and vece for the actual operation. Signed-off-by: Richard Henderson --- tcg/optimize.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/tcg/optimize.c b/tcg/optimize.c index 5150c38a25..24faa06260 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -734,9 +734,13 @@ void tcg_optimize(TCGContext *s) } else if (opc == INDEX_op_sub_i64) { neg_op = INDEX_op_neg_i64; have_neg = TCG_TARGET_HAS_neg_i64; - } else { + } else if (TCG_TARGET_HAS_neg_vec) { + TCGType type = TCGOP_VECL(op) + TCG_TYPE_V64; + unsigned vece = TCGOP_VECE(op); neg_op = INDEX_op_neg_vec; - have_neg = TCG_TARGET_HAS_neg_vec; + have_neg = tcg_can_emit_vec_op(neg_op, type, vece) > 0; + } else { + break; } if (!have_neg) { break;