Skip to content

Commit

Permalink
Changed argument key
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesouza committed Mar 19, 2024
1 parent d8ad549 commit 6d7c15d
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions osaca/parser/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,26 +166,26 @@ def __repr__(self):
def equals(self, other, isa):
if isa == "aarch64":
# check for wildcards
if reg.prefix == self.WILDCARD or i_reg.prefix == self.WILDCARD:
if reg.shape is not None:
if i_reg.shape is not None and (
reg.shape == i_reg.shape or self.WILDCARD in (reg.shape + i_reg.shape)
if self.prefix == self.WILDCARD or other.prefix == self.WILDCARD:
if self.shape is not None:
if other.shape is not None and (
self.shape == other.shape or self.WILDCARD in (self.shape + other.shape)
):
return True
return False
return True
# check for prefix and shape
if reg.prefix != i_reg.prefix:
if self.prefix != other.prefix:
return False
if reg.shape is not None:
if i_reg.shape is not None and (
reg.shape == i_reg.shape or self.WILDCARD in (reg.shape + i_reg.shape)
if self.shape is not None:
if other.shape is not None and (
self.shape == other.shape or self.WILDCARD in (self.shape + other.shape)
):
return True
return False
if reg.lanes is not None:
if i_reg.lanes is not None and (
reg.lanes == i_reg.lanes or self.WILDCARD in (reg.lanes + i_reg.lanes)
if self.lanes is not None:
if other.lanes is not None and (
self.lanes == other.lanes or self.WILDCARD in (self.lanes + other.lanes)
):
return True
return False
Expand All @@ -196,47 +196,47 @@ def equals(self, other, isa):
return True
return False
if isinstance(i_reg, RegisterOperand):

Check failure on line 198 in osaca/parser/register.py

View workflow job for this annotation

GitHub Actions / Flake8

osaca/parser/register.py#L198

Undefined name 'i_reg' (F821)
i_reg_name = i_reg.name
i_reg_name = other.name
else:
i_reg_name = i_reg

Check failure on line 201 in osaca/parser/register.py

View workflow job for this annotation

GitHub Actions / Flake8

osaca/parser/register.py#L201

Undefined name 'i_reg' (F821)
# check for wildcards
if isinstance(reg, str):

Check failure on line 203 in osaca/parser/register.py

View workflow job for this annotation

GitHub Actions / Flake8

osaca/parser/register.py#L203

Undefined name 'reg' (F821)
return False
if i_reg_name is None and reg.name is None:
if i_reg_name is None and self.name is None:
return True
if i_reg_name == self.WILDCARD or reg.name == self.WILDCARD:
if i_reg_name == self.WILDCARD or self.name == self.WILDCARD:
return True
# differentiate between vector registers (mm, xmm, ymm, zmm) and others (gpr)
parser_x86 = ParserX86ATT()

Check failure on line 210 in osaca/parser/register.py

View workflow job for this annotation

GitHub Actions / Flake8

osaca/parser/register.py#L210

Undefined name 'ParserX86ATT' (F821)
if parser_x86.is_vector_register(reg):

Check failure on line 211 in osaca/parser/register.py

View workflow job for this annotation

GitHub Actions / Flake8

osaca/parser/register.py#L211

Undefined name 'reg' (F821)
if reg.name.rstrip(string.digits).lower() == i_reg_name:
if self.name.rstrip(string.digits).lower() == i_reg_name:

Check failure on line 212 in osaca/parser/register.py

View workflow job for this annotation

GitHub Actions / Flake8

osaca/parser/register.py#L212

Undefined name 'string' (F821)
# Consider masking and zeroing for AVX512
if consider_masking:

Check failure on line 214 in osaca/parser/register.py

View workflow job for this annotation

GitHub Actions / Flake8

osaca/parser/register.py#L214

Undefined name 'consider_masking' (F821)
mask_ok = zero_ok = True
if reg.mask is not None or i_reg.mask is not None:
if self.mask is not None or other.mask is not None:
# one instruction is missing the masking while the other has it
mask_ok = False
# check for wildcard
if (
(
reg.mask is not None
and reg.mask.rstrip(string.digits).lower() == i_reg.mask
self.mask is not None
and self.mask.rstrip(string.digits).lower() == other.mask

Check failure on line 223 in osaca/parser/register.py

View workflow job for this annotation

GitHub Actions / Flake8

osaca/parser/register.py#L223

Undefined name 'string' (F821)
)
or reg.mask == self.WILDCARD
or i_reg.mask == self.WILDCARD
or self.mask == self.WILDCARD
or other.mask == self.WILDCARD
):
mask_ok = True
if bool(reg.zeroing) ^ bool("zeroing" in i_reg):
if bool(self.zeroing) ^ bool("zeroing" in i_reg):

Check failure on line 229 in osaca/parser/register.py

View workflow job for this annotation

GitHub Actions / Flake8

osaca/parser/register.py#L229

Undefined name 'i_reg' (F821)
# one instruction is missing zeroing while the other has it
zero_ok = False
# check for wildcard
if i_reg.zeroing == self.WILDCARD or reg.zeroing == self.WILDCARD:
if other.zeroing == self.WILDCARD or self.zeroing == self.WILDCARD:
zero_ok = True
if not mask_ok or not zero_ok:
return False
return True
else:
if reg.name.rstrip(string.digits).lower() == i_reg_name:
if self.name.rstrip(string.digits).lower() == i_reg_name:

Check failure on line 239 in osaca/parser/register.py

View workflow job for this annotation

GitHub Actions / Flake8

osaca/parser/register.py#L239

Undefined name 'string' (F821)
return True
if i_reg_name == "gpr":
return True
Expand Down

0 comments on commit 6d7c15d

Please sign in to comment.