Arm64/VectorOps: Elide moves in ASIMD VUShrNI2 if possible

In the event the destination and lower source are the same, then
we don't need to perform any moves.
This commit is contained in:
Lioncache committed 2023-09-17 15:49:54 -04:00
1 parent 8168a49d10
commit 047646be6d
1 file changed
+11 -3
@@ -3078,9 +3078,17 @@ DEF_OP(VUShrNI2) {
}
splice<ARMEmitter::OpType::Destructive>(SubRegSize, Dst.Z(), Mask, Dst.Z(), VTMP2.Z());
} else {
mov(VTMP1.Q(), VectorLower.Q());
shrn2(SubRegSize, VTMP1.Q(), VectorUpper.Q(), BitShift);
mov(Dst.Q(), VTMP1.Q());
auto Lower = VectorLower;
if (Dst != VectorLower) {
mov(VTMP1.Q(), VectorLower.Q());
Lower = VTMP1;
}
shrn2(SubRegSize, Lower.Q(), VectorUpper.Q(), BitShift);
if (Dst != VectorLower) {
mov(Dst.Q(), Lower.Q());
}
}
}