Merge lp:~ams-codesourcery/gcc-linaro/lp836401-4.6 into lp:gcc-linaro/4.6

Proposed by Andrew Stubbs
Status: Merged
Approved by: Ulrich Weigand
Approved revision: no longer in the source branch.
Merged at revision: 106825
Proposed branch: lp:~ams-codesourcery/gcc-linaro/lp836401-4.6
Merge into: lp:gcc-linaro/4.6
Diff against target: 108 lines (+74/-3)
2 files modified
gcc/config/arm/predicates.md (+11/-3)
gcc/testsuite/gcc.target/arm/shiftable.c (+63/-0)
To merge this branch: bzr merge lp:~ams-codesourcery/gcc-linaro/lp836401-4.6
Reviewer Review Type Date Requested Status
Ulrich Weigand (community) Approve
Review via email: mp+78820@code.launchpad.net

Description of the change

Backport final fix from upstream. (Up until now, we've only had an interim fix.)

There's no need to rush this before the release - the interim fix will do just fine.

To post a comment you must log in.
Revision history for this message
Michael Hope (michaelh1) wrote :

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

The diff against the ancestor r106822 is available at:
 http://builds.linaro.org/toolchain/snapshots/gcc-linaro-4.6+bzr106823~ams-codesourcery~lp836401-4.6.diff

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.6+bzr106823~ams-codesourcery~lp836401-4.6
cbuild-ancestor: lp:gcc-linaro+bzr106822
cbuild-state: check

Revision history for this message
Michael Hope (michaelh1) wrote :
Revision history for this message
Michael Hope (michaelh1) wrote :
Revision history for this message
Michael Hope (michaelh1) wrote :

cbuild successfully built this on armv7l-natty-cbuild193-tcpanda02-cortexa9r1.

The build results are available at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106823~ams-codesourcery~lp836401-4.6/logs/armv7l-natty-cbuild193-tcpanda02-cortexa9r1

+PASS: gcc.target/arm/shiftable.c (test for excess errors)
+PASS: gcc.target/arm/shiftable.c scan-assembler add.*[al]sl #6
+PASS: gcc.target/arm/shiftable.c scan-assembler and.*[al]sl #6
+PASS: gcc.target/arm/shiftable.c scan-assembler eor.*[al]sl #6
+PASS: gcc.target/arm/shiftable.c scan-assembler mvn.*[al]sl #6
+PASS: gcc.target/arm/shiftable.c scan-assembler orr.*[al]sl #6
+PASS: gcc.target/arm/shiftable.c scan-assembler rsb.*[al]sl #6
+PASS: gcc.target/arm/shiftable.c scan-assembler sub.*[al]sl #6

The full diff is at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106823~ams-codesourcery~lp836401-4.6/logs/armv7l-natty-cbuild193-tcpanda02-cortexa9r1/testsuite-diff.txt

The full testsuite results are at:
 http://ex.seabright.co.nz/build/gcc-linaro-4.6+bzr106823~ams-codesourcery~lp836401-4.6/logs/armv7l-natty-cbuild193-tcpanda02-cortexa9r1/gcc-testsuite.txt

cbuild-checked: armv7l-natty-cbuild193-tcpanda02-cortexa9r1

Revision history for this message
Ulrich Weigand (uweigand) wrote :

This is OK.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'gcc/config/arm/predicates.md'
--- gcc/config/arm/predicates.md 2011-10-03 09:47:33 +0000
+++ gcc/config/arm/predicates.md 2011-10-10 11:55:29 +0000
@@ -129,11 +129,12 @@
129 (ior (match_operand 0 "arm_rhs_operand")129 (ior (match_operand 0 "arm_rhs_operand")
130 (match_operand 0 "memory_operand")))130 (match_operand 0 "memory_operand")))
131131
132;; This doesn't have to do much because the constant is already checked
133;; in the shift_operator predicate.
132(define_predicate "shift_amount_operand"134(define_predicate "shift_amount_operand"
133 (ior (and (match_test "TARGET_ARM")135 (ior (and (match_test "TARGET_ARM")
134 (match_operand 0 "s_register_operand"))136 (match_operand 0 "s_register_operand"))
135 (and (match_operand 0 "const_int_operand")137 (match_operand 0 "const_int_operand")))
136 (match_test "INTVAL (op) > 0"))))
137138
138(define_predicate "arm_add_operand"139(define_predicate "arm_add_operand"
139 (ior (match_operand 0 "arm_rhs_operand")140 (ior (match_operand 0 "arm_rhs_operand")
@@ -219,13 +220,20 @@
219 (match_test "mode == GET_MODE (op)")))220 (match_test "mode == GET_MODE (op)")))
220221
221;; True for shift operators.222;; True for shift operators.
223;; Notes:
224;; * mult is only permitted with a constant shift amount
225;; * patterns that permit register shift amounts only in ARM mode use
226;; shift_amount_operand, patterns that always allow registers do not,
227;; so we don't have to worry about that sort of thing here.
222(define_special_predicate "shift_operator"228(define_special_predicate "shift_operator"
223 (and (ior (ior (and (match_code "mult")229 (and (ior (ior (and (match_code "mult")
224 (match_test "power_of_two_operand (XEXP (op, 1), mode)"))230 (match_test "power_of_two_operand (XEXP (op, 1), mode)"))
225 (and (match_code "rotate")231 (and (match_code "rotate")
226 (match_test "GET_CODE (XEXP (op, 1)) == CONST_INT232 (match_test "GET_CODE (XEXP (op, 1)) == CONST_INT
227 && ((unsigned HOST_WIDE_INT) INTVAL (XEXP (op, 1))) < 32")))233 && ((unsigned HOST_WIDE_INT) INTVAL (XEXP (op, 1))) < 32")))
228 (match_code "ashift,ashiftrt,lshiftrt,rotatert"))234 (and (match_code "ashift,ashiftrt,lshiftrt,rotatert")
235 (match_test "GET_CODE (XEXP (op, 1)) != CONST_INT
236 || ((unsigned HOST_WIDE_INT) INTVAL (XEXP (op, 1))) < 32")))
229 (match_test "mode == GET_MODE (op)")))237 (match_test "mode == GET_MODE (op)")))
230238
231;; True for MULT, to identify which variant of shift_operator is in use.239;; True for MULT, to identify which variant of shift_operator is in use.
232240
=== added file 'gcc/testsuite/gcc.target/arm/shiftable.c'
--- gcc/testsuite/gcc.target/arm/shiftable.c 1970-01-01 00:00:00 +0000
+++ gcc/testsuite/gcc.target/arm/shiftable.c 2011-10-10 11:55:29 +0000
@@ -0,0 +1,63 @@
1/* { dg-do compile } */
2/* { dg-options "-O2" } */
3/* { dg-require-effective-target arm32 } */
4
5/* ARM has shift-and-alu insns. Depending on the ALU op GCC represents some
6 of these as a left shift, others as a multiply. Check that we match the
7 right one. */
8
9int
10plus (int a, int b)
11{
12 return (a * 64) + b;
13}
14
15/* { dg-final { scan-assembler "add.*\[al]sl #6" } } */
16
17int
18minus (int a, int b)
19{
20 return a - (b * 64);
21}
22
23/* { dg-final { scan-assembler "sub.*\[al]sl #6" } } */
24
25int
26ior (int a, int b)
27{
28 return (a * 64) | b;
29}
30
31/* { dg-final { scan-assembler "orr.*\[al]sl #6" } } */
32
33int
34xor (int a, int b)
35{
36 return (a * 64) ^ b;
37}
38
39/* { dg-final { scan-assembler "eor.*\[al]sl #6" } } */
40
41int
42and (int a, int b)
43{
44 return (a * 64) & b;
45}
46
47/* { dg-final { scan-assembler "and.*\[al]sl #6" } } */
48
49int
50rsb (int a, int b)
51{
52 return (a * 64) - b;
53}
54
55/* { dg-final { scan-assembler "rsb.*\[al]sl #6" } } */
56
57int
58mvn (int a, int b)
59{
60 return ~(a * 64);
61}
62
63/* { dg-final { scan-assembler "mvn.*\[al]sl #6" } } */

Subscribers

People subscribed via source and target branches