[PATCH] [ARM64]Scalar right shift uint64_t by 64 generates incorrect result.

Hao Liu Hao.Liu at arm.com
Wed May 14 02:15:02 PDT 2014


Committed in http://llvm.org/viewvc/llvm-project?view=revision&revision=208761.

Thanks,
-Hao

================
Comment at: lib/CodeGen/CGBuiltin.cpp:5583
@@ -5582,3 +5582,1 @@
     return Builder.CreateShl(
-        Ops[0], ConstantInt::get(Int64Ty, std::min(static_cast<uint64_t>(63),
-                                                   Amt->getZExtValue())),
----------------
The shift amount is always in range [0, 63] for left shift. If we give a number not in that range, clang will report an error. So don't need to std::min with 63.

http://reviews.llvm.org/D3755






More information about the cfe-commits mailing list