From patchwork Tue Mar 19 17:21:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160603 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp4140862jad; Tue, 19 Mar 2019 10:29:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWmvkGaZQ3FHhdG2cy5iED2P+5ZecFuav5HhXtGEIzGVDs15fbBYJGet0EWko/pP+PoLil X-Received: by 2002:adf:f846:: with SMTP id d6mr18912336wrq.53.1553016542377; Tue, 19 Mar 2019 10:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553016542; cv=none; d=google.com; s=arc-20160816; b=VnIFHHxNbWimc4raXoC9lpOP2eL+vbdPnb7Ou1ZS4UbO8Ks46dimVBMp6og/HYs4Bm DonXr4vQ1O4fOeVUXBX4UbWe3iejIc4FugRLQCoo6AzXYo/gyrOClkOE7kg4H+wwTXSf zuNIpJeBKxA1FGpNfEGcm2/BBzbAhDReSAnXf78/x4VeHNrG/u5THliqJ0UI9Qswzv8H WVYIUFVZw/J+ynpcTzu+JbBcsU9OSpt6Nx6DCSXzL7zSaKGvLJIj9FML2ttIjhimDAQ0 SC9tE0f0xUKw+Ssf++brxK+JrdoFSeerEV//fcEotFt9me2FMhkZXW3gfB9YpLM/jVZu MZ/g== 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=HZlr0Ka3i6hHKffdk3asFuuDEwowOmfTN7aIJMdZHeA=; b=LCcXPWzoptCr2ulvdrwBi/uiteB9vkmLbvcEunv0GSWMZ1AgQHZFBOJOQol/brkyYh oKwGMxDinQFTBE0BBJatICD9oxtXbZr8XJ1Mpjh5lrw84vSNNS2UEIFoyVEwMMFBeg8g K+HCnl4SCcpKPSL8S37lK3V/P8SSTCbn6P7BaHNLbQEe6bBJEdastL0JRBA4kUXlBbtx BRno0zxt4CYw3v3tHgU5sdPcWj8JMdwLS/PR4D1UHWoYKhUUzQG3uDLOfCe6xI9PxI16 SL5mB9zLfExV4KmnVHBaZr5CykUmQA+0gobQBiuakB2dIBiukxJs9MwzAQrpaWbhxbkP u4sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=e5TDsfcs; 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 v13si6732711wrw.440.2019.03.19.10.29.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Mar 2019 10:29:02 -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=e5TDsfcs; 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]:60752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6IXt-0001RS-AG for patch@linaro.org; Tue, 19 Mar 2019 13:29:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6IQu-0004gM-ER for qemu-devel@nongnu.org; Tue, 19 Mar 2019 13:21:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6IQr-0004b7-7p for qemu-devel@nongnu.org; Tue, 19 Mar 2019 13:21:46 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:45688) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h6IQq-0004a1-QL for qemu-devel@nongnu.org; Tue, 19 Mar 2019 13:21:45 -0400 Received: by mail-pf1-x443.google.com with SMTP id v21so14151274pfm.12 for ; Tue, 19 Mar 2019 10:21:44 -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=HZlr0Ka3i6hHKffdk3asFuuDEwowOmfTN7aIJMdZHeA=; b=e5TDsfcsxtbFGKC5ZhfodPRwXiNO6oKcSIEVaEM0dlieRf41SdTvH49nT/dz3ZFUxH zh5+kL7HKwuJaRiZk6xgnHk+lO+U+A63FbGduoUMZ1mKMMt6Q2X1inYKoE3bbszaGPDp gxkXQsAWNR9A7ZbA0Tej+umRwVdKtZUagLAgqGiz7lsFuf3r6jz50Ctyi2EcO5pEfDll x2rk0izz2p4mz0HrnAs86KLaioaBllcsre7nStpn7RYQlzFb1ODHz1D/Pl/hn6fgxtzr hw7/vNh9AlqUybeLDetJlfLwaFpo1Oxm5vLYdW/uSunvveLfUEtu8UsdzRcZ9Da6EznQ elgQ== 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=HZlr0Ka3i6hHKffdk3asFuuDEwowOmfTN7aIJMdZHeA=; b=Z3EXwVDKxYPVQ01bZCWRnVf0goIfdcgVVUYxeOHg6ZIe93GLhZQpXabVG20/+6Hniq RDOrnpochXEz3KbUyDd/LBm7m8ba7jdc9dLnX/5f3ENcAd/pSUJ12uS4Ka9MFJ4CJMdE SVuh/WwoUIlruv5ULthnlf1Gchbhe01b2VQ2IxRsbqc7rsL03uccXexwOnfhadr7/pQi 1GMmB5Ji7CuNNZEqaVzVmSLGVAQFdFpQnt1hVH1NKggB5lTvqT/0onCCHg9ZW+uLwACf s2rowDHx9mbYvuk+F2E0vC8452c+NWFtoqHqJNxwinfX2qOaC6aGxhHFisABSBjJ+27m P2qA== X-Gm-Message-State: APjAAAW+lA6Gfp2zIcXN+bIwzI5Hn4i6NEa00v6tggVjmpQsqHiU/JBU 0noJx0GiwEKRnbE5Aaz1LHCgWJBao7M= X-Received: by 2002:a62:b286:: with SMTP id z6mr2988721pfl.106.1553016103425; Tue, 19 Mar 2019 10:21:43 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id w68sm5616666pfb.176.2019.03.19.10.21.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 10:21:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 19 Mar 2019 10:21:19 -0700 Message-Id: <20190319172126.7502-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190319172126.7502-1-richard.henderson@linaro.org> References: <20190319172126.7502-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::443 Subject: [Qemu-devel] [PATCH for-4.1 v3 10/17] tcg/aarch64: Implement tcg_out_dupm_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: mark.cave-ayland@ilande.co.uk, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.inc.c | 38 ++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) -- 2.17.2 diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index b34a1e5b06..d32e83ddf2 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -381,6 +381,9 @@ typedef enum { I3207_BLR = 0xd63f0000, I3207_RET = 0xd65f0000, + /* AdvSIMD load/store single structure. */ + I3303_LD1R = 0x0d40c000, + /* Load literal for loading the address at pc-relative offset */ I3305_LDR = 0x58000000, I3305_LDR_v64 = 0x5c000000, @@ -414,6 +417,8 @@ typedef enum { I3312_LDRVQ = 0x3c000000 | 3 << 22 | 0 << 30, I3312_STRVQ = 0x3c000000 | 2 << 22 | 0 << 30, + + I3312_TO_I3310 = 0x00200800, I3312_TO_I3313 = 0x01000000, @@ -566,7 +571,14 @@ static inline uint32_t tcg_in32(TCGContext *s) #define tcg_out_insn(S, FMT, OP, ...) \ glue(tcg_out_insn_,FMT)(S, glue(glue(glue(I,FMT),_),OP), ## __VA_ARGS__) -static void tcg_out_insn_3305(TCGContext *s, AArch64Insn insn, int imm19, TCGReg rt) +static void tcg_out_insn_3303(TCGContext *s, AArch64Insn insn, bool q, + TCGReg rt, TCGReg rn, unsigned size) +{ + tcg_out32(s, insn | (rt & 0x1f) | (rn << 5) | (size << 10) | (q << 30)); +} + +static void tcg_out_insn_3305(TCGContext *s, AArch64Insn insn, + int imm19, TCGReg rt) { tcg_out32(s, insn | (imm19 & 0x7ffff) << 5 | rt); } @@ -825,7 +837,29 @@ static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece, TCGReg r, TCGReg base, intptr_t offset) { - return false; + if (offset != 0) { + AArch64Insn add_insn = I3401_ADDI; + TCGReg temp = TCG_REG_TMP; + + if (offset < 0) { + add_insn = I3401_SUBI; + offset = -offset; + } + if (offset <= 0xfff) { + tcg_out_insn_3401(s, add_insn, 1, temp, base, offset); + } else if (offset <= 0xffffff) { + tcg_out_insn_3401(s, add_insn, 1, temp, base, offset & 0xfff000); + if (offset & 0xfff) { + tcg_out_insn_3401(s, add_insn, 1, temp, base, offset & 0xfff); + } + } else { + tcg_out_movi(s, TCG_TYPE_PTR, temp, offset); + tcg_out_insn(s, 3502, ADD, 1, temp, temp, base); + } + base = temp; + } + tcg_out_insn(s, 3303, LD1R, type == TCG_TYPE_V128, r, base, vece); + return true; } static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd,