From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 262B13858C52 for ; Mon, 10 Apr 2023 14:54:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 262B13858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x630.google.com with SMTP id p8so4909178plk.9 for ; Mon, 10 Apr 2023 07:54:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681138455; x=1683730455; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QZAkcDEBGbNmqikFs8g6j1psyapi2w6RjYvv8ndRt6g=; b=fwBxLHsiahrzv8vqffQzKxujKGtlrk6cALrU61YsnoRNqoO6QUwXfGYWIviAuHoOO6 CrGj+UFV6FwYxuh4XSzOnnCSj88wnHMRC31DSmEiRGQQjw0CsWLk0SS2fXW6AGGsGHyo ViGtYc0exlrjDn2GsIH5laPwhr5Hvzw6VqYz6/QHEmnKlV3iuuMTWVxkK+j4NXldAAtX nWqHKKYM3KQ1hIpfka/pmcWGrLbzjbZF435VLzlmo+cbCpmbHK1BCw70yKcrSQ/EMelH 7zv8sHvzsJ1XLfc4hWUR0/t7JyLyg33o8psKFcgXMJf3q0iuDeztFOgLvuE87CUEPfrB MKoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681138455; x=1683730455; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QZAkcDEBGbNmqikFs8g6j1psyapi2w6RjYvv8ndRt6g=; b=HqRIWU63BiB9etVrW5WPtuW8xspqNb8feSz87lASAFqeXuhJ8k+HMhixAttlHrBGIz Np56/pQO8LY+LEm86CuCowlgkNUqqo3otbSK3I2u+GmDeawLyPxCRpEsCEV7kWVtTv3b QbIFKTKVPradqRzQb0E2oWX093o95+DK/bW5aO3vBJVZMsof+x9gKE2CcCLcZVAXflBR dxvd2uDBNdjvUZYRnYoKICzuQ1MDVgax3Uo54qBej9b7Q5ylSw1EZVYuRmpLKerdiEOY WZm1qVkGZy0lncrBbVp3S0gCK7BmV1W8fs19mYAH9fuVbjP/BhynXDRynydv4FmPYpZb aIeg== X-Gm-Message-State: AAQBX9f/O7Tt7bVzK3PFyQlEndgPNmY6Q1OHD9gfmQaBo/l/+4oZBbFR dPOUzpIzQJEHtUaXRqIph64= X-Google-Smtp-Source: AKy350ZqbHnRXMgYkpmV9NH+WfEaBfvEwnIeP9jTXp7uPhNCxQuotDWNdMk+Jun1RyZm3yJq2sZrlg== X-Received: by 2002:a17:90b:1d02:b0:246:a5f3:c7e1 with SMTP id on2-20020a17090b1d0200b00246a5f3c7e1mr4884850pjb.42.1681138454662; Mon, 10 Apr 2023 07:54:14 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id ji21-20020a170903325500b001a5260a6e6csm4541904plb.206.2023.04.10.07.54.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Apr 2023 07:54:14 -0700 (PDT) Message-ID: <89f088ec-8692-01f5-0395-5a66ddf085d7@gmail.com> Date: Mon, 10 Apr 2023 08:54:12 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] machine_mode type size: Extend enum size from 8-bit to 16-bit Content-Language: en-US To: juzhe.zhong@rivai.ai, gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, palmer@dabbelt.com, jakub@redhat.com, richard.sandiford@arm.com, rguenther@suse.de References: <20230410144808.324346-1-juzhe.zhong@rivai.ai> From: Jeff Law In-Reply-To: <20230410144808.324346-1-juzhe.zhong@rivai.ai> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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 4/10/23 08:48, juzhe.zhong@rivai.ai wrote: > From: Juzhe-Zhong > > According RVV ISA: > https://github.com/riscv/riscv-v-spec/blob/master/v-spec.adoc#vector-type-register-vtype > We have LMUL: 1/8, 1/4, 1/2, 1, 2, 4, 8 > Also, for segment instructions, we have tuple type for NF = 2 ~ 8. > For example, for LMUL = 1/2, SEW = 32, we have vint32mf2_t, > we will have NF from 2 ~ 8 tuples: vint32mf2x2_t, vint32mf2x2... vint32mf2x8_t. > So we will end up with over 220+ vector machine mode for RVV. > > PLUS the scalar machine modes that we already have in RISC-V port. > > The total machine modes in RISC-V port > 256. > > Current GCC can not allow us support RVV segment instructions tuple types. > > So extend machine mode size from 8bit to 16bit. > > I have another solution related to this patch, > May be adding a target dependent macro is better? > Revise this patch like this: > > #ifdef TARGET_MAX_MACHINE_MODE_LARGER_THAN_256 > ENUM_BITFIELD(machine_mode) last_set_mode : 16; > #else > ENUM_BITFIELD(machine_mode) last_set_mode : 8; > #endif > > Not sure whether this solution is better? > > This patch Bootstraped on X86 is PASS. Will run make-check gcc-testsuite tomorrow. > > Expecting land in GCC-14, any suggestions ? > > gcc/ChangeLog: > > * combine.cc (struct reg_stat_type): Extend 8bit to 16bit. > * cse.cc (struct qty_table_elem): Ditto. > (struct table_elt): Ditto. > (struct set): Ditto. > * genopinit.cc (main): Ditto. > * ira-int.h (struct ira_allocno): Ditto. > * ree.cc (struct ATTRIBUTE_PACKED): Ditto. > * rtl-ssa/accesses.h: Ditto. > * rtl.h (struct GTY): Ditto. > (subreg_shape::unique_id): Ditto. > * rtlanal.h: Ditto. > * tree-core.h (struct tree_type_common): Ditto. > (struct tree_decl_common): Ditto. This is likely going to be very controversial. It's going to increase the size of two of most heavily used data structures in GCC (rtx and trees). The first thing I would ask is whether or not we really need the full matrix in practice or if we can combine some of the modes. Why hasn't aarch64 stumbled over this problem? Jeff