Re: [PATCH 2/5] LoongArch: Add bit reverse operations

2024-12-17 Thread Xi Ruoyao
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" > > >

Re: [PATCH 2/5] LoongArch: Add bit reverse operations

2024-12-16 Thread Lulu Cheng
在 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

Re: [PATCH 2/5] LoongArch: Add bit reverse operations

2024-12-16 Thread 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

Re: [PATCH 2/5] LoongArch: Add bit reverse operations

2024-12-16 Thread Lulu Cheng
在 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 ? + [(match_operand:HI 0 "register_operand") + (match_operand:HI 1 "register_operand")] + "" + { +r

[PATCH 2/5] LoongArch: Add bit reverse operations

2024-12-16 Thread Xi Ruoyao
LoongArch supports native bit reverse operation for QI, SI, DI, and for HI we can expand it into a shift and a bit reverse in word_mode. I was reluctant to add them because until PR50481 is fixed these operations will be just useless. But now it turns out we can use them to optimize the bit rever