[flang-commits] [flang] [flang] Silence MSVC warning about shifts (NFC) (PR #83737)
via flang-commits
flang-commits at lists.llvm.org
Sun Mar 3 10:52:50 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-fir-hlfir
Author: AtariDreams (AtariDreams)
<details>
<summary>Changes</summary>
Yes, 64-bit shifts are intended.
---
Full diff: https://github.com/llvm/llvm-project/pull/83737.diff
1 Files Affected:
- (modified) flang/lib/Optimizer/Builder/IntrinsicCall.cpp (+4-4)
``````````diff
diff --git a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
index fb9b58ef69c6ae..a94d3e558c8b29 100644
--- a/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+++ b/flang/lib/Optimizer/Builder/IntrinsicCall.cpp
@@ -3812,7 +3812,7 @@ mlir::Value IntrinsicLibrary::genIeeeClass(mlir::Type resultType,
int pos = 3 + highSignificandSize;
mlir::Value index = builder.create<mlir::arith::AndIOp>(
loc, builder.create<mlir::arith::ShRUIOp>(loc, intVal, signShift),
- createIntegerConstant(1 << pos));
+ createIntegerConstant(1ULL << pos));
// [e] exponent != 0
mlir::Value exponent =
@@ -3824,7 +3824,7 @@ mlir::Value IntrinsicLibrary::genIeeeClass(mlir::Type resultType,
loc,
builder.create<mlir::arith::CmpIOp>(
loc, mlir::arith::CmpIPredicate::ne, exponent, zero),
- createIntegerConstant(1 << --pos), zero));
+ createIntegerConstant(1ULL << --pos), zero));
// [m] exponent == 1..1 (max exponent)
index = builder.create<mlir::arith::OrIOp>(
@@ -3833,7 +3833,7 @@ mlir::Value IntrinsicLibrary::genIeeeClass(mlir::Type resultType,
loc,
builder.create<mlir::arith::CmpIOp>(
loc, mlir::arith::CmpIPredicate::eq, exponent, exponentMask),
- createIntegerConstant(1 << --pos), zero));
+ createIntegerConstant(1ULL << --pos), zero));
// [l] low-order significand != 0
index = builder.create<mlir::arith::OrIOp>(
@@ -3845,7 +3845,7 @@ mlir::Value IntrinsicLibrary::genIeeeClass(mlir::Type resultType,
builder.create<mlir::arith::AndIOp>(loc, intVal,
lowSignificandMask),
zero),
- createIntegerConstant(1 << --pos), zero));
+ createIntegerConstant(1ULL << --pos), zero));
// [h] high-order significand (1 or 2 bits)
index = builder.create<mlir::arith::OrIOp>(
``````````
</details>
https://github.com/llvm/llvm-project/pull/83737
More information about the flang-commits
mailing list