[avr-gcc-list] Posible bug in avr-gcc-4.0.2 (inline asm)

2005-10-05 Thread Anatoly Sokolov
Hello. Studying avr-libc bug #14486 I have written the following test case. #define SFR (*(unsigned char *)(0x80)) #define foo() \ ({ \ __asm__ __volatile__\ (

[avr-gcc-list] 'MOVW' instruction in new ATtiny.

2006-02-06 Thread Anatoly Sokolov
Hello. I have created the patch which allows the gcc to use 'MOVW' instruction for new ATtiny devices: https://savannah.nongnu.org/task/?func=detailitemitem_id=5089 (task #5089 overview: Add new arhitecture 'avr25' in gcc toolchain for new ATtiny devices.) Please test it. Anatoly.

Re: [avr-gcc-list] 'MOVW' instruction in new ATtiny.

2006-02-08 Thread Anatoly Sokolov
Hello. Whether you plan to add an __AVR_HAVE_LPMX__ ? I plan to add 'avr55' architecture for ATmega128(x) devices, for which __AVR_HAVE_ELPM__ is defined. It will allow to solve a following problem: Some functions from 'fplib', for example ' fp_powerseries', always use LPM the instruction of

[avr-gcc-list] Re: [avr-libc-dev] [AVR] RTL prologue/epilogue

2006-06-25 Thread Anatoly Sokolov
Hello. Attached is modifed Andy Hutchinson patch that changes AVR GCC to use RTL prologue/epilogue generation. Original patch: http://gcc.gnu.org/ml/gcc/2005-03/msg00923.html New pach is for GCC 4.2. Anatoly. Index: gcc/config/avr/avr-protos.h

[avr-gcc-list] Re: [avr-libc-dev] [AVR] RTL prologue/epilogue

2006-08-02 Thread Anatoly Sokolov
- Original Message - From: Denis Chertykov [EMAIL PROTECTED] To: Anatoly Sokolov [EMAIL PROTECTED] Cc: avr-libc-dev@nongnu.org; avr-gcc-list@nongnu.org; Denis Chertykov [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, June 26, 2006 6:51 PM Subject: Re: [avr-libc-dev] [AVR] RTL

Re: [avr-gcc-list] Re: Removal of unused functions

2006-08-19 Thread Anatoly Sokolov
- Original Message - From: Björn Haase [EMAIL PROTECTED] To: avr-gcc-list@nongnu.org Sent: Saturday, August 19, 2006 9:31 PM Subject: [avr-gcc-list] Re: Removal of unused functions Hello people, I've read quite a bit about the removal of unused functions when using avr-gcc. In

[avr-gcc-list] Re: AVR toolchain patch hell

2006-09-05 Thread Anatoly Sokolov
- Original Message - From: Denis Chertykov Sent: Tuesday, September 05, 2006 9:34 PM Subject: Re: AVR toolchain patch hell I have the one big problem. The AVR port havn't working GCC testsuit. Mike Stein mstein at phenix dot rootshell dot be (mstein) every day sends results

[avr-gcc-list] FW: [AVR] RTL prologue/epilogue

2006-12-23 Thread Anatoly Sokolov
-Original Message- From: Anatoly Sokolov [mailto:[EMAIL PROTECTED] Sent: Saturday, December 23, 2006 9:13 PM To: [EMAIL PROTECTED] Subject: [AVR] RTL prologue/epilogue Hello. Attached is patched for 4.3.0 head that changes AVR target to use RTL prologue/epilogue generation. Tested

[avr-gcc-list] maga256 patch for GCC 4.2

2007-05-02 Thread Anatoly Sokolov
Hello. This is Bjorn Haase 'mega256' patch adapted for GCC4.2. Review and testing is welcomed. I add new punctuation characters (%!), which generate symbol 'e' if AVR_HAVE_EIJMP_EICALL is true. It allows to replace code: if (AVR_HAVE_EIJMP_EICALL) return \eicall\; else

Re: [avr-gcc-list] Inversion of logic improves size speed

2007-08-06 Thread Anatoly Sokolov
Hi, From: Wouter van Gulik [EMAIL PROTECTED] Sent: Sunday, August 05, 2007 11:46 PM After some testing I found out that inverting shift and and instruction can significantly reduce speed and size. In the first is case the compiler misses that it can optimise the shifts for bit 4..7 by

Re: [avr-gcc-list] Inversion of logic improves size speed

2007-08-26 Thread Anatoly Sokolov
Hi. This patch optimizes logic left shift of unsigned char by 4, 5, and 6, excluding double 'andi' instructions in some cases. ... uint8_t getBit4InvShift(uint8_t temp) { uint8_t r = 0; if((temp4)1) r|=0x1; return r; } uint8_t getBit5InvShift(uint8_t temp) { uint8_t r = 0; if((temp5)1)

Re: [avr-gcc-list] Inversion of logic improves size speed

2007-08-27 Thread Anatoly Sokolov
Anatoly Sokolov wrote: Hi. This patch optimizes logic left shift of unsigned char by 4, 5, and 6, excluding double 'andi' instructions in some cases. Patch. Anatoly. begin 666 gcc_fix_11259_33028.txt [EMAIL PROTECTED](=C8R]R96-O9RYCCT]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T] M/3T]/3T]/3T]/3T

