summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/gcc/files/gcc.e5500_mfocr.patch
diff options
context:
space:
mode:
authorZhenhua Luo <b19537@freescale.com>2012-03-09 10:57:35 +0000
committerMatthew McClintock <msm@freescale.com>2012-03-13 12:41:42 -0500
commit122c5bfdad95930de96e191aafb0304fded007b2 (patch)
treeea66cb9147fed9ceacd9eacd5913b10bb64734a1 /recipes-devtools/gcc/files/gcc.e5500_mfocr.patch
parent4f2d99fbb0afd19376e404583700ee31428f7c2e (diff)
downloadmeta-fsl-ppc-122c5bfdad95930de96e191aafb0304fded007b2.tar.gz
integrate fsl toolchain patches
binutils: bin.e500mc_nop.patch bin.e5500.patch bin.e6500-2.patch eglibc: generate-supported.mk glibc.e500mc_subspecies_of_powerpc_is_not_supported.patch glibc.fixgcc4.6.patch glibc.fix_prof.patch glibc.fix_sqrt.patch glibc.readv_proto.patch glibc.undefined_static.patch gcc: gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch gcc.fix_longversionstring.patch gcc.rm_slow_tests.patch gcc.fix_mingw32.patch gcc.fix_cloogstatic2.patch gcc.fix_build-with-cxx.patch gcc.e6500-FSF46.patch gcc.ld_unaligned-460.patch gcc.local_unaligned_altivec.patch gcc.soft_float-460.patch gcc.case_values.patch gcc.builtin_isel.patch gcc.experimental_move.patch gcc.widen_types-46.patch gcc.extelim-v3.patch gcc.e5500_mfocr.patch gcc.opt-array-offset.patch gcc.load_on_store_bypass-462.patch gcc.fix_constvector.patch gcc.fix_MTWX51204-dwarf-vector-reg.patch gcc.fix_ira-loop-pressure.patch optional_libstdc.patch gcc.remove_CCUNSmode_reference.patch gcc.check_path_validity.patch gcc.fix_header_issue.patch gcc.fix_SSIZE_MAX_undefine_issue.patch gettext: gettext.fix_testcase.patch Signed-off-by: Zhenhua Luo <b19537@freescale.com>
Diffstat (limited to 'recipes-devtools/gcc/files/gcc.e5500_mfocr.patch')
-rw-r--r--recipes-devtools/gcc/files/gcc.e5500_mfocr.patch181
1 files changed, 181 insertions, 0 deletions
diff --git a/recipes-devtools/gcc/files/gcc.e5500_mfocr.patch b/recipes-devtools/gcc/files/gcc.e5500_mfocr.patch
new file mode 100644
index 0000000..16b3538
--- /dev/null
+++ b/recipes-devtools/gcc/files/gcc.e5500_mfocr.patch
@@ -0,0 +1,181 @@
1# Problem: Although gcc is prepared to avoid "mfocr" instructions
2 (which takes 5 cycles in our parts and 2 cycles on IBM parts). This
3 instruction is used on the mentioned program. What is suspicious
4 about it, is that the code compiled for 32 bits does not use the
5 instruction. So, it could be a omission in the previous
6 implementation, or a bug, or a new opportunity.
7# Reported by: Performance team (PARC)
8# Owned by: Ping Hu
9# Action:
10 * 'mfocr' flag problem: that 'mfocr' flag was uncorrectly set for E5500,
11 which caused the 'mfocr' instructions generated even on E5500.
12 * avoid generating 'mfcr' and 'mfocr' instructions: due to the fact
13 that both instructions are expensive on Freescale processors.
14 * A target specific flag, -mslow-mfocr, can be used to avoid generating
15 'mfcr' and 'mfocr' instructions in 64-bit mode, thus restoring legacy
16 operations if desired.
17
18diff -ruN gcc-4.6.2-clean/gcc/config/rs6000/rs6000.c gcc-4.6.2/gcc/config/rs6000/rs6000.c
19--- gcc-4.6.2-clean/gcc/config/rs6000/rs6000.c 2011-11-22 11:11:47.479144000 -0600
20+++ gcc-4.6.2/gcc/config/rs6000/rs6000.c 2011-11-29 16:23:45.074279998 -0600
21@@ -1885,6 +1885,7 @@
22 POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64}
23 };
24
25+
26 /* Look up a processor name for -mcpu=xxx and -mtune=xxx. Return -1 if the
27 name is invalid. */
28
29@@ -2902,6 +2903,10 @@
30 || rs6000_cpu == PROCESSOR_PPCE6500)
31 target_flags &= ~MASK_PPC_GPOPT;
32
33+ if (rs6000_cpu == PROCESSOR_PPCE5500)
34+ target_flags &= ~MASK_MFCRF;
35+
36+
37 /* store_one_arg depends on expand_block_move to handle at least the
38 size of reg_parm_stack_space. */
39 if (rs6000_block_move_inline_limit < (TARGET_POWERPC64 ? 64 : 32))
40diff -ruN gcc-4.6.2-clean/gcc/config/rs6000/rs6000.md gcc-4.6.2/gcc/config/rs6000/rs6000.md
41--- gcc-4.6.2-clean/gcc/config/rs6000/rs6000.md 2011-11-22 11:11:47.036144001 -0600
42+++ gcc-4.6.2/gcc/config/rs6000/rs6000.md 2011-11-29 16:24:04.705280001 -0600
43@@ -215,6 +215,8 @@
44 ; (one with a '.') will compare; and the size used for arithmetic carries.
45 (define_mode_iterator P [(SI "TARGET_32BIT") (DI "TARGET_64BIT")])
46
47+(define_mode_iterator P2 [(SI "TARGET_32BIT || TARGET_SLOW_MFOCR") (DI "TARGET_64BIT")])
48+
49 ; Any hardware-supported floating-point mode
50 (define_mode_iterator FP [
51 (SF "TARGET_HARD_FLOAT
52@@ -2208,9 +2210,9 @@
53
54 (define_insn ""
55 [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
56- (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" "r,r"))
57+ (compare:CC (neg:P2 (match_operand:P2 1 "gpc_reg_operand" "r,r"))
58 (const_int 0)))
59- (clobber (match_scratch:P 2 "=r,r"))]
60+ (clobber (match_scratch:P2 2 "=r,r"))]
61 ""
62 "@
63 neg. %2,%1
64@@ -2220,12 +2222,12 @@
65
66 (define_split
67 [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "")
68- (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" ""))
69+ (compare:CC (neg:P2 (match_operand:P2 1 "gpc_reg_operand" ""))
70 (const_int 0)))
71- (clobber (match_scratch:P 2 ""))]
72+ (clobber (match_scratch:P2 2 ""))]
73 "reload_completed"
74 [(set (match_dup 2)
75- (neg:P (match_dup 1)))
76+ (neg:P2 (match_dup 1)))
77 (set (match_dup 0)
78 (compare:CC (match_dup 2)
79 (const_int 0)))]
80@@ -2233,10 +2235,10 @@
81
82 (define_insn ""
83 [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
84- (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" "r,r"))
85+ (compare:CC (neg:P2 (match_operand:P2 1 "gpc_reg_operand" "r,r"))
86 (const_int 0)))
87- (set (match_operand:P 0 "gpc_reg_operand" "=r,r")
88- (neg:P (match_dup 1)))]
89+ (set (match_operand:P2 0 "gpc_reg_operand" "=r,r")
90+ (neg:P2 (match_dup 1)))]
91 ""
92 "@
93 neg. %0,%1
94@@ -2246,13 +2248,13 @@
95
96 (define_split
97 [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "")
98- (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" ""))
99+ (compare:CC (neg:P2 (match_operand:P2 1 "gpc_reg_operand" ""))
100 (const_int 0)))
101- (set (match_operand:P 0 "gpc_reg_operand" "")
102- (neg:P (match_dup 1)))]
103+ (set (match_operand:P2 0 "gpc_reg_operand" "")
104+ (neg:P2 (match_dup 1)))]
105 "reload_completed"
106 [(set (match_dup 0)
107- (neg:P (match_dup 1)))
108+ (neg:P2 (match_dup 1)))
109 (set (match_dup 2)
110 (compare:CC (match_dup 0)
111 (const_int 0)))]
112@@ -15286,31 +15288,31 @@
113 [(set_attr "length" "12")])
114
115 (define_insn_and_split "*gtu<mode>"
116- [(set (match_operand:P 0 "gpc_reg_operand" "=r")
117- (gtu:P (match_operand:P 1 "gpc_reg_operand" "r")
118- (match_operand:P 2 "reg_or_short_operand" "rI")))]
119+ [(set (match_operand:P2 0 "gpc_reg_operand" "=r")
120+ (gtu:P2 (match_operand:P2 1 "gpc_reg_operand" "r")
121+ (match_operand:P2 2 "reg_or_short_operand" "rI")))]
122 ""
123 "#"
124 ""
125- [(set (match_dup 0) (neg:P (gtu:P (match_dup 1) (match_dup 2))))
126- (set (match_dup 0) (neg:P (match_dup 0)))]
127+ [(set (match_dup 0) (neg:P2 (gtu:P2 (match_dup 1) (match_dup 2))))
128+ (set (match_dup 0) (neg:P2 (match_dup 0)))]
129 "")
130
131 (define_insn_and_split "*gtu<mode>_compare"
132 [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
133 (compare:CC
134- (gtu:P (match_operand:P 1 "gpc_reg_operand" "r,r")
135- (match_operand:P 2 "reg_or_short_operand" "rI,rI"))
136+ (gtu:P2 (match_operand:P2 1 "gpc_reg_operand" "r,r")
137+ (match_operand:P2 2 "reg_or_short_operand" "rI,rI"))
138 (const_int 0)))
139- (set (match_operand:P 0 "gpc_reg_operand" "=r,r")
140- (gtu:P (match_dup 1) (match_dup 2)))]
141+ (set (match_operand:P2 0 "gpc_reg_operand" "=r,r")
142+ (gtu:P2 (match_dup 1) (match_dup 2)))]
143 ""
144 "#"
145 ""
146- [(set (match_dup 0) (neg:P (gtu:P (match_dup 1) (match_dup 2))))
147+ [(set (match_dup 0) (neg:P2 (gtu:P2 (match_dup 1) (match_dup 2))))
148 (parallel [(set (match_dup 3)
149- (compare:CC (neg:P (match_dup 0)) (const_int 0)))
150- (set (match_dup 0) (neg:P (match_dup 0)))])]
151+ (compare:CC (neg:P2 (match_dup 0)) (const_int 0)))
152+ (set (match_dup 0) (neg:P2 (match_dup 0)))])]
153 "")
154
155 (define_insn_and_split "*plus_gtu<mode>"
156@@ -15345,9 +15347,9 @@
157 "")
158
159 (define_insn "*neg_gtu<mode>"
160- [(set (match_operand:P 0 "gpc_reg_operand" "=r")
161- (neg:P (gtu:P (match_operand:P 1 "gpc_reg_operand" "r")
162- (match_operand:P 2 "reg_or_short_operand" "rI"))))]
163+ [(set (match_operand:P2 0 "gpc_reg_operand" "=r")
164+ (neg:P2 (gtu:P2 (match_operand:P2 1 "gpc_reg_operand" "r")
165+ (match_operand:P2 2 "reg_or_short_operand" "rI"))))]
166 ""
167 "{sf%I2|subf%I2c} %0,%1,%2\;{sfe|subfe} %0,%0,%0"
168 [(set_attr "type" "two")
169--- gcc-4.6.2-clean/gcc/config/rs6000/rs6000.opt 2011-11-22 11:11:47.480143999 -0600
170+++ gcc-4.6.2/gcc/config/rs6000/rs6000.opt 2011-11-29 16:24:16.322280634 -0600
171@@ -381,6 +381,10 @@
172 Target
173 Generate SPE SIMD instructions on E500
174
175+mslow-mfocr
176+Target Report Var(TARGET_SLOW_MFOCR)
177+Generate slow mfocr instructions
178+
179 mpaired
180 Target Var(rs6000_paired_float) Save
181 Generate PPC750CL paired-single instructions