Re: [avr-gcc-list] Add builtins in avr target.

2008-04-26 Thread Anatoly Sokolov
Hi. __builtin_return_address is extremely useful for target error reporting. e.g. a function can be called(or trapped) to report error in another part of program. This allows such routines to determine the address of the caller without using naked asm functions. You are correct, that

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-26 Thread Andy H
As before I disagree. But let Eric and users decide: 1) Should __builtin_return_address() be disable for 256K device. Since it will only return word not 3 bytes. 2) Should function pointer arithmetic be disabled for 256K device - since it will only operate on word address. I think answer

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-22 Thread Wouter van Gulik
Anatoly Sokolov schreef: Hello. I have considered all proposals on changing '__builtin_avr_delay_cycles' builtin. Also has added '__builtin_avr_fmul*' builtins. There is one thing that crosses my mind. A user would not only want a voidinterrupt_enable (void) uint8_t interrupt_disable

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-21 Thread Rolf Ebert
Anatoly Sokolov schrieb: Hi. Why can not this be done with library/inline functions? I consider that use builtins allows to realize universal delay function easier. Also use builtins will allow to the same delay funcianality it ADA language. I have no problem in Ada calling inline

RE: [avr-gcc-list] Add builtins in avr target.

2008-04-21 Thread Weddington, Eric
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] org] On Behalf Of Rolf Ebert Sent: Monday, April 21, 2008 10:24 AM To: Anatoly Sokolov Cc: avr-gcc-list@nongnu.org Subject: Re: [avr-gcc-list] Add builtins in avr target. Anatoly Sokolov schrieb: Hi

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-20 Thread Anatoly Sokolov
Hello. I have considered all proposals on changing '__builtin_avr_delay_cycles' builtin. Also has added '__builtin_avr_fmul*' builtins. Anatoly.Index: gcc/config/avr/predicates.md === --- gcc/config/avr/predicates.md

RE: [avr-gcc-list] Add builtins in avr target.

2008-04-18 Thread Weddington, Eric
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] org] On Behalf Of Dmitry K. Sent: Thursday, April 17, 2008 9:24 PM To: avr-gcc-list@nongnu.org Subject: Re: [avr-gcc-list] Add builtins in avr target. On Friday 18 April 2008 12:56, Weddington, Eric wrote

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-18 Thread Anatoly Sokolov
Hi. Why can not this be done with library/inline functions? I consider that use builtins allows to realize universal delay function easier. Also use builtins will allow to the same delay funcianality it ADA language. Why does delay always have to be constant? If to allow input parameter

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Anatoly Sokolov
Hi. I wish to add: .. 3. builtin similarly to IAR '__delay_cycles'; .. This unfinished patch add '__builtin_avr_delay_cycles(long delay)' builtin to the avr backend. The 'delay' parameter should be constant. If 'delay' is 1 or 2 then one or two 'nop' instructions is generated. If

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Anatoly Sokolov
I wish to add: .. 3. builtin similarly to IAR '__delay_cycles'; .. This unfinished patch add '__builtin_avr_delay_cycles(long delay)' builtin to the avr backend. The 'delay' parameter should be constant. The patch attached. Anatoly.Index: gcc/config/avr/avr.md

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Wouter van Gulik
Anatoly Sokolov schreef: Hi. I wish to add: .. 3. builtin similarly to IAR '__delay_cycles'; .. This unfinished patch add '__builtin_avr_delay_cycles(long delay)' builtin to the avr backend. The 'delay' parameter should be constant. If 'delay' is 1 or 2 then one or two 'nop'

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Oleksandr Redchuk
2008/4/17, Wouter van Gulik [EMAIL PROTECTED]: For a 2 cycles delays an rjmp can be used. Saves an instruction! And so on: 3 cycles: rjmp . nop 4 cycles: rjmp . rjmp . 5 cycles: rjmp . rjmp . nop 6 cycles: rjmp . rjmp . rjmp . All code portions use no more program

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Oleksandr Redchuk
2008/4/17, Oleksandr Redchuk [EMAIL PROTECTED]: 7 to 756 ldi rX, (delay/3) 1:dec rX brne 1b is generated. 'ldi' instruction can be removed by optimizer. and removed ldi instruction execution time (1 cycle) for 7+ cycles will produce less relative error than for 3..6

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Anatoly Sokolov
Hi. 2008/4/17, Wouter van Gulik [EMAIL PROTECTED]: For a 2 cycles delays an rjmp can be used. Saves an instruction! And so on: 3 cycles: rjmp . nop I shall try to replace 'nop' with 'rjmp .' for two cycle delay. It is necessary to check that the linker relaxation pass will

RE: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Weddington, Eric
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] org] On Behalf Of Anatoly Sokolov Sent: Thursday, April 17, 2008 3:44 PM To: Oleksandr Redchuk; avr-gcc-list@nongnu.org Subject: Re: [avr-gcc-list] Add builtins in avr target. Hi. 2008/4/17, Wouter

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-17 Thread Dmitry K.
On Friday 18 April 2008 12:56, Weddington, Eric wrote: 2008/4/17, Wouter van Gulik [EMAIL PROTECTED]: For a 2 cycles delays an rjmp can be used. Saves an instruction! And so on: 3 cycles: rjmp . nop I shall try to replace 'nop' with 'rjmp .' for two cycle delay.

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-06 Thread Anatoly Sokolov
Hi. My patch adds avr specific builtins, and has no attitude to GCC standard builtins. See GCC bug #21080: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21080 Andy Hutchinson wrote a patch (attached to bug report) to fix this bug which adds support for __builtin_return_address. As far as I

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-06 Thread Andy H
Anatoly, __builtin_return_address is extremely useful for target error reporting. e.g. a function can be called(or trapped) to report error in another part of program. This allows such routines to determine the address of the caller without using naked asm functions. You are correct, that

RE: [avr-gcc-list] Add builtins in avr target.

2008-04-04 Thread Weddington, Eric
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] org] On Behalf Of Anatoly Sokolov Sent: Friday, April 04, 2008 2:51 PM To: avr-gcc-list@nongnu.org Subject: [avr-gcc-list] Add builtins in avr target. Hello. This patch add '__builtin_avr_swap',

Re: [avr-gcc-list] Add builtins in avr target.

2008-04-04 Thread Andrew Hutchinson
Unless the builtins expose more information to gcc, I cannot see any benefit from the addins - with the possible exception of FMUL. The result will be the same. No better code, no fewer bugs. Yes there are lots of outstanding patches that fix real bugs. It would seem to me that these are more