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

i#1569 AArch64: Fix bug in encoding (SIMD structure load/store). #2527

Merged
merged 3 commits into from
Jul 12, 2017

Conversation

egrimley
Copy link
Contributor

@egrimley egrimley commented Jul 12, 2017

The "x16imm" operand type can be a register, or a constant denoted
in the encoding by register number 31. The value of the constant can
be determined from various bits in the instruction, but those bits
can not be uniquely determined from the constant operand. In particular,
we can not generate bit 30 in this case. Within the constraints of the
current formalism the best solution seems to be to remove bit 30 from
the bits generated by x16imm and duplicate the 14 bit patterns that
use x16imm.

There are other instances of such duplication. The formalism should
perhaps be improved.

Change-Id: I319d8e4b9550d39b11f5dce80fe7801115445446

The "x16imm" operand type can be a register, or a constant denoted
in the encoding by register number 31. The value of the constant can
be determined from various bits in the instruction, but those bits
can not be uniquely determined from the constant operand. In particular,
we can not generate bit 30 in this case. Within the constraints of the
current formalism the best solution seems to be to remove bit 30 from
the bits generated by x16imm and duplicate the 14 bit patterns that
use x16imm.

There are other instances of such duplication. The formalism should
perhaps be improved.

This patch also adds some unnecessary initialisers to prevent certain
compiler versions from breaking the build by incorrectly claiming that
certain variables "may be used uninitialized".

Change-Id: I319d8e4b9550d39b11f5dce80fe7801115445446
@fhahn
Copy link
Contributor

fhahn commented Jul 12, 2017

run aarch64 tests

@fhahn fhahn self-requested a review July 12, 2017 10:16
@@ -135,7 +135,8 @@ def generate_encoder(patterns, opndsgen, opndtypes):
vars = (['dst%d' % i for i in range(len(dsts))] +
['src%d' % i for i in range(len(srcs))])
c += [' int opcode = instr->opcode;']
c += [' uint ' + ', '.join(vars) + ';']
# The initial values are only required to silence a bad compiler warning:
c += [' uint ' + ' = 0, '.join(vars) + ' = 0;']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be cleaner to add the initialisers in a separate commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're probably right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate pull request for initialisers: #2528

@egrimley
Copy link
Contributor Author

run aarch64 tests

@fhahn
Copy link
Contributor

fhahn commented Jul 12, 2017

Would it be hard to add a test case for that, e.g. encoding the newly added variants? I think this would be a helpful regression test if we decide to make changes to the formalism you hinted at.

Also the following sentence should be removed from the final commit message.

This patch also adds some unnecessary initialisers to prevent certain
 compiler versions from breaking the build by incorrectly claiming that
 certain variables "may be used uninitialized".

@egrimley
Copy link
Contributor Author

Yes, it ought to be possible to add a line to dis-a64.txt. I'll see if I can do that.

@egrimley
Copy link
Contributor Author

I'll delete the last paragraph from the description. Presumably I'll have to delete it again when I squash and merge.

Change-Id: I2b83318135bd5e6c736aff1ff330e838417fa3d2
@egrimley
Copy link
Contributor Author

rerun aarch64 tests

Copy link
Contributor

@fhahn fhahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I manually tried the test case and it fails without this patch.

@egrimley egrimley merged commit 654f7b2 into master Jul 12, 2017
@egrimley egrimley deleted the i1569-x16imm branch July 12, 2017 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants