]> gcc.gnu.org Git - gcc.git/commit
Support type _Float16/__bf16 independent of SSE2.
authorliuhongt <hongtao.liu@intel.com>
Tue, 18 Apr 2023 06:53:04 +0000 (14:53 +0800)
committerliuhongt <hongtao.liu@intel.com>
Wed, 19 Jul 2023 01:35:58 +0000 (09:35 +0800)
commit9a19fa8b616f83474c35cc5b34a3865073ced829
treece42cd031ed9445d7124cfec0c5328c7786d7a4b
parentec842611618c9f8a50f3326d42c51961de8b28a5
Support type _Float16/__bf16 independent of SSE2.

Enable _Float16 and __bf16 all the time but issue errors when the
types are used in conversion, unary operation, binary operation,
parameter passing or value return when TARGET_SSE2 is not available.

Also undef macros which are used by libgcc/libstdc++ to check the
backend support of the _Float16/__bf16 types when TARGET_SSE2 is not
available.

gcc/ChangeLog:

PR target/109504
* config/i386/i386-builtins.cc
(ix86_register_float16_builtin_type): Remove TARGET_SSE2.
(ix86_register_bf16_builtin_type): Ditto.
* config/i386/i386-c.cc (ix86_target_macros): When TARGET_SSE2
isn't available, undef the macros which are used to check the
backend support of the _Float16/__bf16 types when building
libstdc++ and libgcc.
* config/i386/i386.cc (construct_container): Issue errors for
HFmode/BFmode when TARGET_SSE2 is not available.
(function_value_32): Ditto.
(ix86_scalar_mode_supported_p): Remove TARGET_SSE2 for HFmode/BFmode.
(ix86_libgcc_floating_mode_supported_p): Ditto.
(ix86_emit_support_tinfos): Adjust codes.
(ix86_invalid_conversion): Return diagnostic message string
when there's conversion from/to BF/HFmode w/o TARGET_SSE2.
(ix86_invalid_unary_op): New function.
(ix86_invalid_binary_op): Ditto.
(TARGET_INVALID_UNARY_OP): Define.
(TARGET_INVALID_BINARY_OP): Define.
* config/i386/immintrin.h [__SSE2__]: Remove for fp16/bf16
related instrinsics header files.
* config/i386/i386.h (VALID_SSE2_TYPE_MODE): New macro.

gcc/testsuite/ChangeLog:

* gcc.target/i386/pr109504.c: New test.
* gcc.target/i386/sse2-bfloat16-1.c: Adjust error info.
* gcc.target/i386/sse2-float16-1.c: Ditto.
* gcc.target/i386/sse2-float16-4.c: New test.
* gcc.target/i386/sse2-float16-5.c: New test.
* g++.target/i386/float16-1.C: Adjust error info.

libgcc/ChangeLog:

* config/i386/t-softfp: Add -msse2 to libbid HFtype related
files.
12 files changed:
gcc/config/i386/i386-builtins.cc
gcc/config/i386/i386-c.cc
gcc/config/i386/i386.cc
gcc/config/i386/i386.h
gcc/config/i386/immintrin.h
gcc/testsuite/g++.target/i386/float16-1.C
gcc/testsuite/gcc.target/i386/pr109504.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse2-bfloat16-1.c
gcc/testsuite/gcc.target/i386/sse2-float16-1.c
gcc/testsuite/gcc.target/i386/sse2-float16-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse2-float16-5.c [new file with mode: 0644]
libgcc/config/i386/t-softfp
This page took 0.075415 seconds and 6 git commands to generate.