Re: pic c
- From: Didi <dp@xxxxxxxxxxx>
- Date: 9 May 2007 06:45:07 -0700
From that proof we logically say that we can make any C program
the same size or smaller than an asm benchmark.
You cannot be serious claiming that.
"Any C program can be coded in ASM"
is true (perhaps impractical with some - many - assembly syntaxes);
the reverse is simply not true and you should know it.
Dimiter
------------------------------------------------------
Dimiter Popoff Transgalactic Instruments
http://www.tgi-sci.com
------------------------------------------------------
Walter Banks wrote:
David Brown wrote:
It is often *easier* to write clever code in C, especially if
maintainability of the code is important, but it will *always* be the
case that any code that can be written in C, no matter how clever, can
be written at least as small and fast in assembly (given enough time and
programmer skill), while the opposite is not true.
This last point I don't agree with. With a C compiler that can optimize
small sequences each describing one instruction of the whole
instruction set and producing one instruction we have proof that we
can then take any asm program translate it into C and and compile it
into a program the exact same size as the asm program.
From that proof we logically say that we can make any C program
the same size or smaller than an asm benchmark.
The point of using modern
compilers is not that they can somehow generate impossibly good
code - it is that they can generate better code than assembly
programming in almost all real-life cases.
I am not disputing that at all. This all started a few months ago
as part of a compiler validation excise. The result of the
exercise has a lot of implications in the asm vs C debate
and some approaches to application development.
I am not trying to argumentative on this point, just pointing
out what we did and extrapolating the implications.
We have been aware for 3 or 4 years that it was possible
to encode the instruction set in C. We did most of the
eTPU instruction set in C when we wrote the code generator
for it. The RS08 was the first full instruction set that we
implemented in C and compiled back to single instructions.
Since then we have done 2 more.
Walter Banks
--
Byte Craft Limited
Tel. (519) 888-6911
http://www.bytecraft.com
walter@xxxxxxxxxxxxx
.
- Follow-Ups:
- Re: pic c
- From: Grant Edwards
- Re: pic c
- References:
- pic c
- From: Account1
- Re: pic c
- From: Gonzalo S
- Re: pic c
- From: Walter Banks
- Re: pic c
- From: cbarn24050
- Re: pic c
- From: Chris Hills
- Re: pic c
- From: cbarn24050
- Re: pic c
- From: Walter Banks
- Re: pic c
- From: cbarn24050
- Re: pic c
- From: Walter Banks
- Re: pic c
- From: David Brown
- Re: pic c
- From: Walter Banks
- Re: pic c
- From: David Brown
- Re: pic c
- From: Walter Banks
- pic c
- Prev by Date: Re: cyclic redundancy check 4-bit
- Next by Date: Re: cyclic redundancy check 4-bit
- Previous by thread: Re: pic c
- Next by thread: Re: pic c
- Index(es):
Relevant Pages
|