From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 99E583894C20 for ; Wed, 5 Apr 2023 21:05:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 99E583894C20 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-ej1-x62d.google.com with SMTP id a640c23a62f3a-9188b85a615so86107766b.1 for ; Wed, 05 Apr 2023 14:05:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680728709; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8u0NJsV9lYWtKicD3RzpLs0CaRP68taKcG3Ewq/y85g=; b=TvExfJpOO29b9M2Vq+Ad4YEAQ8kNKiX1qKquYl9Jxemi4cz4N3v+il9TGfaHnF3gP0 /z1jpLre3K9HHIKhEDcvtaMzZGSgv53vBn93CbtO7qZ5uyDhSeEPcwMC0DXIbqGq5rmn lpFlWTMsxqh27m1CQ6N/is+k0iqsNcfAxGYzAsBwU/ScLHGobI13IhlOpBmD3VnmJ4jE gNnZQhnaG8rO9Y+M5pnK0gTHcqq1dFx5jV7qjMaefqmBEHEF/k89eQ6WmXt6dh82l4GG QK0kPTRokiOvabCmtvNz9J9g8hw1ACgtEhvgsbajUDrgtiz5P8xz5WSbfvOIOUXAuj89 8irw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680728709; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8u0NJsV9lYWtKicD3RzpLs0CaRP68taKcG3Ewq/y85g=; b=etMfDUY7++MxBLMMouFw4LtH9pJeO5GtjzS4nLktcpXlgHwCYc818G4OwHilhYMnX5 vka0iLoJiPPVKV+6hRgzvfim0Ut0grQDgRYb9LFOzZjVlXoUNoSldg2eBkOOqEUJ7t3G CpArz7hs02+TX9Pd/Vz3GiO7N/h/uv7pOXI/AYMX/cw+5yFtAGXnlW8knWTCucePa90N nSskFFVgE6nWE65hN8ejML42fwZb4XGG7fa9JUZaXYuMG/vEzeG0mHVuJLxw8SwnUN5W AbDzZlmMCgkZJG5JbtKSXfT3wE8CzPUn6O8rROHbyeXvLv8pcvdoV8BRi4bGND3yWlJs h6Aw== X-Gm-Message-State: AAQBX9cG6KnkSLWVEVQhSQygm4rSLLAMk4je7vH8CQ259JngP2kMZZvo lBS+6VhdZRpsQGkRDMVU2pPbXdai6kNJitcN/PU= X-Google-Smtp-Source: AKy350a8MQFYvo6l8gmzPYwLXdt01/8upynB4PfjR+SLjBrSdNWzo1UWgGlAUXglUkXHzG3uP6136boVlf4Aw8w78DI= X-Received: by 2002:a50:d78f:0:b0:4fb:71d0:6aa8 with SMTP id w15-20020a50d78f000000b004fb71d06aa8mr1885161edi.0.1680728709227; Wed, 05 Apr 2023 14:05:09 -0700 (PDT) MIME-Version: 1.0 References: <20230405162144.984598-1-hjl.tools@gmail.com> <20230405162144.984598-14-hjl.tools@gmail.com> In-Reply-To: <20230405162144.984598-14-hjl.tools@gmail.com> From: Noah Goldstein Date: Wed, 5 Apr 2023 16:04:57 -0500 Message-ID: Subject: Re: [PATCH 13/19] : Add AMX-FP16 support To: "H.J. Lu" Cc: libc-alpha@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.8 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: On Wed, Apr 5, 2023 at 11:28=E2=80=AFAM H.J. Lu via Libc-alpha wrote: > > Add AMX-FP16 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 af79f5eb4d..7d4aa3d339 100644 > --- a/manual/platform.texi > +++ b/manual/platform.texi > @@ -200,6 +200,9 @@ The supported processor features are: > @item > @code{AMX_INT8} -- Tile computational operations on 8-bit numbers. > > +@item > +@code{AMX_FP16} -- Tile computational operations on FP16 numbers. > + > @item > @code{AMX_TILE} -- Tile architecture. > > diff --git a/sysdeps/x86/bits/platform/x86.h b/sysdeps/x86/bits/platform/= x86.h > index 2a15ad937a..2776c69b16 100644 > --- a/sysdeps/x86/bits/platform/x86.h > +++ b/sysdeps/x86/bits/platform/x86.h > @@ -298,6 +298,7 @@ enum > x86_cpu_FSRS =3D x86_cpu_index_7_ecx_1_eax + 11, > x86_cpu_FSRCS =3D x86_cpu_index_7_ecx_1_eax + 1= 2, > x86_cpu_WRMSRNS =3D x86_cpu_index_7_ecx_1_eax + 19, > + x86_cpu_AMX_FP16 =3D x86_cpu_index_7_ecx_1_eax + 21, > x86_cpu_HRESET =3D x86_cpu_index_7_ecx_1_eax + 22, > x86_cpu_LAM =3D x86_cpu_index_7_ecx_1_eax + 26, > > diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c > index da04ad0b00..6c1b5efc5f 100644 > --- a/sysdeps/x86/cpu-features.c > +++ b/sysdeps/x86/cpu-features.c > @@ -213,6 +213,8 @@ update_active (struct cpu_features *cpu_features) > CPU_FEATURE_SET_ACTIVE (cpu_features, AMX_TILE); > /* Determine if AMX_INT8 is usable. */ > CPU_FEATURE_SET_ACTIVE (cpu_features, AMX_INT8); > + /* Determine if AMX_FP16 is usable. */ > + CPU_FEATURE_SET_ACTIVE (cpu_features, AMX_FP16); > } > > /* These features are usable only when OSXSAVE is enabled. */ > diff --git a/sysdeps/x86/include/cpu-features.h b/sysdeps/x86/include/cpu= -features.h > index 4e40fe0482..07c841c1d4 100644 > --- a/sysdeps/x86/include/cpu-features.h > +++ b/sysdeps/x86/include/cpu-features.h > @@ -309,6 +309,7 @@ enum > #define bit_cpu_FZLRM (1u << 10) > #define bit_cpu_FSRS (1u << 11) > #define bit_cpu_FSRCS (1u << 12) > +#define bit_cpu_AMX_FP16 (1u << 21) > #define bit_cpu_HRESET (1u << 22) > #define bit_cpu_LAM (1u << 26) > > @@ -546,6 +547,7 @@ enum > #define index_cpu_FZLRM CPUID_INDEX_7_ECX_1 > #define index_cpu_FSRS CPUID_INDEX_7_ECX_1 > #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_LAM CPUID_INDEX_7_ECX_1 > > @@ -783,6 +785,7 @@ enum > #define reg_FZLRM eax > #define reg_FSRS eax > #define reg_FSRCS eax > +#define reg_AMX_FP16 eax > #define reg_HRESET eax > #define reg_LAM eax > > diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu= -features.c > index 9c436eaa64..c0f222cb77 100644 > --- a/sysdeps/x86/tst-get-cpu-features.c > +++ b/sysdeps/x86/tst-get-cpu-features.c > @@ -210,6 +210,7 @@ do_test (void) > CHECK_CPU_FEATURE_PRESENT (FSRS); > CHECK_CPU_FEATURE_PRESENT (FSRCS); > CHECK_CPU_FEATURE_PRESENT (WRMSRNS); > + CHECK_CPU_FEATURE_PRESENT (AMX_FP16); > CHECK_CPU_FEATURE_PRESENT (HRESET); > CHECK_CPU_FEATURE_PRESENT (LAM); > CHECK_CPU_FEATURE_PRESENT (AESKLE); > @@ -377,6 +378,7 @@ do_test (void) > CHECK_CPU_FEATURE_ACTIVE (FZLRM); > CHECK_CPU_FEATURE_ACTIVE (FSRS); > CHECK_CPU_FEATURE_ACTIVE (FSRCS); > + CHECK_CPU_FEATURE_ACTIVE (AMX_FP16); > CHECK_CPU_FEATURE_ACTIVE (AESKLE); > CHECK_CPU_FEATURE_ACTIVE (WIDE_KL); > CHECK_CPU_FEATURE_ACTIVE (PTWRITE); > -- > 2.39.2 > LGTM Reviewed-by: Noah Goldstein