The corresponding insn serves this purpose quite fine, and leads to slightly less (generated) code. All we need is the insn to not have a leading * in its name, while retaining that * for "extendhfsf2". Introduce a mode attribute in exchange to achieve that.
gcc/ * config/i386/i386.md (extendhfdf2): Delete expander. (extendhf): New mode attribute. (*extendhf<mode>2): Use it. --- Of course the mode attribute could as well supply the full names. --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -5221,13 +5221,9 @@ } }) -(define_expand "extendhfdf2" - [(set (match_operand:DF 0 "register_operand") - (float_extend:DF - (match_operand:HF 1 "nonimmediate_operand")))] - "TARGET_AVX512FP16") +(define_mode_attr extendhf [(SF "*") (DF "")]) -(define_insn "*extendhf<mode>2" +(define_insn "<extendhf>extendhf<mode>2" [(set (match_operand:MODEF 0 "register_operand" "=v") (float_extend:MODEF (match_operand:HF 1 "nonimmediate_operand" "vm")))]