Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch > #31185 > unrolled thread

Fractal Variable-Length Instructions?

Started byQuadibloc <jsavard@ecn.ab.ca>
First post2015-11-24 06:44 -0800
Last post2015-11-24 16:39 -0800
Articles 20 on this page of 53 — 13 participants

Back to article view | Back to comp.arch


Contents

  Fractal Variable-Length Instructions? Quadibloc <jsavard@ecn.ab.ca> - 2015-11-24 06:44 -0800
    Re: Fractal Variable-Length Instructions? Quadibloc <jsavard@ecn.ab.ca> - 2015-11-24 06:59 -0800
      Re: Fractal Variable-Length Instructions? Ivan Godard <ivan@millcomputing.com> - 2015-11-24 16:42 -0800
    Re: Fractal Variable-Length Instructions? mrs@kithrup.com (Mike Stump) - 2015-11-24 22:27 +0000
      Re: Fractal Variable-Length Instructions? Terje Mathisen <terje.mathisen@tmsw.no> - 2015-11-25 07:48 +0100
        Re: Fractal Variable-Length Instructions? mrs@kithrup.com (Mike Stump) - 2015-11-26 18:21 +0000
    Re: Fractal Variable-Length Instructions? MitchAlsup <MitchAlsup@aol.com> - 2015-11-24 15:01 -0800
      Re: Fractal Variable-Length Instructions? mrs@kithrup.com (Mike Stump) - 2015-11-24 23:33 +0000
      Re: Fractal Variable-Length Instructions? Quadibloc <jsavard@ecn.ab.ca> - 2015-11-24 16:44 -0800
        Re: Fractal Variable-Length Instructions? Quadibloc <jsavard@ecn.ab.ca> - 2015-11-27 18:07 -0800
          Re: Fractal Variable-Length Instructions? Quadibloc <jsavard@ecn.ab.ca> - 2015-11-27 18:11 -0800
            Re: Fractal Variable-Length Instructions? Quadibloc <jsavard@ecn.ab.ca> - 2015-12-04 22:56 -0800
          Re: Fractal Variable-Length Instructions? Quadibloc <jsavard@ecn.ab.ca> - 2015-11-28 08:30 -0800
      Re: Fractal Variable-Length Instructions? Quadibloc <jsavard@ecn.ab.ca> - 2015-11-24 17:35 -0800
        Re: Fractal Variable-Length Instructions? Terje Mathisen <terje.mathisen@tmsw.no> - 2015-11-25 08:21 +0100
          Re: Fractal Variable-Length Instructions? Ivan Godard <ivan@millcomputing.com> - 2015-11-24 23:31 -0800
            Re: Fractal Variable-Length Instructions? Terje Mathisen <terje.mathisen@tmsw.no> - 2015-11-25 08:38 +0100
          Re: Fractal Variable-Length Instructions? Bruce Hoult <bruce.hoult@gmail.com> - 2015-11-25 03:23 -0800
            Re: Fractal Variable-Length Instructions? Quadibloc <jsavard@ecn.ab.ca> - 2015-11-25 06:20 -0800
              Re: Fractal Variable-Length Instructions? Walter Banks <walter@bytecraft.com> - 2015-11-25 11:50 -0500
            Re: Fractal Variable-Length Instructions? Megol <golem960@gmail.com> - 2015-11-25 12:30 -0800
              Re: Fractal Variable-Length Instructions? MitchAlsup <MitchAlsup@aol.com> - 2015-11-25 17:53 -0800
            Re: Fractal Variable-Length Instructions? George Neuner <gneuner2@comcast.net> - 2015-11-25 20:35 -0500
              Re: Fractal Variable-Length Instructions? Bruce Hoult <bruce.hoult@gmail.com> - 2015-11-26 00:34 -0800
                Re: Fractal Variable-Length Instructions? George Neuner <gneuner2@comcast.net> - 2015-11-26 12:53 -0500
                  Re: Fractal Variable-Length Instructions? Bruce Hoult <bruce.hoult@gmail.com> - 2015-11-26 10:32 -0800
                Re: Fractal Variable-Length Instructions? Stefan Monnier <monnier@iro.umontreal.ca> - 2015-12-01 14:45 -0500
                  Re: Fractal Variable-Length Instructions? Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-01 12:12 -0800
                    Re: Fractal Variable-Length Instructions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-05 14:19 +0000
                      Re: Fractal Variable-Length Instructions? nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-05 14:56 +0000
                        Re: Fractal Variable-Length Instructions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-05 16:48 +0000
                          Re: Fractal Variable-Length Instructions? nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-05 17:38 +0000
                            Re: Fractal Variable-Length Instructions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-06 15:21 +0000
                              Re: Fractal Variable-Length Instructions? nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-06 16:43 +0000
                                Re: Fractal Variable-Length Instructions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-08 13:55 +0000
                      Re: Fractal Variable-Length Instructions? Chris Gray <cg@GraySage.COM> - 2015-12-05 11:05 -0700
                        Re: Fractal Variable-Length Instructions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-06 14:04 +0000
                          Re: Fractal Variable-Length Instructions? Chris Gray <cg@GraySage.COM> - 2015-12-06 11:09 -0700
                      Re: Fractal Variable-Length Instructions? Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-06 09:15 -0800
                        Re: Fractal Variable-Length Instructions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-08 13:43 +0000
                          Re: Fractal Variable-Length Instructions? nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-08 14:01 +0000
                            Re: Fractal Variable-Length Instructions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-08 16:57 +0000
                              Re: Fractal Variable-Length Instructions? nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-08 18:02 +0000
                          Re: Fractal Variable-Length Instructions? Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-08 06:11 -0800
                            Re: Fractal Variable-Length Instructions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-08 16:08 +0000
                              Re: Fractal Variable-Length Instructions? Quadibloc <jsavard@ecn.ab.ca> - 2015-12-08 10:43 -0800
                                Re: Fractal Variable-Length Instructions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-12 17:06 +0000
                              Re: Fractal Variable-Length Instructions? Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-08 11:29 -0800
                                Re: Fractal Variable-Length Instructions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-12 18:10 +0000
                                  Re: Fractal Variable-Length Instructions? Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-12 15:00 -0800
                                    Re: Fractal Variable-Length Instructions? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-13 16:12 +0000
                  Re: Fractal Variable-Length Instructions? George Neuner <gneuner2@comcast.net> - 2015-12-01 21:27 -0500
    Re: Fractal Variable-Length Instructions? Quadibloc <jsavard@ecn.ab.ca> - 2015-11-24 16:39 -0800

