RISC vs. CISC design principles
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
RISC vs. CISC design principles
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture
Author Message
Paul A. Clayton
Guest





Posted: Wed Jan 12, 2005 10:15 pm    Post subject: RISC vs. CISC design principles Reply with quote

In the CISC vs. RISC debate, it seems that the design principles
behind each are generally not considered in their historical
context.

ISTM that a major concern for CISC was memory capacity. This
concern is expressed in efforts at code density (variable length
instructions, complex instructions [often targeting the
'common case' of higher level programming, meshing with semantic
gap theory], implicit arguments [leading to special-purpose
registers], and fewer registers [fewer bits to encode]), hardware
support of unaligned loads (to improve data density), and
finer-grained memory protection (segment-based rather
page-based). In earlier hardware the cost of unaligned loads may
have been smaller due to the smaller width of memory interfaces.
The cost of ROM relative to RAM (especially fast RAM) may have
tended to encourage the use of static micro-code even beyond the
general code density advantage. Earlier systems may also have
used fewer segments per application and less dynamic resizing,
possibly making segmentation more efficient.

Also earlier semantic gap theory may have seemed more reasonable,
making compilers (and assembly-level programming) simpler when
programming effort was perhaps a greater consideration (and as
mentioned above it meshes well with targeting code density).

OTOH, the main RISC design principles are pipelinability (leading
to fixed-sized instructions, few instruction formats, simpler
memory addressing modes, etc.), compiler optimization ('reduced'
operations can be independently scheduled, a relatively large
number of [fast] registers allows software to cache data [e.g.,
Common Subexpression Elimination] and use faster/less expensive
procedure interfaces), and simpler/faster hardware (in addition
to pipelinability aids, aligned memory accesses [which can
simplify a usually time-critical path] and 'reduced'
instructions [particularly separation of memory accesses from
other operations]).

The design principles of RISC place more burden on the compiler,
which may allow system developers to take advantage of
late-binding. It would certainly seem to allow system developers
to leverage a greater volume of software developers relative to
hardware developers.

At current hardware budgets, the aligned memory access
requirement is probably the least useful of the RISC mechanisms.
The largish number of general purpose registers may become more
burdensome if microthreading becomes more common, but the
benefits of this mechanism still seem to outweigh the
disadvantages significantly. With the exception of some embedded
systems (for which two-sized instructions are common),
fixed-sized instructions seem to provide more benefit than cost.
The emphasis on scalar decode may be considered a weakness of
RISC in the world of superscalar processing, though the simple
generally explicit encoding of RISC does help somewhat even
there.

CISC design principles may be said to depend too much on
expensive memory capacity to remain practical in most modern
circumstances.


Paul A. Clayton
(a 'Dysthymicdolt' reachable at aol.com)
Back to top
Guest






Posted: Thu Jan 13, 2005 12:56 am    Post subject: Re: RISC vs. CISC design principles Reply with quote

"At current hardware budgets, the aligned memory access
requirement is probably the least useful of the RISC mechanisms."

I, respectfully, disagree.

At current hardware budgets, the least useful RISC mechanism is the
fixed length instruction format. Both Intel and AMD have shown that
they/we can decode just as many instructions per unit time as the RISC
guys.

Consider a x86 machine like an Athlon (or P3 or P4). How much
performance is sacrificed by having to decode multibyte instructions?
Answer; with modern branch prediction, the added pipe stages extract a
penalty around only 1%-2% compared to fixed length machines! Yet these
decoded multibyte instructions contain more semantic units of work that
the equivalent 4-ish wide RISC decoders. But, in neither catagory of
machines is the basic throughput significantly dependent upon the
performance of the decoder(s)!

I could address the rest of the statements piecemeal, however, the
general premiss is wrong. The evolution of x86 is proceeding faster
than the evolution of other CPUs bacause of the amount of cubic dollars
that can be thrown at teams of designers to solve yesterdays problems
and develop tomorows monster machines. Cubic dollars beats
architectural cleanliness everytime.

