public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Porting GCC to 8051 Microcontroller
@ 2008-05-09 15:28 Duane Ellis
  0 siblings, 0 replies; 8+ messages in thread
From: Duane Ellis @ 2008-05-09 15:28 UTC (permalink / raw)
  To: gcc-help

andrew>> I've been thinking about this some more.  I 
andrew>> suspect you could get good results by 
andrew>> generating not 8051 assembly language,
andrew>> which would be gross, but a simple bytecode engine.

I know this for a fact :-) in a previous life we modeled 
the one we did off the instruction set like the MIPS. 
Why? Simple - it has to do with the way the flags 
register is done.

On some CPUs - when you add "r0 + r1" => r2, you either
*must* update the flags (zero, carry, overflow) or not.
having to maintain that in a simulator is added wasteful 
steps that you often do not need...

For example the test:

	if( a == b ){
		do_this();
	}

For us the opcodes became:
   test  r1=r2    ;; test(r1==r2)
   braf  +4	   ; branch if false
   jsr24 do_this   ; 24bit relative call.

This simplified the interpretation code and was a 
huge performance win on a 6502 @ 1mhz.

The simulation engine was a big 6502 switch statement.

In effect, the 6502 was a micro-code engine :-)

-Duane.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Porting GCC to 8051 Microcontroller
  2008-05-07 10:15     ` Andrew Haley
@ 2008-05-09 10:35       ` Andrew Haley
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Haley @ 2008-05-09 10:35 UTC (permalink / raw)
  To: Ganesh; +Cc: gcc-help

Andrew Haley wrote:
> Ganesh wrote:
>> I haven't said that I don't understand the steps involved. I have just
>> now started to work on it. I want to check whether if anyone have ever
>> tried this port and successfully completed it.
> 
> It's very unlikely.  It's not completely impossible to do it, but
> code quality would probably be poor.
> 
> See http://gcc.gnu.org/ml/gcc/2003-07/msg00890.html
> http://gcc.gnu.org/ml/gcc/2003-07/msg01167.html

I've been thinking about this some more.  I suspect you could get good
results by generating not 8051 assembly language, which would be gross,
but a simple bytecode engine.  It wouldn't be at all fast, but it would
be possible to generate some native code sequences and intermix them
with the bytecode.  This would be a reasonable compromise between speed
and code density.

Andrew.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Porting GCC to 8051 Microcontroller
  2008-05-07  7:57 ` Fabian Cenedese
@ 2008-05-07 11:48   ` Ganesh
  0 siblings, 0 replies; 8+ messages in thread
From: Ganesh @ 2008-05-07 11:48 UTC (permalink / raw)
  To: Fabian Cenedese; +Cc: gcc-help

When I visited a trade show last month, I found that GCC and 8051 are among 
the list of hot markets. I will also check SDCC. Thanks.

Ganesh.

----- Original Message ----- 
From: "Fabian Cenedese" <Cenedese@indel.ch>
To: <gcc-help@gcc.gnu.org>
Sent: Wednesday, May 07, 2008 1:20 PM
Subject: Re: Porting GCC to 8051 Microcontroller


> At 12:59 07.05.2008 +0530, Ganesh wrote:
>>I am planning to do GCC porting for 8051 Microcontroller.
>>Kindly send me the steps involved in this project.
>
> Are there specific reasons to use gcc? Otherwise there are other
> open source compilers like http://sdcc.sourceforge.net/
>
> bye  Fabi
>
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Porting GCC to 8051 Microcontroller
  2008-05-07 10:03   ` Ganesh
@ 2008-05-07 10:15     ` Andrew Haley
  2008-05-09 10:35       ` Andrew Haley
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Haley @ 2008-05-07 10:15 UTC (permalink / raw)
  To: Ganesh; +Cc: gcc-help

Ganesh wrote:
> I haven't said that I don't understand the steps involved. I have just
> now started to work on it. I want to check whether if anyone have ever
> tried this port and successfully completed it.

It's very unlikely.  It's not completely impossible to do it, but
code quality would probably be poor.

See http://gcc.gnu.org/ml/gcc/2003-07/msg00890.html
http://gcc.gnu.org/ml/gcc/2003-07/msg01167.html

Andrew.

>> Ganesh wrote:
>>> I am planning to do GCC porting for 8051 Microcontroller.
>>>
>>> Kindly send me the steps involved in this project.
>>
>> Well, if you don't understand the steps involved I don't see
>> why you're planning to do the port.  The 8051 architecture has
>> a number of features that will make it very hard to generate
>> code with gcc.
>>
>> The gccint info file has most of the info you need to do the
>> port.
>>
>> Andrew.
>>
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Porting GCC to 8051 Microcontroller
  2008-05-07  9:55 ` Andrew Haley
