OpcodeDispatcher: add ExtractPair helper

terser and will aid coalescing, as well as eventual transition to multidest
extracts which is what we'll actually want.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
Alyssa Rosenzweig 2024-05-21 17:08:08 -04:00
parent 4c7595c68a
commit 1a18e392f8

View File

@ -1576,6 +1576,14 @@ private:
StoreResult(GPRClass, Op, Result, -1);
}
std::pair<OrderedNode*, OrderedNode*> ExtractPair(OpSize Size, OrderedNode* Pair) {
// Extract high first. This is a hack to improve coalescing.
OrderedNode* Hi = _ExtractElementPair(Size, Pair, 1);
OrderedNode* Lo = _ExtractElementPair(Size, Pair, 0);
return std::make_pair(Lo, Hi);
}
// Helper to derive Dest by a given builder-using Expression with the opcode
// replaced with NewOp. Useful for generic building code. Not safe in general.
// but does the right handling of ImplicitFlagClobber at least and must be