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
1=== modified file 'gcc/config/arm/predicates.md'
2--- gcc/config/arm/predicates.md 2011-10-03 09:47:33 +0000
3+++ gcc/config/arm/predicates.md 2011-10-10 11:55:29 +0000
4@@ -129,11 +129,12 @@
5 (ior (match_operand 0 "arm_rhs_operand")
6 (match_operand 0 "memory_operand")))
7
8+;; This doesn't have to do much because the constant is already checked
9+;; in the shift_operator predicate.
10 (define_predicate "shift_amount_operand"
11 (ior (and (match_test "TARGET_ARM")
12 (match_operand 0 "s_register_operand"))
13- (and (match_operand 0 "const_int_operand")
14- (match_test "INTVAL (op) > 0"))))
15+ (match_operand 0 "const_int_operand")))
16
17 (define_predicate "arm_add_operand"
18 (ior (match_operand 0 "arm_rhs_operand")
19@@ -219,13 +220,20 @@
20 (match_test "mode == GET_MODE (op)")))
21
22 ;; True for shift operators.
23+;; Notes:
24+;; * mult is only permitted with a constant shift amount
25+;; * patterns that permit register shift amounts only in ARM mode use
26+;; shift_amount_operand, patterns that always allow registers do not,
27+;; so we don't have to worry about that sort of thing here.
28 (define_special_predicate "shift_operator"
29 (and (ior (ior (and (match_code "mult")
30 (match_test "power_of_two_operand (XEXP (op, 1), mode)"))
31 (and (match_code "rotate")
32 (match_test "GET_CODE (XEXP (op, 1)) == CONST_INT
33 && ((unsigned HOST_WIDE_INT) INTVAL (XEXP (op, 1))) < 32")))
34- (match_code "ashift,ashiftrt,lshiftrt,rotatert"))
35+ (and (match_code "ashift,ashiftrt,lshiftrt,rotatert")
36+ (match_test "GET_CODE (XEXP (op, 1)) != CONST_INT
37+ || ((unsigned HOST_WIDE_INT) INTVAL (XEXP (op, 1))) < 32")))
38 (match_test "mode == GET_MODE (op)")))
39
40 ;; True for MULT, to identify which variant of shift_operator is in use.
41
42=== added file 'gcc/testsuite/gcc.target/arm/shiftable.c'
43--- gcc/testsuite/gcc.target/arm/shiftable.c 1970-01-01 00:00:00 +0000
44+++ gcc/testsuite/gcc.target/arm/shiftable.c 2011-10-10 11:55:29 +0000
45@@ -0,0 +1,63 @@
46+/* { dg-do compile } */
47+/* { dg-options "-O2" } */
48+/* { dg-require-effective-target arm32 } */
49+
50+/* ARM has shift-and-alu insns. Depending on the ALU op GCC represents some
51+ of these as a left shift, others as a multiply. Check that we match the
52+ right one. */
53+
54+int
55+plus (int a, int b)
56+{
57+ return (a * 64) + b;
58+}
59+
60+/* { dg-final { scan-assembler "add.*\[al]sl #6" } } */
61+
62+int
63+minus (int a, int b)
64+{
65+ return a - (b * 64);
66+}
67+
68+/* { dg-final { scan-assembler "sub.*\[al]sl #6" } } */
69+
70+int
71+ior (int a, int b)
72+{
73+ return (a * 64) | b;
74+}
75+
76+/* { dg-final { scan-assembler "orr.*\[al]sl #6" } } */
77+
78+int
79+xor (int a, int b)
80+{
81+ return (a * 64) ^ b;
82+}
83+
84+/* { dg-final { scan-assembler "eor.*\[al]sl #6" } } */
85+
86+int
87+and (int a, int b)
88+{
89+ return (a * 64) & b;
90+}
91+
92+/* { dg-final { scan-assembler "and.*\[al]sl #6" } } */
93+
94+int
95+rsb (int a, int b)
96+{
97+ return (a * 64) - b;
98+}
99+
100+/* { dg-final { scan-assembler "rsb.*\[al]sl #6" } } */
101+
102+int
103+mvn (int a, int b)
104+{
105+ return ~(a * 64);
106+}
107+
108+/* { dg-final { scan-assembler "mvn.*\[al]sl #6" } } */

Subscribers

People subscribed via source and target branches