From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 9BFA73858C62 for ; Tue, 11 Jul 2023 12:39:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9BFA73858C62 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 91DFC1FB; Tue, 11 Jul 2023 05:39:57 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AE5B23F67D; Tue, 11 Jul 2023 05:39:14 -0700 (PDT) From: Richard Sandiford To: Robin Dapp via Gcc-patches Mail-Followup-To: Robin Dapp via Gcc-patches ,Robin Dapp , jeffreyalaw , "juzhe.zhong\@rivai.ai" , richard.sandiford@arm.com Cc: Robin Dapp , jeffreyalaw , "juzhe.zhong\@rivai.ai" Subject: Re: [PATCH] genopinit: Allow more than 256 modes. References: <8fd3db77-035d-6874-6c71-47c944c465b5@gmail.com> Date: Tue, 11 Jul 2023 13:39:13 +0100 In-Reply-To: (Richard Sandiford's message of "Tue, 11 Jul 2023 13:36:42 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-20.9 required=5.0 tests=BAYES_00,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_NONE,SPF_NONE,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 List-Id: Richard Sandiford writes: > Robin Dapp via Gcc-patches writes: >> Hi, >> >> upcoming changes for RISC-V will have us exceed 256 modes or 8 bits. The >> helper functions in gen* rely on the opcode as well as two modes fitting >> into an unsigned int (a signed int even if we consider the qsort default >> comparison function). This patch changes the type of the index/hash >> from unsigned int to unsigned long long and allows up to 16 bits for a >> mode as well as 32 bits for an optab. >> >> Despite fearing worse, bootstrap, build and test suite run times on >> x86, aarch64, rv64 and power10 are actually unchanged (I didn't check >> 32-bit architectures but would expect similar results). > > I think for now we should just bump the mode shift to 10 and assert > (statically) that MAX_MACHINE_MODE < 1024. Sorry, just remembered that we already have: if (NUM_OPTABS > 0xffff || MAX_MACHINE_MODE >= ((1 << MACHINE_MODE_BITSIZE) - 1)) fatal ("genopinit range assumptions invalid"); so it would be a case of changing those instead. Thanks, Richard