EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

What is the most "C unfriendly" architecture for which a workable C compiler exists ?

Started by Anton Erasmus June 3, 2006
Walter Banks wrote:

> Rotates, adds and subtracts with carry are all instructions that > support extended precision integer operations. It is interesting > that the extensions in ISO C standards for embedded systems > TR18037 makes it easy to create compilers that can support > these instructions without resorting to assembly code.
Can you clarify this - do you mean you will be (finally) able to (eg) RotateRight(arg), and RotateRightCY(arg) ? -jg
On Thu, 08 Jun 2006 10:39:02 +1200, the renowned Jim Granville
<no.spam@designtools.co.nz> wrote:

>Pete Fenelon wrote: >> Tim Wescott <tim@seemywebsite.com> wrote: >> >>>>I think the ultimate challenge would be doing a compiler for the old >>>>Motorola 14500... if you could make it drive some RAM ;) >>>> >>>>pete >>> >>>I'm not familiar with that processor, but trying to make an optimizing >>>compiler for the ADSP 21xx would be a challenge -- if you ever need to >>>answer the question "what's a non-orthogonal instruction set" just check >>>that one out. Hand-optimizing assembly code would sometimes involve >>>backtracking 20 instructions to change register choices, then trying it >>>all again. >> >> >> But that sounds the kind of code-gen you could try with all kinds of >> clever algorithms - anything up to and including the >> brute-force-and-ignorance of something like GNU superopt (which seems to >> have died the depth ;)) >> >> The problem with the 14500 is that it's a 1-bit controller ;) -- >> basically a replacement for relays ;) > >Has anyone actually used the 14500 ? - an example of a real application >would be interesting. > >-jg
The real application is for a PLC-like controller. Think ladder logic. Best regards, Spehro Pefhany -- "it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com
Spehro Pefhany wrote:

> On Thu, 08 Jun 2006 10:39:02 +1200, the renowned Jim Granville > <no.spam@designtools.co.nz> wrote:
<snip>>>
>>>The problem with the 14500 is that it's a 1-bit controller ;) -- >>>basically a replacement for relays ;) >> >>Has anyone actually used the 14500 ? - an example of a real application >>would be interesting. >> >>-jg > > > The real application is for a PLC-like controller. Think ladder logic.
I realise what Motorola intended it to be used for; I'm curious if anyone actually did a design using one ? I have seen PLCs using the Signetics 8X300, which relative to the 14500, was an advanced chip :) -jg
Jim Granville wrote:

> > Has anyone actually used the 14500 ? - an example of a real application > would be interesting.
A customer had a 14500-based PLC board for a packing machine back in 1981-ish when PLCs were expensive. Hex keypad program entry, EEPROM program memory. I used to write programs for it, using a photocopied coding sheet. It was an antique way of doing things even then. I've still got one of them around somewhere. Paul Burke
Paul Burke wrote:
> Jim Granville wrote: > >> >> Has anyone actually used the 14500 ? - an example of a real application >> would be interesting. > > > > A customer had a 14500-based PLC board for a packing machine back in > 1981-ish when PLCs were expensive. Hex keypad program entry, EEPROM > program memory. I used to write programs for it, using a photocopied > coding sheet. It was an antique way of doing things even then. I've > still got one of them around somewhere.
Wow, thanks. Was that x8 EPROM, or wider ? Did you ever code counters in this ? I've been mulling over the idea of doing a 14500 in a CPLD, mainly as a teaching exercise. I can see simple ladder logic is do-able, but then wondered how to implement something like a counter, as the opcodes seem just a little short on that. No atomic complement data, for example, SKZ, but not SKNZ, and I'd be tempted to allow longer Skip sizes..... Maybe it needs a 14500++ :) -jg
Jim Granville wrote:

