From patchwork Sat Apr 20 07:34:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 162560 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp302244jan; Sat, 20 Apr 2019 00:43:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWb++0hHVreZzL8pVNussnWQM4Plw8a9I1vgzsLYvwJ0M679SKgXoAqUTwlZJ9tN9OFofG X-Received: by 2002:adf:ed49:: with SMTP id u9mr5690486wro.305.1555746195879; Sat, 20 Apr 2019 00:43:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555746195; cv=none; d=google.com; s=arc-20160816; b=uvTLFuwv9MmIqeZ4AmWGlVm6Sy6RSdEJ3o4IyZ1TgRgaud6TJy2BtSlw7PWUS2/MMb jPiJHLdmyK7Q3zEWj6a/xpP/IwI9/Ari9erZ0UYHJKaw7SfyOZ6D1c1oX4uH8niOIdyT REnaRksAUMGMYeeNxwHTE97mSmkrDZqRTpf78L/lvPE8bhLqqDRXPVlFSwjWN3QFuUcd WuUe9wprkDzqftgzdLwl12AyDIUVQfuG+Hbg+8gwe+M1N06pfFUULtkc4M30OXrd+pHd DjsqWu1Kx9lrcyjZ92/2p7nDCNxIG8x+k5bci4NOk9PpJBVToDm0OoMzAhTGR26WPIYt mmrA== 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=pV+13kF6P9BlfNwiU+pC3oUPKYg5eIexnBRNkKkWSQQ=; b=YAJiQ4BbfOWa/rb3hhraLLUquZhRYbwrrbjZdK5WVz6pToh1JmrfsgnuVpLwL96BW7 95AfEexOsw4Do8JYuztvUsS7qdrNF3xalxrP80H1woS+UOjPW0N0pQXu7/lUtSO0MVhV ni9n+9rD9bM0f4NCsUGdh34HOdCon8t5Lz32a8rVAK6fig6PtAZ5OnDY9RDqYHnrcVw5 DlQOQ9T8hl1babAScOuXH9hYpuvweAmvIFJoagZCp/mWMi3tdfb9qT+kshRRsr5/+zHi OdiSobRwFlvmyomvxNrON1UB/FLmjsSi0SV7RjtmJBQ21TiLACsojs0Om+lj9m6VH7qM EnIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uLUVCTrQ; 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 d6si5401087wrn.325.2019.04.20.00.43.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 20 Apr 2019 00:43:15 -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=uLUVCTrQ; 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]:38172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHkeY-0007SQ-OU for patch@linaro.org; Sat, 20 Apr 2019 03:43:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHkWe-0008Uq-6I for qemu-devel@nongnu.org; Sat, 20 Apr 2019 03:35:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHkWd-0007yl-50 for qemu-devel@nongnu.org; Sat, 20 Apr 2019 03:35:04 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:38606) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHkWc-0007yB-VH for qemu-devel@nongnu.org; Sat, 20 Apr 2019 03:35:03 -0400 Received: by mail-pl1-x644.google.com with SMTP id f36so3538773plb.5 for ; Sat, 20 Apr 2019 00:35:02 -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=pV+13kF6P9BlfNwiU+pC3oUPKYg5eIexnBRNkKkWSQQ=; b=uLUVCTrQ9EuLTgdoWbM/n6PWVNrSAqioVlwSLoLTzuUJ4ojaMx3UXAcnnFp5Nwrdnr yNnZNq8/eNmLsRGSkdtx2hVBc6ZnYiahmDI3DwRaSJcoudNNv6ztCwWvSVnOxKkGLZTY b6M389lWgGmIASDDDb6G/NO/hXTagkS05iXrkdiDu9d/uS9FT/v5FhR9OP2STjPhlNgh 6i+pbwh78p0T6lu84yeUbwIJMwkKvDl+ouREVYMEuUMPzKIUwtpzPvwFxN97nCScxm6J b6VJe8Bt1VtPi0jycqOoev3d8CFC6sAMETXdQpAFLvIw5Mb4nVkXRHoAa6z3s8h2RCZu RrnA== 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=pV+13kF6P9BlfNwiU+pC3oUPKYg5eIexnBRNkKkWSQQ=; b=iIzkuzbYvMWUM7Xys3o0nz+NpqHPagZEf3S+wpY4PCmCaq2YznBc/oloVQT5igHGNm MWflFemRZGC5W/At5lNHrbo+2dl6lFDWzf3h96+aOFUtKy4CCtwIft3tBOnfqmOMLzG2 gBJOyPX9XmLQJke8kiN5U7OOhhgqc4qLL9VbrrGb6UiYkxkrEXdkad+Z6E869Ta59RjJ T9T89ODqs3NNmx3bfODx2WQRWN4xo+g5hypXrUox/zstWmDvz2loFHz8JU8puRKmCtwv bOH1cpP7swG/Q1yDXa8w9SBH23lCP7GiAusUvSqasNIaXYJQxLaXEJXyXvlfprCY1hpf ROFQ== X-Gm-Message-State: APjAAAWqczx3XyiyYNaPFDLWvNpfXVxCzPmCw+dqfVWb+1FgZFFGqVav tL0ZfcB39M7Su51iWZDFNbyQNNZM7xo= X-Received: by 2002:a17:902:9a0c:: with SMTP id v12mr8411359plp.184.1555745701818; Sat, 20 Apr 2019 00:35:01 -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.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Apr 2019 00:35:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 19 Apr 2019 21:34:14 -1000 Message-Id: <20190420073442.7488-11-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::644 Subject: [Qemu-devel] [PATCH 10/38] 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: david@redhat.com 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.1 diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index 3f95930e88..1db4e22365 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,