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.133.124]) by sourceware.org (Postfix) with ESMTPS id 08CC53858C53 for ; Fri, 25 Aug 2023 07:12:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 08CC53858C53 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=1692947538; h=from:from: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=cCFHRpdB3aA/e9qoIHDyeBfMozjEfqTSH8Notqwez1Q=; b=F+XOGboyOwP6h9mp7Qk45bU66kGaNd6LlkUjEiu7aZI0sE9620noooP0e82trxdpTAf1Y0 Fin6hM5ftp3matMQr36YmWYwb5k3qWbNkXK/WS42PIjlZECrcfBrI0EXbQBCcvnP8ycM9X d6oGw1V2x7vtL9pD6OtMDUAMjINtx+4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-624-ZFphyS4JNeWLCvy6sj4EuQ-1; Fri, 25 Aug 2023 03:12:17 -0400 X-MC-Unique: ZFphyS4JNeWLCvy6sj4EuQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E830C805AF6; Fri, 25 Aug 2023 07:12:16 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 434211121319; Fri, 25 Aug 2023 07:12:16 +0000 (UTC) From: Florian Weimer To: Noah Goldstein via Libc-alpha Cc: Noah Goldstein , hjl.tools@gmail.com, carlos@systemhalted.org Subject: Re: [PATCH v2] x86: Add support for AVX10 version and vec size in cpu-features References: <20230824184851.3204976-1-goldstein.w.n@gmail.com> <20230824191430.3220651-1-goldstein.w.n@gmail.com> Date: Fri, 25 Aug 2023 09:12:15 +0200 In-Reply-To: <20230824191430.3220651-1-goldstein.w.n@gmail.com> (Noah Goldstein via Libc-alpha's message of "Thu, 24 Aug 2023 14:14:30 -0500") Message-ID: <87r0nra94g.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: * Noah Goldstein via Libc-alpha: > +/* AVX10 version information is handled differently from all other CPUID > + related logic. Rather than being encoded in cpuid as discrete booleans, the > + AVX10 version is encoded is a full byte that represents the version number > + (greater than or equal to 1). Since the CPUID API is only able to handle > + boolean returns, we enumerate `x86_cpu_AVX10_V{1..255}` which can be queried > + by the user and have special logic in `x86_cpu_{present,active}`. This is > + unpleasant on our end, but is the only way to make the existing API also > + support version queries. */ > + > + /* All 1s should never be a value feature index. */ > + x86_cpu_AVX10_V255 = ~0, > + x86_cpu_AVX10_V254 = x86_cpu_AVX10_V255 - 1, > + x86_cpu_AVX10_V253 = x86_cpu_AVX10_V254 - 1, > + x86_cpu_AVX10_V252 = x86_cpu_AVX10_V253 - 1, > + x86_cpu_AVX10_V251 = x86_cpu_AVX10_V252 - 1, Is this really necessary? We can define an x86_cpu_avx10_version inline function that calls __x86_get_cpuid_feature_leaf and extracts the version byte. Is it really necessary to support something like this? CPU_FEATURE_ACTIVE (AVX10_V2) This would be the alternative: x86_cpu_avx10_version () >= 2 Let's hope that version 0 means no AVX10. 8-) Thanks, Florian