Mitch
Back to top
Paul Rubin
Guest





Posted: Thu Jan 13, 2005 1:00 am    Post subject: Re: RISC vs. CISC design principles Reply with quote

MitchAlsup@aol.com writes:
Quote:
Consider a x86 machine like an Athlon (or P3 or P4). How much
performance is sacrificed by having to decode multibyte instructions?
Answer; with modern branch prediction, the added pipe stages extract a
penalty around only 1%-2% compared to fixed length machines!

What do you mean by that? Don't those added pipe stages and decoder
logic burn a lot of silicon area that could be used for more
functional units or caches or something? What about the x86's
register starvation, couldn't code run faster with more registers?
The x86-64 supports more registers (16 instead of 8), but 16 still
isn't an awful lot, and it makes the instructions longer.
Back to top
Nick Maclaren
Guest





Posted: Thu Jan 13, 2005 1:32 am    Post subject: Re: RISC vs. CISC design principles Reply with quote

In article <1105559795.307333.292340@c13g2000cwb.googlegroups.com>,
<MitchAlsup@aol.com> wrote:
Quote:
"At current hardware budgets, the aligned memory access
requirement is probably the least useful of the RISC mechanisms."

I, respectfully, disagree.

At current hardware budgets, the least useful RISC mechanism is the
fixed length instruction format. Both Intel and AMD have shown that
they/we can decode just as many instructions per unit time as the RISC
guys.

Yes. But let's ignore that and go back to the alignment issue.
Speaking as a software engineer from way back:

"Allowing unaligned memory access is probably the least useful
of common CISC features."

In my career, I have never seen a significant use of it except to
cover up misdesigned interfaces - in particular, ones that have
failed to take the decision whether they are based on semi-abstract
types like integers and floating-point or on precisely specified
bit patterns.

The point is that the former have no trouble with padding being
inserted to create alignment, and the latter are uniformly better
done by the use of packing and unpacking primitives because there
are almost certainly other things to fix up than alignment (e.g.
endianness).


Regards,
Nick Maclaren.
Back to top
Stephen Fuld
Guest





Posted: Thu Jan 13, 2005 3:01 am    Post subject: Re: RISC vs. CISC design principles Reply with quote

"Nick Maclaren" <nmm1@cus.cam.ac.uk> wrote in message
news:cs41hi$62t$1@gemini.csx.cam.ac.uk...

snip

Quote:
Yes. But let's ignore that and go back to the alignment issue.
Speaking as a software engineer from way back:

"Allowing unaligned memory access is probably the least useful
of common CISC features."

In my career, I have never seen a significant use of it except to
cover up misdesigned interfaces - in particular, ones that have
failed to take the decision whether they are based on semi-abstract
types like integers and floating-point or on precisely specified
bit patterns.

While I don't doubt that is true, it is perhaps so due to your specializing
in HPC and not say business data processing. Think COBOL, reports where the
aesthetics of the output are more important than allignment considerations,
dealing with arbitrary input files, etc.

--
- Stephen Fuld
e-mail address disguised to prevent spam
Back to top
David Wang
Guest





Posted: Thu Jan 13, 2005 3:45 am    Post subject: Re: RISC vs. CISC design principles Reply with quote

Paul A. Clayton <carchreader@aol.comnomail> wrote:

Quote:
At current hardware budgets, the aligned memory access
requirement is probably the least useful of the RISC mechanisms.

I think it's just a lot easier to deal with power-of-2 chunks
of data than not. It also costs more than just transistors
to solve the problem. i.e. dealing with coherency issues where
you already own one half of the word while the other half of the
word is on a different line sitting in a different processor.
Worse yet, IIRC, you can have a semaphore that sits across
cacheline boundaries, and it's fun trying to make sure that the
split lines are locked for access. It may be easier to just
specify that the CPU cannot deal with the odd ball corner cases
and limit yourself to aligned data.

--
davewang202(at)yahoo(dot)com
Back to top
Andi Kleen
Guest





Posted: Thu Jan 13, 2005 4:23 am    Post subject: Re: RISC vs. CISC design principles Reply with quote

nmm1@cus.cam.ac.uk (Nick Maclaren) writes:
Quote:

In my career, I have never seen a significant use of it except to
cover up misdesigned interfaces - in particular, ones that have
failed to take the decision whether they are based on semi-abstract
types like integers and floating-point or on precisely specified
bit patterns.

It's useful to process IPv4 packets. On a aligned ethernet packet the
TCP header ends up being unaligned. Same is true for other protocols.

-Andi
Back to top
Nick Maclaren
Guest





Posted: Thu Jan 13, 2005 4:25 am    Post subject: Re: RISC vs. CISC design principles Reply with quote

In article <17hFd.8944$7N1.38@bgtnsc04-news.ops.worldnet.att.net>,
Stephen Fuld <s.fuld@PleaseRemove.att.net> wrote:
Quote:

Yes. But let's ignore that and go back to the alignment issue.
Speaking as a software engineer from way back:

"Allowing unaligned memory access is probably the least useful
of common CISC features."

In my career, I have never seen a significant use of it except to
cover up misdesigned interfaces - in particular, ones that have
failed to take the decision whether they are based on semi-abstract
types like integers and floating-point or on precisely specified
bit patterns.

While I don't doubt that is true, it is perhaps so due to your specializing
in HPC and not say business data processing. Think COBOL, reports where the
aesthetics of the output are more important than allignment considerations,
dealing with arbitrary input files, etc.

Where did you get the idea from that I specialised in HPC for most
of my career? I can assure you that is not so.

Firstly, formatted I/O is irrelevant, as that is always treated as
characters on modern machines.

Secondly, the paragraph that you snipped explains why all portable
programs (and most correct ones) use packing and unpacking primitives
when dealing with arbitrary (binary) input files.

Please note that I have written serious code to convert MVS SL tapes
using most BSAM/QSAM formats to Unix tar files and MS-DOS and MacOS
ZIP files. And vice versa. Plus a good many related tasks, including
reading M-bit data on N-bit systems. That is about as 'commercial'
an application as you get :-)

And I have always been very much into producing aesthetic output,
not least because properly aligned tables are a damn sight easier to
check than unaligned ones, and I spent more years in the statistical
area than the HPC one.

No, sorry. I was posting more with a 'commercial' hat on than an
HPC one.


Regards,
Nick Maclaren.
Back to top
Nick Maclaren
Guest





Posted: Thu Jan 13, 2005 5:14 am    Post subject: Re: RISC vs. CISC design principles Reply with quote

In article <m3acrez0xi.fsf@averell.firstfloor.org>,
Andi Kleen <freitag@alancoxonachip.com> wrote:
Quote:
nmm1@cus.cam.ac.uk (Nick Maclaren) writes:

In my career, I have never seen a significant use of it except to
cover up misdesigned interfaces - in particular, ones that have
failed to take the decision whether they are based on semi-abstract
types like integers and floating-point or on precisely specified
bit patterns.

It's useful to process IPv4 packets. On a aligned ethernet packet the
TCP header ends up being unaligned. Same is true for other protocols.

That is precisely what I am describing as a misdesigned protocol.
It still leaves you with the problem of dealing with endianness,
which is a fruitful source of obscure bugs in Internet programs.
And, worse, God help you if you ever encounter a system that isn't
based on 8-bit, 16-bit and 32-bit unsigned integers.

The formats to which I was referring (i.e. IBM tape label and access
method ones) have exactly the same property, except that they are
not SUPPOSED to be general. And it was faster to code, cleaner and
probably faster to execute using packing and unpacking primitives
rather than relying on unaligned accesses.

I really do assure you, from extensive experience, that abusing
unaligned accesses for such decoding and encoding wastes more time
than it saves. It only SEEMS more effort to do the job properly;
when you include the debugging time, it isn't.


Regards,
Nick Maclaren.
Back to top
Maynard Handley
Guest





Posted: Thu Jan 13, 2005 6:46 am    Post subject: Unaligned accesses (was Re: RISC vs. CISC design principles) Reply with quote

In article <cs41hi$62t$1@gemini.csx.cam.ac.uk>,
nmm1@cus.cam.ac.uk (Nick Maclaren) wrote:

Quote:
In article <1105559795.307333.292340@c13g2000cwb.googlegroups.com>,
MitchAlsup@aol.com> wrote:
"At current hardware budgets, the aligned memory access
requirement is probably the least useful of the RISC mechanisms."

I, respectfully, disagree.

At current hardware budgets, the least useful RISC mechanism is the
fixed length instruction format. Both Intel and AMD have shown that
they/we can decode just as many instructions per unit time as the RISC
guys.

Yes. But let's ignore that and go back to the alignment issue.
Speaking as a software engineer from way back:

"Allowing unaligned memory access is probably the least useful
of common CISC features."

In my career, I have never seen a significant use of it except to
cover up misdesigned interfaces - in particular, ones that have
failed to take the decision whether they are based on semi-abstract
types like integers and floating-point or on precisely specified
bit patterns.

The point is that the former have no trouble with padding being
inserted to create alignment, and the latter are uniformly better
done by the use of packing and unpacking primitives because there
are almost certainly other things to fix up than alignment (e.g.
endianness).


You obviously have never programmed AltiVec, have you, Nick?

While I understand why AltiVec does not allow for unaligned accesses,
and accept that it may well have been and continue to be the correct
tradeoff, the fact is that it is a pain to deal with. And, Nick, please
don't give me any BS about how properly designed code would not require
this. If you've no experience with either AltiVec programming or modern
day audio and video compression algorithms, you're not in a position to
make this claim.

On the other hand, regarding unaligned instructions; is density of
instructions (either inability to load them fast enough, or capacity of
I1$ or I TLB) both really a big deal AND only about a factor of 1.5 off
from ideal, meaning that unaligned instructions are worthwhile? The
window for codes that meet both these requirements strikes me as pretty
small, and I'd have to see some real evidence that the costs of I1$
misses (high but infrequent) are larger than the costs of an extra few
cycles on branch misses (fewer cycles but frequent), not to mention the
extra power and associated issues.

Maynard
Back to top
Andrew Reilly
Guest





Posted: Thu Jan 13, 2005 7:56 am    Post subject: Re: Unaligned accesses (was Re: RISC vs. CISC design princip Reply with quote

On Thu, 13 Jan 2005 02:46:34 +0000, Maynard Handley wrote:

Quote:
In article <cs41hi$62t$1@gemini.csx.cam.ac.uk>,
nmm1@cus.cam.ac.uk (Nick Maclaren) wrote:

In article <1105559795.307333.292340@c13g2000cwb.googlegroups.com>,
MitchAlsup@aol.com> wrote:
"At current hardware budgets, the aligned memory access
requirement is probably the least useful of the RISC mechanisms."

I, respectfully, disagree.

At current hardware budgets, the least useful RISC mechanism is the
fixed length instruction format. Both Intel and AMD have shown that
they/we can decode just as many instructions per unit time as the RISC
guys.

Yes. But let's ignore that and go back to the alignment issue.
Speaking as a software engineer from way back:

"Allowing unaligned memory access is probably the least useful
of common CISC features."

In my career, I have never seen a significant use of it except to
cover up misdesigned interfaces - in particular, ones that have
failed to take the decision whether they are based on semi-abstract
types like integers and floating-point or on precisely specified
bit patterns.

The point is that the former have no trouble with padding being
inserted to create alignment, and the latter are uniformly better
done by the use of packing and unpacking primitives because there
are almost certainly other things to fix up than alignment (e.g.
endianness).


You obviously have never programmed AltiVec, have you, Nick?

What's that got to do with anything? (I haven't programmed AltiVec,
per-se, myself. If a compiler has done it on my behalf, good on it. If a
compiler hasn't been able to do it on my behalf, then perhaps that says
something about the architecture of AltiVec.)

