Instruction-fetch behaviour: undefined byte in 2-byte instructions

Graggi
Posts: 7
Joined: Thu Jun 29, 2023 7:49 pm

Instruction-fetch behaviour: undefined byte in 2-byte instructions

Postby Graggi » Thu Jul 06, 2023 4:46 pm

Hi,

Chapter 3.5.4.1 Little-Endian Fetch Semantics of the Xtensa Instruction Set Architecture (ISA) Summary [1] provides some example code on its behaviour. One of the comments states:

"-- now have a 24-bit instruction (8 bits undefined if 16-bit), break it into fields"

If I replace the op-code of a 2-byte instruction with the op-code of a 3-byte instruction, would the processor take the first byte of the next instruction as the third byte of the current (former 2-byte) instruction? (That is the behaviour that x86 processors would show in this situtation.)

[1] https://esp32.com/download/file.php?id=10134

Regards

MicroController
Posts: 1749
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Instruction-fetch behaviour: undefined byte in 2-byte instructions

Postby MicroController » Sun Jul 16, 2023 4:05 pm

Are we talking self-modifying code?

If so, from what I gather from the information available, the Xtensa is not very supportive of that. Specifically, AFAICT it provides no means to flush the instruction (prefetch) pipeline. So if and when a write to IRAM becomes "visible" to the instruction decoder depends on whether or not the corresponding location is already prefetched or not.

Who is online

Users browsing this forum: No registered users and 37 guests