avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] Strange asm output


From: Nicolas Schodet
Subject: [avr-libc-dev] Strange asm output
Date: Sun, 7 Nov 2004 17:52:42 +0100
User-agent: Mutt/1.5.6+20040722i

Hello,

I have a little piece of code which produce a very strange code:

int32_t a;

    if (a & (1L << 23))
 1f6:   da 01           movw    r26, r20
 1f8:   c9 01           movw    r24, r18
 1fa:   77 e1           ldi     r23, 0x17       ; 23
 1fc:   b6 95           lsr     r27
 1fe:   a7 95           ror     r26
 200:   97 95           ror     r25
 202:   87 95           ror     r24
 204:   7a 95           dec     r23
 206:   d1 f7           brne    .-12            ; 0x1fc
 208:   81 70           andi    r24, 0x01       ; 1
 20a:   90 70           andi    r25, 0x00       ; 0
 20c:   89 2b           or      r24, r25
 20e:   51 f0           breq    .+20            ; 0x224

I can not understand why gcc do not just test the 23th bit.

/Nicolas Schodet




reply via email to

[Prev in Thread] Current Thread [Next in Thread]