The zero-overhead header now can also call for augmented short instruction type instructions to follow it, which allows the use of 15-bit short instructions instead of the more restrictive 14-bit short instructions
more often.
John Savard <quadibloc@invalid.invalid> schrieb:
In order to avoid NOP hell, these have to be filled with the same
instruction length (say 15 bits, like you said above),
is that correct?
You don't have a compiler (obviously), but have you looked at actual
code generated by compilers (for example on godbolt, which is very good)
and checked which instruction sequence would fit which header?
On Mon, 28 Jul 2025 04:39:56 +0000, Thomas Koenig wrote:
John Savard <quadibloc@invalid.invalid> schrieb:
In order to avoid NOP hell, these have to be filled with the same
instruction length (say 15 bits, like you said above),
is that correct?
A block is 256 bits in length, and normally, in the absence of a
header, consists of eight 32-bit instructions. Blocks need, basically,
to be filled with 32-bit instructions to avoid NOPs.
To improve the compactness of code, I have made provision for short instructions; these are nominally 16 bits long, as they're packed
two to a 32-bit word. They can, in reality, be 14 bits long or 15 bits
long, depending on the overhead of indicating them, or 17 bits long or
even longer if some additional bits are provided in the header.
Some headers provide for variable-length instructions. Those headers,
instead of just being either 32 bits or 64 bits long, can also be
48 bits long.
The feature I mentioned in the post to which you are replying,
for avoiding NOP issues, has to do with data, specifically immediate
values in instructions, rather than the instructions themselves.
In order to keep length decoding of instructions simple - or allow code
that consists only of 32-bit instructions - but allow immediate values
of any length, what I had done was come up with a scheme that does the following:
In a register-to-register operate instruction, a source register specification can be replaced with a 5-bit pointer to data; it points
to one of the bytes in a 256-bit block of instructions.
This feature requires a header for use; in the simplest case, a header
may contain a 3-bit field that specifies how many 32-bit instruction words are to be left unused at the end of a block.
So I was avoiding NOP issues by saving old instruction blocks, and allowing
a pointer to a "pseudo-immediate" to point into a saved block instead of
the current block. Yes, that will require flexibility on the part of the compiler; more work on its part, and it will be tricky to code. I think
it's possible in the current state of the art, though.
You don't have a compiler (obviously), but have you looked at actual
code generated by compilers (for example on godbolt, which is very good)
and checked which instruction sequence would fit which header?
Not yet, I have to admit.
On Mon, 28 Jul 2025 04:39:56 +0000, Thomas Koenig wrote:
John Savard <quadibloc@invalid.invalid> schrieb:
In order to avoid NOP hell, these have to be filled with the same
instruction length (say 15 bits, like you said above),
is that correct?
A block is 256 bits in length, and normally, in the absence of a
header, consists of eight 32-bit instructions. Blocks need, basically,
to be filled with 32-bit instructions to avoid NOPs.
To improve the compactness of code, I have made provision for short instructions; these are nominally 16 bits long, as they're packed
two to a 32-bit word. They can, in reality, be 14 bits long or 15 bits
long, depending on the overhead of indicating them, or 17 bits long or
even longer if some additional bits are provided in the header.
Some headers provide for variable-length instructions. Those headers,
instead of just being either 32 bits or 64 bits long, can also be
48 bits long.
The feature I mentioned in the post to which you are replying,
for avoiding NOP issues, has to do with data, specifically immediate
values in instructions, rather than the instructions themselves.
In order to keep length decoding of instructions simple - or allow code
that consists only of 32-bit instructions - but allow immediate values
of any length, what I had done was come up with a scheme that does the following:
In a register-to-register operate instruction, a source register specification can be replaced with a 5-bit pointer to data; it points
to one of the bytes in a 256-bit block of instructions.
This feature requires a header for use; in the simplest case, a header
may contain a 3-bit field that specifies how many 32-bit instruction words are to be left unused at the end of a block.
So I was avoiding NOP issues by saving old instruction blocks, and allowing
a pointer to a "pseudo-immediate" to point into a saved block instead of
the current block. Yes, that will require flexibility on the part of the compiler; more work on its part, and it will be tricky to code. I think
it's possible in the current state of the art, though.
You don't have a compiler (obviously), but have you looked at actual
code generated by compilers (for example on godbolt, which is very good)
and checked which instruction sequence would fit which header?
Not yet, I have to admit.
On Mon, 28 Jul 2025 04:39:56 +0000, Thomas Koenig wrote:
John Savard <quadibloc@invalid.invalid> schrieb:
In order to avoid NOP hell, these have to be filled with the same
instruction length (say 15 bits, like you said above),
is that correct?
A block is 256 bits in length, and normally, in the absence of a
header, consists of eight 32-bit instructions. Blocks need, basically,
to be filled with 32-bit instructions to avoid NOPs.
To improve the compactness of code, I have made provision for short instructions; these are nominally 16 bits long, as they're packed
two to a 32-bit word.
They can, in reality, be 14 bits long or 15 bits
long, depending on the overhead of indicating them, or 17 bits long or
even longer if some additional bits are provided in the header.
Some headers provide for variable-length instructions. Those headers,
instead of just being either 32 bits or 64 bits long, can also be
48 bits long.
The feature I mentioned in the post to which you are replying,
for avoiding NOP issues, has to do with data, specifically immediate
values in instructions, rather than the instructions themselves.
In order to keep length decoding of instructions simple - or allow code
that consists only of 32-bit instructions - but allow immediate values
of any length, what I had done was come up with a scheme that does the following:
In a register-to-register operate instruction, a source register specification can be replaced with a 5-bit pointer to data; it points
to one of the bytes in a 256-bit block of instructions.
This feature requires a header for use; in the simplest case, a header
may contain a 3-bit field that specifies how many 32-bit instruction words are to be left unused at the end of a block.
So I was avoiding NOP issues by saving old instruction blocks, and allowing
a pointer to a "pseudo-immediate" to point into a saved block instead of
the current block. Yes, that will require flexibility on the part of the compiler; more work on its part, and it will be tricky to code. I think
it's possible in the current state of the art, though.
You don't have a compiler (obviously), but have you looked at actual
code generated by compilers (for example on godbolt, which is very good)
and checked which instruction sequence would fit which header?
Not yet, I have to admit.
John Savard <quadibloc@invalid.invalid> schrieb:
Some headers provide for variable-length instructions. Those headers,
instead of just being either 32 bits or 64 bits long, can also be 48
bits long.
Please provide an example of an assembly sequence, how this woult look
like.
The feature I mentioned in the post to which you are replying,
for avoiding NOP issues, has to do with data, specifically immediate
values in instructions, rather than the instructions themselves.
Data in the instruction stream have to be considered part of the
instruction for any reasonable purposes.
I'm afraid I do not understand in the absence of an example. Could you
code up an example of a simple function that uses these features?
Then
doesn't work, the I#1 that needs the 32-bit immediate for which space is being reserved is in the next block after.
But if we do this
where I#1& is an instruction that uses a single instruction slot pseudo-immediate, but as the ^ indicates, from the previous block,
then it all goes together with no wasted space.
On Tue, 29 Jul 2025 05:12:10 +0000, Thomas Koenig wrote:
John Savard <quadibloc@invalid.invalid> schrieb:
Some headers provide for variable-length instructions. Those headers,
instead of just being either 32 bits or 64 bits long, can also be 48
bits long.
Please provide an example of an assembly sequence, how this woult look
like.
It's not clear to me what you would expect to see.
In Assembly, there would just be a directive telling the assembler
what instruction set to expect,
ISET 2
followed by a program that would hardly look any different from,
say, System/360 assembler.
The feature I mentioned in the post to which you are replying,
for avoiding NOP issues, has to do with data, specifically immediate
values in instructions, rather than the instructions themselves.
Data in the instruction stream have to be considered part of the
instruction for any reasonable purposes.
I'm afraid I do not understand in the absence of an example. Could you
code up an example of a simple function that uses these features?
In assembler, pseudo-immediates just look like normal immediates. Normally, the programmer is not required to keep track of where blocks begin and
end.
However, I'll try to provide an example in a different way.
Normally, a block with a pseudo-immediate looks like this:
(2) I I I#2 I I M2
(2) is a header that says "reserve the last two 32-bit instruction
slots for immediate values or stuff".
I is an instruction.
I#2 is an instruction that uses a 64-bit immediate value.
M2 is the immediate value which is two instruction slots or
64 bits long.
Do you only allow 32-byte aligned branch targets? Otherwise what
happens when somebody jumps into middle of a block?
On Tue, 29 Jul 2025 05:12:10 +0000, Thomas Koenig wrote:
John Savard <quadibloc@invalid.invalid> schrieb:
Some headers provide for variable-length instructions. Those headers,
instead of just being either 32 bits or 64 bits long, can also be 48
bits long.
Please provide an example of an assembly sequence, how this woult look
like.
It's not clear to me what you would expect to see.
In Assembly, there would just be a directive telling the assembler
what instruction set to expect,
ISET 2
Whenever a branch is taken, however, the whole block in which the target
is located is fetched, in order that the instructions in the block can
be correctly decoded.
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,064 |
Nodes: | 10 (0 / 10) |
Uptime: | 149:56:28 |
Calls: | 13,691 |
Calls today: | 1 |
Files: | 186,936 |
D/L today: |
437 files (114M bytes) |
Messages: | 2,410,967 |