Quote:
While I understand why AltiVec does not allow for unaligned accesses,
and accept that it may well have been and continue to be the correct
tradeoff, the fact is that it is a pain to deal with. And, Nick, please
don't give me any BS about how properly designed code would not require
this. If you've no experience with either AltiVec programming or modern
day audio and video compression algorithms, you're not in a position to
make this claim.

I would say that modern-day audio and video compression standards are a
good example of file (and communication) formats done *well*, by Nick's
standards, as they are universally (in my experience) defined in terms of
packed bit-strings, rather than fwrite(c-struct) /* and-hope-it-ports-ok,
later */, which was what Nick was complaining about (I believe).

At an audio *algorithm* level, rather than file format level, I've never
encountered anything that would enforce or encourage unaligned floating
point accesses, which is just as well, since most of the DSPs I code for
are still word-addressed.

--
Andrew
Back to top
Terje Mathisen
Guest





Posted: Thu Jan 13, 2005 7:56 am    Post subject: Re: RISC vs. CISC design principles Reply with quote

Nick Maclaren wrote:

Quote:
In article <1105559795.307333.292340@c13g2000cwb.googlegroups.com>,
MitchAlsup@aol.com> wrote:
At current hardware budgets, the least useful RISC mechanism is the
fixed length instruction format. Both Intel and AMD have shown that
they/we can decode just as many instructions per unit time as the RISC
guys.


Yes. But let's ignore that and go back to the alignment issue.
Speaking as a software engineer from way back:

"Allowing unaligned memory access is probably the least useful
of common CISC features."

In my career, I have never seen a significant use of it except to
cover up misdesigned interfaces - in particular, ones that have
failed to take the decision whether they are based on semi-abstract
types like integers and floating-point or on precisely specified
bit patterns.

A recent post in c.l.a.x86 made me go back to C string.h functions, as
well as the *BSD-inspired strl*() replacements.

Efficient handling of C strings pretty much requires you to process a
full register's worth of data (usually 4 or 8 chars), while you cannot
depend on either the source or destination to be properly aligned, right?

Besides alignement, another key problem is that the terminating zero
byte in the source string could well be the last byte in a memory block,
meaning that any access past this point will cause a trap.

Handling both of these at the same time pretty much requires either
unaligned load and/or store operations, together with the capability to
do non-trapping (speculative) load operations past the end of allocated
memory, or you need to re-invent the Alpha:

I.e. load operations that disregard the bottommost (alignment) bits,
together with fast shift/mask/merge operations based on those same bits,
so that you can synthesize unaligned operations this way.

Quote:
The point is that the former have no trouble with padding being
inserted to create alignment, and the latter are uniformly better
done by the use of packing and unpacking primitives because there
are almost certainly other things to fix up than alignment (e.g.
endianness).

Even these are much better off if you can specify them in such a way as
to allow the compiler to generate optimal code, i.e. not just a set of
byte load/shift/merge operations.

Terje

--
- <Terje.Mathisen@hda.hydro.com>
"almost all programming can be viewed as an exercise in caching"
Back to top
Jan Vorbrüggen
Guest





Posted: Thu Jan 13, 2005 2:46 pm    Post subject: Re: RISC vs. CISC design principles Reply with quote

Quote:
In the CISC vs. RISC debate, it seems that the design principles
behind each are generally not considered in their historical
context.

