From patchwork Wed May 22 22:28:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164914 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1419880ili; Wed, 22 May 2019 15:40:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyADSuQQ4Plp6W9QUs7RZG71zpPfmCHXrQ1Ri9qsTxLhXAJ+b2SdfLGcFEgah3491TMVmcO X-Received: by 2002:a50:d519:: with SMTP id u25mr94932696edi.185.1558564821596; Wed, 22 May 2019 15:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558564821; cv=none; d=google.com; s=arc-20160816; b=hHFBWxH8EJXw8Vo0SbSWX7Z+10dTa0dwOkAe3sWzuW9cn2ktKUI7K/CX1uYlS/tH6e YTAmBv5rUf3ySUrcPVkf59DKE9CixDp7aJ8MbT9HSbDJl4xA5jHbO53Vfdep6c0bHyic J+VRSnx0L2I7ZXaqCIaDWaJngd8LEuxOnWN06TlV+A/DgWVJb3dZfIQrapoaws5J5ncc 90njC5EeYgSVfHEH24v8DYI1V40cqoovm2r/r/4kWEGwRRxCRzPKa9ZfpF5hTH+1LLTY LfoTJ2myzjtZ/eMVKCeyNrTNvu08Ur6rz6h2RYr4HI9o/FEl3X+yqvf2NYvGZ6TAcgjy 70yQ== 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=5pgxUU1cRl5UBw70ixoMtifwIrAs5XS+sRdx95+Fg/g=; b=uzFZ2YHbBUN65/hLpLUXBhFYlKbpyN3kpioA3bzjsKiI9ItaxyyejSR4Q84/HA2mky IAt6mlNwrmjKAjCJlYzMe3iXVe9tx9ThOTsAZwU1qSk6RXCUQw0QAmuAp+rEPfJliTOc BRl+OR8HPiNAjK7BWVE2iDx33bbuOBdwuX2e+K/5lehe06vclOPVmJe/SJKTHQ8GTNyL 03x82OogqGpi90sD+QL5aMXCrdEmzYrRFvyATZwVTbbIYW6STe+ePD3uDrRGKj1KbM0J obgz0+7P9tsWTgDtlIzwJmy3tl08S3FSK/jpHlJrLiWZpuCCRxE++Tdp+ZmbRKOLnHLc niQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZmIZP62u; 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 x11si983415eju.280.2019.05.22.15.40.21 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 22 May 2019 15:40:21 -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=ZmIZP62u; 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]:52646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTZuG-0003Hq-IT for patch@linaro.org; Wed, 22 May 2019 18:40:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTZj4-00039y-KG for qemu-devel@nongnu.org; Wed, 22 May 2019 18:28:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTZj3-0007Ra-MV for qemu-devel@nongnu.org; Wed, 22 May 2019 18:28:46 -0400 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]:40216) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hTZj3-0007OH-Gt for qemu-devel@nongnu.org; Wed, 22 May 2019 18:28:45 -0400 Received: by mail-yw1-xc43.google.com with SMTP id 18so1484108ywe.7 for ; Wed, 22 May 2019 15:28:38 -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=5pgxUU1cRl5UBw70ixoMtifwIrAs5XS+sRdx95+Fg/g=; b=ZmIZP62uRC6Ro4Hjl4+oNmfrfolZ2tbnvAyoqcrnhf7UpIYjiB5V41dTdBcvTK8U52 ADxdBPTPWBCy6+fy4wPbBTZVQg8V37ey10GzwufBT7VKJensWHWpa0si10K/JO0erTHT 2FXuPF/IW4OPxG/KzH6705938yLQaWG/Atg5/KB5ZIMsROvtCzDklRp79cJiH3Ee72bQ NzTwIiMbesKF57rK+D6Gb7Wl4gJVKRmeqvYHjpeNNqpNV+W1OpgbSQ/PMpfMqeiDCew3 cuWWlUOJF/drjqGM0qYj5KJpMAGQQkudbsWPjaPzpxJuVJZ8sCt7BfMSGXurz0dyMjkm eFSg== 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=5pgxUU1cRl5UBw70ixoMtifwIrAs5XS+sRdx95+Fg/g=; b=GJkgaiyBdxqJJliUap6lyljHnXn2/q8aViDFRwGk3kcOF01BksNBREoXDlUhEjA524 7BP729+L8twAP1l3ST+kktxQ3h6PKuSRm3HDiWQHjbpPUm/mf/BIZeNMr1ivKlQmYF4N oIeRUHBU2SjzwFaY5qB41TdynY/93z2mfYmihPtjj1QhFfwO8vTVyEpXfw6i3VvZqNk1 napQVXQWFJjwte90Lf10EmLOJbuz/g8SF+1ZPQ8m02DhEZBEeu6BJqR4A9lasaY0OMId kaOGaFh5FxBqu6V5xRhEWTrvWf+G3r0A1VPFlYc+UnAV6r2LONjhnl4/CM9f3AM7Zchh GVpA== X-Gm-Message-State: APjAAAXv9aMu5N5gsFF+w85TFSCRu+5ZUj3DJQ7YZNAzanHPlZ9L60eZ TBXiyM5vnxNkuZHFQFidYuNdDT8D4Bg= X-Received: by 2002:a81:3acb:: with SMTP id h194mr42063623ywa.303.1558564117990; Wed, 22 May 2019 15:28:37 -0700 (PDT) Received: from localhost.localdomain ([71.46.56.17]) by smtp.gmail.com with ESMTPSA id q11sm2276453ywg.7.2019.05.22.15.28.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 May 2019 15:28:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 22 May 2019 18:28:18 -0400 Message-Id: <20190522222821.23850-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190522222821.23850-1-richard.henderson@linaro.org> References: <20190522222821.23850-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::c43 Subject: [Qemu-devel] [PULL 13/16] tcg/aarch64: Use MVNI in tcg_out_dupi_vec 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: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The compliment of a subset of immediates can be computed with a single instruction. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.inc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.17.1 diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index 1422dfebe2..0b8b733805 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -494,6 +494,7 @@ typedef enum { /* AdvSIMD modified immediate */ I3606_MOVI = 0x0f000400, + I3606_MVNI = 0x2f000400, /* AdvSIMD shift by immediate */ I3614_SSHR = 0x0f000400, @@ -838,8 +839,13 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType type, tcg_out_insn(s, 3606, MOVI, q, rd, 0, cmode, imm8); return; } + if (is_shimm16(~v16, &cmode, &imm8)) { + tcg_out_insn(s, 3606, MVNI, q, rd, 0, cmode, imm8); + return; + } } else if (v64 == dup_const(MO_32, v64)) { uint32_t v32 = v64; + uint32_t n32 = ~v32; if (is_shimm32(v32, &cmode, &imm8) || is_soimm32(v32, &cmode, &imm8) || @@ -847,6 +853,11 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType type, tcg_out_insn(s, 3606, MOVI, q, rd, 0, cmode, imm8); return; } + if (is_shimm32(n32, &cmode, &imm8) || + is_soimm32(n32, &cmode, &imm8)) { + tcg_out_insn(s, 3606, MVNI, q, rd, 0, cmode, imm8); + return; + } } else if (is_fimm64(v64, &cmode, &imm8)) { tcg_out_insn(s, 3606, MOVI, q, rd, 1, cmode, imm8); return;