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 C5E413858403 for ; Fri, 2 Feb 2024 15:18:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C5E413858403 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 C5E413858403 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=1706887122; cv=none; b=UyISPD0V74WFtpNNQiz4wn4OI3CI45dNmzJW6Krp5pTY5W2ZSBjKfu+rmSBIyYimcMbYEpHG0YwaDaI1OvziEZITGKl0M9zazei7uYnmSbKiT5NY0tyC87ZlKJI+TKM4eGrMEyP0wZa9WffmgQwogM1yRyo0Litiki2RjJWETec= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706887122; c=relaxed/simple; bh=TpUzUtZYY/TmiT0dJpMGw+hhkxNsPJ+TB+XOLcXH2FQ=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=iClz0LK7D7I1L3dNMr2434EDLZDBDploAGMDcH7U5uvSeyOuhyfKhnf7m5BvgtJYi83ljAJN4peIIWYiACdbjCXe98ulSBh5O4/bgb3dLGzQHve9jGtqPXJlOQGIH5X4lRZR/pyNtkApd4wavopM+jjyrGuTOEX3cUAtoUz8Cis= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706887120; 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=yx0DFFoNdXMAd7nPDjQxN5nximd2R0HJX4K5JOmIzJ8=; b=QQotAnqa+PbsB0jMGQzhuB8ALGWjTlQ/fKmDOxZ1vQviE1HQxUWCmvg4vNXQWQJ5e6cTxk Z1GVLvHgcQpilWEL+z8faXthkLyhiRN9UnzfWZFaqHu7JTF0r6HCA9HkD8musIUo46VLQY imsNI3B9nlVBarNU6d/OSnOOtDLAPfM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-85-pzgwKzS2NZ6u0QfoxGqFpw-1; Fri, 02 Feb 2024 10:18:36 -0500 X-MC-Unique: pzgwKzS2NZ6u0QfoxGqFpw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 83B4C185A787; Fri, 2 Feb 2024 15:18:36 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4673F400DF52; Fri, 2 Feb 2024 15:18:36 +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 412FIDxo2738062 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 2 Feb 2024 16:18:13 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 412FICvE2738061; Fri, 2 Feb 2024 16:18:12 +0100 Date: Fri, 2 Feb 2024 16:18:12 +0100 From: Jakub Jelinek To: Andre Vieira Cc: gcc-patches@gcc.gnu.org, Richard.Sandiford@arm.com, kyrylo.tkachov@arm.com Subject: Re: [PATCH 1/2] bitint: Use TARGET_ARRAY_MODE for large bitints where target supports it Message-ID: Reply-To: Jakub Jelinek References: <20240125174501.32634-1-andre.simoesdiasvieira@arm.com> <20240125174501.32634-2-andre.simoesdiasvieira@arm.com> MIME-Version: 1.0 In-Reply-To: <20240125174501.32634-2-andre.simoesdiasvieira@arm.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 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=-10.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 Thu, Jan 25, 2024 at 05:45:00PM +0000, Andre Vieira wrote: > > This patch ensures we use TARGET_ARRAY_MODE to determine the storage mode of > large bitints that are represented as arrays in memory. This is required to > support such bitints for aarch64 and potential other targets with similar > bitint specifications. Existing tests like gcc.dg/torture/bitint-25.c are > affected by this for aarch64 targets. > > gcc/ChangeLog: > stor-layout.cc (layout_type): Use TARGET_ARRAY_MODE for large bitints > for targets that implement it. I thought this has been resolved by the r14-8275 change. Do you really need it for something? I've tried make check-gcc -j32 -k GCC_TEST_RUN_EXPENSIVE=1 RUNTESTFLAGS="GCC_TEST_RUN_EXPENSIVE=1 dg.exp='*bitint* pr112673.c builtin-stdc-bit-*.c pr112566-2.c pr112511.c' dg-torture.exp=*bitint* dfp.exp=*bitint*" in a x86_64 -> aarch64-linux cross with your other patch but not this one and didn't see any ICEs (note, as I didn't have any aarch64 libc around, all tests fail during linking). I think BITINT_TYPE mode really should be that of a struct containing that many limb elements rather than of an array and this patch doesn't match that. > diff --git a/gcc/stor-layout.cc b/gcc/stor-layout.cc > index 4cf249133e9..31da2c123ab 100644 > --- a/gcc/stor-layout.cc > +++ b/gcc/stor-layout.cc > @@ -2427,8 +2427,16 @@ layout_type (tree type) > } > else > { > - SET_TYPE_MODE (type, BLKmode); > cnt = CEIL (TYPE_PRECISION (type), GET_MODE_PRECISION (limb_mode)); > + machine_mode mode; > + /* Some targets use TARGET_ARRAY_MODE to select the mode they use > + for arrays with a specific element mode and a specific element > + count and we should use this mode for large bitints that are > + stored as such arrays. */ > + if (!targetm.array_mode (limb_mode, cnt).exists (&mode) > + || !targetm.array_mode_supported_p (limb_mode, cnt)) > + mode = BLKmode; > + SET_TYPE_MODE (type, mode); > gcc_assert (info.abi_limb_mode == info.limb_mode > || !info.big_endian == !WORDS_BIG_ENDIAN); > } Jakub