[Mlir-commits] [mlir] [MLIR] Use APFloat semantics to get floating type width (PR #107372)

River Riddle llvmlistbot at llvm.org
Mon Sep 9 15:59:04 PDT 2024


================
@@ -91,21 +91,9 @@ IntegerType IntegerType::scaleElementBitwidth(unsigned scale) {
 //===----------------------------------------------------------------------===//
 
 unsigned FloatType::getWidth() {
-  if (llvm::isa<Float8E5M2Type, Float8E4M3Type, Float8E4M3FNType,
-                Float8E5M2FNUZType, Float8E4M3FNUZType, Float8E4M3B11FNUZType,
-                Float8E3M4Type>(*this))
-    return 8;
-  if (llvm::isa<Float16Type, BFloat16Type>(*this))
-    return 16;
-  if (llvm::isa<Float32Type, FloatTF32Type>(*this))
+  if (llvm::isa<FloatTF32Type>(*this))
     return 32;
----------------
River707 wrote:

Yeah, I don't have a problem with this either

https://github.com/llvm/llvm-project/pull/107372


More information about the Mlir-commits mailing list