Re: [avr-gcc-list] What is the best method to avoid avr35 for avr-gcc4.3?

2008-01-08 Thread Anatoly Sokolov
Hi. I try to build the avr-gcc 4.3-20080104 snapshot. Binutils is 2.18. Build is fault at compilation 'libgcc' for avr35: illegal opcode movw. Is there any method to configure GCC to work with binutils-2.18 ? Use patch: http://sourceware.org/ml/binutils/2008-01/msg00037.html

Re: [avr-gcc-list] Save RAMPZ register in interrupt handler routines

2008-01-29 Thread Anatoly Sokolov
Hi. From: David Brown [EMAIL PROTECTED] Sent: Sunday, January 27, 2008 10:57 PM I'd imagine that the use of pgm_read_*_far macros within interrupt functions is pretty rare - perhaps the best idea is to use the patch, but make -mno-save-rampz the default? Rare for 128K devices, but are more

Re: [avr-gcc-list] Save RAMPZ register in interrupt handler routines

2008-01-31 Thread Anatoly Sokolov
- Original Message - From: [EMAIL PROTECTED] To: AVR-GCC-list@nongnu.org Sent: Thursday, January 31, 2008 7:14 PM Subject: Re: [avr-gcc-list] Save RAMPZ register in interrupt handler routines The perfect way to handle RAMPZ is declare it as fixed register to GCC. Then for each

[avr-gcc-list] Move '__do_copy_data' from gcrt1.S to libgcc.S

2008-02-04 Thread Anatoly Sokolov
Hello. This patches move '_do_copy_data' code for devices with 128KB and up FLASH from avr-libc to libgcc. Anatoly. begin 666 gcc-4.3-do_copy_data.txt [EMAIL PROTECTED](=C8R]C;VYF:6O879R+VQI8F=C8RY3CT]/3T]/3T]/3T]/3T] M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]

[avr-gcc-list] The M3000 devices from System Semiconductor Inc.

2008-03-11 Thread Anatoly Sokolov
Hello. The M3000 devices from System Semiconductor have AVR core and therefore can be added in the avr-gcc toolchain. We shall add them? http://www.systemsemi.com/index.htm Anatoly.___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org

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

2008-04-04 Thread Anatoly Sokolov
Hello. This patch add '__builtin_avr_swap', '__builtin_avr_sei' and '__builtin_avr_cli' builtins in avr backend. It will allow to use 'SWAP', 'SEI' and 'CLI' instructions, without use inline assembly. I wish to add: 1. builtins for 'SLEEP' and 'WDR' instructions; 2. builtins for

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] gcc 4.3.0

2008-04-12 Thread Anatoly Sokolov
Hello. Also, I get an average increase of the codesize (everything identical but the gcc version) of 5% moving from 4.2.3 to 4.3.0 (averiged over 12 projects, varying from 1% to 9%). I did not yet did research on the cause. Try use --param inline-call-cost=5 switch. The minimal

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 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-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] Upgraded and re-compiled a current project and a function was converted to in-line and a function.

2008-04-20 Thread Anatoly Sokolov
Hi. I just installed WinAvr-20080411 and re-compiled a recent project (lab4a). I was surprised that the code increased by almost 400 bytes (lab4b). Looking into the reason I see that the compiler generated my EEPROM_read function and then started generating the function in-line in all of

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-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

[avr-gcc-list] Multiply improvement [1]

2008-04-27 Thread Anatoly Sokolov
Hello. Now AVR-GCC for multiplication of two unsigned and two signed char operands uses instructions 'MUL' and 'MULS' accordingly and is 8x8=16bits operation. Multiplication signed on unsigned chars is carried out as multiplication of two 16-bit values, though in AVR core there is

Re: [avr-gcc-list] Multiply improvement [1]

2008-04-27 Thread Anatoly Sokolov
in tests. I to wait month for user responses before to add the patch in the GCC. Take the decision themselves. Anatoly. - Original Message - From: Weddington, Eric [EMAIL PROTECTED] To: Anatoly Sokolov [EMAIL PROTECTED]; avr-GCC avr-gcc-list@nongnu.org Sent: Sunday, April 27, 2008 11:11

[avr-gcc-list] Multiply improvement [2]

2008-04-29 Thread Anatoly Sokolov
Hello. This patch adds 'maddqihi4' and 'maddqihi4' multiply-add insn patterns for 16bit += 8x8bit operations. Where multiplication is signed on signed or unsigned on unsigned . Code decreased on one 'MOVW' instruction per multiply-add operation. The patch madd.diff caused 0 gcc testsuite

Re: [avr-gcc-list] ATmega2560 and r30/31 save in function prologue

2008-05-03 Thread Anatoly Sokolov
Hi. Anatoly, Andy, can you look at this? Testcase: #include avr/interrupt.h void foo (void) { char tmp = PORTA; } ISR(INT0_vect) { foo(); } int main (void) { return 0; } Code compiled with -O0: void foo (void) { ce: df 93push r29 d0: cf 93push r28 d2: 0f 92

Re: [avr-gcc-list] What has changed between WinAVR 20070525rc2 andWinAVR 20080430?

2008-05-12 Thread Anatoly Sokolov
Hello. The unit has a bit mapped display. With 4.3.0 I have random pixels that I don't have with 4.1.2, which probably indicates that I have something marginal in my display driver timing. When I assert INT0 the unit eventually locks up with 4.3.0, but not with 4.1.2. All rather vague

Re: [avr-gcc-list] Avr-gcc Produces Incorrect Code with -Os

2008-05-22 Thread Anatoly Sokolov
Hi. An alternative way to handle this sort of thing would be to implement a critical function attribute like in the msp430 port of gcc - a function with this attribute has interrupts disabled at the start, and restored at the end. It will work for for tiny and mega devices, but xmega

Re: [avr-gcc-list] BUG: GCC use don't saved registers in ISR with -O3optimization

2008-06-02 Thread Anatoly Sokolov
Hi. Do you have a GCC bug report for this yet? I could not find one... Eric The bug and patch: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36424 Anatoly.___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org

