Hi Richard,
When I hack the LoongArch backend I notice something like
slli.d $r4, $r4, 2
add.w $r4, $r4, $r5
Or
(set (reg:DI 4) (ashift:DI (reg:DI 4) (const_int 2))
(set (reg:DI 4)
(sign_extend:DI (add:SI (reg:SI 4) (reg:SI 5))))
can appear after split. On LoongArch it can be done via an alsl.w
instruction, so I attempted to combine them in late combine with:
(define_insn
[(set (match_operand:DI 0 "register_operand" "=r")
(sign_extend:DI
(add:SI
(subreg:SI
(ashift:DI (match_operand:DI 1 "register_operand" "r")
(match_operand:SI 2 "const_immalsl_operand" ""))
0)
(match_operand:SI 3 "register_operand" "r"))))]
"TARGET_64BIT"
"alsl.w\t%0,%1,%3,%2")
But this does not work and I get "RTL substitution failed" with
-fdump-rtl-late_combine2-details.
I want to open an RFE in Bugzilla. But before that I'm wondering: maybe
I'm just too stupid to figure out the correct way for this?
--
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University