From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id B15F93857717 for ; Wed, 5 Apr 2023 16:21:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B15F93857717 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-pj1-x102d.google.com with SMTP id e15-20020a17090ac20f00b0023d1b009f52so40030772pjt.2 for ; Wed, 05 Apr 2023 09:21:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680711712; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=y9o+x8DfwBYDqwN1RLRQhTuhBoZD67UUpW3arcmh24U=; b=is82ndV7h+eUu6spNJCHDkiIbQqwiURwH8TxijtxxxkzkVud5hGuSD1WihIgP85bQ1 uDncWqWj6fayc/MwBHabFEnENBsnHK4lMFvq6zoWs1vE61a47INWq5ScKMlRMi2/hyWL hxj7SsTQmw05R8+4WO+sje5Y12sZ0ftG5c/40O9iVmnicZ7D+oM40zDha2LHMhBq2P0k e5M/FvMMPH6L1L5j8a7GiXUBu8yZUu4IR8HwZYVpQUSyDBSCupEe53ErG3A7yDZiXAm0 5LB6bUpGLQdiRJ2mxFdKPp9WaRK84wnitb/LNyIRAAXkNlmXpVgfS7fqYKcwXmKO4d3v 8+tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680711712; 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=y9o+x8DfwBYDqwN1RLRQhTuhBoZD67UUpW3arcmh24U=; b=iE0rRNRJjXUbEQK8F2LS1MHr0mqkxXwhWaYP4c10MkgRFjCR4Rp+FNYH8ykLmlXJTV JPTdE9eXduHOmnPZ1jiZ1lXZf7pMU4l2u3ctzVNudpKi2WA3clD6/BC1ifCAZqijAzbU HsFsm1C/mKKYpEPoOlp/+UdduEo3xqoCN7Pjs3IM5cZQhp9sMlndED1dtO3xipq8rkpF 57jI+WriJ60KPgkCI/2wfIV0GGgxgy1pwWUslX9+MhYppfRJWdzuhb5PQXXkXkpcl+rB vt/Qr5sna3hJy/h4iLPTbgW2P6OYWDXxPjJXs0dwWJW8dg3AdlbViZKdaFoseMC5hn/s NPEQ== X-Gm-Message-State: AAQBX9cmDpyE9lZye/lKPk3o1ZbOW7ffFAqCbEYOxi8+EzMyg2AHZyiF A6iIiHf2Q23HIWQiXr63JOEYwobHg+8= X-Google-Smtp-Source: AKy350YCEBxQ9qeff/R4Q+mJZW/BqOnlvv5UCSZW8dAVIgUtECrl47ox/zaw48bGHYWD1mbdyVRv1A== X-Received: by 2002:a17:902:e883:b0:1a1:db10:7ba5 with SMTP id w3-20020a170902e88300b001a1db107ba5mr8608775plg.41.1680711711873; Wed, 05 Apr 2023 09:21:51 -0700 (PDT) Received: from gnu-cfl-3.localdomain ([172.59.161.240]) by smtp.gmail.com with ESMTPSA id iy5-20020a170903130500b0019e81c8fd01sm10324447plb.249.2023.04.05.09.21.48 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 12C7E740148 for ; Wed, 5 Apr 2023 09:21:45 -0700 (PDT) From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH 14/19] : Add AVX-IFMA support Date: Wed, 5 Apr 2023 09:21:39 -0700 Message-Id: <20230405162144.984598-15-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 Content-Transfer-Encoding: 8bit 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 List-Id: Add AVX-IFMA support to . --- 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 7d4aa3d339..af75e5c413 100644 --- a/manual/platform.texi +++ b/manual/platform.texi @@ -219,6 +219,9 @@ Leaf (EAX = 23H). @item @code{AVX2} -- The AVX2 instruction extensions. +@item +@code{AVX_IFMA} -- The AVX-IFMA 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 2776c69b16..abc0116607 100644 --- a/sysdeps/x86/bits/platform/x86.h +++ b/sysdeps/x86/bits/platform/x86.h @@ -300,6 +300,7 @@ enum x86_cpu_WRMSRNS = x86_cpu_index_7_ecx_1_eax + 19, x86_cpu_AMX_FP16 = x86_cpu_index_7_ecx_1_eax + 21, x86_cpu_HRESET = x86_cpu_index_7_ecx_1_eax + 22, + x86_cpu_AVX_IFMA = x86_cpu_index_7_ecx_1_eax + 23, x86_cpu_LAM = x86_cpu_index_7_ecx_1_eax + 26, x86_cpu_index_19_ebx diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index 6c1b5efc5f..06fae443a8 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -139,6 +139,8 @@ update_active (struct cpu_features *cpu_features) cpu_features->preferred[index_arch_AVX_Fast_Unaligned_Load] |= bit_arch_AVX_Fast_Unaligned_Load; } + /* Determine if AVX-IFMA is usable. */ + CPU_FEATURE_SET_ACTIVE (cpu_features, AVX_IFMA); /* Determine if AVX-VNNI is usable. */ CPU_FEATURE_SET_ACTIVE (cpu_features, AVX_VNNI); /* Determine if FMA is usable. */ diff --git a/sysdeps/x86/include/cpu-features.h b/sysdeps/x86/include/cpu-features.h index 07c841c1d4..1f4b6831f9 100644 --- a/sysdeps/x86/include/cpu-features.h +++ b/sysdeps/x86/include/cpu-features.h @@ -311,6 +311,7 @@ enum #define bit_cpu_FSRCS (1u << 12) #define bit_cpu_AMX_FP16 (1u << 21) #define bit_cpu_HRESET (1u << 22) +#define bit_cpu_AVX_IFMA (1u << 23) #define bit_cpu_LAM (1u << 26) /* CPUID_INDEX_19. */ @@ -549,6 +550,7 @@ enum #define index_cpu_FSRCS CPUID_INDEX_7_ECX_1 #define index_cpu_AMX_FP16 CPUID_INDEX_7_ECX_1 #define index_cpu_HRESET CPUID_INDEX_7_ECX_1 +#define index_cpu_AVX_IFMA CPUID_INDEX_7_ECX_1 #define index_cpu_LAM CPUID_INDEX_7_ECX_1 /* CPUID_INDEX_19. */ @@ -787,6 +789,7 @@ enum #define reg_FSRCS eax #define reg_AMX_FP16 eax #define reg_HRESET eax +#define reg_AVX_IFMA eax #define reg_LAM eax /* CPUID_INDEX_19. */ diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c index c0f222cb77..3a2d4671ec 100644 --- a/sysdeps/x86/tst-get-cpu-features.c +++ b/sysdeps/x86/tst-get-cpu-features.c @@ -212,6 +212,7 @@ do_test (void) CHECK_CPU_FEATURE_PRESENT (WRMSRNS); CHECK_CPU_FEATURE_PRESENT (AMX_FP16); CHECK_CPU_FEATURE_PRESENT (HRESET); + CHECK_CPU_FEATURE_PRESENT (AVX_IFMA); CHECK_CPU_FEATURE_PRESENT (LAM); CHECK_CPU_FEATURE_PRESENT (AESKLE); CHECK_CPU_FEATURE_PRESENT (WIDE_KL); @@ -379,6 +380,7 @@ do_test (void) CHECK_CPU_FEATURE_ACTIVE (FSRS); CHECK_CPU_FEATURE_ACTIVE (FSRCS); CHECK_CPU_FEATURE_ACTIVE (AMX_FP16); + CHECK_CPU_FEATURE_ACTIVE (AVX_IFMA); CHECK_CPU_FEATURE_ACTIVE (AESKLE); CHECK_CPU_FEATURE_ACTIVE (WIDE_KL); CHECK_CPU_FEATURE_ACTIVE (PTWRITE); -- 2.39.2