From patchwork Sun Nov 19 14:30:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 1865739 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=xry111.site header.i=@xry111.site header.a=rsa-sha256 header.s=default header.b=YD2VLacr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SYCkJ0MgMz1ySL for ; Mon, 20 Nov 2023 01:31:19 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E9E8638582AA for ; Sun, 19 Nov 2023 14:31:11 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 117B03858D33 for ; Sun, 19 Nov 2023 14:30:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 117B03858D33 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 117B03858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=89.208.246.23 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700404261; cv=none; b=qoHjEifdp4dId2WoDJHgKvmMCowNCrBOkdHqBGsVci9KvwfT+E6E7UrLrhrNzN+FJ02/8ZdzgbgOHsC21+uyRlt4IlYt2hChvQLNYbNRZz2tm13ZAiCqZ6fnMmo0qSpVvRyqAAcgL4VPGyDZeD0JciD+bhOoFY75kZLiAg/o8KQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700404261; c=relaxed/simple; bh=j41d3N3YlCNKtvc7oVXXjvXizyhveG78DIGG0csks/Y=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vLdtZmDwATFL8w0VBoaIqyVGPOTVKyJYjVg9xgZMwDFAfKebm3rRjNqR0XhzzMCkH8S7H0TxeSQvZ2WdVSBboa6cklewstUMFYLqI5x+7rUtJ63mkpysu4Cvxy1x8IjAKCdidYt2B+Hn3v7ukDw88Xm/pO2jwSFfyffPCzEAfxU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1700404255; bh=j41d3N3YlCNKtvc7oVXXjvXizyhveG78DIGG0csks/Y=; h=From:To:Cc:Subject:Date:From; b=YD2VLacr3gQyuBMg/yrH+cyctrjuzfqP99sDwt1agRfAET+gKmvV3UkLowOmJlXv/ Tf3JQh/n9x2sU7EVSDM8HULiLJXbzgNi1lpESDKj4sbKvfUE86AQ/venk4GGfFKs40 WqonUu/d7UsGnehRtGFPL6halgn8woG51Mn9snFU= Received: from stargazer.. (unknown [124.115.222.147]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 056BC66B39; Sun, 19 Nov 2023 09:30:53 -0500 (EST) From: Xi Ruoyao To: gcc-patches@gcc.gnu.org Cc: chenglulu , i@xen0n.name, xuchenghua@loongson.cn, Xi Ruoyao Subject: [PATCH v2 0/3] LoongArch: SIMD fixes and optimizations Date: Sun, 19 Nov 2023 22:30:34 +0800 Message-ID: <20231119143037.16443-1-xry111@xry111.site> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, LIKELY_SPAM_FROM, RCVD_IN_ABUSEAT, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org The [1/3] patch is the PR112578 fix at https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637097.html unchanged. As I've made other two patches depending on the simd.md file introduced by it, resend it as a part of this series. As many LASX instructions are only differentiated from the corresponding LSX instruction with operand length, create simd.md file to contain the RTX templates sharable by LSX and LASX. This makes the code cleaner and easier to maintain. The [2/3] and [3/3] patches make vector product highpart and rotate shift operations for GNU vectors and auto vectorization. Bootstrapped and regtested on loongarch64-linux-gnu. Ok for trunk? Xi Ruoyao (3): LoongArch: Fix usage of LSX and LASX frint/ftint instructions [PR112578] LoongArch: Use standard pattern name and RTX code for LSX/LASX muh instructions LoongArch: Use standard pattern name and RTX code for LSX/LASX rotate shift gcc/config/loongarch/lasx.md | 271 ----------------- gcc/config/loongarch/loongarch-builtins.cc | 52 ++-- gcc/config/loongarch/loongarch.md | 7 +- gcc/config/loongarch/lsx.md | 284 ------------------ gcc/config/loongarch/simd.md | 238 +++++++++++++++ .../loongarch/vect-frint-no-inexact.c | 48 +++ .../gcc.target/loongarch/vect-frint.c | 82 +++++ .../loongarch/vect-ftint-no-inexact.c | 44 +++ .../gcc.target/loongarch/vect-ftint.c | 80 +++++ gcc/testsuite/gcc.target/loongarch/vect-muh.c | 36 +++ .../gcc.target/loongarch/vect-rotr.c | 36 +++ 11 files changed, 598 insertions(+), 580 deletions(-) create mode 100644 gcc/config/loongarch/simd.md create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-frint-no-inexact.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-frint.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-ftint-no-inexact.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-ftint.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-muh.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vect-rotr.c