================
@@ -0,0 +1,539 @@
+#!/usr/bin/env python3
+"""
+Generate C test files that call ACLE builtins found in a JSON manifest.
+
+Expected JSON input format (array of objects):
+[
+  {
+    "guard": "sve,(sve2p1|sme)",
+    "streaming_guard": "sme",
+    "flags": "feature-dependent",
+    "builtin": "svint16_t svrevd_s16_z(svbool_t, svint16_t);"
+  },
+  ...
+]
+"""
+
+from __future__ import annotations
+
+import argparse
+import json
+import re
+import sys
+from collections import defaultdict
+from dataclasses import dataclass
+from enum import Enum
+from itertools import product
+from pathlib import Path
+from typing import Any, Dict, Iterable, List, Sequence, Tuple
+
+assert sys.version_info >= (3, 7), "Only Python 3.7+ is supported."
+
+
+# Are we testing arm_sve.h or arm_sme.h based builtins.
+class Mode(Enum):
+    SVE = "sve"
+    SME = "sme"
+
+
+class FunctionType(Enum):
+    NORMAL = "normal"
+    STREAMING = "streaming"
+    STREAMING_COMPATIBLE = "streaming-compatible"
+
+
+# Builtins are grouped by their required features.
+@dataclass(frozen=True, order=True)
+class BuiltinContext:
+    guard: str
+    streaming_guard: str
+    flags: tuple[str, ...]
----------------
huntergr-arm wrote:

nit: Tuple

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

Reply via email to