Merge lp:~rsandifo/gcc-linaro/lp723185-4.5 into lp:gcc-linaro/4.5

Proposed by Richard Sandiford
Status: Merged
Approved by: Ramana Radhakrishnan
Approved revision: no longer in the source branch.
Merged at revision: 99524
Proposed branch: lp:~rsandifo/gcc-linaro/lp723185-4.5
Merge into: lp:gcc-linaro/4.5
Diff against target: 226 lines (+162/-21) (has conflicts)
3 files modified
ChangeLog.linaro (+27/-0)
gcc/config/arm/arm.h (+134/-20)
gcc/config/arm/arm.md (+1/-1)
Text conflict in ChangeLog.linaro
To merge this branch: bzr merge lp:~rsandifo/gcc-linaro/lp723185-4.5
Reviewer Review Type Date Requested Status
Linaro Toolchain Developers Pending
Review via email: mp+67728@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild has taken a snapshot of this branch at r99522 and queued it for build.

The snapshot is available at:
 http://ex.seabright.co.nz/snapshots/gcc-linaro-4.5+bzr99522~rsandifo~lp723185-4.5.tar.xdelta3.xz

and will be built on the following builders:
 a9-builder armv5-builder i686 x86_64

You can track the build queue at:
 http://ex.seabright.co.nz/helpers/scheduler

cbuild-snapshot: gcc-linaro-4.5+bzr99522~rsandifo~lp723185-4.5
cbuild-ancestor: lp:gcc-linaro+bzr99521
cbuild-state: check

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on i686-natty-cbuild158-oort4-i686r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99522~rsandifo~lp723185-4.5/logs/i686-natty-cbuild158-oort4-i686r1

The test suite results were unchanged compared to the branch point lp:gcc-linaro+bzr99521.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99522~rsandifo~lp723185-4.5/logs/i686-natty-cbuild158-oort4-i686r1/gcc-testsuite.txt

cbuild-checked: i686-natty-cbuild158-oort4-i686r1

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on x86_64-natty-cbuild158-oort1-x86_64r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99522~rsandifo~lp723185-4.5/logs/x86_64-natty-cbuild158-oort1-x86_64r1

The test suite results were unchanged compared to the branch point lp:gcc-linaro+bzr99521.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99522~rsandifo~lp723185-4.5/logs/x86_64-natty-cbuild158-oort1-x86_64r1/gcc-testsuite.txt

cbuild-checked: x86_64-natty-cbuild158-oort1-x86_64r1

Revision history for this message
Ramana Radhakrishnan (ramana) wrote :

The patch looks ok but I'll wait for the ARM results to show up.

Ramana

Revision history for this message
Linaro Toolchain Builder (cbuild) wrote :

cbuild successfully built this on armv7l-natty-cbuild158-ursa4-cortexa9r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99522~rsandifo~lp723185-4.5/logs/armv7l-natty-cbuild158-ursa4-cortexa9r1

