[llvm] 2bc0950 - [AMDGPU] Use llvm::bit_cast (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 12 21:59:21 PST 2023
Author: Kazu Hirata
Date: 2023-02-12T21:59:14-08:00
New Revision: 2bc095037eb64c55e63888ac9c7adde33a4ed933
URL: https://github.com/llvm/llvm-project/commit/2bc095037eb64c55e63888ac9c7adde33a4ed933
DIFF: https://github.com/llvm/llvm-project/commit/2bc095037eb64c55e63888ac9c7adde33a4ed933.diff
LOG: [AMDGPU] Use llvm::bit_cast (NFC)
AFAICT, this is the only place where we pass a 64-bit value into
BitsToFloat.
Added:
Modified:
llvm/lib/Target/AMDGPU/MCTargetDesc/R600InstPrinter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/R600InstPrinter.cpp b/llvm/lib/Target/AMDGPU/MCTargetDesc/R600InstPrinter.cpp
index f77ed1faf029c..22d0594e2b86a 100644
--- a/llvm/lib/Target/AMDGPU/MCTargetDesc/R600InstPrinter.cpp
+++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/R600InstPrinter.cpp
@@ -97,7 +97,7 @@ void R600InstPrinter::printLiteral(const MCInst *MI, unsigned OpNo,
assert(Op.isImm() || Op.isExpr());
if (Op.isImm()) {
int64_t Imm = Op.getImm();
- O << Imm << '(' << BitsToFloat(Imm) << ')';
+ O << Imm << '(' << llvm::bit_cast<float>(static_cast<uint32_t>(Imm)) << ')';
}
if (Op.isExpr()) {
Op.getExpr()->print(O << '@', &MAI);
More information about the llvm-commits
mailing list