[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-b
From: |
Vincent Trouilliez |
Subject: |
Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ? |
Date: |
Fri, 04 Nov 2005 07:59:27 +0100 |
> I replaced the '&' operator with the more appropriate '&&' one.... works
> much better... 5 instructions instead of 115 (3 + 6*18 + 4) for the
> previous code.
> So that's indeed about 20 times faster. Although I still don't get why
> it can't just use one single SBRC/S instruction instead of these 4 cp or
> cpc instructions... I guess I am still missing something in the bit test
> department...
>
> if (address && 0x00040000)
> 24ec: 21 15 cp r18, r1
> 24ee: 31 05 cpc r19, r1
> 24f0: 41 05 cpc r20, r1
> 24f2: 51 05 cpc r21, r1
> 24f4: 11 f0 breq .+4 ; 0x24fa
Hmmm, '&&' might give much tighter code than '&', but my program no
longer works ! So it's still not the proper way to test a bit then,
dear... :o(((
--
Vince
- [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Vincent Trouilliez, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Vincent Trouilliez, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Royce Pereira, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?,
Vincent Trouilliez <=
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Ian Caddy, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within a multi-byte integer ?, Vincent Trouilliez, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within amulti-byte integer ?, Jurek Szczesiul, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within amulti-byte integer ?, Vincent Trouilliez, 2005/11/04
- RE: [avr-gcc-list] How to (efficeiently !!!) test a bit withinamulti-byte integer ?, niklo, 2005/11/04
- RE: [avr-gcc-list] How to (efficeiently !!!) test a bit withinamulti-byte integer ?, Vincent Trouilliez, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bit withinamulti-byte intege, Dave Hansen, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test a bitwithinamulti-byte intege, David Brown, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Dave Hansen, 2005/11/04
- Re: [avr-gcc-list] How to (efficeiently !!!) test abitwithinamulti-byte intege, Dave Hylands, 2005/11/04