Skip to content

Conversation

@kseniadobrovolskaya
Copy link
Contributor

Here is the easiest way to add the agnostic behavior discussed in this issue: Implementation of a special case of an agnostic element behavior policy #2061

Added extensions to implement:
1. Mask agnostic behavior of filling with 1s - xspikema1s
2. Tail agnostic behavior of filling with 1s - xspiketa1s

@kseniadobrovolskaya kseniadobrovolskaya force-pushed the kseniadobrovolskaya/instr-postprocess-plugins branch from 732432c to 7ade0f4 Compare December 2, 2025 12:13
  Added extensions to implement:
    1. Mask agnostic behavior of filling with 1s - xspikema1s
    2. Tail agnostic behavior of filling with 1s - xspiketa1s
@kseniadobrovolskaya kseniadobrovolskaya force-pushed the kseniadobrovolskaya/instr-postprocess-plugins branch from 7ade0f4 to dc0788b Compare December 2, 2025 12:51
@kseniadobrovolskaya
Copy link
Contributor Author

@aswaterman, take a look please

Copy link
Collaborator

@arromanoff arromanoff left a comment

Choose a reason for hiding this comment

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

Instruction post-processing LGTM. I'd like someone else to take a look as well

@arromanoff
Copy link
Collaborator

@aswaterman, @nibrunieAtSi5 Could you review this please?

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

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

I have a few issues with this approach. First, it adds several instructions to the critical execution path--even iterating over an empty list on every instruction materially slows down the simulator. Whatever we do shouldn't have a performance effect on instructions that don't use the feature.

Second, although I am sympathetic to the desire to model a wider variety of implementation-defined behaviors, I'm not convinced that the pattern of a postprocessing hook is either necessary or sufficient to meet our needs. It does work OK for this particular case, but it's more general than necessary for this case. And still, there are other cases for which it doesn't suffice.

Defining a custom extension to modify this behavior does make sense to me, but the way I'd do it is to have the custom instructions redefine these instructions, rather than adding a hook. (Recall, custom extensions in Spike can redefine standard opcodes, since custom extensions are always searched first for an opcode match.) This approach also has the advantage of not requiring any Spike modifications.

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