From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 1BE463829BD7 for ; Fri, 10 Jun 2022 11:35:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1BE463829BD7 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-489-Vg8OEzXZOp6hY60rT3avXw-1; Fri, 10 Jun 2022 07:35:17 -0400 X-MC-Unique: Vg8OEzXZOp6hY60rT3avXw-1 Received: by mail-qv1-f70.google.com with SMTP id x18-20020a0ce0d2000000b0046458e0e18bso16878319qvk.1 for ; Fri, 10 Jun 2022 04:35:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=fNWLElNsOHKtVDwleKDMIgOPfhnrvSu5KO0AlzYx3Cs=; b=zWxdpja3v4+cNYOi9rC2Bkr+LbZUi60BBcTZSB7+EsHAmdWytaI+kdbhhWL8YJ/6Y0 t3hmHm1B7X7rWF3Rv3VgjyYK9GCtzPharzjsdyoiSPpASJZoBvQZW/4dQeU6MeNeGMu0 GC5puZ4cnwFRXEnhEluRNyil2YkfamKDagOkrw17U0S1i3L00tmO0ENeNrrnGtmSooEK KYLa7uxxQA3Nfr1TPgwr+era5m0l8sMJajUrWzc1aGtSoyQOM9C3B1xSxwznTr6gSAOa 2KxFAnXbYVO1NN0f7awpUOyPBrZX2R/hEYTmICY5UP38X8jo1OjUCEWc4UBrTuW88ni3 hKzw== X-Gm-Message-State: AOAM532V8qTqkCOLem08dWazP1pPFYTFSUFwyI+MQvOpo5aKiYdVulqr 3SjKmu1JnmLDBcZHkraVrkAb+EL2qHDLUBsuw1szdIB1dkmbuBW2xGYuJ8DRrYpDAznNt2TV/Rv AvinmlsaD8qkqy3avKw== X-Received: by 2002:a05:622a:487:b0:304:fbfc:9933 with SMTP id p7-20020a05622a048700b00304fbfc9933mr14944465qtx.682.1654860916029; Fri, 10 Jun 2022 04:35:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyy3sRkr1TSSpkRh9PasF49O93T3Q3A5tyN4rackWIlpv7F33C8PEDPJm04pZsraVXKsGjUlA== X-Received: by 2002:a05:622a:487:b0:304:fbfc:9933 with SMTP id p7-20020a05622a048700b00304fbfc9933mr14944448qtx.682.1654860915756; Fri, 10 Jun 2022 04:35:15 -0700 (PDT) Received: from t14s.localdomain (c-73-69-212-193.hsd1.ma.comcast.net. [73.69.212.193]) by smtp.gmail.com with ESMTPSA id s6-20020a05620a254600b006a6b0ed619csm14471811qko.67.2022.06.10.04.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 04:35:15 -0700 (PDT) Message-ID: Subject: Re: [PATCH 2/2] Add a general mapping from internal fns to target insns From: David Malcolm To: Richard Sandiford , gcc-patches@gcc.gnu.org Date: Fri, 10 Jun 2022 07:35:13 -0400 In-Reply-To: References: User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2022 11:35:20 -0000 On Fri, 2022-06-10 at 10:14 +0100, Richard Sandiford via Gcc-patches wrote: Several existing internal functions map directly to an instruction defined in target-insns.def.  This patch makes it easier to define more such functions in future. This should help to reduce cut-&-paste, but more importantly, it allows the difference between optab functions and target-insns.def functions to be abstracted away; both are now treated as “directly-mapped”. Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install? Richard gcc/         * internal-fn.def (DEF_INTERNAL_INSN_FN): New macro.         (GOMP_SIMT_ENTER_ALLOC, GOMP_SIMT_EXIT, GOMP_SIMT_LANE)         (GOMP_SIMT_LAST_LANE, GOMP_SIMT_ORDERED_PRED, GOMP_SIMT_VOTE_ANY)         (GOMP_SIMT_XCHG_BFLY, GOMP_SIMT_XCHG_IDX): Use it.         * internal-fn.h (direct_internal_fn_info::directly_mapped): New         member variable.         (direct_internal_fn_info::vectorizable): Reduce to 1 bit.         (direct_internal_fn_p): Also return true for internal functions         that map directly to instructions defined target-insns.def.         (direct_internal_fn): Adjust comment accordingly.         * internal-fn.c (direct_insn, optab1, optab2, vectorizable_optab1) [...snip...] ---  gcc/internal-fn.cc  | 152 +++++++++++++++-----------------------------  gcc/internal-fn.def |  34 +++++++---  gcc/internal-fn.h   |  20 +++---  3 files changed, 87 insertions(+), 119 deletions(-) [...snip...] I can't comment on the correctness of the patch, but I happened to spot that the filename in the changelog entry needs renaming for the .c to .cc transition, or the git hooks will complain when you try to push this. Dave