i386: Add AVX512BW to AVX512F in MASK_ISA2

Message ID 20220630015031.104897-1-haochen.jiang@intel.com
State Committed
Commit 33981253cdf4505af30d3467ba5baa142cc62772
Headers
Series i386: Add AVX512BW to AVX512F in MASK_ISA2 |

Commit Message

Haochen Jiang June 30, 2022, 1:50 a.m. UTC
  Hi all,

I just found in MASK_ISA2_UNSET part, since AVX512BW is based on AVX512F, we
should add OPTION_MASK_ISA2_AVX512BW_UNSET to AVX512F for maintainence
convenience and logic correctness, or we will need to add all future ISAs based
on AVX512BW in both AVX512F and AVX512BW. This will be easily forgot and might
cause confusion.

Also remove the redundant ones in this change.

Regtested on x86_64-pc-linux-gnu. Ok for trunk?

BRs,
Haochen

gcc/ChangeLog:

	* common/config/i386/i386-common.cc (OPTION_MASK_ISA2_AVX512F_UNSET):
	Add OPTION_MASK_ISA2_AVX512BW_UNSET, remove
	OPTION_MASK_ISA2_AVX512BF16_UNSET and
	OPTION_MASK_ISA2_AVX512FP16_UNSET.
---
 gcc/common/config/i386/i386-common.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

Li, Pan2 via Gcc-patches June 30, 2022, 1:51 a.m. UTC | #1
> -----Original Message-----
> From: Jiang, Haochen <haochen.jiang@intel.com>
> Sent: Thursday, June 30, 2022 9:51 AM
> To: gcc-patches@gcc.gnu.org
> Cc: ubizjak@gmail.com; Liu, Hongtao <hongtao.liu@intel.com>
> Subject: [PATCH] i386: Add AVX512BW to AVX512F in MASK_ISA2
> 
> Hi all,
> 
> I just found in MASK_ISA2_UNSET part, since AVX512BW is based on AVX512F,
> we should add OPTION_MASK_ISA2_AVX512BW_UNSET to AVX512F for
> maintainence convenience and logic correctness, or we will need to add all
> future ISAs based on AVX512BW in both AVX512F and AVX512BW. This will be
> easily forgot and might cause confusion.
> 
> Also remove the redundant ones in this change.
> 
> Regtested on x86_64-pc-linux-gnu. Ok for trunk?
LGTM.
> 
> BRs,
> Haochen
> 
> gcc/ChangeLog:
> 
> 	* common/config/i386/i386-common.cc
> (OPTION_MASK_ISA2_AVX512F_UNSET):
> 	Add OPTION_MASK_ISA2_AVX512BW_UNSET, remove
> 	OPTION_MASK_ISA2_AVX512BF16_UNSET and
> 	OPTION_MASK_ISA2_AVX512FP16_UNSET.
> ---
>  gcc/common/config/i386/i386-common.cc | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/gcc/common/config/i386/i386-common.cc
> b/gcc/common/config/i386/i386-common.cc
> index cb878163492..c0c2ad74d87 100644
> --- a/gcc/common/config/i386/i386-common.cc
> +++ b/gcc/common/config/i386/i386-common.cc
> @@ -315,11 +315,10 @@ along with GCC; see the file COPYING3.  If not see
>     | OPTION_MASK_ISA_SSE_UNSET)
> 
>  #define OPTION_MASK_ISA2_AVX512F_UNSET \
> -  (OPTION_MASK_ISA2_AVX512BF16_UNSET \
> +  (OPTION_MASK_ISA2_AVX512BW_UNSET \
>     | OPTION_MASK_ISA2_AVX5124FMAPS_UNSET \
>     | OPTION_MASK_ISA2_AVX5124VNNIW_UNSET \
> -   | OPTION_MASK_ISA2_AVX512VP2INTERSECT_UNSET \
> -   | OPTION_MASK_ISA2_AVX512FP16_UNSET)
> +   | OPTION_MASK_ISA2_AVX512VP2INTERSECT_UNSET)
>  #define OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET \
>    OPTION_MASK_ISA2_SSE_UNSET
>  #define OPTION_MASK_ISA2_AVX_UNSET OPTION_MASK_ISA2_AVX2_UNSET
> --
> 2.18.1
  

Patch

diff --git a/gcc/common/config/i386/i386-common.cc b/gcc/common/config/i386/i386-common.cc
index cb878163492..c0c2ad74d87 100644
--- a/gcc/common/config/i386/i386-common.cc
+++ b/gcc/common/config/i386/i386-common.cc
@@ -315,11 +315,10 @@  along with GCC; see the file COPYING3.  If not see
    | OPTION_MASK_ISA_SSE_UNSET)
 
 #define OPTION_MASK_ISA2_AVX512F_UNSET \
-  (OPTION_MASK_ISA2_AVX512BF16_UNSET \
+  (OPTION_MASK_ISA2_AVX512BW_UNSET \
    | OPTION_MASK_ISA2_AVX5124FMAPS_UNSET \
    | OPTION_MASK_ISA2_AVX5124VNNIW_UNSET \
-   | OPTION_MASK_ISA2_AVX512VP2INTERSECT_UNSET \
-   | OPTION_MASK_ISA2_AVX512FP16_UNSET)
+   | OPTION_MASK_ISA2_AVX512VP2INTERSECT_UNSET)
 #define OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET \
   OPTION_MASK_ISA2_SSE_UNSET
 #define OPTION_MASK_ISA2_AVX_UNSET OPTION_MASK_ISA2_AVX2_UNSET