https://gcc.gnu.org/g:2aaf39e21c87d6644cf378280393f0bd5021a932
commit r14-12237-g2aaf39e21c87d6644cf378280393f0bd5021a932 Author: liuhongt <[email protected]> Date: Thu Jan 8 17:46:38 2026 -0800 Add TARGET_MMX_WITH_SSE to the condition of all 64-bit _Float16 vector related patterns. gcc/ChangeLog: PR target/123484 * config/i386/mmx.md (divv4hf3): Add TARGET_MMX_WITH_SSE to the condition. (cmlav4hf4): Ditto. (cmla_conjv4hf4): Ditto. (cmulv4hf3): Ditto. (cmul_conjv4hf3): Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/pr123484.c: New test. (cherry picked from commit 808fc71d15a458cc627f187449fac4f2b6d6cb3f) Diff: --- gcc/config/i386/mmx.md | 15 ++++++++++----- gcc/testsuite/gcc.target/i386/pr123484.c | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index de7f4086684a..ae8aa353a62b 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -1998,7 +1998,8 @@ (div:V4HF (match_operand:V4HF 1 "nonimmediate_operand") (match_operand:V4HF 2 "register_operand")))] - "TARGET_AVX512FP16 && TARGET_AVX512VL && ix86_partial_vec_fp_math" + "TARGET_AVX512FP16 && TARGET_AVX512VL && ix86_partial_vec_fp_math + && TARGET_MMX_WITH_SSE" { rtx op2 = gen_reg_rtx (V8HFmode); rtx op1 = gen_reg_rtx (V8HFmode); @@ -2678,7 +2679,8 @@ (match_operand:V4HF 1 "vector_operand") (match_operand:V4HF 2 "vector_operand") (match_operand:V4HF 3 "vector_operand")] - "TARGET_AVX512FP16 && TARGET_AVX512VL" + "TARGET_AVX512FP16 && TARGET_AVX512VL + && TARGET_MMX_WITH_SSE" { rtx op3 = gen_reg_rtx (V8HFmode); rtx op2 = gen_reg_rtx (V8HFmode); @@ -2700,7 +2702,8 @@ (match_operand:V4HF 1 "vector_operand") (match_operand:V4HF 2 "vector_operand") (match_operand:V4HF 3 "vector_operand")] - "TARGET_AVX512FP16 && TARGET_AVX512VL" + "TARGET_AVX512FP16 && TARGET_AVX512VL + && TARGET_MMX_WITH_SSE" { rtx op3 = gen_reg_rtx (V8HFmode); rtx op2 = gen_reg_rtx (V8HFmode); @@ -2721,7 +2724,8 @@ [(match_operand:V4HF 0 "register_operand") (match_operand:V4HF 1 "vector_operand") (match_operand:V4HF 2 "vector_operand")] - "TARGET_AVX512FP16 && TARGET_AVX512VL" + "TARGET_AVX512FP16 && TARGET_AVX512VL + && TARGET_MMX_WITH_SSE" { rtx op2 = gen_reg_rtx (V8HFmode); rtx op1 = gen_reg_rtx (V8HFmode); @@ -2739,7 +2743,8 @@ [(match_operand:V4HF 0 "register_operand") (match_operand:V4HF 1 "vector_operand") (match_operand:V4HF 2 "vector_operand")] - "TARGET_AVX512FP16 && TARGET_AVX512VL" + "TARGET_AVX512FP16 && TARGET_AVX512VL + && TARGET_MMX_WITH_SSE" { rtx op2 = gen_reg_rtx (V8HFmode); rtx op1 = gen_reg_rtx (V8HFmode); diff --git a/gcc/testsuite/gcc.target/i386/pr123484.c b/gcc/testsuite/gcc.target/i386/pr123484.c new file mode 100644 index 000000000000..258da40793aa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr123484.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx512vl -mavx512fp16 " }*/ +typedef __attribute__((__vector_size__ (8))) _Float16 F; +int a, b; +F f, *p; + +void +foo () +{ + do + { + f /= b ? *p : (F) {40}; +l: + } + while (a); + goto l; +}
