On Tue, 2024-12-17 at 12:52 +0800, Lulu Cheng wrote: > > 在 2024/12/17 下午12:30, Xi Ruoyao 写道: > > On Tue, 2024-12-17 at 11:27 +0800, Lulu Cheng wrote: > > > 在 2024/12/16 下午9:20, Xi Ruoyao 写道: > > > /* snip */ > > > > +;; For HImode it's a little complicated... > > > > +(define_expand "rbithi" > > > I didn't find rtithi's template description. Are there any test cases > > > ? > > No, it's not a standard name. I just used the same name as AArch64. > > And due to PR50481 is unimplemented yet, there's no way to directly test > > it :(. > > Bitreverse is a standard operation. if "define_expand "rbithi"" > implementated using > > bitreverse, will it trigger optimization in some cases? > > If so, can we add an operation here?
Quote from "Defining RTL Sequences for Code Generation" in GCC internal: [For define_expand] the RTL template is not used for matching, only for generating the initial insn list. If the preparation statement always invokes ‘DONE’ or ‘FAIL’, the RTL template may be reduced to a simple list of operands ... So adding a template containing bitreverse:HI here will be useless. If we want to translate bitreverse:HI to bitreverse:X and shift, we'll need to make a define_insn_and_split, but it'll still be useless: currently there's nothing emitting bitreverse:HI (otherwise it'd immediately trigger an ICE because of an unrecognizable insn). -- Xi Ruoyao <xry...@xry111.site> School of Aerospace Science and Technology, Xidian University