Introduce API for codegen getting temp registers from gtRsvdRegs
authorBruce Forstall <brucefo@microsoft.com>
Thu, 13 Apr 2017 00:16:46 +0000 (17:16 -0700)
committerBruce Forstall <brucefo@microsoft.com>
Fri, 14 Apr 2017 20:19:29 +0000 (13:19 -0700)
commita07bddd49d411523e2b496bcf26d0dbeb7213183
tree1f9cc899c078a06127f5dac4c395ad6c483802d8
parente5b2af967c89f78fcd68c444de0b2adba1a8e9dd
Introduce API for codegen getting temp registers from gtRsvdRegs

LSRA puts a set of temporary registers needed by a node in the
gtRsvdRegs register mask. Currently, evey codegen function that
needs to use a temporary register manually manipulates this mask.

Introduce a few functions to make this simpler and more regular:

1. GetSingleTempReg() // Gets a temp; asserts there is exactly one temp reg.
2. ExtractTempReg() // Gets the lowest temp, removes it from gtRsvdRegs so subsequent calls don't see it.
3. AvailableTempRegCount() // Returns a count of available temp registers.

All take an optional register mask, so you can extract a register from
just the set specified by the mask (typically RBM_ALLINT or RBM_ALLFLOAT).

Commit migrated from https://github.com/dotnet/coreclr/commit/950b0904511058e3d0254009573535e576fe4574
14 files changed:
src/coreclr/src/jit/codegenarm.cpp
src/coreclr/src/jit/codegenarm64.cpp
src/coreclr/src/jit/codegenarmarch.cpp
src/coreclr/src/jit/codegencommon.cpp
src/coreclr/src/jit/codegeninterface.h
src/coreclr/src/jit/codegenxarch.cpp
src/coreclr/src/jit/emitarm.cpp
src/coreclr/src/jit/emitarm64.cpp
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/gentree.h
src/coreclr/src/jit/lsraarm.cpp
src/coreclr/src/jit/lsraarm64.cpp
src/coreclr/src/jit/simdcodegenxarch.cpp