From 4ed9bcf63ab72b401ef0bf70b9152754c53ad2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Calixte?= Date: Sat, 27 Mar 2021 18:38:30 +0100 Subject: asm_processor: support asm comments with ; --- tools/asm_processor/asm_processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/asm_processor/asm_processor.py') diff --git a/tools/asm_processor/asm_processor.py b/tools/asm_processor/asm_processor.py index ec01c68e..d97dfe86 100755 --- a/tools/asm_processor/asm_processor.py +++ b/tools/asm_processor/asm_processor.py @@ -375,14 +375,14 @@ def is_temp_name(name): # https://stackoverflow.com/a/241506 def re_comment_replacer(match): s = match.group(0) - if s[0] in "/#": + if s[0] in "/#;": return " " else: return s re_comment_or_string = re.compile( - r'#.*|/\*.*?\*/|"(?:\\.|[^\\"])*"' + r';.*|#.*|/\*.*?\*/|"(?:\\.|[^\\"])*"' ) -- cgit v1.2.3 From 352625ff40a989775c396b1db2c6e4fcc22b1967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Calixte?= Date: Sat, 27 Mar 2021 18:38:59 +0100 Subject: asm_processor: count bls, .word and .extern correctly --- tools/asm_processor/asm_processor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/asm_processor/asm_processor.py') diff --git a/tools/asm_processor/asm_processor.py b/tools/asm_processor/asm_processor.py index d97dfe86..13ebf106 100755 --- a/tools/asm_processor/asm_processor.py +++ b/tools/asm_processor/asm_processor.py @@ -584,8 +584,12 @@ class GlobalAsmBlock: elif line.startswith('.byte'): self.add_sized(len(line.split(',')), real_line) # Branches are 4 bytes long - elif line.startswith('bl'): + elif line.startswith('bl') and not line.startswith('bls'): self.add_sized(4, real_line) + elif line.startswith('.word'): + self.add_sized(4, real_line) + elif line.startswith('.extern'): + pass else: # Unfortunately, macros are hard to support for .rodata -- # we don't know how how space they will expand to before -- cgit v1.2.3 From e831892511c1440df4e20f5ae1478c2b86d17060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Calixte?= Date: Sat, 27 Mar 2021 18:39:33 +0100 Subject: asm_processor: split padding functions are broken so set a high limit --- tools/asm_processor/asm_processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/asm_processor/asm_processor.py') diff --git a/tools/asm_processor/asm_processor.py b/tools/asm_processor/asm_processor.py index 13ebf106..f0054204 100755 --- a/tools/asm_processor/asm_processor.py +++ b/tools/asm_processor/asm_processor.py @@ -9,7 +9,7 @@ import os from collections import namedtuple, defaultdict from io import StringIO -MAX_FN_SIZE = 100 +MAX_FN_SIZE = 3000 SLOW_CHECKS = False EI_NIDENT = 16 -- cgit v1.2.3 From da21d9dc67083e0076e478e332fbda9a9e493e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Calixte?= Date: Sat, 27 Mar 2021 18:40:05 +0100 Subject: asm_processor: fix number of skip instructions --- tools/asm_processor/asm_processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/asm_processor/asm_processor.py') diff --git a/tools/asm_processor/asm_processor.py b/tools/asm_processor/asm_processor.py index f0054204..5c909388 100755 --- a/tools/asm_processor/asm_processor.py +++ b/tools/asm_processor/asm_processor.py @@ -824,7 +824,7 @@ def repl_float_hex(m): def parse_source(f, opt, framepointer, input_enc, output_enc, print_source=None): opt = "O4" min_instr_count = 3 # idk - skip_instr_count = 2 # idk + skip_instr_count = 3 # mandatory instructions: push, pop and mov r0, 0 use_jtbl_for_rodata = False if opt in ['O2', 'g3'] and not framepointer: -- cgit v1.2.3