From patchwork Fri Nov 24 18:07:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 169535 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp1423277vqx; Fri, 24 Nov 2023 10:08:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4d7Ox+HEvRZMuvE3emzJXkK5I5McuSzRZXxlFvmzTt7sdsKYQ9zQMxOMx2JEMNwZs54le X-Received: by 2002:ae9:c104:0:b0:779:f0a1:3128 with SMTP id z4-20020ae9c104000000b00779f0a13128mr3819677qki.63.1700849283474; Fri, 24 Nov 2023 10:08:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700849283; cv=pass; d=google.com; s=arc-20160816; b=Dg0BFY2HiyTowqNHzmcyfdCBqmFOKBDDajZI5oYdMt4bEbMqGjANvkzDuzjoz3/esn u7gPwcVzvLjop16NkWwIFZE1wK6iQwGVY+ISq9+X2WsGLurp/yNuJobKnLSikGz+GRlG 83ZqAWG3jAaLspHDmWrVFtRDHtviCdSvKKIJPnT9IlDZMP25WFOEj/3Hei+wabnDSe5L lCI8VcIaDoSVmNj6ymmDeOt5dz97Gf71arolaHCL4mSLiTyfWwNP5aOv6oHZzpTCf2Q7 Z2E8e2ZBa4hKjQpBiYO8GRvHqNhMrbIxDWjqjNWTKs6iI6tVTDbz4VSEWPcFKdh9fSat pYbQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=OQ2hbhw7DWFAtfj4ysdoqamcYo16th6jrZneaqp6vKw=; fh=fedKVR9G0s8aS3Vg9oEsVXNcyGCem0u78PB1X4TJFgY=; b=iBz++iJ2cKoEqJfzumwy/Tapx0VmdyzMcrzxrtPQ2WwWu5HL6X8YufbSVvDpzAj1QO HYd6wMb5Pny+w1REcNftYkVWdPq+oY+Vwj0tVFtL4Xc7zWXysggEQJT2H16iGEZrDHnS e5HJLH6p9XEumSlGusvS/UYIDxSFvfkNq/siNHjO562WmwXxHYs454kZWTuiuWOSOIFg lLVykd8+MVyUOo0Hdi+qjKhgUtN3pmIRcZWVRZ0wUYaEgxxB6m2g/zoT0O2fX9WvM43D /22ndHLufJnIjK38S36Fu/CNWutrpLziEg5HofmYHZuSX7OTjdrbR3iZZZgXzxi7ohDa sVmw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IR0eRLF4; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id t13-20020a05620a450d00b0077bcbb62af2si3748930qkp.650.2023.11.24.10.08.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 10:08:03 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IR0eRLF4; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 408C138582A4 for ; Fri, 24 Nov 2023 18:08:03 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1D5083858D32 for ; Fri, 24 Nov 2023 18:07:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D5083858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1D5083858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700849261; cv=none; b=OJsVr20wEVmJgg8/VVfREs8FfogdVkL4LyyRjFMXWW/oW7mhowuTTM+eA2R5lM0xBtpforI+2XSDgm5aMV3umvZ7iCBVjOLWPQgVpX5c2KZ0wo3DxFo6/+34d1uKVP8ELkYlFb0axDzDr7ekAgucRD+W99KXhVkh5eEZLXD0+3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700849261; c=relaxed/simple; bh=o8U0MgSeKX2JLIBJHaEf7GQ5yI75zBuK+KM2Eyw3odg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=rUcz0y9yHwWEwwiI6JlEzX+qrI6boZO3zQDHuEfg9p2wdWV4cvF4aDg0hqCLlObpZolICRcvaF5etOxz36Q9QRjrhtc5Mmy58lPzHTpBqShFvSjwQUg95qaRJfpL+pr8yj3VDuOuC/JLfJ6CfOmDXTAOsIHy0vmy0V/5DSf9M4s= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700849259; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=OQ2hbhw7DWFAtfj4ysdoqamcYo16th6jrZneaqp6vKw=; b=IR0eRLF40JrPlTF31qd7x/QKEkCW0EGtxa4plNBWvHjzIWkzZYhOyz5UbFQ0jHcPH4Rgk9 n2jFyZDDx9Dx7XAbu8GLnENGXFQJd+5thYU5Ks2qAQgzF5WqiazwigKj9HcqUP7yLjyEo+ Dteqq9OOTWhRohK2iM9Ikp3PEwK98U0= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-549-HZAaTSIBMNag8y8wC9E9oQ-1; Fri, 24 Nov 2023 13:07:38 -0500 X-MC-Unique: HZAaTSIBMNag8y8wC9E9oQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B7F5829AA3BB; Fri, 24 Nov 2023 18:07:37 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7A8F636E2; Fri, 24 Nov 2023 18:07:37 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3AOI7YvC3486578 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 24 Nov 2023 19:07:35 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3AOI7YHx3486577; Fri, 24 Nov 2023 19:07:34 +0100 Date: Fri, 24 Nov 2023 19:07:33 +0100 From: Jakub Jelinek To: Richard Earnshaw , Richard Sandiford , Kyrylo Tkachov Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] aarch64: Fix up aarch64_simd_stp [PR109977] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham 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: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783469738206776996 X-GMAIL-MSGID: 1783469738206776996 Hi! The aarch64_simd_stp pattern uses w constraint in one alternative and r in another, but for the latter incorrectly uses iterator in %1 which expands to %d1 for V2DF and %s1 for V2SF and V4SF (this one not relevant to the pattern) and %w1 for others, so it ICEs if the alternative is selected during final. Compared to this, macro has the same values for all modes but uses w for V2DF and V2SF. Bootstrapped/regtested on aarch64-linux, ok for trunk? 2023-11-24 Andrew Pinski Jakub Jelinek PR target/109977 * config/aarch64/aarch64-simd.md (aarch64_simd_stp): Use rather than % for alternative with r constraint on input operand. * gcc.dg/pr109977.c: New test. Jakub --- gcc/config/aarch64/aarch64-simd.md.jj 2023-11-22 22:55:20.577075762 +0100 +++ gcc/config/aarch64/aarch64-simd.md 2023-11-24 12:51:22.855215700 +0100 @@ -269,7 +269,7 @@ (define_insn "aarch64_simd_stp" "TARGET_SIMD" {@ [ cons: =0 , 1 ; attrs: type ] [ Umn , w ; neon_stp ] stp\t%1, %1, %y0 - [ Umn , r ; store_ ] stp\t%1, %1, %y0 + [ Umn , r ; store_ ] stp\t%1, %1, %y0 } ) --- gcc/testsuite/gcc.dg/pr109977.c.jj 2023-11-24 12:51:04.551473591 +0100 +++ gcc/testsuite/gcc.dg/pr109977.c 2023-11-24 12:50:44.158760916 +0100 @@ -0,0 +1,16 @@ +/* PR target/109977 */ +/* { dg-do compile } */ +/* { dg-options "-Og" } */ + +typedef double __attribute__((__vector_size__ (8))) V; +typedef double __attribute__((__vector_size__ (16))) W; +V v; +int i; +extern void bar (void *); + +void +foo (void) +{ + W w = __builtin_shufflevector (v, (W) { }, 0, 0); + bar (&w); +}