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 747C33858404 for ; Fri, 26 Aug 2022 11:04:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 747C33858404 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661511858; 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:in-reply-to:in-reply-to: references:references; bh=C+BwMfNjh3thKiG4D7i2Mexpdm4naYQn/S1LA1ZnOxw=; b=Bc54VAm5OKcpK57WsPAmosV9I68cN+mxzJ93mDWSKLpthVgNneSKGjijknGRlo3uliSYVV uYz81ZT9naAdES6ar91A3lSEnxtQI/qkOnwjvI/s+aGu7LeRKTZ+YZ4CLPYgOYVel1Ufgf 1rXQS4spVNKdei3aL5a/o24r4bPskJc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-91-DIkGveqaPDi1NL3-OJLb8Q-1; Fri, 26 Aug 2022 07:04:16 -0400 X-MC-Unique: DIkGveqaPDi1NL3-OJLb8Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 482D93C0F38B; Fri, 26 Aug 2022 11:04:16 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 03A542026D4C; Fri, 26 Aug 2022 11:04:15 +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 27QB4Dbk223683 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 26 Aug 2022 13:04:13 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 27QB4CRi223682; Fri, 26 Aug 2022 13:04:12 +0200 Date: Fri, 26 Aug 2022 13:04:11 +0200 From: Jakub Jelinek To: Andrew Stubbs Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 1/3] omp-simd-clone: Allow fixed-lane vectors Message-ID: Reply-To: Jakub Jelinek References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 List-Id: On Tue, Aug 09, 2022 at 02:23:48PM +0100, Andrew Stubbs wrote: > > The vecsize_int/vecsize_float has an assumption that all arguments will use > the same bitsize, and vary the number of lanes according to the element size, > but this is inappropriate on targets where the number of lanes is fixed and > the bitsize varies (i.e. amdgcn). > > With this change the vecsize can be left zero and the vectorization factor will > be the same for all types. > > gcc/ChangeLog: > > * doc/tm.texi: Regenerate. > * omp-simd-clone.cc (simd_clone_adjust_return_type): Allow zero > vecsize. > (simd_clone_adjust_argument_types): Likewise. > * target.def (compute_vecsize_and_simdlen): Document the new > vecsize_int and vecsize_float semantics. LGTM, except for a formatting nit. > @@ -618,8 +621,12 @@ simd_clone_adjust_argument_types (struct cgraph_node *node) > veclen = sc->vecsize_int; > else > veclen = sc->vecsize_float; > - veclen = exact_div (veclen, > - GET_MODE_BITSIZE (SCALAR_TYPE_MODE (parm_type))); > + if (known_eq (veclen, 0)) > + veclen = sc->simdlen; > + else > + veclen = exact_div (veclen, > + GET_MODE_BITSIZE > + (SCALAR_TYPE_MODE (parm_type))); Macro name on one line and ( on another is too ugly, can you please use: veclen = exact_div (veclen, GET_MODE_BITSIZE (SCALAR_TYPE_MODE (parm_type))); or: { scalar_mode m = SCALAR_TYPE_MODE (parm_type); veclen = exact_div (veclen, GET_MODE_BITSIZE (m)); } ? Jakub