]> git.pld-linux.org Git - packages/crossavr-gcc.git/blob - 505-gcc-avrtc381-tiny.patch
- rebuild with ppl 1.0
[packages/crossavr-gcc.git] / 505-gcc-avrtc381-tiny.patch
1 diff -Naurp gcc/config/avr/avr.md gcc/config/avr/avr.md
2 --- gcc/config/avr/avr.md       2012-04-13 11:19:25.000000000 +0530
3 +++ gcc/config/avr/avr.md       2012-04-13 13:21:49.000000000 +0530
4 @@ -72,7 +72,8 @@
5     (UNSPECV_DELAY_CYCLES_1    101)
6     (UNSPECV_DELAY_CYCLES_2    102)
7     (UNSPECV_DELAY_CYCLES_3    103)
8 -   (UNSPECV_DELAY_CYCLES_4    104)])
9 +   (UNSPECV_DELAY_CYCLES_4    104)
10 +   (UNSPECV_DELAY_CYCLES_2_TINY 105)])
11  
12  (include "predicates.md")
13  (include "constraints.md")
14 @@ -3370,7 +3371,12 @@
15        if (loop_count > 0xFFFF)
16          loop_count = 0xFFFF;
17        unsigned int cycles_used = (((loop_count - 1) * 4) + 5);
18 -      emit_insn (gen_delay_cycles_2 (gen_int_mode (loop_count, HImode)));
19 +      if (AVR_TINY) {
20 +        emit_insn (gen_delay_cycles_2_tiny (gen_int_mode (loop_count, HImode)));
21 +      }
22 +      else {
23 +        emit_insn (gen_delay_cycles_2 (gen_int_mode (loop_count, HImode)));
24 +      }
25        cycles -= cycles_used;
26      }
27    if (IN_RANGE(cycles, 6, 767))
28 @@ -3418,6 +3424,19 @@
29    [(set_attr "length" "4")
30     (set_attr "cc" "clobber")])
31  
32 +(define_insn "delay_cycles_2_tiny"
33 +  [(unspec_volatile [(const_int 0)] UNSPECV_DELAY_CYCLES_2_TINY)
34 +   (match_operand:HI 0 "immediate_operand" "")
35 +   (clobber (match_scratch:HI 1 "=&d"))]
36 +  ""
37 +  " ldi %A1,lo8(%0)
38 +    ldi %B1,hi8(%0)
39 +    1:subi %A1,1
40 +    sbci %B1,0
41 +    brne 1b"
42 +  [(set_attr "length" "5")
43 +   (set_attr "cc" "clobber")])
44 +
45  (define_insn "delay_cycles_3"
46    [(unspec_volatile [(const_int 0)] UNSPECV_DELAY_CYCLES_3)
47     (match_operand:SI 0 "immediate_operand" "")
This page took 0.030941 seconds and 3 git commands to generate.