Page 1 of 3  [1] 2 3  Next page →


#31185 — Fractal Variable-Length Instructions?

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-11-24 06:44 -0800
SubjectFractal Variable-Length Instructions?
Message-ID<2b8bddd7-19e1-4acd-b593-2ca353ceabee@googlegroups.com>
I started a thread recently where I noted a scheme I had to make the decoding 
of variable-length instructions efficient: each instruction in a block of eight 
32-bit instructions would have as its first bit a warning bit, indicating that 
the corresponding 32 bits in the next block was the first half of a 64-bit 
instruction.

One of the implications of this, though, is that the second 32 bits of a 64-bit 
instruction still had to have their first bit reserved for use as a warning 
bits.

And in an earlier discussion, one of the participants in this forum noted that 
a major reason *for* supporting variable-length instructions is to allow 
instructions to contain *immediate operands*.

Obviously, one can still cut a 32-bit immediate operand into _pieces_ to fit it 
into a 64-bit instruction that's really only two 31-bit halves.

But this is inelegant.

My first thought was to use the fact that the warning bits have some illegal 
combinations that could be repurposed.

The second half of a 64-bit instruction can't also be the first half of another 
64-bit instruction.

So if the warning bits were 11000000, then the next block could consist 
entirely of uninterrupted 64-bit instructions, and the block after that, not 
having warning bits to advise about it, would consist entirely of normal 32-bit 
instructions, including warning bits.

Such a special block of 64-bit instructions, including instructions with 
immediate operands, could not contain any branch targets, nor could the block 
of 32-bit instructions following it.

Well, that was already too complicated, but I went further.

As instructions could not cross block boundaries, another possibility is 
wwwwwww1, which could indicate a special block, but then the block following 
could use those warning bits and be a normal mix of 32-bit and 64-bit 
instructions, even if it still couldn't include branch targets.

But this wasn't baroque enough!

What about 64-bit immediates?

So if a whole block of 64-bit instructions is format B, let's have format B'.

Now, warning bits in the format

11000uu0 would indicate a block of 64-bit instructions, except that the two u 
bits indicate that the first or second half is a 128-bit instruction instead.

Actually, the first bit in the 128-bit instruction itself would indicate if it 
was a 32-bit instruction followed by a 96-bit instruction, or the other way 
'round.

And then 110vvuu1 would indicate we had two blocks like this in a row before 
getting to a block entirely of 32-bit instructions!

At this point, I realized I was getting too complicated, at least if I 
cherished illusory hopes that my proposed architecture would overtake OpenRISC 
and Risc-V!

So I took notice of what I did for 16-bit instructions. A 32-bit instruction, 
based on its opcode bits, could be a pair of 16-bit instructions instead, based 
on its opcode, and this didn't interfere with decoding all the instructions in 
a block in parallel.

Why not generalize this principle?

And so we have a 256-bit block.

Its two 128-bit halves may begin with...

110 to indicate a 96-bit instruction followed by a 32-bit instruction, or
111 to indicate a 32-bit instruction (missing three bits, of course) followed 
by a 96-bit instruction

10 to indicate that it is instead a pair of 64-bit instructions.

Well, then the second 64-bit instruction may begin with

1 to indicate it really is a 64-bit instruction,

and either of those 64-bit instructions, the first one beginning with 10, or 
the second one beginning with 1, can instead begin with 0 to indicate that it 
is a pair of 32-bit instructions!

Well, this was a novel idea, although I'm sure it's been thought of before by 
someone else, no doubt in a more sensible form.

However, I realized that even this is too complicated.

So I finally gave up, and decided that what I did for the Concertina 
architecture as an option would be simplest:

begin each block with 16 bits, having the form

01aaaaaaaaaaaaaa

where each bit indicates that the corresponding 16-bit part of the block is the 
beginning of an instruction. While this form suggests serial decoding of 
instructions, in fact, suitable implementation still allows parallel decoding.

John Savard

[toc] | [next] | [standalone]


#31186

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-11-24 06:59 -0800
Message-ID<5da2bdfa-f518-4da5-b8de-818164ff8436@googlegroups.com>
In reply to#31185
On Tuesday, November 24, 2015 at 7:44:46 AM UTC-7, Quadibloc wrote:
 
> So I finally gave up, and decided that what I did for the Concertina 
> architecture as an option would be simplest:
> 
> begin each block with 16 bits, having the form
> 
> 01aaaaaaaaaaaaaa
> 
> where each bit indicates that the corresponding 16-bit part of the block is the 
> beginning of an instruction. While this form suggests serial decoding of 
> instructions, in fact, suitable implementation still allows parallel decoding.

One bit of good news; now, instructions with 64-bit immediates can be merely 80 bits long instead of 96 bits. So sometimes I get those 16 bits back.

John Savard

[toc] | [prev] | [next] | [standalone]


#31198

FromIvan Godard <ivan@millcomputing.com>
Date2015-11-24 16:42 -0800
Message-ID<n3301m$65c$1@dont-email.me>
In reply to#31186
On 11/24/2015 6:59 AM, Quadibloc wrote:
> On Tuesday, November 24, 2015 at 7:44:46 AM UTC-7, Quadibloc wrote:
>
>> So I finally gave up, and decided that what I did for the
>> Concertina architecture as an option would be simplest:
>>
>> begin each block with 16 bits, having the form
>>
>> 01aaaaaaaaaaaaaa
>>
>> where each bit indicates that the corresponding 16-bit part of the
>> block is the beginning of an instruction. While this form suggests
>> serial decoding of instructions, in fact, suitable implementation
>> still allows parallel decoding.
>
> One bit of good news; now, instructions with 64-bit immediates can be
> merely 80 bits long instead of 96 bits. So sometimes I get those 16
> bits back.

That's not bad for a conventional encoding. Ours varies with family 
member, the actual value involved, and how many other operarions share 
the instruction-level overhead, in total running from 14 or so to 95 or so.

[toc] | [prev] | [next] | [standalone]


#31191

Frommrs@kithrup.com (Mike Stump)
Date2015-11-24 22:27 +0000
Message-ID<nyCBq4.xLH@kithrup.com>
In reply to#31185
In article <2b8bddd7-19e1-4acd-b593-2ca353ceabee@googlegroups.com>,
Quadibloc  <jsavard@ecn.ab.ca> wrote:
>I started a thread recently where I noted a scheme I had to make the decoding 
>of variable-length instructions efficient

So, I have always wondered why we don't seem to have people that take
a big data, compression algorithm designer view of instruction decode.
Here is a corpus that 10GB of instruction traces that we feel would be
nice to do a good job at, and want want people to submit algorithms
that design decoders that work given a chip cost model M, and produce
a design that is optimized to be low cost.  Complete freedom to add or
remove semantics (instructions), to try novel encodings or novel
semantics.  The idea is, given such an algorithm, we then give it what
costs we face (M) for our silcon and/or process techonology and then
it comes up with the instruction set.

The first 20 versions may well be only useful for toy semantics, toy
silicon, but the idea would be to evolve it to real silcon, real
semantics.

Anyone know of such a system, competition or research?

[toc] | [prev] | [next] | [standalone]


#31202

FromTerje Mathisen <terje.mathisen@tmsw.no>
Date2015-11-25 07:48 +0100
Message-ID<n33ljv$fhj$1@speranza.aioe.org>
In reply to#31191
Mike Stump wrote:
> In article <2b8bddd7-19e1-4acd-b593-2ca353ceabee@googlegroups.com>,
> Quadibloc  <jsavard@ecn.ab.ca> wrote:
>> I started a thread recently where I noted a scheme I had to make the decoding
>> of variable-length instructions efficient
>
> So, I have always wondered why we don't seem to have people that take
> a big data, compression algorithm designer view of instruction decode.
> Here is a corpus that 10GB of instruction traces that we feel would be
> nice to do a good job at, and want want people to submit algorithms
> that design decoders that work given a chip cost model M, and produce
> a design that is optimized to be low cost.  Complete freedom to add or
> remove semantics (instructions), to try novel encodings or novel
> semantics.  The idea is, given such an algorithm, we then give it what
> costs we face (M) for our silcon and/or process techonology and then
> it comes up with the instruction set.
>
> The first 20 versions may well be only useful for toy semantics, toy
> silicon, but the idea would be to evolve it to real silcon, real
> semantics.
>
> Anyone know of such a system, competition or research?
>
Have you looked at the Mill instruction encoding?

Completely machine-generated, optimized for the specific (sub-)set of 
operations to be used on a particular model.

Terje
-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

[toc] | [prev] | [next] | [standalone]


#31250

Frommrs@kithrup.com (Mike Stump)
Date2015-11-26 18:21 +0000
Message-ID<nyFpo7.1IGv@kithrup.com>
In reply to#31202
In article <n33ljv$fhj$1@speranza.aioe.org>,
Terje Mathisen  <terje.mathisen@tmsw.no> wrote:
>> Anyone know of such a system, competition or research?

>Completely machine-generated

Ok, I'll have to add that to my reading list.  Thanks.

[toc] | [prev] | [next] | [standalone]


#31194

FromMitchAlsup <MitchAlsup@aol.com>
Date2015-11-24 15:01 -0800
Message-ID<8bf641f9-2130-44fb-984d-d1990677651a@googlegroups.com>
In reply to#31185
On Tuesday, November 24, 2015 at 8:44:46 AM UTC-6, Quadibloc wrote:
I think you are overthinking the problem to be solved.
I think you think that instruction set encoding is a means to some end.

[toc] | [prev] | [next] | [standalone]


#31196

Frommrs@kithrup.com (Mike Stump)
Date2015-11-24 23:33 +0000
Message-ID<nyCErA.12qs@kithrup.com>
In reply to#31194
In article <8bf641f9-2130-44fb-984d-d1990677651a@googlegroups.com>,
MitchAlsup  <MitchAlsup@aol.com> wrote:
>On Tuesday, November 24, 2015 at 8:44:46 AM UTC-6, Quadibloc wrote:
>I think you are overthinking the problem to be solved.
>I think you think that instruction set encoding is a means to some end.

In the end, CPU design.

[toc] | [prev] | [next] | [standalone]


#31199

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-11-24 16:44 -0800
Message-ID<c644cdc5-fd88-4206-b868-20b7cb6db609@googlegroups.com>
In reply to#31194
On Tuesday, November 24, 2015 at 4:01:14 PM UTC-7, MitchAlsup wrote:

> I think you are overthinking the problem to be solved.
> I think you think that instruction set encoding is a means to some end.

I would definitely agree if you said that I was making a mistake if I thought 
that instruction set encoding were an end in itself.

As a means to some end, though, well, of course it is.

The ends are:

- specifying, somehow, all the operations one wants a given computer to be able to do;
- minimizing overhead in decoding instructions;
- efficiently encoding instructions in a minimum amount of memory.

And not mentioned in that list, but which certainly affects how the instruction 
set is encoded, because it involves a lot more than just the instruction set 
encoding, is facilitating the efficient execution of programs.

This is why we have different architectures, including different instruction 
set encodings, for digital signal processors, in-order RISC machines, and 
legacy CISC processors that are helped to be efficient by out-of-order 
execution.

John Savard

[toc] | [prev] | [next] | [standalone]


#31270

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-11-27 18:07 -0800
Message-ID<278b4076-8dcb-4b86-a242-3f68c78ee3cc@googlegroups.com>
In reply to#31199
On Tuesday, November 24, 2015 at 5:44:23 PM UTC-7, Quadibloc wrote:

> I would definitely agree if you said that I was making a mistake if I thought 
> that instruction set encoding were an end in itself.

Which is what I kind of think that you had intended to write.

Anyways, I have further updated

http://www.quadibloc.com/arch/srisc0302.htm

(the illustration on that page is in PNG format instead of GIF, and thus may not be compatible with some older browsers)

to show a _conventional_ CISC format with prefix bits in the instructions themselves.

What's new about this is that I have finally achieved a personal goal of packing in certain common instruction types into the available opcode space for instructions of the length they really need... instead of having to give up and encode them as longer instructions.

I think I will have to encode, say, vector register operations as 48 bits instead of 32 bits, but those are less common operations; always, in my previous work on the Concertina architecture, I was dissatisfied with the level of density in the instruction encoding I had achieved, although what I had achieved _was_ pretty dense.

John Savard

[toc] | [prev] | [next] | [standalone]


#31271

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-11-27 18:11 -0800
Message-ID<5de570b6-dd57-40fd-8415-eeee9b8880fe@googlegroups.com>
In reply to#31270
On Friday, November 27, 2015 at 7:07:39 PM UTC-7, Quadibloc wrote:

> What's new about this is that I have finally achieved a personal goal of 
> packing in certain common instruction types into the available opcode space for 
> instructions of the length they really need... instead of having to give up and 
> encode them as longer instructions.

> I think I will have to encode, say, vector register operations as 48 bits 
> instead of 32 bits, but those are less common operations; always, in my 
> previous work on the Concertina architecture, I was dissatisfied with the level 
> of density in the instruction encoding I had achieved, although what I had 
> achieved _was_ pretty dense.

Oh, yes: an image is finally online for that which inspired me to give the name "Concertina" to my CISC architecture, which will now have to be revised to incorporate the advances I've achieved on this other page.

http://www.madcoversite.com/mad084.html

John Savard

[toc] | [prev] | [next] | [standalone]


#31441

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-12-04 22:56 -0800
Message-ID<94187d44-6e76-4fad-9507-8657cdd336a9@googlegroups.com>
In reply to#31271
On Friday, November 27, 2015 at 7:11:56 PM UTC-7, Quadibloc wrote:
 
> Oh, yes: an image is finally online for that which inspired me to give the name 
> "Concertina" to my CISC architecture, which will now have to be revised to 
> incorporate the advances I've achieved on this other page.

> http://www.madcoversite.com/mad084.html

Speaking of madness...

Having my CISC instruction set reach its goal led me to think of my other 
wilder idea - floating-point sizes of 36, 48, and 60 bits. I thought that if 
instructions are 16 and 32 bits long, one could fit three 16 bit units in a 
48-bit word, so I wouldn't have to change the instruction set much for a 
computer with a 12-bit unit instead of an 8-bit unit.

The alignment restrictions on floating-point would be less severe, so I would 
have to shorten the address field by one bit to compensate; I did this in a 
previous example instruction set.

But up to three variable-length instructions per word led me to think in 
another direction;

how about a 64-bit word, containing up to three instructions, where 
instructions could be 20 or 40 bits long? The extra length would allow a 
RISC-like larger register set.

The remaining 4 bits could be used as follows:

0bbb - three 20-bit instructions
10bb - a 20-bit instruction followed by a 40-bit instruction
11bb - a 40-bit instruction followed by a 20-bit instruction

Thus there are three b bits where there are three instructions, two b bits where there are two; these bits indicate which instruction starts a new block of instructions intended to be started in a single cycle.

So in fetching 256 bits from memory at once, the instructions are variable-
length, the memory-reference instructions are increased to 40 bits from 32 but 
the register-to-register instructions shrink to 20, so even with four overhead 
bits out of 64, now instead of up to 8 instructions fetched at once, it can be 
up to 12 instructions.

One bad feature is that there likely would have to be some 20-bit NOPs at the 
beginning of a program, when data items are being read in from memory to 
registers, so an odd number of units instead of an even number, where a memory-
reference instruction takes two units is a problem.

But in any event, after I came up with that notion, I realized that This Way 
Lies Madness... or, at least, the Itanium, which it somewhat resembles despite 
being quite a bit simpler.

John Savard

[toc] | [prev] | [next] | [standalone]


#31274

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-11-28 08:30 -0800
Message-ID<8135b255-4c91-433f-b90d-6dfaf7a19556@googlegroups.com>
In reply to#31270
On Friday, November 27, 2015 at 7:07:39 PM UTC-7, Quadibloc wrote:

> Anyways, I have further updated

> http://www.quadibloc.com/arch/srisc0302.htm

Like Howard Aiken, I forgot the conditional branch instructions; that has been 
corrected.

John Savard

[toc] | [prev] | [next] | [standalone]


#31201

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-11-24 17:35 -0800
Message-ID<7068e92b-ccc3-46a4-bf27-2777717c707b@googlegroups.com>
In reply to#31194
On Tuesday, November 24, 2015 at 4:01:14 PM UTC-7, MitchAlsup wrote:

> I think you are overthinking the problem to be solved.
> I think you think that instruction set encoding is a means to some end.

Incidentally, looking through older posts in this group, I noted a post in which 
you mentioned that it took all of 30 gates for you to add variable-length coding 
to a RISC architecture, to allow all the immediate operands one might want.

I didn't find the post I was actually thinking of, but now I think it was 
likely also by you, where it was stated that any sensible architecture ought to 
have good provision for immediate operands. I had that in mind when I was 
trying to revise the CISC portion of this ISA to better serve immediates.

John Savard

[toc] | [prev] | [next] | [standalone]


#31204

FromTerje Mathisen <terje.mathisen@tmsw.no>
Date2015-11-25 08:21 +0100
Message-ID<n33nhe$kd2$1@speranza.aioe.org>
In reply to#31201
Quadibloc wrote:
> On Tuesday, November 24, 2015 at 4:01:14 PM UTC-7, MitchAlsup wrote:
>
>> I think you are overthinking the problem to be solved.
>> I think you think that instruction set encoding is a means to some end.
>
> Incidentally, looking through older posts in this group, I noted a post in which
> you mentioned that it took all of 30 gates for you to add variable-length coding
> to a RISC architecture, to allow all the immediate operands one might want.
>
> I didn't find the post I was actually thinking of, but now I think it was
> likely also by you, where it was stated that any sensible architecture ought to
> have good provision for immediate operands. I had that in mind when I was
> trying to revise the CISC portion of this ISA to better serve immediates.

With the continously increasing gap between streaming bandwidth and 
random access, it is pretty obvious that you would want immediates of 
almost arbitrary size as long as you knew they would be accessed each 
time the code came this way.

I.e. if you have a switch table then it should be located directly 
following the instruction which performs the multi-way branch, at least 
as long as it is shorter than a cache line or two:

   cmp rax,LIMIT
    jae errorhandler

   jmp [rip+rax*8]

swtable dq sw0, sw1, sw2, sw3, sw4...

sw0: ; Target for case 0
   ...
   jmp merge

sw1: ; Case 1
   ...
   jmp merge

etc.

The big advantage here is that swtable will be prefetched into the code 
cache, but this would require a RIP-relative addresses to be able to 
read from this cache instead of forcing the same line into the data cache!

This could be handled with a special form of the instruction, but it is 
probably better to avoid a lot of extra encodings, just let the RIP 
signal this case.

BTW,I didn't realize before now that the default absolute addressing 
mode for x64 is RIP-relative! This makes it much simpler to relocate 
such programs...

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

[toc] | [prev] | [next] | [standalone]


#31205

FromIvan Godard <ivan@millcomputing.com>
Date2015-11-24 23:31 -0800
Message-ID<n33nvm$tb6$1@dont-email.me>
In reply to#31204
On 11/24/2015 11:21 PM, Terje Mathisen wrote:
> Quadibloc wrote:
>> On Tuesday, November 24, 2015 at 4:01:14 PM UTC-7, MitchAlsup wrote:
>>
>>> I think you are overthinking the problem to be solved.
>>> I think you think that instruction set encoding is a means to some end.
>>
>> Incidentally, looking through older posts in this group, I noted a
>> post in which
>> you mentioned that it took all of 30 gates for you to add
>> variable-length coding
>> to a RISC architecture, to allow all the immediate operands one might
>> want.
>>
>> I didn't find the post I was actually thinking of, but now I think it was
>> likely also by you, where it was stated that any sensible architecture
>> ought to
>> have good provision for immediate operands. I had that in mind when I was
>> trying to revise the CISC portion of this ISA to better serve immediates.
>
> With the continously increasing gap between streaming bandwidth and
> random access, it is pretty obvious that you would want immediates of
> almost arbitrary size as long as you knew they would be accessed each
> time the code came this way.
>
> I.e. if you have a switch table then it should be located directly
> following the instruction which performs the multi-way branch, at least
> as long as it is shorter than a cache line or two:
>
>    cmp rax,LIMIT
>     jae errorhandler
>
>    jmp [rip+rax*8]
>
> swtable dq sw0, sw1, sw2, sw3, sw4...
>
> sw0: ; Target for case 0
>    ...
>    jmp merge
>
> sw1: ; Case 1
>    ...
>    jmp merge
>
> etc.
>
> The big advantage here is that swtable will be prefetched into the code
> cache, but this would require a RIP-relative addresses to be able to
> read from this cache instead of forcing the same line into the data cache!
>
> This could be handled with a special form of the instruction, but it is
> probably better to avoid a lot of extra encodings, just let the RIP
> signal this case.
>
> BTW,I didn't realize before now that the default absolute addressing
> mode for x64 is RIP-relative! This makes it much simpler to relocate
> such programs...
>
> Terje
>

In-line tables are not necessarily better. If the switch is rarely 
taken, then the table fragment at the end of the cache line containing 
the switch jump plugs up I$1 space and fetch bandwidth. The nasty cases 
are (for example) the jump table in a YACC parser, which can have tables 
with thousands of entries. A read-ahead just produces clutter; you want 
the table to stay in L2 and hot lines in L1.

There is too much variation in switch code for a one-size-fits-all solution.

[toc] | [prev] | [next] | [standalone]


#31206

FromTerje Mathisen <terje.mathisen@tmsw.no>
Date2015-11-25 08:38 +0100
Message-ID<n33oii$m7q$1@speranza.aioe.org>
In reply to#31205
Ivan Godard wrote:
> In-line tables are not necessarily better. If the switch is rarely
> taken, then the table fragment at the end of the cache line containing
> the switch jump plugs up I$1 space and fetch bandwidth. The nasty cases
> are (for example) the jump table in a YACC parser, which can have tables
> with thousands of entries. A read-ahead just produces clutter; you want
> the table to stay in L2 and hot lines in L1.
>
> There is too much variation in switch code for a one-size-fits-all
> solution.

Which is why I stated that an inline table only made sense when the 
total size was limited to less than a couple of cache lines. :-)

Terje

-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

[toc] | [prev] | [next] | [standalone]


#31210

FromBruce Hoult <bruce.hoult@gmail.com>
Date2015-11-25 03:23 -0800
Message-ID<c1cf66ed-9ff6-4773-a49a-3c0b7dd4241f@googlegroups.com>
In reply to#31204
On Wednesday, November 25, 2015 at 10:21:22 AM UTC+3, Terje Mathisen wrote:
> With the continously increasing gap between streaming bandwidth and 
> random access, it is pretty obvious that you would want immediates of 
> almost arbitrary size as long as you knew they would be accessed each 
> time the code came this way.

