Improved the Baresifter program a bit.
Added 2 bitmask parameters: detect_prefixes and used_prefixes.
Both default to 0xFF (use all available) for compatibility.
Now the two settings work as follows:
- The bit in the variable represents the prefix group (bit 0=LOCK/REPNE/REP, bit 1=segment overrides, bit 2=operand size override, bit 3=address size override, bit 4=REX prefixes).
- Clearing a bit excludes a group from detection or being used in sifting (not being used effectively skips the instructions containing them).
detect_prefixes affects how the prefixes are detected at all. Clearing a bit makes it behave like an opcode, otherwise it's a prefix.
This thus affects whether a prefix is a prefix or an opcode.
Then, once the prefix vs opcode and count is determined, when filtering the instructions to execute, clearing the bit in used_prefixes filters it to not appear in the results (effectively being skipped from running).
The nice thing about is, you can combine the two to disable certain prefixes from being prefixes on certain machines (like REX not existing on a pure x86 machine, being a normal opcode instead), thus detect_prefixes is required.
On plain x86 (until Pentium 4 at least, probably newer as well) you'd set detect_prefixes to 15, thus excluding REX from being a prefix (it's actually an INC/DEC opcode instead).
Then, when sifting, you might want to exclude prefixes that don't affect the instruction in a visible way anyway (other than faults perhaps). Thus you can exclude the segment overrides at least (thus setting used_prefixes=13 on x86 machines).
So this is what I end up with right now:
The attachment baresifter_floppy_operand-addresssize_lock-repne-rep.zip is no longer available
The attachment baresifter.x86_i386_prefixesconfigurable.zip is no longer available
Edit: Although the Analyzer that's included can't skip opcode groups yet so far. Haven't looked at that one.
UniPCemu is now happily churning away at that latest baresifter build, with 2 prefixes etc. and the other prefixes (REX detection disabled and segment override prefixes skipped).
That will cause the segment override instructions to error out, but will provide much better coverage because of the reducing of executed instructions inside UniPCemu, which is slow enough as it is.
Edit: Actually, screw that. Excluding LOCK/REP/REPNZ as well, as those only affect the faulting behaviour in this case, not the instruction length I want to know about.
So restarting once again.
The attachment baresifter_floppy_opeandaddresssizeonly.zip is no longer available
(Although all that's changed is the syslinux.cfg file in this case)
Simply the address and operand size prefixes (not using any of those other prefixes) would make the Analyzer spew out all those opcodes using that, but the instructions not using those prefixes should be relatively easy to spot in the error log?
Or perhaps some option is needed to exclude those from the analyzer as well somehow?