Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consideration of addressing modes #25

Closed
cod3monk opened this issue Jan 15, 2019 · 3 comments
Closed

Consideration of addressing modes #25

cod3monk opened this issue Jan 15, 2019 · 3 comments
Labels

Comments

@cod3monk
Copy link
Member

Is it currently possible to differentiate between simple (base+offset) and complex (base+offset+index*scale) addressing as memory parameters in CSV the file syntax?

@JanLJL
Copy link
Collaborator

JanLJL commented Jan 15, 2019

It is not yet possible to differentiate between different addressing modes in the CSV.
Nevertheless, when creating a parameter, every MemAddr object is checked for the addressing mode and contains the attributes

offset, base, index, scale

which are currently either True or None. This is done during the init of a MemAddr in param.py:

OSACA/osaca/param.py

Lines 27 to 42 in 961364c

name = name.strip(', \t')
self.offset = None
self.base = None
self.index = None
self.scale = None
m = re.match(r'(?P<offset>[x0-9a-fA-F]*)\((?P<base>[^,\)]+)(?:,\s*(?P<index>[^,\)]+)'
r'(?:,\s*(?P<scale>[^,\)]+))?)?\)', name)
if not m:
raise ValueError('Type not supported: {!r}'.format(name))
self.offset = m.group('offset') or None
self.base = m.group('base') or None
self.index = m.group('index') or None
self.scale = m.group('scale') or None

Some examples:

>>> mem = MemAddr('8(%rsp,%rax,8)')
>>> print(mem)
MEM(offset(base, index, scale))
>>> mem = MemAddr('(%rsp,%rax,8)')
>>> print(mem)
MEM((base, index, scale))
>>> mem = MemAddr('(%rsp)')
>>> print(mem)
MEM((base))

@cod3monk
Copy link
Member Author

Okay, the issue is that uops.info also has no notion of different addressing modes and seems to use simple addresses during their benchmarks and therefore consider Port7 as a viable target for all address generation uops. Not yet sure how this should be handled in future.

@cod3monk
Copy link
Member Author

cod3monk commented Feb 4, 2020

solved in new version (dev releases are available)

@cod3monk cod3monk closed this as completed Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants