diff options
Diffstat (limited to 'recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99353.patch')
| -rw-r--r-- | recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99353.patch | 298 |
1 files changed, 298 insertions, 0 deletions
diff --git a/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99353.patch b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99353.patch new file mode 100644 index 0000000000..239251d2b5 --- /dev/null +++ b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99353.patch | |||
| @@ -0,0 +1,298 @@ | |||
| 1 | 2010-04-08 Bernd Schmidt <bernds@codesourcery.com> | ||
| 2 | |||
| 3 | Issue #6952 | ||
| 4 | |||
| 5 | gcc/ | ||
| 6 | * ira-costs.c (record_reg_classes): Ignore alternatives that are | ||
| 7 | not enabled. | ||
| 8 | * config/arm/vfp.md (arm_movdi_vfp): Enable only when not tuning | ||
| 9 | for Cortex-A8. | ||
| 10 | (arm_movdi_vfp_cortexa8): New pattern. | ||
| 11 | * config/arm/neon.md (adddi3_neon, subdi3_neon, anddi3_neon, | ||
| 12 | iordi3_neon, xordi3_neon): Add alternatives to discourage Neon | ||
| 13 | instructions when tuning for Cortex-A8. Set attribute "alt_tune". | ||
| 14 | * config/arm/arm.md (define_attr "alt_tune", define_attr "enabled"): | ||
| 15 | New. | ||
| 16 | |||
| 17 | 2010-07-26 Julian Brown <julian@codesourcery.com> | ||
| 18 | |||
| 19 | Merge from Sourcery G++ 4.4: | ||
| 20 | |||
| 21 | 2010-04-07 Thomas Schwinge <thomas@codesourcery.com> | ||
| 22 | Daniel Jacobowitz <dan@codesourcery.com> | ||
| 23 | |||
| 24 | |||
| 25 | === modified file 'gcc/config/arm/arm.md' | ||
| 26 | --- old/gcc/config/arm/arm.md 2010-08-13 10:30:35 +0000 | ||
| 27 | +++ new/gcc/config/arm/arm.md 2010-08-13 11:40:17 +0000 | ||
| 28 | @@ -432,6 +432,20 @@ | ||
| 29 | (const_string "yes") | ||
| 30 | (const_string "no")))) | ||
| 31 | |||
| 32 | +; Specifies which machine an alternative is tuned for. Used to compute | ||
| 33 | +; attribute ENABLED. | ||
| 34 | +(define_attr "alt_tune" "all,onlya8,nota8" (const_string "all")) | ||
| 35 | + | ||
| 36 | +(define_attr "enabled" "" | ||
| 37 | + (cond [(and (eq_attr "alt_tune" "onlya8") | ||
| 38 | + (not (eq_attr "tune" "cortexa8"))) | ||
| 39 | + (const_int 0) | ||
| 40 | + | ||
| 41 | + (and (eq_attr "alt_tune" "nota8") | ||
| 42 | + (eq_attr "tune" "cortexa8")) | ||
| 43 | + (const_int 0)] | ||
| 44 | + (const_int 1))) | ||
| 45 | + | ||
| 46 | (include "arm-generic.md") | ||
| 47 | (include "arm926ejs.md") | ||
| 48 | (include "arm1020e.md") | ||
| 49 | |||
| 50 | === modified file 'gcc/config/arm/neon.md' | ||
| 51 | --- old/gcc/config/arm/neon.md 2010-08-10 13:31:21 +0000 | ||
| 52 | +++ new/gcc/config/arm/neon.md 2010-08-13 11:40:17 +0000 | ||
| 53 | @@ -827,23 +827,25 @@ | ||
| 54 | ) | ||
| 55 | |||
| 56 | (define_insn "adddi3_neon" | ||
| 57 | - [(set (match_operand:DI 0 "s_register_operand" "=w,?&r,?&r") | ||
| 58 | - (plus:DI (match_operand:DI 1 "s_register_operand" "%w,0,0") | ||
| 59 | - (match_operand:DI 2 "s_register_operand" "w,r,0"))) | ||
| 60 | + [(set (match_operand:DI 0 "s_register_operand" "=w,?w,?&r,?&r") | ||
| 61 | + (plus:DI (match_operand:DI 1 "s_register_operand" "%w,w,0,0") | ||
| 62 | + (match_operand:DI 2 "s_register_operand" "w,w,r,0"))) | ||
| 63 | (clobber (reg:CC CC_REGNUM))] | ||
| 64 | "TARGET_NEON" | ||
| 65 | { | ||
| 66 | switch (which_alternative) | ||
| 67 | { | ||
| 68 | - case 0: return "vadd.i64\t%P0, %P1, %P2"; | ||
| 69 | - case 1: return "#"; | ||
| 70 | + case 0: /* fall through */ | ||
| 71 | + case 1: return "vadd.i64\t%P0, %P1, %P2"; | ||
| 72 | case 2: return "#"; | ||
| 73 | + case 3: return "#"; | ||
| 74 | default: gcc_unreachable (); | ||
| 75 | } | ||
| 76 | } | ||
| 77 | - [(set_attr "neon_type" "neon_int_1,*,*") | ||
| 78 | - (set_attr "conds" "*,clob,clob") | ||
| 79 | - (set_attr "length" "*,8,8")] | ||
| 80 | + [(set_attr "neon_type" "neon_int_1,neon_int_1,*,*") | ||
| 81 | + (set_attr "conds" "*,*,clob,clob") | ||
| 82 | + (set_attr "length" "*,*,8,8") | ||
| 83 | + (set_attr "alt_tune" "nota8,onlya8,*,*")] | ||
| 84 | ) | ||
| 85 | |||
| 86 | (define_insn "*sub<mode>3_neon" | ||
| 87 | @@ -861,24 +863,26 @@ | ||
| 88 | ) | ||
| 89 | |||
| 90 | (define_insn "subdi3_neon" | ||
| 91 | - [(set (match_operand:DI 0 "s_register_operand" "=w,?&r,?&r,?&r") | ||
| 92 | - (minus:DI (match_operand:DI 1 "s_register_operand" "w,0,r,0") | ||
| 93 | - (match_operand:DI 2 "s_register_operand" "w,r,0,0"))) | ||
| 94 | + [(set (match_operand:DI 0 "s_register_operand" "=w,?w,?&r,?&r,?&r") | ||
| 95 | + (minus:DI (match_operand:DI 1 "s_register_operand" "w,w,0,r,0") | ||
| 96 | + (match_operand:DI 2 "s_register_operand" "w,w,r,0,0"))) | ||
| 97 | (clobber (reg:CC CC_REGNUM))] | ||
| 98 | "TARGET_NEON" | ||
| 99 | { | ||
| 100 | switch (which_alternative) | ||
| 101 | { | ||
| 102 | - case 0: return "vsub.i64\t%P0, %P1, %P2"; | ||
| 103 | - case 1: /* fall through */ | ||
| 104 | - case 2: /* fall through */ | ||
| 105 | - case 3: return "subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2"; | ||
| 106 | + case 0: /* fall through */ | ||
| 107 | + case 1: return "vsub.i64\t%P0, %P1, %P2"; | ||
| 108 | + case 2: /* fall through */ | ||
| 109 | + case 3: /* fall through */ | ||
| 110 | + case 4: return "subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2"; | ||
| 111 | default: gcc_unreachable (); | ||
| 112 | } | ||
| 113 | } | ||
| 114 | - [(set_attr "neon_type" "neon_int_2,*,*,*") | ||
| 115 | - (set_attr "conds" "*,clob,clob,clob") | ||
| 116 | - (set_attr "length" "*,8,8,8")] | ||
| 117 | + [(set_attr "neon_type" "neon_int_2,neon_int_2,*,*,*") | ||
| 118 | + (set_attr "conds" "*,*,clob,clob,clob") | ||
| 119 | + (set_attr "length" "*,*,8,8,8") | ||
| 120 | + (set_attr "alt_tune" "nota8,onlya8,*,*,*")] | ||
| 121 | ) | ||
| 122 | |||
| 123 | (define_insn "*mul<mode>3_neon" | ||
| 124 | @@ -964,23 +968,26 @@ | ||
| 125 | ) | ||
| 126 | |||
| 127 | (define_insn "iordi3_neon" | ||
| 128 | - [(set (match_operand:DI 0 "s_register_operand" "=w,w,?&r,?&r") | ||
| 129 | - (ior:DI (match_operand:DI 1 "s_register_operand" "%w,0,0,r") | ||
| 130 | - (match_operand:DI 2 "neon_logic_op2" "w,Dl,r,r")))] | ||
| 131 | + [(set (match_operand:DI 0 "s_register_operand" "=w,?w,w,?w,?&r,?&r") | ||
| 132 | + (ior:DI (match_operand:DI 1 "s_register_operand" "%w,w,0,0,0,r") | ||
| 133 | + (match_operand:DI 2 "neon_logic_op2" "w,w,Dl,Dl,r,r")))] | ||
| 134 | "TARGET_NEON" | ||
| 135 | { | ||
| 136 | switch (which_alternative) | ||
| 137 | { | ||
| 138 | - case 0: return "vorr\t%P0, %P1, %P2"; | ||
| 139 | - case 1: return neon_output_logic_immediate ("vorr", &operands[2], | ||
| 140 | + case 0: /* fall through */ | ||
| 141 | + case 1: return "vorr\t%P0, %P1, %P2"; | ||
| 142 | + case 2: /* fall through */ | ||
| 143 | + case 3: return neon_output_logic_immediate ("vorr", &operands[2], | ||
| 144 | DImode, 0, VALID_NEON_QREG_MODE (DImode)); | ||
| 145 | - case 2: return "#"; | ||
| 146 | - case 3: return "#"; | ||
| 147 | + case 4: return "#"; | ||
| 148 | + case 5: return "#"; | ||
| 149 | default: gcc_unreachable (); | ||
| 150 | } | ||
| 151 | } | ||
| 152 | - [(set_attr "neon_type" "neon_int_1,neon_int_1,*,*") | ||
| 153 | - (set_attr "length" "*,*,8,8")] | ||
| 154 | + [(set_attr "neon_type" "neon_int_1,neon_int_1,neon_int_1,neon_int_1,*,*") | ||
| 155 | + (set_attr "length" "*,*,*,*,8,8") | ||
| 156 | + (set_attr "alt_tune" "nota8,onlya8,nota8,onlya8,*,*")] | ||
| 157 | ) | ||
| 158 | |||
| 159 | ;; The concrete forms of the Neon immediate-logic instructions are vbic and | ||
| 160 | @@ -1006,23 +1013,26 @@ | ||
| 161 | ) | ||
| 162 | |||
| 163 | (define_insn "anddi3_neon" | ||
| 164 | - [(set (match_operand:DI 0 "s_register_operand" "=w,w,?&r,?&r") | ||
| 165 | - (and:DI (match_operand:DI 1 "s_register_operand" "%w,0,0,r") | ||
| 166 | - (match_operand:DI 2 "neon_inv_logic_op2" "w,DL,r,r")))] | ||
| 167 | + [(set (match_operand:DI 0 "s_register_operand" "=w,?w,w,?w,?&r,?&r") | ||
| 168 | + (and:DI (match_operand:DI 1 "s_register_operand" "%w,w,0,0,0,r") | ||
| 169 | + (match_operand:DI 2 "neon_inv_logic_op2" "w,w,DL,DL,r,r")))] | ||
| 170 | "TARGET_NEON" | ||
| 171 | { | ||
| 172 | switch (which_alternative) | ||
| 173 | { | ||
| 174 | - case 0: return "vand\t%P0, %P1, %P2"; | ||
| 175 | - case 1: return neon_output_logic_immediate ("vand", &operands[2], | ||
| 176 | + case 0: /* fall through */ | ||
| 177 | + case 1: return "vand\t%P0, %P1, %P2"; | ||
| 178 | + case 2: /* fall through */ | ||
| 179 | + case 3: return neon_output_logic_immediate ("vand", &operands[2], | ||
| 180 | DImode, 1, VALID_NEON_QREG_MODE (DImode)); | ||
| 181 | - case 2: return "#"; | ||
| 182 | - case 3: return "#"; | ||
| 183 | + case 4: return "#"; | ||
| 184 | + case 5: return "#"; | ||
| 185 | default: gcc_unreachable (); | ||
| 186 | } | ||
| 187 | } | ||
| 188 | - [(set_attr "neon_type" "neon_int_1,neon_int_1,*,*") | ||
| 189 | - (set_attr "length" "*,*,8,8")] | ||
| 190 | + [(set_attr "neon_type" "neon_int_1,neon_int_1,neon_int_1,neon_int_1,*,*") | ||
| 191 | + (set_attr "length" "*,*,*,*,8,8") | ||
| 192 | + (set_attr "alt_tune" "nota8,onlya8,nota8,onlya8,*,*")] | ||
| 193 | ) | ||
| 194 | |||
| 195 | (define_insn "orn<mode>3_neon" | ||
| 196 | @@ -1080,16 +1090,18 @@ | ||
| 197 | ) | ||
| 198 | |||
| 199 | (define_insn "xordi3_neon" | ||
| 200 | - [(set (match_operand:DI 0 "s_register_operand" "=w,?&r,?&r") | ||
| 201 | - (xor:DI (match_operand:DI 1 "s_register_operand" "%w,0,r") | ||
| 202 | - (match_operand:DI 2 "s_register_operand" "w,r,r")))] | ||
| 203 | + [(set (match_operand:DI 0 "s_register_operand" "=w,?w,?&r,?&r") | ||
| 204 | + (xor:DI (match_operand:DI 1 "s_register_operand" "%w,w,0,r") | ||
| 205 | + (match_operand:DI 2 "s_register_operand" "w,w,r,r")))] | ||
| 206 | "TARGET_NEON" | ||
| 207 | "@ | ||
| 208 | veor\t%P0, %P1, %P2 | ||
| 209 | + veor\t%P0, %P1, %P2 | ||
| 210 | # | ||
| 211 | #" | ||
| 212 | - [(set_attr "neon_type" "neon_int_1,*,*") | ||
| 213 | - (set_attr "length" "*,8,8")] | ||
| 214 | + [(set_attr "neon_type" "neon_int_1,neon_int_1,*,*") | ||
| 215 | + (set_attr "length" "*,*,8,8") | ||
| 216 | + (set_attr "alt_tune" "nota8,onlya8,*,*")] | ||
| 217 | ) | ||
| 218 | |||
| 219 | (define_insn "one_cmpl<mode>2" | ||
| 220 | |||
| 221 | === modified file 'gcc/config/arm/vfp.md' | ||
| 222 | --- old/gcc/config/arm/vfp.md 2010-08-13 10:59:06 +0000 | ||
| 223 | +++ new/gcc/config/arm/vfp.md 2010-08-13 11:40:17 +0000 | ||
| 224 | @@ -133,9 +133,51 @@ | ||
| 225 | ;; DImode moves | ||
| 226 | |||
| 227 | (define_insn "*arm_movdi_vfp" | ||
| 228 | - [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r,m,w,r,w,w, Uv") | ||
| 229 | - (match_operand:DI 1 "di_operand" "rIK,mi,r,r,w,w,Uvi,w"))] | ||
| 230 | - "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP | ||
| 231 | + [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, m,w,r,w,w, Uv") | ||
| 232 | + (match_operand:DI 1 "di_operand" "rIK,mi,r,r,w,w,Uvi,w"))] | ||
| 233 | + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP && arm_tune != cortexa8 | ||
| 234 | + && ( register_operand (operands[0], DImode) | ||
| 235 | + || register_operand (operands[1], DImode))" | ||
| 236 | + "* | ||
| 237 | + switch (which_alternative) | ||
| 238 | + { | ||
| 239 | + case 0: | ||
| 240 | + return \"#\"; | ||
| 241 | + case 1: | ||
| 242 | + case 2: | ||
| 243 | + return output_move_double (operands); | ||
| 244 | + case 3: | ||
| 245 | + return \"fmdrr%?\\t%P0, %Q1, %R1\\t%@ int\"; | ||
| 246 | + case 4: | ||
| 247 | + return \"fmrrd%?\\t%Q0, %R0, %P1\\t%@ int\"; | ||
| 248 | + case 5: | ||
| 249 | + if (TARGET_VFP_SINGLE) | ||
| 250 | + return \"fcpys%?\\t%0, %1\\t%@ int\;fcpys%?\\t%p0, %p1\\t%@ int\"; | ||
| 251 | + else | ||
| 252 | + return \"fcpyd%?\\t%P0, %P1\\t%@ int\"; | ||
| 253 | + case 6: case 7: | ||
| 254 | + return output_move_vfp (operands); | ||
| 255 | + default: | ||
| 256 | + gcc_unreachable (); | ||
| 257 | + } | ||
| 258 | + " | ||
| 259 | + [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarithd,f_loadd,f_stored") | ||
| 260 | + (set_attr "neon_type" "*,*,*,neon_mcr_2_mcrr,neon_mrrc,neon_vmov,*,*") | ||
| 261 | + (set (attr "length") (cond [(eq_attr "alternative" "0,1,2") (const_int 8) | ||
| 262 | + (eq_attr "alternative" "5") | ||
| 263 | + (if_then_else | ||
| 264 | + (eq (symbol_ref "TARGET_VFP_SINGLE") (const_int 1)) | ||
| 265 | + (const_int 8) | ||
| 266 | + (const_int 4))] | ||
| 267 | + (const_int 4))) | ||
| 268 | + (set_attr "pool_range" "*,1020,*,*,*,*,1020,*") | ||
| 269 | + (set_attr "neg_pool_range" "*,1008,*,*,*,*,1008,*")] | ||
| 270 | +) | ||
| 271 | + | ||
| 272 | +(define_insn "*arm_movdi_vfp_cortexa8" | ||
| 273 | + [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r,m,w,!r,w,w, Uv") | ||
| 274 | + (match_operand:DI 1 "di_operand" "rIK,mi,r,r,w,w,Uvi,w"))] | ||
| 275 | + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP && arm_tune == cortexa8 | ||
| 276 | && ( register_operand (operands[0], DImode) | ||
| 277 | || register_operand (operands[1], DImode))" | ||
| 278 | "* | ||
| 279 | |||
| 280 | === modified file 'gcc/ira-costs.c' | ||
| 281 | --- old/gcc/ira-costs.c 2009-11-25 10:55:54 +0000 | ||
| 282 | +++ new/gcc/ira-costs.c 2010-08-13 11:40:17 +0000 | ||
| 283 | @@ -224,6 +224,14 @@ | ||
| 284 | int alt_fail = 0; | ||
| 285 | int alt_cost = 0, op_cost_add; | ||
| 286 | |||
| 287 | + if (!recog_data.alternative_enabled_p[alt]) | ||
| 288 | + { | ||
| 289 | + for (i = 0; i < recog_data.n_operands; i++) | ||
| 290 | + constraints[i] = skip_alternative (constraints[i]); | ||
| 291 | + | ||
| 292 | + continue; | ||
| 293 | + } | ||
| 294 | + | ||
| 295 | for (i = 0; i < n_ops; i++) | ||
| 296 | { | ||
| 297 | unsigned char c; | ||
| 298 | |||
