diff options
Diffstat (limited to 'toolchain-layer/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99343.patch')
-rw-r--r-- | toolchain-layer/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99343.patch | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/toolchain-layer/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99343.patch b/toolchain-layer/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99343.patch new file mode 100644 index 0000000000..86b2d81093 --- /dev/null +++ b/toolchain-layer/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99343.patch | |||
@@ -0,0 +1,132 @@ | |||
1 | Backport from FSF mainline: | ||
2 | |||
3 | gcc/ | ||
4 | * config/arm/thumb2.md (*thumb2_addsi3_compare0): New. | ||
5 | (*thumb2_addsi3_compare0_scratch): New. | ||
6 | * config/arm/constraints.md (Pv): New. | ||
7 | * config/arm/arm.md (*addsi3_compare0): Remove FIXME comment. Use | ||
8 | for ARM mode only. | ||
9 | (*addsi3_compare0_scratch): Likewise. | ||
10 | |||
11 | 2010-07-26 Julian Brown <julian@codesourcery.com> | ||
12 | |||
13 | Merge from Sourcery G++ 4.4: | ||
14 | |||
15 | 2010-05-25 Julian Brown <julian@codesourcery.com> | ||
16 | |||
17 | === modified file 'gcc/config/arm/arm.md' | ||
18 | --- old/gcc/config/arm/arm.md 2010-08-12 13:35:39 +0000 | ||
19 | +++ new/gcc/config/arm/arm.md 2010-08-12 16:47:21 +0000 | ||
20 | @@ -701,7 +701,6 @@ | ||
21 | "" | ||
22 | ) | ||
23 | |||
24 | -;; ??? Make Thumb-2 variants which prefer low regs | ||
25 | (define_insn "*addsi3_compare0" | ||
26 | [(set (reg:CC_NOOV CC_REGNUM) | ||
27 | (compare:CC_NOOV | ||
28 | @@ -710,7 +709,7 @@ | ||
29 | (const_int 0))) | ||
30 | (set (match_operand:SI 0 "s_register_operand" "=r,r") | ||
31 | (plus:SI (match_dup 1) (match_dup 2)))] | ||
32 | - "TARGET_32BIT" | ||
33 | + "TARGET_ARM" | ||
34 | "@ | ||
35 | add%.\\t%0, %1, %2 | ||
36 | sub%.\\t%0, %1, #%n2" | ||
37 | @@ -723,7 +722,7 @@ | ||
38 | (plus:SI (match_operand:SI 0 "s_register_operand" "r, r") | ||
39 | (match_operand:SI 1 "arm_add_operand" "rI,L")) | ||
40 | (const_int 0)))] | ||
41 | - "TARGET_32BIT" | ||
42 | + "TARGET_ARM" | ||
43 | "@ | ||
44 | cmn%?\\t%0, %1 | ||
45 | cmp%?\\t%0, #%n1" | ||
46 | |||
47 | === modified file 'gcc/config/arm/constraints.md' | ||
48 | --- old/gcc/config/arm/constraints.md 2010-07-29 16:58:56 +0000 | ||
49 | +++ new/gcc/config/arm/constraints.md 2010-08-12 16:47:21 +0000 | ||
50 | @@ -31,7 +31,7 @@ | ||
51 | ;; The following multi-letter normal constraints have been used: | ||
52 | ;; in ARM/Thumb-2 state: Da, Db, Dc, Dn, Dl, DL, Dv, Dy, Di | ||
53 | ;; in Thumb-1 state: Pa, Pb | ||
54 | -;; in Thumb-2 state: Ps, Pt | ||
55 | +;; in Thumb-2 state: Ps, Pt, Pv | ||
56 | |||
57 | ;; The following memory constraints have been used: | ||
58 | ;; in ARM/Thumb-2 state: Q, Ut, Uv, Uy, Un, Um, Us | ||
59 | @@ -158,6 +158,11 @@ | ||
60 | (and (match_code "const_int") | ||
61 | (match_test "TARGET_THUMB2 && ival >= -7 && ival <= 7"))) | ||
62 | |||
63 | +(define_constraint "Pv" | ||
64 | + "@internal In Thumb-2 state a constant in the range -255 to 0" | ||
65 | + (and (match_code "const_int") | ||
66 | + (match_test "TARGET_THUMB2 && ival >= -255 && ival <= 0"))) | ||
67 | + | ||
68 | (define_constraint "G" | ||
69 | "In ARM/Thumb-2 state a valid FPA immediate constant." | ||
70 | (and (match_code "const_double") | ||
71 | |||
72 | === modified file 'gcc/config/arm/thumb2.md' | ||
73 | --- old/gcc/config/arm/thumb2.md 2010-08-05 16:34:46 +0000 | ||
74 | +++ new/gcc/config/arm/thumb2.md 2010-08-12 16:47:21 +0000 | ||
75 | @@ -1241,6 +1241,56 @@ | ||
76 | (set_attr "length" "2")] | ||
77 | ) | ||
78 | |||
79 | +(define_insn "*thumb2_addsi3_compare0" | ||
80 | + [(set (reg:CC_NOOV CC_REGNUM) | ||
81 | + (compare:CC_NOOV | ||
82 | + (plus:SI (match_operand:SI 1 "s_register_operand" "l, 0, r") | ||
83 | + (match_operand:SI 2 "arm_add_operand" "lPt,Ps,rIL")) | ||
84 | + (const_int 0))) | ||
85 | + (set (match_operand:SI 0 "s_register_operand" "=l,l,r") | ||
86 | + (plus:SI (match_dup 1) (match_dup 2)))] | ||
87 | + "TARGET_THUMB2" | ||
88 | + "* | ||
89 | + HOST_WIDE_INT val; | ||
90 | + | ||
91 | + if (GET_CODE (operands[2]) == CONST_INT) | ||
92 | + val = INTVAL (operands[2]); | ||
93 | + else | ||
94 | + val = 0; | ||
95 | + | ||
96 | + if (val < 0 && const_ok_for_arm (ARM_SIGN_EXTEND (-val))) | ||
97 | + return \"subs\\t%0, %1, #%n2\"; | ||
98 | + else | ||
99 | + return \"adds\\t%0, %1, %2\"; | ||
100 | + " | ||
101 | + [(set_attr "conds" "set") | ||
102 | + (set_attr "length" "2,2,4")] | ||
103 | +) | ||
104 | + | ||
105 | +(define_insn "*thumb2_addsi3_compare0_scratch" | ||
106 | + [(set (reg:CC_NOOV CC_REGNUM) | ||
107 | + (compare:CC_NOOV | ||
108 | + (plus:SI (match_operand:SI 0 "s_register_operand" "l, r") | ||
109 | + (match_operand:SI 1 "arm_add_operand" "lPv,rIL")) | ||
110 | + (const_int 0)))] | ||
111 | + "TARGET_THUMB2" | ||
112 | + "* | ||
113 | + HOST_WIDE_INT val; | ||
114 | + | ||
115 | + if (GET_CODE (operands[1]) == CONST_INT) | ||
116 | + val = INTVAL (operands[1]); | ||
117 | + else | ||
118 | + val = 0; | ||
119 | + | ||
120 | + if (val < 0 && const_ok_for_arm (ARM_SIGN_EXTEND (-val))) | ||
121 | + return \"cmp\\t%0, #%n1\"; | ||
122 | + else | ||
123 | + return \"cmn\\t%0, %1\"; | ||
124 | + " | ||
125 | + [(set_attr "conds" "set") | ||
126 | + (set_attr "length" "2,4")] | ||
127 | +) | ||
128 | + | ||
129 | ;; 16-bit encodings of "muls" and "mul<c>". We only use these when | ||
130 | ;; optimizing for size since "muls" is slow on all known | ||
131 | ;; implementations and since "mul<c>" will be generated by | ||
132 | |||