From: Borja F. <bor...@gm...> - 2010-09-24 13:06:12
|
Hello everybody, I've been working lately in the AVR backend for LLVM by myself until i've found this project. I'm not completely happy with the code GCC produces so i decided to take on with this challenge. I think it would be a good idea to join our efforts in this project, instead of duplicating the work if we do it by separate. My current code has the following status: - It can build and emit AVR asm code for very basic C code. - Produce code for all arithmetic and binary operators and for different sizes wider than char (except division for larger types which will end being a lib call). - Basic support for shifts, currently only by a constant number. (We needed here customized shifts because AVR only supports shifts by 1). - Support for the multiplication instruction. - Support for input function arguments and return values of any size. - Code pass to fold two move instructions into a movw. (I dont like this as a final solution since i prefer patching the DAG before codegen but it works atm). - Very basic support for function calls (I'm currently working into this). My code looks very similar to the one in this project with some exceptions, for example the instruction formats and instruction description. I've taken a different approach on encoding instructions trying to pack instructions by format like Reg,Reg or Reg, K, etc so we end up encoding them in a compact form. I've been running some tests and the code produced looks very promising, LLVM produces more compact code than gcc without having written any single optimization yet in my code. Of course there are cases that need tuning, but I think optimizations should be left for a later stage in development until things work decently. Although i couldnt resist on this last point, i've reported some missed optimizations in the LLVM dev list, and filled them as a bug report. One great thing about LLVM is that you get pretty fast support and things get fixed much faster than for GCC where a bug report can be open for 8 years. Well let me know what you think and if we can merge our code. Thanks |