What steps will reproduce the problem?
1. avr-gcc -Os -S -mmcu=atmega8 fix16.c
2. Read .s file
What is the expected output? What do you see instead?
This is a diff of sequences from fix16.c:fix16_sadd resp. fix16.c:fix16_ssub.
There is a comparison >0 that can be replaced by a comparison >= 0.
Comparisons >= 0 might be more efficient on some systems because only the sign
bit needs to be tested. AVR is an example. In this test, it does not matter
whether >=0 or >0 is used:
diff fix16-a.s fix16-b.s
23,27c23,24
< cp __zero_reg__,r12
< cpc __zero_reg__,r13
< cpc __zero_reg__,r14
< cpc __zero_reg__,r15
< brge .L13
---
> sbrc r15,7
> rjmp .L13
76,80c73,74
< cp __zero_reg__,r12
< cpc __zero_reg__,r13
< cpc __zero_reg__,r14
< cpc __zero_reg__,r15
< brge .L17
---
> sbrc r15,7
> rjmp .L17
What version of the product are you using? On what operating system?
r64, hosted on avr-unknown-none
Original issue reported on code.google.com by georgjoh...@web.de on 27 Jan 2013 at 8:14
Original issue reported on code.google.com by
georgjoh...@web.de
on 27 Jan 2013 at 8:14Attachments: