mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user