Skip to content

Commit

Permalink
Arm64: Skip redundant hwintrinsic float movs (#58954) (#75202)
Browse files Browse the repository at this point in the history
* Arm64: Skip redundant hwintrinsic float movs (#58954)

For every FMOV emitted by the hardware intrinsics that is currently
marked as not skippable: if the src and dest registers are the same
and the types match, then the instruction will have no effect and
can be safely marked as skippable.

* Use hardcoded canSkip values
  • Loading branch information
a74nh authored Sep 12, 2022
1 parent 96f5037 commit 9b7883b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/coreclr/jit/hwintrinsiccodegenarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,9 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
{
// fmov reg1, reg2
assert(GetEmitter()->IsMovInstruction(ins));
assert(intrin.baseType == intrin.op1->gtType);
GetEmitter()->emitIns_Mov(ins, emitTypeSize(intrin.baseType), targetReg, op1Reg,
/* canSkip */ false, INS_OPTS_NONE);
/* canSkip */ true, INS_OPTS_NONE);
}
else
{
Expand Down Expand Up @@ -806,7 +807,8 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
{
assert(intrin.baseType == TYP_DOUBLE);
assert(GetEmitter()->IsMovInstruction(ins));
GetEmitter()->emitIns_Mov(ins, emitSize, targetReg, op1Reg, /* canSkip */ false, opt);
assert(intrin.baseType == intrin.op1->gtType);
GetEmitter()->emitIns_Mov(ins, emitSize, targetReg, op1Reg, /* canSkip */ true, opt);
}
else
{
Expand Down

0 comments on commit 9b7883b

Please sign in to comment.