Re: Disobeying jet engines - why?
- From: "Joel Koltner" <zapwireDASHgroups@xxxxxxxxx>
- Date: Wed, 30 Jan 2008 12:34:47 -0800
"Jan Panteltje" <pNaonStpealmtje@xxxxxxxxx> wrote in message
news:fnqlse$qhu$1@xxxxxxxxxxx
eh, using C, with the modern compilers highly optimising,
they 'know' the processor', may actually improve performance, and reduce
chances of errors that could have occurred by misunderstanding some CPU
features
by an asm programmer.
Something as simple as a standard CRC routine such as this one:
ULONG CalcCRC(ULONG rc,const UCHAR* buf,UINT len)
{
while (len > 0)
{
UCHAR nb = *buf;
UCHAR i = (rc & 0xff);
i ^= nb;
rc = rc >> 8;
rc ^= CRCTable [i];
buf++;
len--;
}
return rc;
}
....is a lot quicker to implement in C than it is in assembly; if I'm paying
someone to do this C is certainly the way to go here. It's also then a lot
faster to change the code around to use pointers (effectively changing the
addressing mode used in the generated code) and check whether or not the
performance improves (on this CPU it became a little worse).
Much is 'vague', for example if you use FPGA, then you depend on the
vendor's soft
to create the interconnects from the HDL.
This is a good point that a lot of people overlook. Even if you're
programming in assembly, you're still making use of the (seemingly reasonable,
at first blush) assumption that the code will execute the way you wrote it.
With superscalar CPUs that dynamically reorder program execution, that's a
HUGE amount of complexity going on behind the scenes to give the _appearance_
that that's what's happening, and of course the end result is that pretty much
all "big iron" (32 or 64 bit desktop) CPUs today have non-negligible errata
lists of what doesn't quite work the way it should.
---Joel
.
- Follow-Ups:
- Re: Disobeying jet engines - why?
- From: Martin Brown
- Re: Disobeying jet engines - why?
- From: Didi
- Re: Disobeying jet engines - why?
- References:
- Re: Disobeying jet engines - why?
- From: Damon Hill
- Re: Disobeying jet engines - why?
- From: John Larkin
- Re: Disobeying jet engines - why?
- From: Glen Walpert
- Re: Disobeying jet engines - why?
- From: John Larkin
- Re: Disobeying jet engines - why?
- From: Martin Brown
- Re: Disobeying jet engines - why?
- From: John Larkin
- Re: Disobeying jet engines - why?
- From: Terry Given
- Re: Disobeying jet engines - why?
- From: John Larkin
- Re: Disobeying jet engines - why?
- From: Joel Koltner
- Re: Disobeying jet engines - why?
- From: John Larkin
- Re: Disobeying jet engines - why?
- From: Martin Brown
- Re: Disobeying jet engines - why?
- From: John Larkin
- Re: Disobeying jet engines - why?
- From: Jan Panteltje
- Re: Disobeying jet engines - why?
- From: Didi
- Re: Disobeying jet engines - why?
- From: Jan Panteltje
- Re: Disobeying jet engines - why?
- From: Didi
- Re: Disobeying jet engines - why?
- From: Jan Panteltje
- Re: Disobeying jet engines - why?
- Prev by Date: Re: Is the HF Band a Noise Wasteland?
- Next by Date: Re: What's the LM324 of the day?
- Previous by thread: Re: Disobeying jet engines - why?
- Next by thread: Re: Disobeying jet engines - why?
- Index(es):
Relevant Pages
|