From patchwork Mon Nov 2 17:09:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 320324 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp3896435ilc; Mon, 2 Nov 2020 09:14:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzO5TccR8ZtJUfPMHocZjIKf34yNIfhetDvfv+JNVSfZryNxxlfxS6dVI6RNl4D5bUQZEs3 X-Received: by 2002:a05:622a:188:: with SMTP id s8mr15518005qtw.369.1604337274171; Mon, 02 Nov 2020 09:14:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604337274; cv=none; d=google.com; s=arc-20160816; b=DPaUzHUU5tbCJTXhvPkk2N+PqDIb8kPwyj4KqYLGjhcK7mmnHdyICu8VIyIk4OTPqe UNcurC66IThnWUeOo3dQXUzieiAe4D+uvnnjaS/+CRLnqV/xLe4k8E/0zmgQg2lv8Rxw J5vA6bAVOhEbWWAo7Nh3o9f+zmgi0ePM56nDXo7PRKNTs51s3rcB0UGGU/N3YK+vSt6T OYa0804u8TQ8k4xxlOJPppiI1WNRwXz+MNKixwMSfNV637KxQ2bKnQOMe6kPtkvvvipK Y7VKZWjui8sA6ZRcdLVlcw0O8J+tUq9qmygqtz4k2iCNl0PZom8f3hYw1SO7O/lUZljw Lm0g== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=bF6PwLy/yI0XHBna/A/NHJlJMEtI1ZSu2nypD5iZDi0=; b=TwKC5w3nv/6bAuB7kpCzug4tSO7e0oJ1DYaJfqqXfroRTHflKC7BRQdDd/S03j/eOq LGiPjSUrltf5meZ3yaxUCamrXpqrH6aT1xje1oVs2OpmIgjtrMw2KreP3PKETXz4vDy6 IVHeIaGWRuW4sVINGD0oK1PsYgQ+kIvsEbOL0++93SCcmqMk+Z5A1l4Ev3uLm71vZHm6 dAFmrp/Q2htqAN+bpEYCqHvFilqfr57BdWqVi4V0j/5BNRBOai5yHSz4144oKaoLu2TC d8M5O3+8q7iX75isDGMueT6Mc9xf0uRtfqZyDmfGaV8c0vSzy8rGOqwB78LBDZjUO/Lv LGwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HiTOm/aF"; 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=pass (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 a3si4243188qta.258.2020.11.02.09.14.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Nov 2020 09:14:34 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b="HiTOm/aF"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZdPd-0005jb-Lo for patch@linaro.org; Mon, 02 Nov 2020 12:14:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZdLt-0000vz-9D for qemu-devel@nongnu.org; Mon, 02 Nov 2020 12:10:41 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:45750) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kZdLn-0006a3-Ie for qemu-devel@nongnu.org; Mon, 02 Nov 2020 12:10:40 -0500 Received: by mail-wr1-x42f.google.com with SMTP id a9so15467444wrg.12 for ; Mon, 02 Nov 2020 09:10:34 -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:mime-version :content-transfer-encoding; bh=bF6PwLy/yI0XHBna/A/NHJlJMEtI1ZSu2nypD5iZDi0=; b=HiTOm/aFhzuzQQnOnN3GhDnA5j3OcmgWkBlKj8w14AWt8I8f2rkdDo1xnVUmDXRYbn fE9eS0aYJzhWgdCtv5mWc6BMVlCKxWXDCfmZnfWajSdFqUne+sF2C+xAJl8LvrdDxRhK L+s3Q90CFYHCuamwmv6TxDf6MOs0tKIjt7/2PoyfSfvbCeNrIwV2AVj9fgIhNUlCXTk8 yshy2hG47HG3qT9MQVTeIc45k7Y3rds8rn/MySMtUQhIY70WB1MYAUdJF+U96q1sKOTV CSlnghGRawddats5p8jxwPg6Q5zs6fVXkU12OheZx+ZXeprrKJyxZs0yz0Zq+C1ZJ8to I/2g== 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:mime-version:content-transfer-encoding; bh=bF6PwLy/yI0XHBna/A/NHJlJMEtI1ZSu2nypD5iZDi0=; b=A5DJcgq4qUSZ3BlLc61gxCUsibHRQ9muHYP96Rrn6ndi1DNrbem/hr6SYlKMqhaQdA aDLyZZU2EJgxshg7SkRMxCm3Bq3Z3IJ5hKHjyuzjAjjO1ABJloJFZ3wl9falhcaAPcjV JDgo8f5l2uVYKMBbTbJrYcfpk3ajgl4QSp6POv9LTg0jNxtkLjazgxzyLmbpElalLAJ5 ioLWmvvYQ1Hp8ovpNOEerVwFRfzyDFdAKHheHnXpZGK5snV5S2iid9F19fSedH4Xsr0Y g7TcWBWZQ2CSUypZyIPBS2F28VnwjFMsaeh9ghB8D+iumQ6ONi3IKYG7uuTqa9cHUQ90 jyTw== X-Gm-Message-State: AOAM530CGjjo2isZSifu/3wJTPFML+mUfiU/bbgzzDMiHd0Z5EJnvCbN ukVD4NU+92lC4BMlIXT5ToZYYLpAGnU2aQ== X-Received: by 2002:adf:f74e:: with SMTP id z14mr21204569wrp.312.1604337033116; Mon, 02 Nov 2020 09:10:33 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id c18sm22396540wrt.10.2020.11.02.09.10.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 09:10:32 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 13/26] target/arm: Fix VUDOT/VSDOT (scalar) on big-endian hosts Date: Mon, 2 Nov 2020 17:09:52 +0000 Message-Id: <20201102171005.30690-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201102171005.30690-1-peter.maydell@linaro.org> References: <20201102171005.30690-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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" The helper functions for performing the udot/sdot operations against a scalar were not using an address-swizzling macro when converting the index of the scalar element into a pointer into the vm array. This had no effect on little-endian hosts but meant we generated incorrect results on big-endian hosts. For these insns, the index is indexing over group of 4 8-bit values, so 32 bits per indexed entity, and H4() is therefore what we want. (For Neon the only possible input indexes are 0 and 1.) Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20201028191712.4910-3-peter.maydell@linaro.org --- target/arm/vec_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c index 30d76d05beb..0f33127c4c4 100644 --- a/target/arm/vec_helper.c +++ b/target/arm/vec_helper.c @@ -293,7 +293,7 @@ void HELPER(gvec_sdot_idx_b)(void *vd, void *vn, void *vm, uint32_t desc) intptr_t index = simd_data(desc); uint32_t *d = vd; int8_t *n = vn; - int8_t *m_indexed = (int8_t *)vm + index * 4; + int8_t *m_indexed = (int8_t *)vm + H4(index) * 4; /* Notice the special case of opr_sz == 8, from aa64/aa32 advsimd. * Otherwise opr_sz is a multiple of 16. @@ -324,7 +324,7 @@ void HELPER(gvec_udot_idx_b)(void *vd, void *vn, void *vm, uint32_t desc) intptr_t index = simd_data(desc); uint32_t *d = vd; uint8_t *n = vn; - uint8_t *m_indexed = (uint8_t *)vm + index * 4; + uint8_t *m_indexed = (uint8_t *)vm + H4(index) * 4; /* Notice the special case of opr_sz == 8, from aa64/aa32 advsimd. * Otherwise opr_sz is a multiple of 16.