Re: [avr-gcc-list] Re: [patch #6004] main-as-normal patches for GCC

2008-06-02 Thread Anatoly Sokolov
Hi. Is there some documentation out there about the effect of all the AVR specific attributes? I'd like to understand the puposes and (generated code) consequences of OS_main Function with OS_main and 'OS_task' attributes do not save any call-saved registers. 1. OS_main attribute

Re: [avr-gcc-list] ATmega2560 and gcc __prologue_saves__

2008-07-14 Thread Anatoly Sokolov
Hello. I've stumbled across another problem with ATmega2560 support. Although the problem is triggered from avr-libc, I believe this to be a gcc problem. Then the do_rand() calls __prologue_saves__. That function saves the appropriate registers, but then assembles an EIJUMP without

[avr-gcc-list] Re: progmem_far attribute

2008-07-20 Thread Anatoly Sokolov
Hi. The patch add progmem_far attribute in GCC. Anatoly. - Original Message - From: Anatoly Sokolov [EMAIL PROTECTED] To: avr-GCC avr-gcc-list@nongnu.org Cc: Anatoliy Sokolov [EMAIL PROTECTED] Sent: Friday, May 02, 2008 8:36 PM Subject: progmem_far attribute Hello. Now GCC have

Re: [avr-gcc-list] Re: progmem_far attribute

2008-07-20 Thread Anatoly Sokolov
Hi. From: Andy H [EMAIL PROTECTED] Sent: Sunday, July 20, 2008 8:51 PM A better name would be progmem_high. FAR is entirely different. Ok. Unlike some cpu AVR does not need different direct JMP/CALL/RET... This patch adderss only to data. User space of 'progmem' section limeted to

Re: [avr-gcc-list] Transfer bit conserved by gcc?

2008-09-21 Thread Anatoly Sokolov
Hi. Well actually it is not, the other place i found is define_insn negsf2 which could be repaired too. fplib in avr-libc use T bit. atoi, atol, itoa ltoa and vfprintf (__ultoa_invert) functions use T bit also. Anatoliy.___ AVR-GCC-list

Re: [avr-gcc-list] Transfer bit conserved by gcc?

2008-09-21 Thread Anatoly Sokolov
Hi. I look avr.c file, set instruction used for implementation shift operation and for loading constant with one bit set (0b0010). T-bit is used by avr-gcc for internal purpose, the same way as temp reg (r0) and cannot be used for storing value.

Re: [avr-gcc-list] Funny business with latest WinAvr20081205+ xmega128A1 and stdio

2009-01-19 Thread Anatoly Sokolov
Is there a WinAVR bug report filed for this? Yes. This is the sourceforge.ne bug #2490164 XMega (128A1): subroutine calling may corrupt stack pointer http://sourceforge.net/tracker/index.php?func=detailaid=2490164group_id=68108atid=520074 Anatoly.

Re: [avr-gcc-list] no avr/lib/avr25/attiny13a/Makefile.in

2009-02-01 Thread Anatoly Sokolov
Hi. I'm ok with say that we require some verion = X. Anything X should fail. Anything = X should be allowed. With X being the lowest version that we check for. Test for autoconf min version alredy present in configure.ac: 38: AC_PREREQ(2.57) Test for automake version can add this way:

Re: [avr-gcc-list] Overlong interrupt vector table

2009-02-03 Thread Anatoly Sokolov
Hi Richard F wrote: So doesn't look like any more optimisation to be had there! Sorry. I has not understood your phrase. If you consider that the jump table optimisation is not effective for your project, you can disable it with the -fno-jump-tables switch. The target specific

Re: [avr-gcc-list] Code optimistaion in AVR Tiny13

2009-02-16 Thread Anatoly Sokolov
Hi, add OS_main attribute to main function, -mtiny-stack Anatoly. ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Re: [avr-gcc-list] Bug in *rotlsi3 insns?

2009-03-23 Thread Anatoly Sokolov
Hi. Consider this test case: unsigned long rotl (int dummy, unsigned long x) { return (x 8) | (x 24); } Compile with, e.g. avr-gcc -mmcu=atmega8 -S -Os -fno-split-wide-types This will map 0x33221100 to 0x33110033 instead of to 0x22110033 Please test the patch. And what version

Re: [avr-gcc-list] when is it safe to use -mtiny-stack

2009-04-06 Thread Anatoly Sokolov
Hi. Are there any caveats to the use of this option? How would one know if it is safe to use for a given code base? The -mtiny-stack may (and should) be used only for devices with 0xFF max RAM adderss, i.e. if SP register is 8-bit. All devices with 1KB and 2KB FLASH memory satisfy this

Re: [avr-gcc-list] mcall-prologues completely broken for 128k

2009-05-13 Thread Anatoly Sokolov
Hi. On 5/12/09, Weddington, Eric eric.wedding...@atmel.com wrote: I don't understand what you're doing here. You've completely removed EIJMP from gcc. That is correct. It is better for gcc not to use this instruction. This prevent using indirect function call in bootloader code for

Re: [avr-gcc-list] mcall-prologues completely broken for 128k

2009-05-13 Thread Anatoly Sokolov
- Original Message - From: Sean D'Epagnier geckosena...@gmail.com To: Anatoly Sokolov ae...@post.ru Cc: Weddington, Eric eric.wedding...@atmel.com; avr-gcc-list@nongnu.org Sent: Wednesday, May 13, 2009 6:35 PM Subject: Re: [avr-gcc-list] mcall-prologues completely broken for 128k

Re: [avr-gcc-list] mcall-prologues completely broken for 128k

2009-05-13 Thread Anatoly Sokolov
In any case, the rules of EIND usage must be documented. The avr-gcc/avr-ld internally use the EIND for indirect function call, case statement optimization (tablejump) and -mcall-prologues optimization. The EIND always should contain hh8(pm(start of .trampolines section)) value, i.e. 0 when

Re: [avr-gcc-list] build error with svn gcc

2009-05-29 Thread Anatoly Sokolov
Hi. ../../gcc/config/avr/avr.c -o avr.o .../../gcc/config/avr/avr.c: In function �‘avr_override_options�’: .../../gcc/config/avr/avr.c:396: error: �‘PARAM_INLINE_CALL_COST�’ undeclared (first use in this func ) .../../gcc/config/avr/avr.c:396: error: (Each undeclared identifier

Re: [avr-gcc-list] Clarification for interrupt specific changes inoutput_movhi() in revision 136238

2010-08-25 Thread Anatoly Sokolov
Hi. There is one issue I would like to get clarified. In prologue, conditional check for is_OS_main is happening but not the same in epilogue. expand_prologue() { ... + else if (TARGET_NO_INTERRUPTS +|| cfun-machine-is_signal +|| cfun-machine-is_OS_main) + { insn =

[avr-gcc-list] [M32R] Hookize GO_IF_MODE_DEPENDENT_ADDRESS

2010-09-08 Thread Anatoly Sokolov
Hi. This patch removes obsolete GO_IF_MODE_DEPENDENT_ADDRESS macro from the M32R back end in the GCC and introduces equivalent TARGET_MODE_DEPENDENT_ADDRESS_P target hook. Regression tested on m32r-unknown-elf. OK to install? * config/m32r/m32r.c