]> git.ipfire.org Git - thirdparty/gcc.git/commit
i386: Utilize VCOMSBF16 for BF16 Comparisons with AVX10.2
authorLevy Hsu <admin@levyhsu.com>
Wed, 9 Oct 2024 08:38:57 +0000 (16:38 +0800)
committerHongyu Wang <hongyu.wang@intel.com>
Tue, 5 Nov 2024 02:41:13 +0000 (10:41 +0800)
commit61622cfa463f2ef4fc835ace2ecf5451b232cf4f
treeadbdb512a2ba720c5c9477af953d41d50ef6b4ce
parent6177b45fcdc4273c5e94e8032644ca5807e7e93b
i386: Utilize VCOMSBF16 for BF16 Comparisons with AVX10.2

This patch enables the use of the VCOMSBF16 instruction from AVX10.2 for
efficient BF16 comparisons.

gcc/ChangeLog:

* config/i386/i386-expand.cc (ix86_expand_branch): Handle BFmode
when TARGET_AVX10_2_256 is enabled.
(ix86_prepare_fp_compare_args): Use SSE_FLOAT_MODE_SSEMATH_OR_HFBF_P.
(ix86_expand_fp_movcc): Ditto.
(ix86_expand_fp_compare): Handle BFmode under IX86_FPCMP_COMI.
* config/i386/i386.cc (ix86_multiplication_cost): Use
SSE_FLOAT_MODE_SSEMATH_OR_HFBF_P.
(ix86_division_cost): Ditto.
(ix86_rtx_costs): Ditto.
(ix86_vector_costs::add_stmt_cost): Ditto.
* config/i386/i386.h (SSE_FLOAT_MODE_SSEMATH_OR_HF_P): Rename to ...
(SSE_FLOAT_MODE_SSEMATH_OR_HFBF_P): ...this, and add BFmode.
* config/i386/i386.md (*cmpibf): New define_insn.

gcc/testsuite/ChangeLog:

* gcc.target/i386/avx10_2-comibf-1.c: New test.
* gcc.target/i386/avx10_2-comibf-2.c: Ditto.
gcc/config/i386/i386-expand.cc
gcc/config/i386/i386.cc
gcc/config/i386/i386.h
gcc/config/i386/i386.md
gcc/testsuite/gcc.target/i386/avx10_2-comibf-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx10_2-comibf-2.c [new file with mode: 0644]