Skip to content
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

Merged
merged 2 commits into from Jan 30, 2024
Merged

cpu/t11: minor enhancements: #11964

merged 2 commits into from Jan 30, 2024

Conversation

shattered
Copy link
Contributor

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.

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.
Comment on lines 271 to 272
/* test if insn is supported by the CPU */
#define CHECK_IS(d) if (!(c_insn_set & (d))) { illegal(op); return; }
Copy link
Member

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)

Comment on lines -16 to -19
#define T11_IRQ0 0 /* IRQ0 */
#define T11_IRQ1 1 /* IRQ1 */
#define T11_IRQ2 2 /* IRQ2 */
#define T11_IRQ3 3 /* IRQ3 */
Copy link
Member

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.

Copy link
Contributor Author

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)

@cuavas cuavas merged commit ca245e2 into mamedev:master Jan 30, 2024
5 checks passed
Mokona pushed a commit to Mokona/mame that referenced this pull request Feb 28, 2024
* Ignore least significant bit of PC when fetching opcodes.
* Corrected MTPS and MFPS to be byte-wide.
* Reject instructions not implemented by each variant.
stonedDiscord pushed a commit to stonedDiscord/mame that referenced this pull request Apr 8, 2024
* Ignore least significant bit of PC when fetching opcodes.
* Corrected MTPS and MFPS to be byte-wide.
* Reject instructions not implemented by each variant.
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.

None yet

2 participants