AVR C Runtime Library - Bugs: bug #36611, _delay_loop_2 must not use...
You are not allowed to post comments on this tracker with your current authentication level.
bug #36611: _delay_loop_2 must not use constraint "w" with all targets
Submitter: | Georg-Johann Lay <gjlayde> | ||
Submitted: | Fri 08 Jun 2012 10:36:27 PM UTC | ||
Category: | Header | Severity: | 3 - Normal |
Priority: | 9 - Immediate | Item Group: | Header files |
Status: | None | Assigned to: | None |
Percent Complete: | 0% | Open/Closed: | Open |
Release: | 1.8.0 | Fixed Release: | None |
Wed 10 May 2017 01:45:07 AM UTC, comment #4: |
Cameron Tacklind <cinderblock> |
Fri 16 Nov 2012 09:17:17 PM UTC, comment #3: We'll need to verify that __builtin_delay_cycles in gcc is still valid. |
Eric Weddington <arcanum> |
Fri 16 Nov 2012 09:04:06 PM UTC, comment #2: Factor out the ISA / architecture by means of #if / #ifdef _HAVE_ADIW_ or _HAVE_CONSTRAINT_W_ or _AVR_ARCH_ or whatever your tools provide and use 2-insn decrement alongside with "d".
|
Georg-Johann Lay <gjlayde> |
Fri 16 Nov 2012 06:13:05 PM UTC, comment #1: Johann, what do you recommend to fix this? |
Eric Weddington <arcanum> |
Fri 08 Jun 2012 10:36:27 PM UTC, original submission:
./include/util/delay_basic.h
|
Georg-Johann Lay <gjlayde> |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
Follows 1 latest change.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2012-11-16 | arcanum | Priority | 5 - Normal | 9 - Immediate |
Powered by Savane 3.13-f8d8.
Corresponding source code
I ran into this problem and just re-wrote the _delay_loop_2 assembly.
This should be equivalent for all AVRs. It should even take the same number of clock cycles (since sbiw takes 2 clock cycles).
My initial tests suggest this is working. Since __count is a 2 byte number, %A0 and %B0 should always work as expected.