It is really cool that LLVM has a backend for PIC now. I wonder if someone could comment on the suitability of LLVM for 8-bit and 16-bit MCUs? Is there significant impedance mismatch or is it relatively easy to get good object code for these platforms? (I.e. roughly comparable to gcc4?) I ask since gcc is causing significant pain for one of my students. He could switch over to LLVM but only after writing a backend for AVR (8-bit RISC). Thanks, John Regehr
John Regehr wrote:> I ask since gcc is causing significant pain for one of my students. He > could switch over to LLVM but only after writing a backend for AVR (8-bit > RISC).An AVR backend would be very cool. AVR is way more compiler friendly than PIC, so it should not be all that difficult either. The only hitch is that in the MCU world people expect to be able to write interrupt handlers and the like in C, so one needs to invent a way to express them in LLVM. Inventive use of #define and some asm may be all that is needed, though. -- Pertti
On Mon, 2008-05-19 at 20:40 +0300, Pertti Kellomäki wrote:> The only hitch is that in the MCU world people expect to be > able to write interrupt handlers and the like in C...Most of the support that I have seen for this in other compilers amounts to custom calling conventions and preambles. Are you thinking of more than this?
Anyone else interested in an AVR backend? If so, for what members of the AVR family? If we do a port, likely it'll support only the ATmegas. John
There is an email thread under llvm-commits titled: [llvm-commits] PATCH for PIC16 target. One of the replies to this thread explains some of the challenges that we are facing on PIC16 Ali. -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of John Regehr Sent: Monday, May 19, 2008 9:45 AM To: llvmdev at cs.uiuc.edu Subject: [LLVMdev] LLVM on small MCUs? It is really cool that LLVM has a backend for PIC now. I wonder if someone could comment on the suitability of LLVM for 8-bit and 16-bit MCUs? Is there significant impedance mismatch or is it relatively easy to get good object code for these platforms? (I.e. roughly comparable to gcc4?) I ask since gcc is causing significant pain for one of my students. He could switch over to LLVM but only after writing a backend for AVR (8-bit RISC). Thanks, John Regehr _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev