diff options
author | liuhongt <hongtao.liu@intel.com> | 2023-04-18 14:53:04 +0800 |
---|---|---|
committer | liuhongt <hongtao.liu@intel.com> | 2023-07-19 09:35:58 +0800 |
commit | 9a19fa8b616f83474c35cc5b34a3865073ced829 (patch) | |
tree | ce42cd031ed9445d7124cfec0c5328c7786d7a4b /libgcc | |
parent | ec842611618c9f8a50f3326d42c51961de8b28a5 (diff) | |
download | gcc-9a19fa8b616f83474c35cc5b34a3865073ced829.zip gcc-9a19fa8b616f83474c35cc5b34a3865073ced829.tar.gz gcc-9a19fa8b616f83474c35cc5b34a3865073ced829.tar.bz2 |
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.
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/config/i386/t-softfp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libgcc/config/i386/t-softfp b/libgcc/config/i386/t-softfp index 69d0f81..80d1fac 100644 --- a/libgcc/config/i386/t-softfp +++ b/libgcc/config/i386/t-softfp @@ -31,3 +31,10 @@ CFLAGS-trunchfbf2.c += -msse2 CFLAGS-eqhf2.c += -msse2 CFLAGS-_divhc3.c += -msse2 CFLAGS-_mulhc3.c += -msse2 + +CFLAGS-_hf_to_sd.c += -msse2 +CFLAGS-_hf_to_dd.c += -msse2 +CFLAGS-_hf_to_td.c += -msse2 +CFLAGS-_sd_to_hf.c += -msse2 +CFLAGS-_dd_to_hf.c += -msse2 +CFLAGS-_td_to_hf.c += -msse2 |