summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorKalle Raiskila <kalle.raiskila@nokia.com>2010-12-17 09:36:09 +0000
committerKalle Raiskila <kalle.raiskila@nokia.com>2010-12-17 09:36:09 +0000
commitaffe15fd670751058444094c306d60e3059714ab (patch)
tree089a0763b38a6c69181e303f2e6ca653c4c515c8 /llvm/lib
parent1b0340a1dd96cb450c1ebe9f1250a135b2876819 (diff)
downloadbcm5719-llvm-affe15fd670751058444094c306d60e3059714ab.tar.gz
bcm5719-llvm-affe15fd670751058444094c306d60e3059714ab.zip
Don't feed 19 bit immediates to ILA.
Patch (slightly modified) by Visa Putkinen. llvm-svn: 122052
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/CellSPU/SPUOperands.td6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/CellSPU/SPUOperands.td b/llvm/lib/Target/CellSPU/SPUOperands.td
index 3c8b3c3442f..96cde51709e 100644
--- a/llvm/lib/Target/CellSPU/SPUOperands.td
+++ b/llvm/lib/Target/CellSPU/SPUOperands.td
@@ -143,7 +143,7 @@ def immU16 : PatLeaf<(imm), [{
def imm18 : PatLeaf<(imm), [{
// imm18 predicate: True if the immediate fits into an 18-bit unsigned field.
int Value = (int) N->getZExtValue();
- return ((Value & ((1 << 19) - 1)) == Value);
+ return isUInt<18>(Value);
}]>;
def lo16 : PatLeaf<(imm), [{
@@ -203,7 +203,7 @@ def FPimm_sext16 : SDNodeXForm<fpimm, [{
def FPimm_u18 : SDNodeXForm<fpimm, [{
float fval = N->getValueAPF().convertToFloat();
- return getI32Imm(FloatToBits(fval) & ((1 << 19) - 1));
+ return getI32Imm(FloatToBits(fval) & ((1 << 18) - 1));
}]>;
def fpimmSExt16 : PatLeaf<(fpimm), [{
@@ -225,7 +225,7 @@ def hi16_f32 : PatLeaf<(fpimm), [{
def fpimm18 : PatLeaf<(fpimm), [{
if (N->getValueType(0) == MVT::f32) {
uint32_t Value = FloatToBits(N->getValueAPF().convertToFloat());
- return ((Value & ((1 << 19) - 1)) == Value);
+ return isUInt<18>(Value);
}
return false;
OpenPOWER on IntegriCloud