Skip to content

WIP: symbolic opcode#1

Closed
mmcloughlin wants to merge 5 commits intopartial_evalfrom
mbm/sym-opcode
Closed

WIP: symbolic opcode#1
mmcloughlin wants to merge 5 commits intopartial_evalfrom
mbm/sym-opcode

Conversation

@mmcloughlin
Copy link
Copy Markdown
Owner

@mmcloughlin mmcloughlin commented Mar 6, 2024

This PR shows adhoc support for symbolic opcodes.

Changes

  • The op argument to dis_decode_entry is changed from value to sym type. This change cascades throughout the dis functions.
  • Extend the sym_inmask implementation with simplification rules.
  • Adds some operations on masks to primops.
  • Hacks in an asli :adhoc command for testing purposes. We would need an actual user interface if we were going to land this.
  • (Unfortunately, my editor has also polluted the PR by removing whitespace and end of lines.)

Example

For comparison, when you ask for semantics for a concrete add immediate:

asm: add x7, x8, #291
opcode: 91048d07

Decoding instruction A64 91048d07
__array _R [ 7 ] = add_bits.0 {{ 64 }} ( __array _R [ 8 ],'0000000000000000000000000000000000000000000000000000000100100011' ) ;

ASLp can now execute opcodes that are expressions. For example the assembly template add x7, x8, #<imm> would be the opcode concatenation 0x244:imm:0x107. It now gives the semantics:

__array _R [ 7 ] = add_bits.0 {{ 64 }} ( __array _R [ 8 ],append_bits.0 {{ 52,12 }} ( '0000000000000000000000000000000000000000000000000000',imm [ 0 +: 12 ] ) ) ;

mmcloughlin added a commit that referenced this pull request Oct 4, 2024
@mmcloughlin mmcloughlin mentioned this pull request Oct 4, 2024
@mmcloughlin
Copy link
Copy Markdown
Owner Author

Preserving this as-is. Rebased on latest and continued work in #4.

@mmcloughlin mmcloughlin closed this Oct 4, 2024
mmcloughlin added a commit that referenced this pull request Oct 5, 2024
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.

1 participant