The test suite results were unchanged compared to the branch point lp:gcc-linaro+bzr99521.

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.5+bzr99522~rsandifo~lp723185-4.5/logs/armv7l-natty-cbuild158-ursa4-cortexa9r1/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild158-ursa4-cortexa9r1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog.linaro'
2--- ChangeLog.linaro 2011-07-11 14:35:32 +0000
3+++ ChangeLog.linaro 2011-07-12 16:48:14 +0000
4@@ -1,3 +1,4 @@
5+<<<<<<< TREE
6 2011-07-11 Revital Eres <revital.eres@linaro.org>
7
8 Backport from mainline -r175091
9@@ -15,6 +16,32 @@
10 without passing row_rest_count.
11 (rotate_partial_schedule): Update rows_length.
12
13+=======
14+2011-07-12 Richard Sandiford <richard.sandiford@linaro.org>
15+
16+ gcc/
17+ * config/arm/arm.h (ARM_LEGITIMIZE_RELOAD_ADDRESS): Apply the
18+ arm_legitimize_reload_address changes marked [*] below.
19+
20+ Backport from mainline:
21+
22+ 2011-04-20 Chung-Lin Tang <cltang@codesourcery.com>
23+
24+ [*] config/arm/arm.c (arm_legitimize_reload_address): For NEON
25+ quad-word modes, reduce to 9-bit index range when above 1016
26+ limit.
27+
28+ 2011-04-11 Chung-Lin Tang <cltang@codesourcery.com>
29+ Richard Earnshaw <rearnsha@arm.com>
30+
31+ PR target/48250
32+ [*] config/arm/arm.c (arm_legitimize_reload_address): Update cases
33+ to use sign-magnitude offsets. Reject unsupported unaligned
34+ cases. Add detailed description in comments.
35+ * config/arm/arm.md (reload_outdf): Disable for ARM mode; change
36+ condition from TARGET_32BIT to TARGET_ARM.
37+
38+>>>>>>> MERGE-SOURCE
39 2011-07-08 Richard Sandiford <rdsandiford@googlemail.com>
40
41 gcc/
42
43=== modified file 'gcc/config/arm/arm.h'
44--- gcc/config/arm/arm.h 2011-04-20 10:07:36 +0000
45+++ gcc/config/arm/arm.h 2011-07-12 16:48:14 +0000
46@@ -1399,6 +1399,11 @@
47 ? GENERAL_REGS : NO_REGS) \
48 : THUMB_SECONDARY_INPUT_RELOAD_CLASS (CLASS, MODE, X)))
49
50+#define SIGN_MAG_LOW_ADDR_BITS(VAL, N) \
51+ (((VAL) & ((1 << (N)) - 1)) \
52+ ? (((VAL) & ((1 << ((N) + 1)) - 1)) ^ (1 << (N))) - (1 << (N)) \
53+ : 0)
54+
55 /* Try a machine-dependent way of reloading an illegitimate address
56 operand. If we find one, push the reload and jump to WIN. This
57 macro is used in only one place: `find_reloads_address' in reload.c.
58@@ -1418,26 +1423,135 @@
59 HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \
60 HOST_WIDE_INT low, high; \
61 \
62- if (MODE == DImode || (MODE == DFmode && TARGET_SOFT_FLOAT)) \
63- low = ((val & 0xf) ^ 0x8) - 0x8; \
64- else if (TARGET_MAVERICK && TARGET_HARD_FLOAT) \
65- /* Need to be careful, -256 is not a valid offset. */ \
66- low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
67- else if (TARGET_REALLY_IWMMXT && MODE == SImode) \
68- /* Need to be careful, -1024 is not a valid offset. */ \
69- low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \
70- else if (MODE == SImode \
71- || (MODE == SFmode && TARGET_SOFT_FLOAT) \
72- || ((MODE == HImode || MODE == QImode) && ! arm_arch4)) \
73- /* Need to be careful, -4096 is not a valid offset. */ \
74- low = val >= 0 ? (val & 0xfff) : -((-val) & 0xfff); \
75- else if ((MODE == HImode || MODE == QImode) && arm_arch4) \
76- /* Need to be careful, -256 is not a valid offset. */ \
77- low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
78- else if (GET_MODE_CLASS (MODE) == MODE_FLOAT \
79- && TARGET_HARD_FLOAT && TARGET_FPA) \
80- /* Need to be careful, -1024 is not a valid offset. */ \
81- low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \
82+ /* Detect coprocessor load/stores. */ \
83+ bool coproc_p = ((TARGET_HARD_FLOAT \
84+ && (TARGET_VFP || TARGET_FPA || TARGET_MAVERICK) \
85+ && (mode == SFmode || mode == DFmode \
86+ || (mode == DImode && TARGET_MAVERICK))) \
87+ || (TARGET_REALLY_IWMMXT \
88+ && VALID_IWMMXT_REG_MODE (mode)) \
89+ || (TARGET_NEON \
90+ && (VALID_NEON_DREG_MODE (mode) \
91+ || VALID_NEON_QREG_MODE (mode)))); \
92+ \
93+ /* For some conditions, bail out when lower two bits are \
94+ unaligned. */ \
95+ if ((val & 0x3) != 0 \
96+ /* Coprocessor load/store indexes are 8-bits + '00' \
97+ appended. */ \
98+ && (coproc_p \
99+ /* For DI, and DF under soft-float: */ \
100+ || ((mode == DImode || mode == DFmode) \
101+ /* Without ldrd, we use stm/ldm, which does not \
102+ fair well with unaligned bits. */ \
103+ && (! TARGET_LDRD \
104+ /* Thumb-2 ldrd/strd is [-1020,+1020] in \
105+ steps of 4. */ \
106+ || TARGET_THUMB2)))) \
107+ break; \
108+ \
109+ /* When breaking down a [reg+index] reload address into \
110+ [(reg+high)+low], of which the (reg+high) gets turned into \
111+ a reload add insn, we try to decompose the index into \
112+ high/low values that can often also lead to better reload \
113+ CSE. For example: \
114+ ldr r0, [r2, #4100] // Offset too large \
115+ ldr r1, [r2, #4104] // Offset too large \
116+ \
117+ is best reloaded as: \
118+ add t1, r2, #4096 \
119+ ldr r0, [t1, #4] \
120+ add t2, r2, #4096 \
121+ ldr r1, [t2, #8] \
122+ \
123+ which post-reload CSE can simplify in most cases to eliminate \
124+ the second add instruction: \
125+ add t1, r2, #4096 \
126+ ldr r0, [t1, #4] \
127+ ldr r1, [t1, #8] \
128+ \
129+ The idea here is that we want to split out the bits of the \
130+ constant as a mask, rather than as subtracting the maximum \
131+ offset that the respective type of load/store used can \
132+ handle. \
133+ \
134+ When encountering negative offsets, we can still utilize it \
135+ even if the overall offset is positive; sometimes this may \
136+ lead to an immediate that can be constructed with fewer \
137+ instructions. For example: \
138+ ldr r0, [r2, #0x3FFFFC] \
139+ \
140+ This is best reloaded as: \
141+ add t1, r2, #0x400000 \
142+ ldr r0, [t1, #-4] \
143+ \
144+ The trick for spotting this for a load insn with N bits of \
145+ offset (i.e. bits N-1:0) is to look at bit N; if it is set, \
146+ then chose a negative offset that is going to make bit N and \
147+ all the bits below it become zero in the remainder part. \
148+ \
149+ The SIGN_MAG_LOW_ADDR_BITS macro below implements this, \
150+ with respect to sign-magnitude addressing (i.e. separate \
151+ +- bit, or 1's complement), used in most cases of ARM \
152+ load/store instructions. */ \
153+ \
154+ if (coproc_p) \
155+ { \
156+ low = SIGN_MAG_LOW_ADDR_BITS (val, 10); \
157+ \
158+ /* NEON quad-word load/stores are made of two double-word \
159+ accesses, so the valid index range is reduced by 8. \
160+ Treat as 9-bit range if we go over it. */ \
161+ if (TARGET_NEON && VALID_NEON_QREG_MODE (mode) && low >= 1016) \
162+ low = SIGN_MAG_LOW_ADDR_BITS (val, 9); \
163+ } \
164+ else if (GET_MODE_SIZE (mode) == 8) \
165+ { \
166+ if (TARGET_LDRD) \
167+ low = (TARGET_THUMB2 \
168+ ? SIGN_MAG_LOW_ADDR_BITS (val, 10) \
169+ : SIGN_MAG_LOW_ADDR_BITS (val, 8)); \
170+ else \
171+ /* For pre-ARMv5TE (without ldrd), we use ldm/stm(db/da/ib) \
172+ to access doublewords. The supported load/store offsets \
173+ are -8, -4, and 4, which we try to produce here. */ \
174+ low = ((val & 0xf) ^ 0x8) - 0x8; \
175+ } \
176+ else if (GET_MODE_SIZE (mode) < 8) \
177+ { \
178+ /* NEON element load/stores do not have an offset. */ \
179+ if (TARGET_NEON_FP16 && mode == HFmode) \
180+ break; \
181+ \
182+ if (TARGET_THUMB2) \
183+ { \
184+ /* Thumb-2 has an asymmetrical index range of (-256,4096). \
185+ Try the wider 12-bit range first, and re-try if the \
186+ result is out of range. */ \
187+ low = SIGN_MAG_LOW_ADDR_BITS (val, 12); \
188+ if (low < -255) \
189+ low = SIGN_MAG_LOW_ADDR_BITS (val, 8); \
190+ } \
191+ else \
192+ { \
193+ if (mode == HImode || mode == HFmode) \
194+ { \
195+ if (arm_arch4) \
196+ low = SIGN_MAG_LOW_ADDR_BITS (val, 8); \
197+ else \
198+ { \
199+ /* The storehi/movhi_bytes fallbacks can use \
200+ only [-4094,+4094] of the full ldrb/strb \
201+ index range. */ \
202+ low = SIGN_MAG_LOW_ADDR_BITS (val, 12); \
203+ if (low == 4095 || low == -4095) \
204+ break; \
205+ } \
206+ } \
207+ else \
208+ low = SIGN_MAG_LOW_ADDR_BITS (val, 12); \
209+ } \
210+ } \
211 else \
212 break; \
213 \
214
215=== modified file 'gcc/config/arm/arm.md'
216--- gcc/config/arm/arm.md 2011-04-28 16:13:24 +0000
217+++ gcc/config/arm/arm.md 2011-07-12 16:48:14 +0000
218@@ -6167,7 +6167,7 @@
219 [(match_operand:DF 0 "arm_reload_memory_operand" "=o")
220 (match_operand:DF 1 "s_register_operand" "r")
221 (match_operand:SI 2 "s_register_operand" "=&r")]
222- "TARGET_32BIT"
223+ "TARGET_THUMB2"
224 "
225 {
226 enum rtx_code code = GET_CODE (XEXP (operands[0], 0));

Subscribers

People subscribed via source and target branches