mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
Hexagon (target/hexagon) Remove next_PC from runtime state
The imported files don't properly mark all CONDEXEC instructions, so we add some logic to hex_common.py to add the attribute. Acked-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com> Message-Id: <20221108162906.3166-7-tsimpson@quicinc.com>
This commit is contained in:
parent
40085901db
commit
613653e500
10 changed files with 65 additions and 12 deletions
|
@ -66,6 +66,19 @@ def add_qemu_macro_attrib(name, attrib):
|
|||
macros[name].attribs.add(attrib)
|
||||
|
||||
immextre = re.compile(r'f(MUST_)?IMMEXT[(]([UuSsRr])')
|
||||
|
||||
def is_cond_jump(tag):
|
||||
if tag == 'J2_rte':
|
||||
return False
|
||||
if ('A_HWLOOP0_END' in attribdict[tag] or
|
||||
'A_HWLOOP1_END' in attribdict[tag]):
|
||||
return False
|
||||
return \
|
||||
re.compile(r"(if.*fBRANCH)|(if.*fJUMPR)").search(semdict[tag]) != None
|
||||
|
||||
def is_cond_call(tag):
|
||||
return re.compile(r"(if.*fCALL)").search(semdict[tag]) != None
|
||||
|
||||
def calculate_attribs():
|
||||
add_qemu_macro_attrib('fREAD_PC', 'A_IMPLICIT_READS_PC')
|
||||
add_qemu_macro_attrib('fTRAP', 'A_IMPLICIT_READS_PC')
|
||||
|
@ -96,6 +109,11 @@ def calculate_attribs():
|
|||
for regtype, regid, toss, numregs in regs:
|
||||
if regtype == "P" and is_written(regid):
|
||||
attribdict[tag].add('A_WRITES_PRED_REG')
|
||||
# Mark conditional jumps and calls
|
||||
# Not all instructions are properly marked with A_CONDEXEC
|
||||
for tag in tags:
|
||||
if is_cond_jump(tag) or is_cond_call(tag):
|
||||
attribdict[tag].add('A_CONDEXEC')
|
||||
|
||||
def SEMANTICS(tag, beh, sem):
|
||||
#print tag,beh,sem
|
||||
|
@ -211,6 +229,9 @@ def need_ea(tag):
|
|||
def need_PC(tag):
|
||||
return 'A_IMPLICIT_READS_PC' in attribdict[tag]
|
||||
|
||||
def helper_needs_next_PC(tag):
|
||||
return 'A_CALL' in attribdict[tag]
|
||||
|
||||
def need_pkt_has_multi_cof(tag):
|
||||
return 'A_COF' in attribdict[tag]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue