Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Walter Banks <walter@bytecraft.com> |
|---|---|
| Newsgroups | comp.arch |
| Subject | Re: CISC to RISC dual aspect code idea |
| Date | 2016-01-14 13:36 -0500 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <n78ps9$5tc$1@gioia.aioe.org> (permalink) |
| References | <ee9b3630-9bdc-4444-baed-2faf4b1acd80@googlegroups.com> |
On 14/01/2016 11:28 AM, Quadibloc wrote: > In a thread 'Making Fat Binaries Work for You', I suggested that a computer > might provide similar CISC and RISC instruction sets, where the program would > exist in its entirety in CISC form, but where some segments would have an > alternate RISC version that did the same thing. > > The idea was that RISC reduces latency by having more registers - so when > several threads are running, registers would be conserved by using the CISC > form, and throughput is maintained by multithreading. > > The objection was raised that debugging might be made more complicated. > > Then, in the thread 'Fat Binaries Without the Extra Weight', I noted that with > some restrictions, I was able to come up with a way to have code that could be > executed in a semi-DSP fashion or a plain RISC fashion. But the base version > had to be RISC and not CISC, as I needed more registers to play with to make > the idea workable. > > Now I've come up with a third idea in this vein, but I suspect it's not > original with me. > > Given that it's really only the loops in a program that need to be optimized > (in most cases), I now have something that spans the CISC to RISC area of the > spectrum. But it involves severe restrictions, and thus is not useful for all > programs. > > Basically: > > Write the program in CISC form. > > Where one has an innermost loop that doesn't call any subroutines, and where > the loop is ruled solely by a counter, with no other termination conditions... > > and each iteration of the loop is independent of all other iterations, > > then, if the loop is delimited by instructions: > > LOOP N > > and > > REPEAT > > where the code between them is repeated with the LOOP N instruction putting the > numbers from 0 to N-1 in, say, register 7 of a register bank from 0 to 7... > > the processor could, if more registers are available, copy the data in the > registers to other register sets, except for putting a different count value in > register 7 of each set. > > Aside from the restrictions excluding the innermost loops of many types of > program, another problem is that for independent iterations to do something > useful, they'll have to reference memory. Since each iteration is > self-contained, there's a big stall after the initial read instructions that > can't be filled with anything useful. > Fundamentally a workable idea but has some problems. The most significant is who in the long run is responsible for resource management the compiler or the execution unit. The compiler in most ISA's would still need to know that this is happening. Compiling for a risc target is often about generating the kind of code you are describing. There is the issue of generally wanting to do at compile time what ever is possible. Increasingly code is being compiled to internal representation and a simple compiler implemented as a loader performs targeting and location specific details. What your are describing might be able to done in that step in some cases. Another approach that we have done (implemented in one processor ISA) was to give the processor a macro capability. This allows very complex instructions. This approach did not find as much use as I expected. Even though I wrote the code generator our C compiler for this processor I found that there are not many sequences that could be broken out and turned int very complex instructions. w..
Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
CISC to RISC dual aspect code idea Quadibloc <jsavard@ecn.ab.ca> - 2016-01-14 08:28 -0800
Re: CISC to RISC dual aspect code idea Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2016-01-14 09:25 -0800
Re: CISC to RISC dual aspect code idea Quadibloc <jsavard@ecn.ab.ca> - 2016-01-14 09:38 -0800
Re: CISC to RISC dual aspect code idea Walter Banks <walter@bytecraft.com> - 2016-01-14 13:36 -0500
Re: CISC to RISC dual aspect code idea Quadibloc <jsavard@ecn.ab.ca> - 2016-01-14 18:53 -0800
Re: CISC to RISC dual aspect code idea Walter Banks <walter@bytecraft.com> - 2016-01-15 12:15 -0500
Re: CISC to RISC dual aspect code idea MitchAlsup <MitchAlsup@aol.com> - 2016-01-14 15:01 -0800
Re: CISC to RISC dual aspect code idea Quadibloc <jsavard@ecn.ab.ca> - 2016-01-14 19:06 -0800
Re: CISC to RISC dual aspect code idea Bruce Hoult <bruce.hoult@gmail.com> - 2016-01-15 04:32 -0800
csiph-web