to multiply the accumulator by 7. What it's doing is loading X with the constant five, and incrementing it twice, leaving seven. Then it does the multiplication, and then moves the result where it should be.
It's a bit stupid
But picking a random immediate value with any of the possible values picked with a uniform distribution makes it too unattractive to the search function, and it ends up trying to use shifts and things. This is because mutating a single instruction means randomizing all of the opcode and the source and destination operands. It's too great a step.
So we should experiment with some kind of "smaller step". So maybe the mutation here should take immediates and pick one of: increment, decrement, flip-a-bit, negate, etc. In the example above, this would mean offering successively closer values for x in the first instruction, which would reduce the probability of strop inserting these pointless incw instructions.
Strop generated this code:
to multiply the accumulator by 7. What it's doing is loading X with the constant five, and incrementing it twice, leaving seven. Then it does the multiplication, and then moves the result where it should be.
It's a bit stupid
But picking a random immediate value with any of the possible values picked with a uniform distribution makes it too unattractive to the search function, and it ends up trying to use shifts and things. This is because mutating a single instruction means randomizing all of the opcode and the source and destination operands. It's too great a step.
So we should experiment with some kind of "smaller step". So maybe the mutation here should take immediates and pick one of: increment, decrement, flip-a-bit, negate, etc. In the example above, this would mean offering successively closer values for x in the first instruction, which would reduce the probability of strop inserting these pointless
incw
instructions.