================
@@ -431,133 +434,130 @@ const std::array<SVEEmitter::ReinterpretTypeInfo, 12> 
SVEEmitter::Reinterprets =
 // Type implementation
 
//===----------------------------------------------------------------------===//
 
-std::string SVEType::builtin_str() const {
-  std::string OutStr;
-
-  if (isScalarPredicate())
-    return "b";
-
-  if (isSvcount())
+std::string SVEType::builtinBaseType() const {
+  switch (Kind) {
+  case TypeKind::Void:
+    return "v";
+  case TypeKind::Svcount:
     return "Qa";
-
-  if (isVoid()) {
-    OutStr += "v";
-    if (!isPointer())
-      return OutStr;
-  } else if (isFloat()) {
+  case TypeKind::BFloat16:
+    assert(ElementBitwidth == 16 && "Invalid BFloat16!");
+    return "y";
+  case TypeKind::MFloat8:
+    assert(ElementBitwidth == 8 && "Invalid MFloat8!");
+    return "c";
+  case TypeKind::Float:
     switch (ElementBitwidth) {
     case 16:
-      OutStr += "h";
-      break;
+      return "h";
     case 32:
-      OutStr += "f";
-      break;
+      return "f";
     case 64:
-      OutStr += "d";
-      break;
+      return "d";
     default:
-      llvm_unreachable("Unhandled float type!");
+      llvm_unreachable("Unhandled float width!");
     }
-  } else if (isBFloat()) {
-    assert(ElementBitwidth == 16 && "Not a valid BFloat.");
-    OutStr += "y";
-  } else if (isMFloat()) {
-    assert(ElementBitwidth == 8 && "Not a valid MFloat.");
-    OutStr += "m";
-  } else {
+  case TypeKind::Predicate:
+    if (isScalar())
+      return "b";
+    [[fallthrough]];
+  // SInt/UInt, PredicatePattern, PrefetchOp.
+  default:
----------------
sdesmalen-arm wrote:

They have the size of an `int`, so that would be the string `"i"`.

https://github.com/llvm/llvm-project/pull/117717
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to