Add an int64_t variant of abs, for host environments

without one.  Use it where we were using abs on
int64_t objects.
(I strongly suspect the casts to unsigned in the
fragments in LoopStrengthReduce are not doing whatever
the original intent was, but the obvious change to
uint64_t doesn't work.  Maybe later.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71612 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dale Johannesen
2009-05-13 00:24:22 +00:00
parent 0e0da734bb
commit 7b9486ad43
3 changed files with 12 additions and 5 deletions

View File

@@ -69,7 +69,7 @@ def nearP2X : SDNodeXForm<imm, [{
}]>;
def nearP2RemX : SDNodeXForm<imm, [{
uint64_t x =
abs(N->getZExtValue() - getNearPower2((uint64_t)N->getZExtValue()));
abs64(N->getZExtValue() - getNearPower2((uint64_t)N->getZExtValue()));
return getI64Imm(Log2_64(x));
}]>;
@@ -124,7 +124,7 @@ def immRemP2 : PatLeaf<(imm), [{
getNearPower2((uint64_t)N->getZExtValue()));
}]>;
def immUExt8ME : PatLeaf<(imm), [{ //use this imm for mulqi
int64_t d = abs((int64_t)N->getZExtValue() -
int64_t d = abs64((int64_t)N->getZExtValue() -
(int64_t)getNearPower2((uint64_t)N->getZExtValue()));
if (isPowerOf2_64(d)) return false;
switch (d) {