Merge lp:~ramana/gcc-linaro/fix-lp-709329 into lp:gcc-linaro/4.4

Proposed by Ramana Radhakrishnan
Status: Merged
Merged at revision: 93575
Proposed branch: lp:~ramana/gcc-linaro/fix-lp-709329
Merge into: lp:gcc-linaro/4.4
Diff against target: 116 lines (+65/-4)
4 files modified
ChangeLog.linaro (+12/-0)
gcc/config/arm/arm-protos.h (+1/-0)
gcc/config/arm/arm.c (+51/-0)
gcc/config/arm/neon.md (+1/-4)
To merge this branch: bzr merge lp:~ramana/gcc-linaro/fix-lp-709329
Reviewer Review Type Date Requested Status
Linaro Toolchain Developers Pending
Review via email: mp+47897@code.launchpad.net

Description of the change

Tested with a cross-build for v7-a, neon with languages C,C++ with no regressions.

Ok to merge ?

2011-01-28 Ramana Radhakrishnan <email address hidden>

 LP: #709329
 Backport from FSF trunk
 2010-07-03 Jie Zhang <email address hidden>

 * config/arm/arm.c (arm_attr_length_move_neon): New.
 * config/arm/arm-protos.h (arm_attr_length_move_neon): Declare.
 * config/arm/neon.md (define_mode_attr V_slen): Remove.
 (neon_mov<mode> for VSTRUCT): Use arm_attr_length_move_neon
 to compute length attribute.

To post a comment you must log in.

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-01-07 11:48:28 +0000
3+++ ChangeLog.linaro 2011-01-29 12:44:53 +0000
4@@ -1,3 +1,15 @@
5+2011-01-28 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
6+
7+ LP: #709329
8+ Backport from FSF trunk
9+ 2010-07-03 Jie Zhang <jie@codesourcery.com>
10+
11+ * config/arm/arm.c (arm_attr_length_move_neon): New.
12+ * config/arm/arm-protos.h (arm_attr_length_move_neon): Declare.
13+ * config/arm/neon.md (define_mode_attr V_slen): Remove.
14+ (neon_mov<mode> for VSTRUCT): Use arm_attr_length_move_neon
15+ to compute length attribute.
16+
17 2011-01-07 Andrew Stubbs <ams@codesourcery.com>
18
19 gcc/
20
21=== modified file 'gcc/config/arm/arm-protos.h'
22--- gcc/config/arm/arm-protos.h 2010-06-17 08:44:15 +0000
23+++ gcc/config/arm/arm-protos.h 2011-01-29 12:44:53 +0000
24@@ -137,6 +137,7 @@
25 extern const char *output_move_quad (rtx *);
26 extern const char *output_move_vfp (rtx *operands);
27 extern const char *output_move_neon (rtx *operands);
28+extern int arm_attr_length_move_neon (rtx);
29 extern const char *output_add_immediate (rtx *);
30 extern const char *arithmetic_instr (rtx, int);
31 extern void output_ascii_pseudo_op (FILE *, const unsigned char *, int);
32
33=== modified file 'gcc/config/arm/arm.c'
34--- gcc/config/arm/arm.c 2010-12-21 14:17:38 +0000
35+++ gcc/config/arm/arm.c 2011-01-29 12:44:53 +0000
36@@ -13078,6 +13078,57 @@
37 return "";
38 }
39
40+/* Compute and return the length of neon_mov<mode>, where <mode> is
41+ one of VSTRUCT modes: EI, OI, CI or XI. */
42+int
43+arm_attr_length_move_neon (rtx insn)
44+{
45+ rtx reg, mem, addr;
46+ int regno, load;
47+ enum machine_mode mode;
48+
49+ extract_insn_cached (insn);
50+
51+ if (REG_P (recog_data.operand[0]) && REG_P (recog_data.operand[1]))
52+ {
53+ mode = GET_MODE (recog_data.operand[0]);
54+ switch (mode)
55+ {
56+ case EImode:
57+ case OImode:
58+ return 8;
59+ case CImode:
60+ return 12;
61+ case XImode:
62+ return 16;
63+ default:
64+ gcc_unreachable ();
65+ }
66+ }
67+
68+ load = REG_P (recog_data.operand[0]);
69+ reg = recog_data.operand[!load];
70+ mem = recog_data.operand[load];
71+
72+ gcc_assert (MEM_P (mem));
73+
74+ mode = GET_MODE (reg);
75+ regno = REGNO (reg);
76+ addr = XEXP (mem, 0);
77+
78+ /* Strip off const from addresses like (const (plus (...))). */
79+ if (GET_CODE (addr) == CONST && GET_CODE (XEXP (addr, 0)) == PLUS)
80+ addr = XEXP (addr, 0);
81+
82+ if (GET_CODE (addr) == LABEL_REF || GET_CODE (addr) == PLUS)
83+ {
84+ int insns = HARD_REGNO_NREGS (REGNO (reg), mode) / 2;
85+ return insns * 4;
86+ }
87+ else
88+ return 4;
89+}
90+
91 /* Output an ADD r, s, #n where n may be too big for one instruction.
92 If adding zero to one register, output nothing. */
93 const char *
94
95=== modified file 'gcc/config/arm/neon.md'
96--- gcc/config/arm/neon.md 2010-06-17 08:44:15 +0000
97+++ gcc/config/arm/neon.md 2011-01-29 12:44:53 +0000
98@@ -163,9 +163,6 @@
99 ;; Opaque structure types wider than TImode.
100 (define_mode_iterator VSTRUCT [EI OI CI XI])
101
102-;; Number of instructions needed to load/store struct elements. FIXME!
103-(define_mode_attr V_slen [(EI "2") (OI "2") (CI "3") (XI "4")])
104-
105 ;; Opaque structure types used in table lookups (except vtbl1/vtbx1).
106 (define_mode_iterator VTAB [TI EI OI])
107
108@@ -573,7 +570,7 @@
109 }
110 }
111 [(set_attr "neon_type" "neon_int_1,neon_stm_2,neon_ldm_2")
112- (set_attr "length" "<V_slen>,<V_slen>,<V_slen>")])
113+ (set (attr "length") (symbol_ref "arm_attr_length_move_neon (insn)"))])
114
115 (define_split
116 [(set (match_operand:EI 0 "s_register_operand" "")

Subscribers

People subscribed via source and target branches