Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Add some TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedn committed Oct 2, 2019
1 parent 8c0f467 commit 44466c2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/jit/codegenarmarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,13 @@ void CodeGen::genCodeForInitBlkUnroll(GenTreeBlk* node)
}
else
{
// TODO-CQ: If the local frame offset is too large to be encoded, the emitter automatically
// loads the offset into a reserved register (see CodeGen::rsGetRsvdReg()). If we generate
// multiple store instructions we'll also generate multiple offset loading instructions.
// We could try to detect such cases, compute the base destination address in this reserved
// and use it in all store instructions we generate. Basically this would undo the effect
// of local address containment done by lowering.

assert(dstAddr->OperIsLocalAddr());
dstLclNum = dstAddr->AsLclVarCommon()->GetLclNum();

Expand Down Expand Up @@ -2078,6 +2085,15 @@ void CodeGen::genCodeForCpBlkUnroll(GenTreeBlk* node)
}
else
{
// TODO-CQ: If the local frame offset is too large to be encoded, the emitter automatically
// loads the offset into a reserved register (see CodeGen::rsGetRsvdReg()). If we generate
// multiple store instructions we'll also generate multiple offset loading instructions.
// We could try to detect such cases, compute the base destination address in this reserved
// and use it in all store instructions we generate. Basically this would undo the effect
// of local address containment done by lowering.
//
// Same for the local source address case below.

assert(dstAddr->OperIsLocalAddr());
dstLclNum = dstAddr->AsLclVarCommon()->GetLclNum();

Expand Down
2 changes: 2 additions & 0 deletions src/jit/codegenxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3083,6 +3083,8 @@ void CodeGen::genCodeForInitBlkUnroll(GenTreeBlk* node)
emit->emitIns_R_R(INS_punpckldq, EA_16BYTE, srcXmmReg, srcXmmReg);
#ifdef _TARGET_X86_
// For x86, we need one more to convert it from 8 bytes to 16 bytes.
// TODO-CQ: Instead of 2 punpckldq we could use a single pshufd. This can also be useful
// on x64 as it may avoid the need for an 8 byte immediate.
emit->emitIns_R_R(INS_punpckldq, EA_16BYTE, srcXmmReg, srcXmmReg);
#endif
}
Expand Down

0 comments on commit 44466c2

Please sign in to comment.