From patchwork Wed Apr 5 16:21:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 67415 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9EF67383302E for ; Wed, 5 Apr 2023 16:25:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9EF67383302E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680711906; bh=glCPFRp0fiTHOY8l0voKdQxsRLH3sM7FrG5b0QUXIxk=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=VRtwe5rnbWNGFDqe3V6PrY+y9ZziUzjIBOEw1xwDnCabh04oGfVrC4SyBI7detRC9 jy0JU07HafPG7qugzEIBH3XGzLayAa0uNDWkJ3IBTfr6hmjk8aLuYAz0UldVdUNjux KsUz33Nfv1fJgoVVR7FiQgaW0jaOUrU4J5HoOejE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 667143857712 for ; Wed, 5 Apr 2023 16:21:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 667143857712 Received: by mail-pl1-x634.google.com with SMTP id kc4so34879175plb.10 for ; Wed, 05 Apr 2023 09:21:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680711713; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=glCPFRp0fiTHOY8l0voKdQxsRLH3sM7FrG5b0QUXIxk=; b=TLhuP6nElkrgI24tNvinjizUSbAuvCj6ZIRty4vkIo2URPioH81xSgJt1lxeeNRgHJ E4QJ61ZiRSxMuNGbyCxVcmlVAz0maFrnk36RuDApTmbJmqtPVLSTjn6SFx4zwirWYH5N kjHw0gfODpg+/GVRH9NTo8+fWsA4pdPvP5xC9GGWpDqjWJIKO6Tc+dOXevNPiePZ4Ogm YM33w7jnzS85S8i+D9rVKtVxY6m8ISKsmUKzqSOo5+9o29psBvoYtZP0O91I6DNJdkix o3ZtFDqjA7sfyefWm5+yKd/P/IyWGQuRPlIowgjCrxM5ti2bhH1bIUf4u8/3TIZ4QUsJ /w7w== X-Gm-Message-State: AAQBX9f0HL+kXn/KQOM3e32qvN8lYBAu8DGcapc8TH0cF4Zmt0G6EXo3 JzDN7wYrcyi+rVMzILoG5QRPARizGkA= X-Google-Smtp-Source: AKy350YBLs+GT9OXu6+nTwRkX8DC6blR957/6SNueKkAVC/2ZRMRhjFIEf5vVhagPMof8HQZVEncJA== X-Received: by 2002:a05:6a20:cf63:b0:db:b7:fe3f with SMTP id hz35-20020a056a20cf6300b000db00b7fe3fmr5865808pzb.10.1680711712738; Wed, 05 Apr 2023 09:21:52 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.161.240]) by smtp.gmail.com with ESMTPSA id 127-20020a630885000000b0051324e710d0sm8125322pgi.59.2023.04.05.09.21.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 09:21:50 -0700 (PDT) Received: from gnu-cfl-3.. (localhost [IPv6:::1]) by gnu-cfl-3.localdomain (Postfix) with ESMTP id 36F48740167 for ; Wed, 5 Apr 2023 09:21:45 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH 17/19] : Add AVX-NE-CONVERT support Date: Wed, 5 Apr 2023 09:21:42 -0700 Message-Id: <20230405162144.984598-18-hjl.tools@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230405162144.984598-1-hjl.tools@gmail.com> References: <20230405162144.984598-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3025.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Add AVX-NE-CONVERT support to . Reviewed-by: Noah Goldstein --- manual/platform.texi | 3 +++ sysdeps/x86/bits/platform/x86.h | 1 + sysdeps/x86/cpu-features.c | 2 ++ sysdeps/x86/include/cpu-features.h | 3 +++ sysdeps/x86/tst-get-cpu-features.c | 2 ++ 5 files changed, 11 insertions(+) diff --git a/manual/platform.texi b/manual/platform.texi index 873ea0a84a..1e120993d7 100644 --- a/manual/platform.texi +++ b/manual/platform.texi @@ -222,6 +222,9 @@ Leaf (EAX = 23H). @item @code{AVX_IFMA} -- The AVX-IFMA instruction extensions. +@item +@code{AVX_NE_CONVERT} -- The AVX-NE-CONVERT instruction extensions. + @item @code{AVX_VNNI} -- The AVX-VNNI instruction extensions. diff --git a/sysdeps/x86/bits/platform/x86.h b/sysdeps/x86/bits/platform/x86.h index 7b239ef188..d8ba33bd42 100644 --- a/sysdeps/x86/bits/platform/x86.h +++ b/sysdeps/x86/bits/platform/x86.h @@ -309,6 +309,7 @@ enum + cpuid_register_index_edx * 8 * sizeof (unsigned int)), x86_cpu_AVX_VNNI_INT8 = x86_cpu_index_7_ecx_1_edx + 4, + x86_cpu_AVX_NE_CONVERT = x86_cpu_index_7_ecx_1_edx + 5, x86_cpu_index_19_ebx = (CPUID_INDEX_19 * 8 * 4 * sizeof (unsigned int) diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index f34f4884eb..dfd1b85dce 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -141,6 +141,8 @@ update_active (struct cpu_features *cpu_features) } /* Determine if AVX-IFMA is usable. */ CPU_FEATURE_SET_ACTIVE (cpu_features, AVX_IFMA); + /* Determine if AVX-NE-CONVERT is usable. */ + CPU_FEATURE_SET_ACTIVE (cpu_features, AVX_NE_CONVERT); /* Determine if AVX-VNNI is usable. */ CPU_FEATURE_SET_ACTIVE (cpu_features, AVX_VNNI); /* Determine if AVX-VNNI-INT8 is usable. */ diff --git a/sysdeps/x86/include/cpu-features.h b/sysdeps/x86/include/cpu-features.h index 5e09c58d9c..673cf8ca92 100644 --- a/sysdeps/x86/include/cpu-features.h +++ b/sysdeps/x86/include/cpu-features.h @@ -316,6 +316,7 @@ enum /* EDX. */ #define bit_cpu_AVX_VNNI_INT8 (1u << 4) +#define bit_cpu_AVX_NE_CONVERT (1u << 5) /* CPUID_INDEX_19. */ @@ -556,6 +557,7 @@ enum #define index_cpu_AVX_IFMA CPUID_INDEX_7_ECX_1 #define index_cpu_LAM CPUID_INDEX_7_ECX_1 #define index_cpu_AVX_VNNI_INT8 CPUID_INDEX_7_ECX_1 +#define index_cpu_AVX_NE_CONVERT CPUID_INDEX_7_ECX_1 /* CPUID_INDEX_19. */ @@ -798,6 +800,7 @@ enum /* EDX. */ #define reg_AVX_VNNI_INT8 edx +#define reg_AVX_NE_CONVERT edx /* CPUID_INDEX_19. */ diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c index f0585cf330..bb1b67fd1c 100644 --- a/sysdeps/x86/tst-get-cpu-features.c +++ b/sysdeps/x86/tst-get-cpu-features.c @@ -216,6 +216,7 @@ do_test (void) CHECK_CPU_FEATURE_PRESENT (LAM); CHECK_CPU_FEATURE_PRESENT (MSRLIST); CHECK_CPU_FEATURE_PRESENT (AVX_VNNI_INT8); + CHECK_CPU_FEATURE_PRESENT (AVX_NE_CONVERT); CHECK_CPU_FEATURE_PRESENT (AESKLE); CHECK_CPU_FEATURE_PRESENT (WIDE_KL); CHECK_CPU_FEATURE_PRESENT (PTWRITE); @@ -384,6 +385,7 @@ do_test (void) CHECK_CPU_FEATURE_ACTIVE (AMX_FP16); CHECK_CPU_FEATURE_ACTIVE (AVX_IFMA); CHECK_CPU_FEATURE_ACTIVE (AVX_VNNI_INT8); + CHECK_CPU_FEATURE_ACTIVE (AVX_NE_CONVERT); CHECK_CPU_FEATURE_ACTIVE (AESKLE); CHECK_CPU_FEATURE_ACTIVE (WIDE_KL); CHECK_CPU_FEATURE_ACTIVE (PTWRITE);