i386: Integrate BFmode for Enhanced Vectorization in ix86_preferred_simd_mode
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gcc_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-arm |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 |
success
|
Test passed
|
Commit Message
Hi
This change adds BFmode support to the ix86_preferred_simd_mode function
enhancing SIMD vectorization for BF16 operations. The update ensures
optimized usage of SIMD capabilities improving performance and aligning
vector sizes with processor capabilities.
Bootstrapped and tested on x86-64-pc-linux-gnu.
Ok for trunk?
gcc/ChangeLog:
* config/i386/i386.cc (ix86_preferred_simd_mode): Add BFmode Support.
---
gcc/config/i386/i386.cc | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
On Wed, Sep 4, 2024 at 9:32 AM Levy Hsu <admin@levyhsu.com> wrote:
>
> Hi
>
> This change adds BFmode support to the ix86_preferred_simd_mode function
> enhancing SIMD vectorization for BF16 operations. The update ensures
> optimized usage of SIMD capabilities improving performance and aligning
> vector sizes with processor capabilities.
>
> Bootstrapped and tested on x86-64-pc-linux-gnu.
> Ok for trunk?
Ok.
>
> gcc/ChangeLog:
>
> * config/i386/i386.cc (ix86_preferred_simd_mode): Add BFmode Support.
> ---
> gcc/config/i386/i386.cc | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
> index 7af9ceca429..aea138c85ad 100644
> --- a/gcc/config/i386/i386.cc
> +++ b/gcc/config/i386/i386.cc
> @@ -24570,6 +24570,14 @@ ix86_preferred_simd_mode (scalar_mode mode)
> }
> return word_mode;
>
> + case E_BFmode:
> + if (TARGET_AVX512F && TARGET_EVEX512 && !TARGET_PREFER_AVX256)
> + return V32BFmode;
> + else if (TARGET_AVX && !TARGET_PREFER_AVX128)
> + return V16BFmode;
> + else
> + return V8BFmode;
> +
> case E_SFmode:
> if (TARGET_AVX512F && TARGET_EVEX512 && !TARGET_PREFER_AVX256)
> return V16SFmode;
> --
> 2.31.1
>
@@ -24570,6 +24570,14 @@ ix86_preferred_simd_mode (scalar_mode mode)
}
return word_mode;
+ case E_BFmode:
+ if (TARGET_AVX512F && TARGET_EVEX512 && !TARGET_PREFER_AVX256)
+ return V32BFmode;
+ else if (TARGET_AVX && !TARGET_PREFER_AVX128)
+ return V16BFmode;
+ else
+ return V8BFmode;
+
case E_SFmode:
if (TARGET_AVX512F && TARGET_EVEX512 && !TARGET_PREFER_AVX256)
return V16SFmode;