mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 14:43:08 +00:00
asm: Fix replacing reg names that are substrings (DAIF etc)
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
48db941199
commit
6c005ddd49
1 changed files with 2 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
import os, tempfile, shutil, subprocess
|
||||
import os, tempfile, shutil, subprocess, re
|
||||
from . import sysreg
|
||||
|
||||
__all__ = ["AsmException", "ARMAsm"]
|
||||
|
@ -55,7 +55,7 @@ class BaseAsm(object):
|
|||
|
||||
def compile(self, source):
|
||||
for name, enc in sysreg.sysreg_fwd.items():
|
||||
source = source.replace(name, f"s{enc[0]}_{enc[1]}_c{enc[2]}_c{enc[3]}_{enc[4]}")
|
||||
source = re.sub("\\b" + name + "\\b", f"s{enc[0]}_{enc[1]}_c{enc[2]}_c{enc[3]}_{enc[4]}", source)
|
||||
|
||||
self.sfile = self._tmp + "b.S"
|
||||
with open(self.sfile, "w") as fd:
|
||||
|
|
Loading…
Reference in a new issue