mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
PR7774: Fix undefined shifts in Alpha backend. As a bonus, this actually
improves the generated code in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109985 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -113,8 +113,8 @@ namespace {
|
||||
static uint64_t getNearPower2(uint64_t x) {
|
||||
if (!x) return 0;
|
||||
unsigned at = CountLeadingZeros_64(x);
|
||||
uint64_t complow = 1 << (63 - at);
|
||||
uint64_t comphigh = 1 << (64 - at);
|
||||
uint64_t complow = 1ULL << (63 - at);
|
||||
uint64_t comphigh = 1ULL << (64 - at);
|
||||
//cerr << x << ":" << complow << ":" << comphigh << "\n";
|
||||
if (abs64(complow - x) <= abs64(comphigh - x))
|
||||
return complow;
|
||||
|
Reference in New Issue
Block a user