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
cpu/t11: minor enhancements: #11964
cpu/t11: minor enhancements: #11964
Conversation
Opcode fetch ignores least significant bit of PC; some tests check this. MTPS and MFPS are byte-wide instructions. Define instruction set variants and reject instructions that are invalid for current CPU type.
src/devices/cpu/t11/t11ops.hxx
Outdated
/* test if insn is supported by the CPU */ | ||
#define CHECK_IS(d) if (!(c_insn_set & (d))) { illegal(op); return; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can produce weird effects if someone does something like:
if (foo)
CHECK_IS(IS_LEIS)
else
bar();
To make the macro work more like a single statement, wrap it in a dummy do/while loop:
#define CHECK_IS(d) do { if (!(c_insn_set & (d))) { illegal(op); return; } while (false)
#define T11_IRQ0 0 /* IRQ0 */ | ||
#define T11_IRQ1 1 /* IRQ1 */ | ||
#define T11_IRQ2 2 /* IRQ2 */ | ||
#define T11_IRQ3 3 /* IRQ3 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These input line constants are used in at least src/mame/dec/pdp11.cpp and possibly other places. The code currently doesn’t compile. If you give them a new home (e.g. as static inline constexpr
inside t11_device
), please do a full build and update everything that uses them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update that to use existing enum (t11_device::CP0_LINE)
* Ignore least significant bit of PC when fetching opcodes. * Corrected MTPS and MFPS to be byte-wide. * Reject instructions not implemented by each variant.
* Ignore least significant bit of PC when fetching opcodes. * Corrected MTPS and MFPS to be byte-wide. * Reject instructions not implemented by each variant.
Opcode fetch ignores least significant bit of PC; some tests check this. MTPS and MFPS are byte-wide instructions.
Define instruction set variants and reject instructions that are invalid for current CPU type.