From: liuhongt Date: Fri, 9 Jan 2026 01:46:38 +0000 (-0800) Subject: Add TARGET_MMX_WITH_SSE to the condition of all 64-bit _Float16 vector related patterns. X-Git-Tag: basepoints/gcc-17~2075 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=808fc71d15a458cc627f187449fac4f2b6d6cb3f;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 0525bfdd561..a23474716a6 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -2061,7 +2061,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); @@ -2896,7 +2897,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); @@ -2918,7 +2920,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); @@ -2939,7 +2942,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); @@ -2957,7 +2961,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 00000000000..258da40793a --- /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; +}