It does seem so, which I always thought to be a Bad Thing...but then,
computing is not alone in not wanting or being able to learn from history.

Quote:
OTOH, the main RISC design principles are pipelinability [...],
compiler optimization ([...] a relatively large number of [fast]
registers [...]), and simpler/faster hardware [...].

I have always had the impression that for the original Californian RISC
designs, a major consideration was that all of a processor core should
fit on one chip. Grudgingly, (some of) the MMU was made optional or put
on an additional chip in the early designs, IIRC, but was pulled on-chip
as soon as that was feasible. Cache tags remained off-chip for longer,
then the FPU was pulled on-chip as well. If you take this consideration
as a major force driving these designs, I have always felt it easier to
understand the decisions their designers made - including such things
as leaving out multiplication instructions, complicated addressing modes
(some of which are useful without introducing additional memory accesses
or other evil - cf. Mashey's classic classification essay), and so on.

How many transistors did the R2000 have? IIRC, the T800 managed to do
a processor, four serial links, 4 kbytes of memory, and an IEEE-compliant
FPU in 250.000 - but no memory-management hardware to speak of. So that's
a rather complete processor-on-one-chip already. I believe one of the
Alpha's instruction decoder/re-orderer is twice that alone.

Jan
Back to top
Nick Maclaren
Guest





Posted: Thu Jan 13, 2005 3:54 pm    Post subject: Re: Unaligned accesses (was Re: RISC vs. CISC design princip Reply with quote

In article <pan.2005.01.13.03.00.01.273325@areilly.bpc-users.org>,
Andrew Reilly <andrew-newspost@areilly.bpc-users.org> writes:
|>
|> I would say that modern-day audio and video compression standards are a
|> good example of file (and communication) formats done *well*, by Nick's
|> standards, as they are universally (in my experience) defined in terms of
|> packed bit-strings, rather than fwrite(c-struct) /* and-hope-it-ports-ok,
|> later */, which was what Nick was complaining about (I believe).

Precisely.


Regards,
Nick Maclaren.
Back to top
Nick Maclaren
Guest





Posted: Thu Jan 13, 2005 4:02 pm    Post subject: Re: RISC vs. CISC design principles Reply with quote

In article <cs5815$p3o$1@osl016lin.hda.hydro.com>,
Terje Mathisen <terje.mathisen@hda.hydro.com> writes:
|>
|> A recent post in c.l.a.x86 made me go back to C string.h functions, as
|> well as the *BSD-inspired strl*() replacements.
|>
|> Efficient handling of C strings pretty much requires you to process a
|> full register's worth of data (usually 4 or 8 chars), while you cannot
|> depend on either the source or destination to be properly aligned, right?

Well, there are other approaches, but I agree that is one of the
few that works on most current hardware.

|> Besides alignement, another key problem is that the terminating zero
|> byte in the source string could well be the last byte in a memory block,
|> meaning that any access past this point will cause a trap.
|>
|> Handling both of these at the same time pretty much requires either
|> unaligned load and/or store operations, together with the capability to
|> do non-trapping (speculative) load operations past the end of allocated
|> memory, or you need to re-invent the Alpha:

Well, no, it doesn't. Look at BSD libraries for examples of how
you can (semi-portably) use only aligned loads and stores.

Also, you are asking for MUCH more than just unaligned operations.
For example, you are relying on two features that are generally
not the case:

1) EFFICIENT unaligned loads and stores, whether in terms of
cycle counts, cache use or TLB use.

2) The non-trapping aspects you mentioned, which can be very
important indeed.

3) No error detection in such operations. This is less obvious,
but I have almost never seen code that operates that way (including
relying on non-trapping aspects) AND correctly traps when using a
genuinely invalid location.


Regards,
Nick Maclaren.
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Computer Architecture All times are GMT
Goto page 1, 2, 3, 4, 5, 6, 7, 8  Next
Page 1 of 8

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB