[clang] [Clang][AArch64] Add customisable immediate range checking to NEON (PR #100278)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 25 08:21:30 PDT 2024


================
@@ -215,7 +215,37 @@ namespace clang {
       return ET == Poly8 || ET == Poly16 || ET == Poly64;
     }
     bool isUnsigned() const { return (Flags & UnsignedFlag) != 0; }
-    bool isQuad() const { return (Flags & QuadFlag) != 0; }
+    bool isQuad() const { return (Flags & QuadFlag) != 0; };
+    unsigned getEltSizeInBits() const {
+      switch (getEltType()) {
+      case Int8:
+      case Poly8:
+        return 8;
+      case Int16:
+      case Float16:
+      case Poly16:
+      case BFloat16:
+        return 16;
+      case Int32:
+      case Float32:
+        return 32;
+      case Int64:
+      case Float64:
+      case Poly64:
+        return 64;
+      case Poly128:
+        return 128;
+      default:
+        llvm_unreachable("Invalid NeonTypeFlag!");
+      }
+    }
+  };
+
+  // Shared between SVE/SME and NEON
+  enum ArmImmCheckType {
----------------
Lukacma wrote:

I am not sure there is a need to rename it from ImmCheckType

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


More information about the cfe-commits mailing list