diff options
author | Akira Akashi <rubenru09@aol.com> | 2021-06-02 22:13:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-02 22:13:57 +0100 |
commit | 9d3d4a2acff67f43896e9e0dcd26e7aaeb55e3b3 (patch) | |
tree | d707aa8fead427dadbbb29b886875e6c8961bd5a /tools/asm_processor/asm_processor.py | |
parent | a2a17a9426f16ee601ff17840b8bb7851fef7138 (diff) | |
parent | 7e32d3758e7e36d7a67a1442cdb9386f9aa18a6e (diff) |
Merge branch 'master' into 0202A1E0
Diffstat (limited to 'tools/asm_processor/asm_processor.py')
-rwxr-xr-x | tools/asm_processor/asm_processor.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/asm_processor/asm_processor.py b/tools/asm_processor/asm_processor.py index ec01c68e..5c909388 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 @@ -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';.*|#.*|/\*.*?\*/|"(?:\\.|[^\\"])*"' ) @@ -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 @@ -820,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: |