On Thu, 2023-11-23 at 14:35 +0800, chenglulu wrote:
> Hi,
>
> I don’t quite understand this part. Is it because define_insn would be
> duplicated with the above implementation,
>
> so define_insn_and_split is used?
Yes, but if you think duplicating the above implementation is better I
can dup it as well (as it's just a single line).
(I wrote it as a define_expand but it didn't work, then I modified it to
define_insn_and_split).
> > +(define_insn_and_split "fix_trunc<mode><vimode>2"
> > + [(set (match_operand:<VIMODE> 0 "register_operand" "=f")
> > + (fix:<VIMODE> (match_operand:FVEC 1 "register_operand" "f")))]
> > + ""
> > + "#"
> > + ""
> > + [(const_int 0)]
> > + {
> > + emit_insn (gen_<simd_isa>_<x>vftintrz_<simdifmt_for_f>_<simdfmt> (
> > + operands[0], operands[1]));
> > + DONE;
> > + }
> > + [(set_attr "type" "simd_fcvt")
> > + (set_attr "mode" "<MODE>")])
--
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University