bugfixes for SP reg and ccodes

This commit is contained in:
JanLJL
2023-12-12 18:32:43 +01:00
parent 78387a374d
commit c5ef5f7432
3 changed files with 10 additions and 6 deletions

View File

@@ -850,7 +850,7 @@ instruction_forms:
shape: "*"
source: true
destination: false
- name: ldp
- name: [ldp, ldnp]
operands:
- class: register
prefix: "*"
@@ -895,7 +895,7 @@ instruction_forms:
source: true
destination: false
operation: "op1['name'] = op2['name']; op1['value'] = op2['value']"
- name: stp
- name: [stp, stnp]
operands:
- class: register
prefix: "*"

View File

@@ -382,7 +382,7 @@ class ParserAArch64(BaseParser):
):
# resolve ranges and lists
return self.resolve_range_list(self.process_register_list(operand[self.REGISTER_ID]))
if self.REGISTER_ID in operand and operand[self.REGISTER_ID]["name"] == "sp":
if self.REGISTER_ID in operand and operand[self.REGISTER_ID]["name"].lower() == "sp":
return self.process_sp_register(operand[self.REGISTER_ID])
# add value attribute to floating point immediates without exponent
if self.IMMEDIATE_ID in operand:
@@ -404,9 +404,13 @@ class ParserAArch64(BaseParser):
base = memory_address.get("base", None)
index = memory_address.get("index", None)
scale = 1
if base is not None and "name" in base and base["name"] == "sp":
if base is not None and "name" in base and base["name"].lower() == "sp":
base["prefix"] = "x"
if index is not None and "name" in index and index["name"] == "sp":
if index is not None and "name" in index and index["name"].lower() == "sp":
index["prefix"] = "x"
if base is not None and "name" in base and base["name"].lower() == "zr":
base["prefix"] = "x"
if index is not None and "name" in index and index["name"].lower() == "zr":
index["prefix"] = "x"
valid_shift_ops = ["lsl", "uxtw", "uxtb", "sxtw"]
if "index" in memory_address:

View File

@@ -589,7 +589,7 @@ class MachineModel(object):
return i_operand["class"] == "prfop"
# condition
if "condition" in operand:
if i_operand["ccode"] == self.WILDCARD:
if i_operand["class"] == "condition" and i_operand["ccode"] == self.WILDCARD:
return True
return i_operand["class"] == "condition" and (
operand.get("condition", None) == i_operand.get("ccode", None).upper()