summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-bsp/recipes-microblaze/gcc
diff options
context:
space:
mode:
authorManjukumar Matha <manjukumar.harthikote-matha@xilinx.com>2017-12-06 16:06:35 -0800
committerManjukumar Matha <manjukumar.harthikote-matha@xilinx.com>2017-12-13 16:11:14 -0800
commita18947c20dba2c0c38db8bde1ad4684995df4bbd (patch)
tree917bf2abbe439a6f99ede8cfafb25812dca54a9a /meta-xilinx-bsp/recipes-microblaze/gcc
parent6ddc5873b0ede30e6542f0ab151a6236acc37944 (diff)
downloadmeta-xilinx-a18947c20dba2c0c38db8bde1ad4684995df4bbd.tar.gz
meta-xilinx: Restructuring meta-xilinx to support multiple layers
As discussed previously on mailing list, we are proceeding with layer restructuring. For rocko release we will have the following layers meta-xilinx ->meta-xilinx-bsp (current meta-xilinx) ->meta-xilinx-contrib In the subsequent releases we will add other layers from Xilinx meta-xilinx ->meta-xilinx-bsp (current meta-xilinx) ->meta-petalinux ->meta-xilinx-tools ->meta-xilinx-contrib This will provide one clone to get all the required meta layers from Xilinx for a complete solution, and the users can blacklist any layer which they don't want to use using bblayer.conf. This will enables us to help our vendors/partners to add their reference designs, board definitions etc. Recipe changes : * Move reference design zybo-linux-bd.bb to meta-xilinx-contrib * Move kernel patches realted to zybo-linux-bd-zynq7 board to meta-xilinx-contrib * Update README Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
Diffstat (limited to 'meta-xilinx-bsp/recipes-microblaze/gcc')
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0001-Revert.patch42
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0002-microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch67
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0003-microblaze-sync.md-Correct-behaviour-and-define-side.patch76
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0004-gcc-config-microblaze-Use-default-ident-output-gener.patch80
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_7.%.bbappend9
5 files changed, 274 insertions, 0 deletions
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0001-Revert.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0001-Revert.patch
new file mode 100644
index 00000000..8501bd87
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0001-Revert.patch
@@ -0,0 +1,42 @@
1From cd395cbdaa551924459d6ecf143cb8e4a5771f2f Mon Sep 17 00:00:00 2001
2From: eager <eager@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Sat, 27 May 2017 18:29:40 +0000
4Subject: [PATCH 1/4] Revert: 2016-01-21 Ajit Agarwal
5 <ajitkum@xilinx.com>
6
7 See https://gcc.gnu.org/ml/gcc/2017-05/msg00221.html.
8
9 * config/microblaze/microblaze.h
10 (FIXED_REGISTERS): Update in macro.
11 (CALL_USED_REGISTERS): Update in macro.
12
13git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248540 138bc75d-0d04-0410-961f-82ee72b054a4
14Upstream-Status: Backport [from post gcc-7]
15---
16 gcc/config/microblaze/microblaze.h | 4 ++--
17 1 file changed, 2 insertions(+), 2 deletions(-)
18
19diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
20index 66e4ef5c3d..2c9ece1d6c 100644
21--- a/gcc/config/microblaze/microblaze.h
22+++ b/gcc/config/microblaze/microblaze.h
23@@ -269,14 +269,14 @@ extern enum pipeline_type microblaze_pipe;
24 #define FIXED_REGISTERS \
25 { \
26 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, \
27- 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
28+ 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
29 1, 1, 1, 1 \
30 }
31
32 #define CALL_USED_REGISTERS \
33 { \
34 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
35- 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
36+ 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
37 1, 1, 1, 1 \
38 }
39 #define GP_REG_FIRST 0
40--
412.11.0
42
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0002-microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0002-microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch
new file mode 100644
index 00000000..9aa5d98a
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0002-microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch
@@ -0,0 +1,67 @@
1From db7a0ac634ccaa1781d0a0d17dfffd3f1719bb6d Mon Sep 17 00:00:00 2001
2From: Nathan Rossi <nathan@nathanrossi.com>
3Date: Thu, 12 Nov 2015 16:09:31 +1000
4Subject: [PATCH 2/4] microblaze.md: Improve 'adddi3' and 'subdi3' insn
5 definitions
6
7Change adddi3 to handle DI immediates as the second operand, this
8requires modification to the output template however reduces the need to
9specify seperate templates for 16-bit positive/negative immediate
10operands. The use of 32-bit immediates for the addi and addic
11instructions is handled by the assembler, which will emit the imm
12instructions when required. This conveniently handles the optimizable
13cases where the immediate constant value does not need the higher half
14words of the operands upper/lower words.
15
16Change the constraints of the subdi3 instruction definition such that it
17does not match the second operand as an immediate value. This is because
18there is no definition to handle this case nor is it possible to
19implement purely with instructions as microblaze does not provide an
20instruction to perform a forward arithmetic subtraction (it only
21provides reverse 'rD = IMM - rA').
22
23Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
24Upstream-Status: Unsubmitted
25---
26 gcc/config/microblaze/microblaze.md | 13 ++++++-------
27 1 file changed, 6 insertions(+), 7 deletions(-)
28
29diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
30index b3a0011fd7..8a372d7ebb 100644
31--- a/gcc/config/microblaze/microblaze.md
32+++ b/gcc/config/microblaze/microblaze.md
33@@ -483,17 +483,16 @@
34 ;; Adding 2 DI operands in register or reg/imm
35
36 (define_insn "adddi3"
37- [(set (match_operand:DI 0 "register_operand" "=d,d,d")
38- (plus:DI (match_operand:DI 1 "register_operand" "%d,d,d")
39- (match_operand:DI 2 "arith_operand32" "d,P,N")))]
40+ [(set (match_operand:DI 0 "register_operand" "=d,d")
41+ (plus:DI (match_operand:DI 1 "register_operand" "%d,d")
42+ (match_operand:DI 2 "arith_operand" "d,i")))]
43 ""
44 "@
45 add\t%L0,%L1,%L2\;addc\t%M0,%M1,%M2
46- addi\t%L0,%L1,%2\;addc\t%M0,%M1,r0
47- addi\t%L0,%L1,%2\;addc\t%M0,%M1,r0\;addi\t%M0,%M0,-1"
48+ addi\t%L0,%L1,%j2\;addic\t%M0,%M1,%h2"
49 [(set_attr "type" "darith")
50 (set_attr "mode" "DI")
51- (set_attr "length" "8,8,12")])
52+ (set_attr "length" "8,8")])
53
54 ;;----------------------------------------------------------------
55 ;; Subtraction
56@@ -530,7 +529,7 @@
57 (define_insn "subdi3"
58 [(set (match_operand:DI 0 "register_operand" "=&d")
59 (minus:DI (match_operand:DI 1 "register_operand" "d")
60- (match_operand:DI 2 "arith_operand32" "d")))]
61+ (match_operand:DI 2 "register_operand" "d")))]
62 ""
63 "rsub\t%L0,%L2,%L1\;rsubc\t%M0,%M2,%M1"
64 [(set_attr "type" "darith")
65--
662.11.0
67
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0003-microblaze-sync.md-Correct-behaviour-and-define-side.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0003-microblaze-sync.md-Correct-behaviour-and-define-side.patch
new file mode 100644
index 00000000..9336291b
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0003-microblaze-sync.md-Correct-behaviour-and-define-side.patch
@@ -0,0 +1,76 @@
1From 6c7a10a9e077d0221cc9a6c5f5a6365815c1dca4 Mon Sep 17 00:00:00 2001
2From: Nathan Rossi <nathan@nathanrossi.com>
3Date: Mon, 12 Jun 2017 00:28:42 +1000
4Subject: [PATCH 3/4] microblaze/sync.md: Correct behaviour and define
5 side-effects
6
7This change corrects the behaviour with regards to the bool output.
8Previously the definition would set the bool operand to true (non-zero)
9on failure, specifically at the 'cmp' against the expected operand which
10would be set non-zero when the memory != expected value. Instead of
11using the bool operand as the compare result use the clobbered %8
12operand for temporary comparison result and set the bool operand at the
13end of the definition to true (in this case the immediate value of 1).
14Also to ensure that the bool operand is 0 in all other cases the first
15instruction which is intended as a clear of the carry bit is reused to
16set the bool operand to 0 at the same time as clearing the carry bit.
17And finally the jump offsets were updated
18
19Additional to the behaviour change this change defines the side-effects
20of the atomic_compare_and_swap. Specifically the side effects where the
21bool and val operands are modified/set based on the value of the memory
22content. This prevents certain optimization behaviour from incorrectly
23optimizing away code. An example of this is the snippet below, where in
24certain cases the comparison is optimized away entirely.
25
26 mem = 2;
27 if (atomic_compare_and_swap(&mem, ...) == 2)
28 ...
29
30Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
31Upstream-Status: Unsubmitted
32---
33 gcc/config/microblaze/sync.md | 14 ++++++++------
34 1 file changed, 8 insertions(+), 6 deletions(-)
35
36diff --git a/gcc/config/microblaze/sync.md b/gcc/config/microblaze/sync.md
37index 8125bd8d63..605a9a969e 100644
38--- a/gcc/config/microblaze/sync.md
39+++ b/gcc/config/microblaze/sync.md
40@@ -18,9 +18,10 @@
41 ;; <http://www.gnu.org/licenses/>.
42
43 (define_insn "atomic_compare_and_swapsi"
44- [(match_operand:SI 0 "register_operand" "=&d") ;; bool output
45- (match_operand:SI 1 "register_operand" "=&d") ;; val output
46- (match_operand:SI 2 "nonimmediate_operand" "+Q") ;; memory
47+ [(set (match_operand:SI 0 "register_operand" "=&d") ;; bool output
48+ (match_operand:SI 2 "nonimmediate_operand" "+Q")) ;; memory
49+ (set (match_operand:SI 1 "register_operand" "=&d") ;; val output
50+ (match_dup 2))
51 (match_operand:SI 3 "register_operand" "d") ;; expected value
52 (match_operand:SI 4 "register_operand" "d") ;; desired value
53 (match_operand:SI 5 "const_int_operand" "") ;; is_weak
54@@ -29,15 +30,16 @@
55 (clobber (match_scratch:SI 8 "=&d"))]
56 ""
57 {
58- output_asm_insn ("addc \tr0,r0,r0", operands);
59+ output_asm_insn ("add \t%0,r0,r0", operands);
60 output_asm_insn ("lwx \t%1,%y2,r0", operands);
61 output_asm_insn ("addic\t%8,r0,0", operands);
62 output_asm_insn ("bnei \t%8,.-8", operands);
63- output_asm_insn ("cmp \t%0,%1,%3", operands);
64- output_asm_insn ("bnei \t%0,.+16", operands);
65+ output_asm_insn ("cmp \t%8,%1,%3", operands);
66+ output_asm_insn ("bnei \t%8,.+20", operands);
67 output_asm_insn ("swx \t%4,%y2,r0", operands);
68 output_asm_insn ("addic\t%8,r0,0", operands);
69 output_asm_insn ("bnei \t%8,.-28", operands);
70+ output_asm_insn ("addi \t%0,r0,1", operands);
71 return "";
72 }
73 )
74--
752.11.0
76
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0004-gcc-config-microblaze-Use-default-ident-output-gener.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0004-gcc-config-microblaze-Use-default-ident-output-gener.patch
new file mode 100644
index 00000000..3b8a2f5d
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0004-gcc-config-microblaze-Use-default-ident-output-gener.patch
@@ -0,0 +1,80 @@
1From 308ac81945b2674953797a9db4aee98397f88362 Mon Sep 17 00:00:00 2001
2From: Nathan Rossi <nathan@nathanrossi.com>
3Date: Sat, 27 May 2017 00:00:17 +1000
4Subject: [PATCH 4/4] gcc/config/microblaze: Use default ident output
5 generation
6
7Remove the MicroBlaze specific TARGET_ASM_OUTPUT_IDENT definition, and
8use the default.
9
10Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
11Upstream-Status: Unsubmitted
12---
13 gcc/config/microblaze/microblaze-protos.h | 1 -
14 gcc/config/microblaze/microblaze.c | 24 ------------------------
15 gcc/config/microblaze/microblaze.h | 2 +-
16 3 files changed, 1 insertion(+), 26 deletions(-)
17
18diff --git a/gcc/config/microblaze/microblaze-protos.h b/gcc/config/microblaze/microblaze-protos.h
19index 9ba8f2d46f..b56e052ae4 100644
20--- a/gcc/config/microblaze/microblaze-protos.h
21+++ b/gcc/config/microblaze/microblaze-protos.h
22@@ -51,7 +51,6 @@ extern int microblaze_regno_ok_for_base_p (int, int);
23 extern HOST_WIDE_INT microblaze_initial_elimination_offset (int, int);
24 extern void microblaze_declare_object (FILE *, const char *, const char *,
25 const char *, int);
26-extern void microblaze_asm_output_ident (const char *);
27 extern int microblaze_legitimate_pic_operand (rtx);
28 extern bool microblaze_tls_referenced_p (rtx);
29 extern int symbol_mentioned_p (rtx);
30diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
31index d0f86fd460..bba6983b65 100644
32--- a/gcc/config/microblaze/microblaze.c
33+++ b/gcc/config/microblaze/microblaze.c
34@@ -3351,30 +3351,6 @@ microblaze_eh_return (rtx op0)
35 emit_insn (gen_movsi (gen_rtx_MEM (Pmode, stack_pointer_rtx), op0));
36 }
37
38-/* Queue an .ident string in the queue of top-level asm statements.
39- If the string size is below the threshold, put it into .sdata2.
40- If the front-end is done, we must be being called from toplev.c.
41- In that case, do nothing. */
42-void
43-microblaze_asm_output_ident (const char *string)
44-{
45- const char *section_asm_op;
46- int size;
47- char *buf;
48-
49- if (symtab->state != PARSING)
50- return;
51-
52- size = strlen (string) + 1;
53- if (size <= microblaze_section_threshold)
54- section_asm_op = SDATA2_SECTION_ASM_OP;
55- else
56- section_asm_op = READONLY_DATA_SECTION_ASM_OP;
57-
58- buf = ACONCAT ((section_asm_op, "\n\t.ascii \"", string, "\\0\"\n", NULL));
59- symtab->finalize_toplevel_asm (build_string (strlen (buf), buf));
60-}
61-
62 static void
63 microblaze_elf_asm_init_sections (void)
64 {
65diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
66index 2c9ece1d6c..ccd77e8b4d 100644
67--- a/gcc/config/microblaze/microblaze.h
68+++ b/gcc/config/microblaze/microblaze.h
69@@ -743,7 +743,7 @@ do { \
70 #define STRING_ASM_OP "\t.asciz\t"
71
72 #undef TARGET_ASM_OUTPUT_IDENT
73-#define TARGET_ASM_OUTPUT_IDENT microblaze_asm_output_ident
74+#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive
75
76 /* Default to -G 8 */
77 #ifndef MICROBLAZE_DEFAULT_GVALUE
78--
792.11.0
80
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_7.%.bbappend b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_7.%.bbappend
new file mode 100644
index 00000000..5b695638
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_7.%.bbappend
@@ -0,0 +1,9 @@
1# Add MicroBlaze Patches (only when using MicroBlaze)
2FILESEXTRAPATHS_append_microblaze := "${THISDIR}/gcc-7:"
3SRC_URI_append_microblaze = " \
4 file://0001-Revert.patch \
5 file://0002-microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch \
6 file://0003-microblaze-sync.md-Correct-behaviour-and-define-side.patch \
7 file://0004-gcc-config-microblaze-Use-default-ident-output-gener.patch \
8 "
9