On Wed, 2025-01-22 at 12:00 +0800, Lulu Cheng wrote:
> >
> > Currently, command fusion can only be done in the following situations:
> >
> > bstrpick.d rd, rs, 31, 0 + alsl.d rd1,rj,rk,shamt and "rd = rj"
> I learned from my colleagues that to do command fusion, we need to meet
> rd! =rs.
Hmm but with a toy example:
.p2align 5
.globl main
main:
li.d $a0, 115
li.d $a1, 514
li.d $t1, 1000000
1:
.rept 1000
#ifdef AVOID_RD_EQUAL_RS
move $t0, $a0
#define SRC t0
#else
#define SRC a0
#endif
bstrpick.d $a0, $SRC, 31, 0
alsl.d $a0, $a0, $a1, 2
.endr
addi.d $t1, $t1, -1
bnez $t1, 1b
ret
-DAVOID_RD_EQUAL_RS actually makes the program slower (on LA464)... So
I don't think it's really beneficial to deliberate insert a move.
--
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University