Add more patterns to match in the integer comparison test harnesses.

Fix bugs encountered, mostly due to range matching for immediates;
the CellSPU's 10-bit immediates are sign extended, covering a
larger range of unsigned values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48575 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Scott Michel
2008-03-20 00:51:36 +00:00
parent 71d83741d2
commit 79698f60c4
6 changed files with 34 additions and 16 deletions

View File

@@ -76,9 +76,8 @@ def uimm7: PatLeaf<(imm), [{
// immSExt8 predicate - True if the immediate fits in an 8-bit sign extended
// field.
def immSExt8 : PatLeaf<(imm), [{
int Value = (int) N->getValue();
int Value8 = (Value << 24) >> 24;
return (Value < 0xff && (Value8 >= -128 && Value8 < 127));
int Value = int(N->getSignExtended());
return (Value >= -(1 << 8) && Value <= (1 << 8) - 1);
}]>;
// immU8: immediate, unsigned 8-bit quantity