@ 2008-05-07 10:03   ` Ganesh
  2008-05-07 10:15     ` Andrew Haley
  0 siblings, 1 reply; 8+ messages in thread
From: Ganesh @ 2008-05-07 10:03 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc-help

I haven't said that I don't understand the steps involved. I have just now 
started to work on it. I want to check whether if anyone have ever tried 
this port and successfully completed it.

Thanks for your input (gccint info file).


----- Original Message ----- 
From: "Andrew Haley" <aph@redhat.com>
To: "Ganesh" <ganesh@acmet.com>
Cc: <gcc-help@gcc.gnu.org>
Sent: Wednesday, May 07, 2008 1:45 PM
Subject: Re: Porting GCC to 8051 Microcontroller


> Ganesh wrote:
>> I am planning to do GCC porting for 8051 Microcontroller.
>>
>> Kindly send me the steps involved in this project.
>
> Well, if you don't understand the steps involved I don't see
> why you're planning to do the port.  The 8051 architecture has
> a number of features that will make it very hard to generate
> code with gcc.
>
> The gccint info file has most of the info you need to do the
> port.
>
> Andrew.
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Porting GCC to 8051 Microcontroller
  2008-05-07  7:50 Ganesh
  2008-05-07  7:57 ` Fabian Cenedese
@ 2008-05-07  9:55 ` Andrew Haley
  2008-05-07 10:03   ` Ganesh
  1 sibling, 1 reply; 8+ messages in thread
From: Andrew Haley @ 2008-05-07  9:55 UTC (permalink / raw)
  To: Ganesh; +Cc: gcc-help

Ganesh wrote:
> I am planning to do GCC porting for 8051 Microcontroller.
> 
> Kindly send me the steps involved in this project.

Well, if you don't understand the steps involved I don't see
why you're planning to do the port.  The 8051 architecture has
a number of features that will make it very hard to generate
code with gcc.  

The gccint info file has most of the info you need to do the
port.

Andrew.
  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Porting GCC to 8051 Microcontroller
  2008-05-07  7:50 Ganesh
@ 2008-05-07  7:57 ` Fabian Cenedese
  2008-05-07 11:48   ` Ganesh
  2008-05-07  9:55 ` Andrew Haley
  1 sibling, 1 reply; 8+ messages in thread
From: Fabian Cenedese @ 2008-05-07  7:57 UTC (permalink / raw)
  To: gcc-help

At 12:59 07.05.2008 +0530, Ganesh wrote:
>I am planning to do GCC porting for 8051 Microcontroller.
>Kindly send me the steps involved in this project.

Are there specific reasons to use gcc? Otherwise there are other
open source compilers like http://sdcc.sourceforge.net/ 

bye  Fabi


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Porting GCC to 8051 Microcontroller
@ 2008-05-07  7:50 Ganesh
  2008-05-07  7:57 ` Fabian Cenedese
  2008-05-07  9:55 ` Andrew Haley
  0 siblings, 2 replies; 8+ messages in thread
From: Ganesh @ 2008-05-07  7:50 UTC (permalink / raw)
  To: gcc-help

I am planning to do GCC porting for 8051 Microcontroller.
 
Kindly send me the steps involved in this project.
 
Regards,
Ganesh

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-05-09 10:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-09 15:28 Porting GCC to 8051 Microcontroller Duane Ellis
  -- strict thread matches above, loose matches on Subject: below --
2008-05-07  7:50 Ganesh
2008-05-07  7:57 ` Fabian Cenedese
2008-05-07 11:48   ` Ganesh
2008-05-07  9:55 ` Andrew Haley
2008-05-07 10:03   ` Ganesh
2008-05-07 10:15     ` Andrew Haley
2008-05-09 10:35       ` Andrew Haley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).