On 10/08/13 21:48, Przemek Klosowski wrote:
> On Tue, Oct 8, 2013 at 8:50 PM, Charles Steinkuehler
> <[email protected]> wrote:
> 
>>  Ah well...maybe someone will write a virtual AVR emulator for the PRU,
>> then you could have *THREE* Arduino's on a Tre!
> 
> Now this is crazy, but I think it would be useful to port GCC (or
> llvm) to PRU.  It is well known that while top coders can write better
>  assembly than best compilers, at least for short codes, the
> relentless nature of compiler optimizations gives them edge on longer
> pieces and less smart programmers. It'd be tricky to implement the
> bitfields, but I believe that all the infrastructure is there.

It's not that crazy.  The biggest problem is there's no real stack on
the PRU, and while you can emulate one for nested calls, it rapidly
becomes cumbersome and starts eating cycles.  And I don't know much C
code that works well with one level of call depth.  :(

...but burning 4+ clocks or so on a function call/return probably isn't
the end of the world either.  If I did more programming in C (I
generally code in VHDL for my day job, and use C only when I need to
shoot myself in the foot or crash the machine*), I would happily port
gcc to the PRU, but I'll leave that to others.  :)

[*] This small C program is 100% equivalent in functionality to
approximately 90+ percent of the C code I've ever written (thanks to
http://llbit.se/?p=1744 for the size reduction!):

main;

--
Charles Steinkuehler
charles@steinkuehler

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to