diff options
author | Hanjoung Lee <hanjoung.lee@samsung.com> | 2017-08-10 15:35:38 +0900 |
---|---|---|
committer | Hanjoung Lee <hanjoung.lee@samsung.com> | 2017-08-10 15:40:11 +0900 |
commit | 7c3b04a5ef20104e842135ac59ec11309123147e (patch) | |
tree | de7ad0736eb2f2765808d33b783c0f03a5ac82b2 | |
parent | 3e4965efc916cae2040aa0abd766a470a45aa658 (diff) | |
download | coreclr-7c3b04a5ef20104e842135ac59ec11309123147e.tar.gz coreclr-7c3b04a5ef20104e842135ac59ec11309123147e.tar.bz2 coreclr-7c3b04a5ef20104e842135ac59ec11309123147e.zip |
[RyuJIT/armel] Introduce GetRegCount() for MultiRegOp
Abstract getting reg count with method GetRegCount()
Added the case when the reg count is 0.
-rw-r--r-- | src/jit/codegenlinear.cpp | 4 | ||||
-rw-r--r-- | src/jit/gentree.h | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/jit/codegenlinear.cpp b/src/jit/codegenlinear.cpp index dfe0458c51..eb49edbf8d 100644 --- a/src/jit/codegenlinear.cpp +++ b/src/jit/codegenlinear.cpp @@ -1037,7 +1037,7 @@ void CodeGen::genUnspillRegIfNeeded(GenTree* tree) else if (unspillTree->OperIsMultiRegOp()) { GenTreeMultiRegOp* multiReg = unspillTree->AsMultiRegOp(); - unsigned regCount = multiReg->gtOtherReg == REG_NA ? 1 : 2; + unsigned regCount = multiReg->GetRegCount(); // In case of split struct argument node, GTF_SPILLED flag on it indicates that // one or more of its result regs are spilled. Call node needs to be @@ -1685,7 +1685,7 @@ void CodeGen::genProduceReg(GenTree* tree) else if (tree->OperIsMultiRegOp()) { GenTreeMultiRegOp* multiReg = tree->AsMultiRegOp(); - unsigned regCount = multiReg->gtOtherReg == REG_NA ? 1 : 2; + unsigned regCount = multiReg->GetRegCount(); for (unsigned i = 0; i < regCount; ++i) { diff --git a/src/jit/gentree.h b/src/jit/gentree.h index 54545aa896..fb447f5ae9 100644 --- a/src/jit/gentree.h +++ b/src/jit/gentree.h @@ -3921,6 +3921,15 @@ struct GenTreeMultiRegOp : public GenTreeOp ClearOtherRegFlags(); } + unsigned GetRegCount() const + { + if (gtRegNum == REG_NA || gtRegNum == REG_STK) + { + return 0; + } + return (gtOtherReg == REG_NA || gtOtherReg == REG_STK) ? 1 : 2; + } + //--------------------------------------------------------------------------- // GetRegNumByIdx: get ith register allocated to this struct argument. // |