How often (outside perhaps of FP code) do you have a large literal with a lot of significant bits?

ARM64 lets you load or merge a 16 bit literal within the 32 bit instruction into any quarter of a 64 bit register. If you use two such instructions it's no worse than a hypothetical opcode that is followed by a 32 bit literal. Even loading all four quarters of the register like this is only 16 bytes, vs 12 bytes for a hypothetical opcode that is followed by a 64 bit literal.

Even in Thumb1, it's usually pretty convenient and fast to load a large literal placed after the next unconditional branch (at worst, the end of the function, but in any case within 1 KB), using PC-relative addressing.

[toc] | [prev] | [next] | [standalone]


#31217

FromQuadibloc <jsavard@ecn.ab.ca>
Date2015-11-25 06:20 -0800
Message-ID<05002b57-eee8-416b-9663-2fa6ba1a746f@googlegroups.com>
In reply to#31210
On Wednesday, November 25, 2015 at 4:23:09 AM UTC-7, Bruce Hoult wrote:
 
> Even in Thumb1, it's usually pretty convenient and fast to load a large literal placed after the next unconditional branch (at worst, the end of the function, but in any case within 1 KB), using PC-relative addressing.

I had figured that sort of thing requires complicated interlocks to detect that 
the easy case is present, and I was aiming at a straightforward in-order design.

But I am now thinking that even a 16-bit start-of-instruction field is not the 
best, and that it would yield satisfactory results to go with prefix 
instruction length coding, like on the IBM 360, as long as the code is 
relatively simple.

Something like:

0: 32 bits (because of the load/store multiple instructions)
10: 16 bits
1100: 48 bits
1101: 64 bits
1110: 80 bits
1111: 144 bits

and this would satisfy those who do feel that instruction sets should have 
immediates of all the sizes used by the architecture... even extended-precision 
floating-point!

Each 16-bit word would have decoding circuitry, which would have a 'don't 
decode' input with a rather large OR gate leading into it, and perhaps a 'do 
decode' input as well.

John Savard

[toc] | [prev] | [next] | [standalone]


#31218

FromWalter Banks <walter@bytecraft.com>
Date2015-11-25 11:50 -0500
Message-ID<n34oso$dbu$1@speranza.aioe.org>
In reply to#31217
On 25/11/2015 9:20 AM, Quadibloc wrote:
> On Wednesday, November 25, 2015 at 4:23:09 AM UTC-7, Bruce Hoult
> wrote:
>
>> Even in Thumb1, it's usually pretty convenient and fast to load a
>> large literal placed after the next unconditional branch (at worst,
>> the end of the function, but in any case within 1 KB), using
>> PC-relative addressing.
>
> I had figured that sort of thing requires complicated interlocks to
> detect that the easy case is present, and I was aiming at a
> straightforward in-order design.
>
> But I am now thinking that even a 16-bit start-of-instruction field
> is not the best, and that it would yield satisfactory results to go
> with prefix instruction length coding, like on the IBM 360, as long
> as the code is relatively simple.
>
> Something like:
>
> 0: 32 bits (because of the load/store multiple instructions) 10: 16
> bits 1100: 48 bits 1101: 64 bits 1110: 80 bits 1111: 144 bits
>
> and this would satisfy those who do feel that instruction sets should
> have immediates of all the sizes used by the architecture... even
> extended-precision floating-point!
>
> Each 16-bit word would have decoding circuitry, which would have a
> 'don't decode' input with a rather large OR gate leading into it, and
> perhaps a 'do decode' input as well.
>

You might be losing focus on the ISA. Separate the ISA functional
objectives from the encoding and then deal with the ISA encoding. You
may well find that the information you are trying to encode will fall
out of the logic with less overhead than your encoding.

"If it isn't contributing to the solution it is part of the problem"

In this age of machine generated code generation even fields have no
need to be contiguous. I have worked on a couple ISA's that separated
functionality from encoding that resulted in substantial savings in
logic and code space traded for more complex compiler code generators.

w..

[toc] | [prev] | [next] | [standalone]


Page 1 of 3  [1] 2 3  Next page →

Back to top | Article view | comp.arch


csiph-web