> Wow, thanks. > Was that x8 EPROM, or wider ? > Did you ever code counters in this ? >
I've just dug it out of the glory hole... the one I've got here is a very late one, with 85 date codes on the chips. The program store is an XC2816 with an RS label (that was shortly after they'd stopped being Radiospares). The RAM is a 2147. Sadly I junked all the circuit diagrams etc. about 6 years ago. I never did counters, it was all straightforward relay replacement stuff. Paul Burke
--------------9FAEB4075ED7A5ABD5420EBF
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Jim,

TR 18037 allows direct access to the processors registers. If the
condition codes are declared as a

register volatile struct {
       int is_IRQ       : 1;
       int disable_FIRQ : 1;
       int half_carry   : 1;
       int disable_IRQ  : 1;
       int N            : 1;
       int Z            : 1;
       int V            : 1;
       int C            : 1;
   } CC;

then

c = a + CC.C + b;

should now generate a

load  a
adc   b
store c

sequence. Similarily other instructions that
involve condition code access can now be used.

w..






Jim Granville wrote:

> Walter Banks wrote: > > > Rotates, adds and subtracts with carry are all instructions that > > support extended precision integer operations. It is interesting > > that the extensions in ISO C standards for embedded systems > > TR18037 makes it easy to create compilers that can support > > these instructions without resorting to assembly code. > > Can you clarify this - do you mean you will be (finally) > able to (eg) RotateRight(arg), and RotateRightCY(arg) ? > > -jg
--------------9FAEB4075ED7A5ABD5420EBF Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> Jim, <p>TR 18037 allows direct access to the processors registers. If the <br>condition codes are declared as a <p><tt>register volatile struct {</tt> <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int is_IRQ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 1;</tt> <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int disable_FIRQ : 1;</tt> <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int half_carry&nbsp;&nbsp; : 1;</tt> <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int disable_IRQ&nbsp; : 1;</tt> <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int N&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 1;</tt> <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int Z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 1;</tt> <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 1;</tt> <br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 1;</tt> <br><tt>&nbsp;&nbsp; } CC;</tt> <p>then <p>c = a + CC.C + b; <p>should now generate a <p>load&nbsp; a <br>adc&nbsp;&nbsp; b <br>store c <p>sequence. Similarily other instructions that <br>involve condition code access can now be used. <p>w.. <br>&nbsp; <br>&nbsp; <br>&nbsp; <br>&nbsp; <br>&nbsp; <p>Jim Granville wrote: <blockquote TYPE=CITE>Walter Banks wrote: <p>> Rotates, adds and subtracts with carry are all instructions that <br>> support extended precision integer operations. It is interesting <br>> that the extensions in ISO C standards for embedded systems <br>> TR18037 makes it easy to create compilers that can support <br>> these instructions without resorting to assembly code. <p>Can you clarify this - do you mean you will be (finally) <br>able to (eg) RotateRight(arg), and RotateRightCY(arg) ? <p>-jg</blockquote> </html> --------------9FAEB4075ED7A5ABD5420EBF--
Walter Banks wrote:
> > Part 1.1 Type: Plain Text (text/plain) > Encoding: 7bit
Please don't use html and/or attachments in usenet. -- "Our enemies are innovative and resourceful, and so are we. They never stop thinking about new ways to harm our country and our people, and neither do we." -- G. W. Bush. "The people can always be brought to the bidding of the leaders. All you have to do is tell them they are being attacked and denounce the pacifists for lack of patriotism and exposing the country to danger. It works the same way in any country." --Hermann Goering.
Thanks,
  Sounds like a worthwhile improvement (when supported:) , but it still 
does not allow access to RR/RRC opcodes ?

-jg


Walter Banks wrote:

> Jim, > > TR 18037 allows direct access to the processors registers. If the > condition codes are declared as a > > register volatile struct { > int is_IRQ : 1; > int disable_FIRQ : 1; > int half_carry : 1; > int disable_IRQ : 1; > int N : 1; > int Z : 1; > int V : 1; > int C : 1; > } CC; > > then > > c = a + CC.C + b; > > should now generate a > > load a > adc b > store c > > sequence. Similarily other instructions that > involve condition code access can now be used. > > w.. > > > > > > > Jim Granville wrote: > >> Walter Banks wrote: >> >> > Rotates, adds and subtracts with carry are all instructions that >> > support extended precision integer operations. It is interesting >> > that the extensions in ISO C standards for embedded systems >> > TR18037 makes it easy to create compilers that can support >> > these instructions without resorting to assembly code. >> >> Can you clarify this - do you mean you will be (finally) >> able to (eg) RotateRight(arg), and RotateRightCY(arg) ? >> >> -jg >>
Paul Burke wrote:

> Jim Granville wrote: > >> Wow, thanks. >> Was that x8 EPROM, or wider ? >> Did you ever code counters in this ? >> > > I've just dug it out of the glory hole... the one I've got here is a > very late one, with 85 date codes on the chips. The program store is an > XC2816 with an RS label (that was shortly after they'd stopped being > Radiospares). The RAM is a 2147. Sadly I junked all the circuit diagrams > etc. about 6 years ago.
You probably thought no one would ever ask about it :)
> I never did counters, it was all straightforward relay replacement stuff.
Thanks. I've worked out that counters are possible, with some small extensions. As time allows, I think I'll code a 14500, then re-map the 16 opcodes to remove dead spaces... -jg

The 2024 Embedded Online Conference