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

Zero register destination operands in multi-destination register AArch64 instructions #375

Open
jj16791 opened this issue Jan 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jj16791
Copy link
Contributor

jj16791 commented Jan 26, 2024

In #352, an update was made to address the issue with zero registers as destination operands. Namely, the results vector has been modified to include entries for these zero registers in its tail elements whilst the destinationRegisters vector has zero registers excluded. I.e.

results = {{implicit destinations}, {explicit non-zero registers}, {explicit zero registers}}

destinationRegisters = {{implicit destinations}, {explicit non-zero registers}}

This way, zero registers destination indexes can be consumed in the instruction execution logic but not written to at the writeback stage or equivalent.

An issue arises when there's a mismatch between results and destinationRegisters indexes. For example, take an instruction with the destination registers of xzr and x0. The results vector would therefore have two entries with xzr = results[0] and x0 = results[1]. In our writeback stage, we iterate over the results vector and set the corresponding register (the same vector index) in destinationRegisters to be that value. In this case, destinationRegisters[0] == x0 and thus x0 = results[0] not results[1] like it should. You also run into the issue of trying to access destinationRegisters[1] which doesn't exist.

@jj16791 jj16791 added the bug Something isn't working label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ToDo
Development

No branches or pull requests

1 participant