[avr-gcc-list] (no subject)
hello plese send me an tinyusb project files for avr programmer with usb thank you [EMAIL PROTECTED] - Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games.___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
[avr-gcc-list] possible 4.1.2 bug
Hi all- The code below, compiled with avr-gcc 4.1.2 like this avr-gcc -c -Os -mmcu=atmega128 prob.c produces faulty assembly code that attempts ldi into r14. I'm not at all sure that the asm is correct (didn't write it) but it seems that gcc shouldn't be picking an unusable register in any case. The only other version I tried is 3.4.3 which has the same problem. Figured I'd check here to see if I'm missing something silly before filing a bug. John Regehr void foo (char, char, char, char, char); short bar (void) { char a = 0; volatile char b = 0; char c = 0; char d = 0; char e = 0; int in; int out; foo (e, d, c, b, a); __asm__ (swap %B1 \n\t swap %C1 \n\t swap %D1 \n\t ldi %A1, 0xf0 \n\t eor %D1, %C1 \n\t and %D1, %A1 \n\t eor %D1, %C1 \n\t eor %C1, %B1 \n\t and %C1, %A1 \n\t eor %C1, %B1 \n\t movw %A0, %C1 \n\t : =r (out) : r (in)); return out; } ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
Re: [avr-gcc-list] possible 4.1.2 bug
Doh. I figured that this sort of constraint would be implicit from the instructions used. Thanks! John Regehr On Thu, 29 Mar 2007, Joerg Wunsch wrote: John Regehr [EMAIL PROTECTED] wrote: I'm not at all sure that the asm is correct (didn't write it) but it seems that gcc shouldn't be picking an unusable register in any case. The constraint r says: You are free to pick *any* register. As your instruction requires an upper register (r16 through r31), you simply need to tell that: make the constraint of the second argument d, and it will work. -- cheers, Jorg .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-) ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
RE: [avr-gcc-list] possible 4.1.2 bug
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] org] On Behalf Of John Regehr Sent: Wednesday, March 28, 2007 10:15 PM To: avr-gcc-list@nongnu.org Subject: [avr-gcc-list] possible 4.1.2 bug void foo (char, char, char, char, char); short bar (void) { char a = 0; volatile char b = 0; char c = 0; char d = 0; char e = 0; int in; int out; foo (e, d, c, b, a); __asm__ (swap %B1 \n\t swap %C1 \n\t swap %D1 \n\t ldi %A1, 0xf0 \n\t eor %D1, %C1 \n\t and %D1, %A1 \n\t eor %D1, %C1 \n\t eor %C1, %B1 \n\t and %C1, %A1 \n\t eor %C1, %B1 \n\t movw %A0, %C1 \n\t : =r (out) : r (in)); return out; } Besides what Joerg wrote, I'm puzzled about the above inline assembly. This code uses 4 parts (bytes), A through D, as if in was a 32-bit value. But both variables, out and in, are defined to be int, which on an AVR are 16 bits. Either there's a descrepency here, or I'm just not understanding what's going on here. Eric ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list