diff options
author | Simon Moll <simon.moll@emea.nec.com> | 2021-12-23 14:12:34 +0100 |
---|---|---|
committer | Simon Moll <simon.moll@emea.nec.com> | 2021-12-23 14:12:44 +0100 |
commit | 2810c3403e421560ad3e97053ca7227f81596daf (patch) | |
tree | 7e5c730b7ec54f4e3e0b0e3a1a28fc06ed887e14 /llvm/utils/UpdateTestChecks/asm.py | |
parent | 1e2c31c66be79b6ca6aeb42fc2835017935b8b27 (diff) | |
download | llvm-2810c3403e421560ad3e97053ca7227f81596daf.zip llvm-2810c3403e421560ad3e97053ca7227f81596daf.tar.gz llvm-2810c3403e421560ad3e97053ca7227f81596daf.tar.bz2 |
[VE] Add VE support to update_llc_test_checks
Add VE assembly scrubbing and triple support to update_llc_test_checks.
Reviewed By: kaz7
Differential Revision: https://reviews.llvm.org/D116104
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r-- | llvm/utils/UpdateTestChecks/asm.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py index a877fea..f876b664 100644 --- a/llvm/utils/UpdateTestChecks/asm.py +++ b/llvm/utils/UpdateTestChecks/asm.py @@ -166,6 +166,12 @@ ASM_FUNCTION_WASM32_RE = re.compile( r'^\s*(\.Lfunc_end[0-9]+:\n|end_function)', flags=(re.M | re.S)) +ASM_FUNCTION_VE_RE = re.compile( + r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n' + r'(?P<body>^##?[ \t]+[^:]+:.*?)\s*' + r'.Lfunc_end[0-9]+:\n', + flags=(re.M | re.S)) + SCRUB_X86_SHUFFLES_RE = ( re.compile( r'^(\s*\w+) [^#\n]+#+ ((?:[xyz]mm\d+|mem)( \{%k\d+\}( \{z\})?)? = .*)$', @@ -354,6 +360,16 @@ def scrub_asm_wasm32(asm, args): asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) return asm +def scrub_asm_ve(asm, args): + # Scrub runs of whitespace out of the assembly, but leave the leading + # whitespace in place. + asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm) + # Expand the tabs used for indentation. + asm = string.expandtabs(asm, 2) + # Strip trailing whitespace. + asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) + return asm + def get_triple_from_march(march): triples = { 'amdgcn': 'amdgcn', @@ -361,6 +377,7 @@ def get_triple_from_march(march): 'mips': 'mips', 'sparc': 'sparc', 'hexagon': 'hexagon', + 've': 've', } for prefix, triple in triples.items(): if march.startswith(prefix): @@ -404,6 +421,7 @@ def get_run_handler(triple): 'sparc': (scrub_asm_sparc, ASM_FUNCTION_SPARC_RE), 's390x': (scrub_asm_systemz, ASM_FUNCTION_SYSTEMZ_RE), 'wasm32': (scrub_asm_wasm32, ASM_FUNCTION_WASM32_RE), + 've': (scrub_asm_ve, ASM_FUNCTION_VE_RE), } handler = None best_prefix = '' |