1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

Make these predicates correct in 64-bit mode too.

llvm-svn: 28890
This commit is contained in:
Chris Lattner 2006-06-20 23:21:20 +00:00
parent 75e6449a0f
commit 10d22c274e

View File

@ -122,12 +122,15 @@ def HA16 : SDNodeXForm<imm, [{
def immSExt16 : PatLeaf<(imm), [{
// immSExt16 predicate - True if the immediate fits in a 16-bit sign extended
// field. Used by instructions like 'addi'.
return (int)N->getValue() == (short)N->getValue();
if (N->getValueType(0) == MVT::i32)
return (int32_t)N->getValue() == (short)N->getValue();
else
return (int64_t)N->getValue() == (short)N->getValue();
}]>;
def immZExt16 : PatLeaf<(imm), [{
// immZExt16 predicate - True if the immediate fits in a 16-bit zero extended
// field. Used by instructions like 'ori'.
return (unsigned)N->getValue() == (unsigned short)N->getValue();
return (uint64_t)N->getValue() == (unsigned short)N->getValue();
}], LO16>;
// imm16Shifted* - These match immediates where the low 16-bits are zero. There