mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user