summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Enedino Hernandez Samaniego <alejandr@xilinx.com>2018-12-12 09:57:10 -0800
committerManjukumar Matha <manjukumar.harthikote-matha@xilinx.com>2019-06-28 16:32:42 -0700
commiteca44e3e9f65a242c384735946307c663b87804b (patch)
tree80f27ab934c9b2923d39edd359f3a12d05d2b001
parent3b825c1d9667fcfa3d16f513361236b87886033d (diff)
downloadmeta-xilinx-eca44e3e9f65a242c384735946307c663b87804b.tar.gz
gcc-8: rebase microblaze patches for gcc 8.2.0
Align patch names with Xilinxs gcc 8 repo for easier upgrade later Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
-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/0003-PR-target-83013.patch32
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0004-dejagnu-static-testing-on-qemu-suppress-warnings.patch36
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0012-Fix-the-Microblaze-crash-with-msmall-divides-flag.patch37
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0017-Disable-fivopts-by-default-Turn-off-ivopts-by-defaul.patch38
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0020-Modified-MicroBlaze-trap-instruction.patch33
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0022-Inline-Expansion-of-fsqrt-builtin.patch64
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0025-MicroBlaze-correct-the-const-high-double-immediate-v.patch72
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0026-Fix-internal-compiler-error-with-msmall-divides.patch42
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0033-MicroBlaze-fix-signed-bit-fields-with-bit-field-inst.patch51
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0001-LOCAL-Testsuite-builtins-tests-require-fpic.patch35
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0002-LOCAL-Quick-fail-g-.dg-opt-memcpy1.C.patch31
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0003-LOCAL-Testsuite-explicitly-add-fivopts-for-tests-tha.patch116
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0004-LOCAL-For-dejagnu-static-testing-on-qemu-suppress-wa.patch35
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0005-Patch-testsuite-Add-MicroBlaze-to-target-supports-fo.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0006-Add-MicroBlaze-to-target-supports-for-atomic-builtin.patch)16
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0005-Testsuite-explicitly-add-fivopts-for-tests-that-depe.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0005-Testsuite-explicitly-add-fivopts-for-tests-that-depe.patch)0
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0006-Patch-testsuite-Update-MicroBlaze-strings-test.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0007-Update-MicroBlaze-strings-test-for-new-scan-assembly.patch)15
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0007-Patch-testsuite-Allow-MicroBlaze-.weakext-pattern-in.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0008-Allow-MicroBlaze-.weakext-pattern-in-testsuite.patch)31
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0008-Patch-testsuite-Add-MicroBlaze-to-check_profiling_av.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0009-Add-MicroBlaze-to-check_profiling_available-Testsuit.patch)22
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0009-Patch-microblaze-Fix-atomic-side-effects.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0010-Fix-atomic-side-effects.patch)24
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0010-Patch-microblaze-Fix-atomic-boolean-return-value.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0011-Fix-atomic-boolean-return-value.patch)18
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0011-Patch-microblaze-Fix-the-Microblaze-crash-with-msmal.patch33
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0012-Patch-microblaze-Added-ashrsi3_with_size_opt.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0013-Add-MicroBlaze-ashrsi_3_with_size_opt.patch)25
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0013-Patch-microblaze-Fixed-missing-save-of-r18-in-fast_i.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0015-MicroBlaze-fixed-missing-save-of-r18-in-fast_interru.patch)23
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0014-Patch-microblaze-Use-bralid-for-profiler-calls.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0016-MicroBlaze-use-bralid-for-profiler-calls.patch)17
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0015-Patch-microblaze-Disable-fivopts-by-default.patch42
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0016-Patch-microblaze-Removed-moddi3-routinue.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0014-Removed-MicroBlaze-moddi3-routinue.patch)35
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0017-Patch-microblaze-Add-INIT_PRIORITY-support.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0018-Add-INIT_PRIORITY-support-Added-TARGET_ASM_CONSTRUCT.patch)21
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0018-Patch-microblaze-Add-optimized-lshrsi3.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0019-MicroBlaze-add-optimized-lshrsi3-When-barrel-shifter.patch)26
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0019-Patch-microblaze-Modified-trap-instruction.patch29
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0020-Patch-microblaze-Reducing-Stack-space-for-arguments.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0021-Reducing-Stack-space-for-arguments-Currently-in-Micr.patch)46
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0021-Patch-microblaze-Add-cbranchsi4_reg.patch159
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0022-Patch-microblaze-Inline-Expansion-of-fsqrt-builtin.patch58
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0023-Patch-OPT-Update-heuristics-for-loop-invariant-for-a.patch47
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0024-PATCH-microblaze.md-Improve-adddi3-and-subdi3-insn-d.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0002-microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch)33
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0025-Patch-microblaze-Update-ashlsi3-movsf-patterns.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0023-Update-MicroBlaze-ashlsi3-movsf-patterns.patch)44
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0026-Patch-microblaze-8-stage-pipeline-for-microblaze.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0024-8-stage-pipeline-for-microblaze.patch)44
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0027-Patch-rtl-Optimization-Better-register-pressure-esti.patch142
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0028-Patch-microblaze-Correct-the-const-high-double-immed.patch69
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0029-Fix-microblaze-Fix-internal-compiler-error-with-msma.patch36
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0030-patch-microblaze-Fix-the-calculation-of-high-word-in.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0027-Fix-the-calculation-of-high-word-in-a-long-long-64-b.patch)33
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0031-Patch-microblaze-Add-new-bit-field-instructions.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0028-Add-new-bit-field-instructions.patch)34
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0032-Patch-microblaze-Fix-bug-in-MB-version-calculation.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0029-Fix-bug-in-MB-version-calculation.patch)41
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0033-Fixing-the-bug-in-the-bit-field-instruction.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0030-MicroBlaze-fixing-the-bug-in-the-bit-field-instructi.patch)20
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0034-Patch-microblaze-Macros-used-in-Xilinx-internal-patc.patch32
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0035-Fixing-the-issue-with-the-builtin_alloc.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0031-Fixing-the-issue-with-MicroBlaze-builtin_alloc.patch)22
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0036-Patch-Microblaze-reverting-the-cost-check-before-pro.patch49
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0037-Patch-Microblaze-update-in-constraints-for-bitfield-.patch (renamed from meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0032-MicroBlaze-remove-bitfield-instructions-macros.patch)51
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0038-Patch-Microblaze-Removed-fsqrt-generation-for-double.patch38
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0039-Intial-commit-of-64-bit-Microblaze.patch810
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0040-Added-load-store-pattern-movdi-and-also-adding-missi.patch83
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0041-Intial-commit-for-64bit-MB-sources.patch2463
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0042-re-arrangement-of-the-compare-branches.patch268
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0043-Patch-Microblaze-previous-commit-broke-the-handling-.patch28
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0044-Patch-Microblaze-Support-of-multilibs-with-m64.patch73
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0045-Fixed-issues-like.patch70
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0046-Fixed-below-issues.patch306
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0047-Added-double-arith-instructions.patch135
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0048-Fixed-the-issue-in-the-delay-slot-with-swap-instruct.patch37
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0049-Fixed-the-load-store-issue-with-the-32bit-arith-libr.patch256
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0050-extending-the-Dwarf-support-to-64bit-Microblaze.patch25
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0051-fixing-the-typo-errors-in-umodsi3-file.patch29
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0052-fixing-the-32bit-LTO-related-issue9-1014024.patch68
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0053-Fixed-the-missing-stack-adjustment-in-prologue-of-mo.patch25
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0054-Patch-Microblaze-corrected-SPN-for-dlong-instruction.patch29
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_7.%.bbappend38
-rw-r--r--meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_8.%.bbappend58
67 files changed, 5995 insertions, 845 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
deleted file mode 100644
index 93af6514..00000000
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0001-Revert.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From 12cd383fbef719cc1a84cc80ff171073409a8557 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] 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.14.2
42
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0003-PR-target-83013.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0003-PR-target-83013.patch
deleted file mode 100644
index 42bfd3c1..00000000
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0003-PR-target-83013.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From f17cdebf4e0defaefce927176ddeb9717de073d2 Mon Sep 17 00:00:00 2001
2From: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Mon, 15 Jan 2018 06:02:19 +0000
4Subject: [PATCH] PR target/83013
5
6 * config/microblaze/microblaze.c (microblaze_asm_output_ident):
7 Use .pushsection/.popsection.
8
9git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256681 138bc75d-0d04-0410-961f-82ee72b054a4
10Upstream-Status: Backport [backport from trunk pre-release v8]
11---
12 gcc/config/microblaze/microblaze.c | 4 +++-
13 1 file changed, 3 insertions(+), 1 deletion(-)
14
15diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
16index d0f86fd460..a98aca1235 100644
17--- a/gcc/config/microblaze/microblaze.c
18+++ b/gcc/config/microblaze/microblaze.c
19@@ -3371,7 +3371,9 @@ microblaze_asm_output_ident (const char *string)
20 else
21 section_asm_op = READONLY_DATA_SECTION_ASM_OP;
22
23- buf = ACONCAT ((section_asm_op, "\n\t.ascii \"", string, "\\0\"\n", NULL));
24+ buf = ACONCAT (("\t.pushsection", section_asm_op,
25+ "\n\t.ascii \"", string, "\\0\"\n",
26+ "\t.popsection\n", NULL));
27 symtab->finalize_toplevel_asm (build_string (strlen (buf), buf));
28 }
29
30--
312.15.1
32
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0004-dejagnu-static-testing-on-qemu-suppress-warnings.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0004-dejagnu-static-testing-on-qemu-suppress-warnings.patch
deleted file mode 100644
index c0a427ea..00000000
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0004-dejagnu-static-testing-on-qemu-suppress-warnings.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From ab2cb6320138c173b20fee8ce6e8d4afa4696384 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:16 -0700
4Subject: [PATCH] dejagnu static testing on qemu, suppress warnings
5
6For dejagnu static testing on qemu, suppress warnings about multiple
7definitions from the test function and libc in line with method used by
8powerpc. Dynamic linking and using a qemu binary which understands
9sysroot resolves all test failures with builtins
10
11Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
12Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
13Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
14Upstream-Status: Pending
15---
16 gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp | 4 ++++
17 1 file changed, 4 insertions(+)
18
19diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
20index ba16b09c41..ada149912b 100644
21--- a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
22+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
23@@ -48,6 +48,10 @@ if { [istarget *-*-eabi*]
24 lappend additional_flags "-Wl,--allow-multiple-definition"
25 }
26
27+if [istarget "microblaze*-*-linux*"] {
28+ lappend additional_flags "-Wl,-zmuldefs"
29+}
30+
31 foreach src [lsort [find $srcdir/$subdir *.c]] {
32 if {![string match *-lib.c $src] && [runtest_file_p $runtests $src]} {
33 c-torture-execute [list $src \
34--
352.14.2
36
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0012-Fix-the-Microblaze-crash-with-msmall-divides-flag.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0012-Fix-the-Microblaze-crash-with-msmall-divides-flag.patch
deleted file mode 100644
index 464f59e3..00000000
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0012-Fix-the-Microblaze-crash-with-msmall-divides-flag.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From 1a9dcdb578452ecd53e0aec65fe6279233218778 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:26 -0700
4Subject: [PATCH] Fix the Microblaze crash with msmall-divides flag
5
6Fix the Microblaze crash with msmall-divides flag Compiler is crashing
7when we use msmall-divides and mxl-barrel-shift flag. This is because
8when use above flags microblaze_expand_divide function will be called
9for division operation. In microblaze_expand_divide function we are
10using sub_reg but MicroBlaze doesn't have subreg register due to this
11compiler was crashing. Changed the logic to avoid sub_reg call
12
13Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
14Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
15Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
16Upstream-Status: Pending
17---
18 gcc/config/microblaze/microblaze.c | 3 +--
19 1 file changed, 1 insertion(+), 2 deletions(-)
20
21diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
22index bba6983b65..15080db539 100644
23--- a/gcc/config/microblaze/microblaze.c
24+++ b/gcc/config/microblaze/microblaze.c
25@@ -3527,8 +3527,7 @@ microblaze_expand_divide (rtx operands[])
26 mem_rtx = gen_rtx_MEM (QImode,
27 gen_rtx_PLUS (Pmode, regt1, div_table_rtx));
28
29- insn = emit_insn (gen_movqi (regqi, mem_rtx));
30- insn = emit_insn (gen_movsi (operands[0], gen_rtx_SUBREG (SImode, regqi, 0)));
31+ insn = emit_insn (gen_zero_extendqisi2(operands[0],mem_rtx));
32 jump = emit_jump_insn_after (gen_jump (div_end_label), insn);
33 JUMP_LABEL (jump) = div_end_label;
34 LABEL_NUSES (div_end_label) = 1;
35--
362.14.2
37
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0017-Disable-fivopts-by-default-Turn-off-ivopts-by-defaul.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0017-Disable-fivopts-by-default-Turn-off-ivopts-by-defaul.patch
deleted file mode 100644
index 4041e11f..00000000
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0017-Disable-fivopts-by-default-Turn-off-ivopts-by-defaul.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From 25b161dd222311cca0e6ab46b7f3be444bd4bbe8 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:32 -0700
4Subject: [PATCH] Disable fivopts by default Turn off ivopts by default.
5 Interferes with cse.
6
7Changelog
8
92013-03-18 Edgar E. Iglesias <edgar.iglesias@xilinx.com>
10
11 * gcc/common/config/microblaze/microblaze-common.c
12 (microblaze_option_optimization_table): Disable fivopts by default.
13
14Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
15Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
16Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
17Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
18Upstream-Status: Pending
19---
20 gcc/common/config/microblaze/microblaze-common.c | 2 ++
21 1 file changed, 2 insertions(+)
22
23diff --git a/gcc/common/config/microblaze/microblaze-common.c b/gcc/common/config/microblaze/microblaze-common.c
24index 4975663305..8ddc4c3cbe 100644
25--- a/gcc/common/config/microblaze/microblaze-common.c
26+++ b/gcc/common/config/microblaze/microblaze-common.c
27@@ -27,6 +27,8 @@
28 /* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
29 static const struct default_options microblaze_option_optimization_table[] =
30 {
31+ /* Turn off ivopts by default. It messes up cse. */
32+ { OPT_LEVELS_ALL, OPT_fivopts, NULL, 0 },
33 { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
34 { OPT_LEVELS_NONE, 0, NULL, 0 }
35 };
36--
372.14.2
38
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0020-Modified-MicroBlaze-trap-instruction.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0020-Modified-MicroBlaze-trap-instruction.patch
deleted file mode 100644
index 00e79b93..00000000
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0020-Modified-MicroBlaze-trap-instruction.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From 1b9bd76840fc1e67770a23c58bf18a24a25eb2b9 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:36 -0700
4Subject: [PATCH] Modified MicroBlaze trap instruction
5
6Modified trap instruction The instruction was wrongly written to brki
7r0,-1 it should be bri r0. Modified with the correct instruction
8
9Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
10Signed-off-by: Ajit Agarwal <ajitkum@xilinx.com>
11Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
12Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
13Upstream-Status: Pending
14---
15 gcc/config/microblaze/microblaze.md | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
19index abbe97c15f..a3954a24b6 100644
20--- a/gcc/config/microblaze/microblaze.md
21+++ b/gcc/config/microblaze/microblaze.md
22@@ -2343,7 +2343,7 @@
23 (define_insn "trap"
24 [(trap_if (const_int 1) (const_int 0))]
25 ""
26- "brki\tr0,-1"
27+ "bri\t0"
28 [(set_attr "type" "trap")]
29 )
30
31--
322.14.2
33
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0022-Inline-Expansion-of-fsqrt-builtin.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0022-Inline-Expansion-of-fsqrt-builtin.patch
deleted file mode 100644
index 6de17024..00000000
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0022-Inline-Expansion-of-fsqrt-builtin.patch
+++ /dev/null
@@ -1,64 +0,0 @@
1From cf85f09a0fade1e7827828a3dc9a526c212f3be7 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:39 -0700
4Subject: [PATCH] Inline Expansion of fsqrt builtin
5
6Inline Expansion of fsqrt builtin. The changes are made in the patch for
7the inline expansion of the fsqrt builtin with fqrt instruction. The
8sqrt math function takes double as argument and return double as
9argument. The pattern is selected while expanding the unary op through
10expand_unop which passes DFmode and the DFmode pattern was not there
11returning zero. Thus the sqrt math function is not inlined and expanded.
12The pattern with DFmode argument is added. Also the source and
13destination argument is not same the DF through two different
14consecutive registers with lower 32 bit is the argument passed to sqrt
15and the higher 32 bit is zero. If the source and destinations are
16different the DFmode 64 bits registers is not set properly giving the
17problem in runtime. Such changes are taken care in the implementation of
18the pattern for DFmode for inline expansion of the sqrt.
19
20ChangeLog:
21
222015-06-16 Ajit Agarwal <ajitkum@xilinx.com>
23 Nagaraju Mekala <nagaraju.mekala@xilinx.com>
24
25 * config/microblaze/microblaze.md (sqrtdf2): New
26 pattern.
27
28Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
29Signed-off-by: Ajit Agarwal <ajitkum@xilinx.com>
30Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
31Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
32Upstream-Status: Pending
33---
34 gcc/config/microblaze/microblaze.md | 14 ++++++++++++++
35 1 file changed, 14 insertions(+)
36
37diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
38index a3954a24b6..13f8803428 100644
39--- a/gcc/config/microblaze/microblaze.md
40+++ b/gcc/config/microblaze/microblaze.md
41@@ -449,6 +449,20 @@
42 (set_attr "mode" "SF")
43 (set_attr "length" "4")])
44
45+(define_insn "sqrtdf2"
46+ [(set (match_operand:DF 0 "register_operand" "=d")
47+ (sqrt:DF (match_operand:DF 1 "register_operand" "dG")))]
48+ "TARGET_HARD_FLOAT && TARGET_FLOAT_SQRT"
49+ {
50+ if (REGNO (operands[0]) == REGNO (operands[1]))
51+ return "fsqrt\t%0,%1";
52+ else
53+ return "fsqrt\t%0,%1\n\taddk\t%D0,%D1,r0";
54+ }
55+ [(set_attr "type" "fsqrt")
56+ (set_attr "mode" "SF")
57+ (set_attr "length" "4")])
58+
59 (define_insn "fix_truncsfsi2"
60 [(set (match_operand:SI 0 "register_operand" "=d")
61 (fix:SI (match_operand:SF 1 "register_operand" "d")))]
62--
632.14.2
64
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0025-MicroBlaze-correct-the-const-high-double-immediate-v.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0025-MicroBlaze-correct-the-const-high-double-immediate-v.patch
deleted file mode 100644
index ff8e6107..00000000
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0025-MicroBlaze-correct-the-const-high-double-immediate-v.patch
+++ /dev/null
@@ -1,72 +0,0 @@
1From fabd23a354496701b4a9ebf6931485b0d61c7bbe Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:45 -0700
4Subject: [PATCH] MicroBlaze correct the const high double immediate value
5
6With this patch the loading of the DI mode immediate values will be
7using REAL_VALUE_FROM_CONST_DOUBLE and REAL_VALUE_TO_TARGET_DOUBLE
8functions, as CONST_DOUBLE_HIGH was returning the sign extension value
9even of the unsigned long long constants also
10
11ChangeLog:
12
132016-02-03 Nagaraju Mekala <nagaraju.mekala@xilinx.com>
14 Ajit Agarwal <ajitkum@xilinx.com>
15
16 * microblaze.c (print_operand): Use REAL_VALUE_FROM_CONST_DOUBLE &
17 REAL_VALUE_TO_TARGET_DOUBLE
18 * long.c (new): Added new testcase
19
20Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
21Signed-off-by: Ajit Agarwal <ajitkum@xilinx.com>
22Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
23Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
24Upstream-Status: Pending
25---
26 gcc/config/microblaze/microblaze.c | 6 ++++--
27 gcc/testsuite/gcc.target/microblaze/long.c | 10 ++++++++++
28 2 files changed, 14 insertions(+), 2 deletions(-)
29 create mode 100644 gcc/testsuite/gcc.target/microblaze/long.c
30
31diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
32index e7697bf30d..96bf6e1cab 100644
33--- a/gcc/config/microblaze/microblaze.c
34+++ b/gcc/config/microblaze/microblaze.c
35@@ -2493,14 +2493,16 @@ print_operand (FILE * file, rtx op, int letter)
36 else if (letter == 'h' || letter == 'j')
37 {
38 long val[2];
39+ long l[2];
40 if (code == CONST_DOUBLE)
41 {
42 if (GET_MODE (op) == DFmode)
43 REAL_VALUE_TO_TARGET_DOUBLE (*CONST_DOUBLE_REAL_VALUE (op), val);
44 else
45 {
46- val[0] = CONST_DOUBLE_HIGH (op);
47- val[1] = CONST_DOUBLE_LOW (op);
48+ REAL_VALUE_TO_TARGET_DOUBLE (*CONST_DOUBLE_REAL_VALUE (op), l);
49+ val[1] = l[WORDS_BIG_ENDIAN == 0];
50+ val[0] = l[WORDS_BIG_ENDIAN != 0];
51 }
52 }
53 else if (code == CONST_INT)
54diff --git a/gcc/testsuite/gcc.target/microblaze/long.c b/gcc/testsuite/gcc.target/microblaze/long.c
55new file mode 100644
56index 0000000000..4d4518619d
57--- /dev/null
58+++ b/gcc/testsuite/gcc.target/microblaze/long.c
59@@ -0,0 +1,10 @@
60+/* { dg-options "-O0" } */
61+#define BASEADDR 0xF0000000ULL
62+int main ()
63+{
64+ unsigned long long start;
65+ start = (unsigned long long) BASEADDR;
66+ return 0;
67+}
68+/* { dg-final { scan-assembler "addik\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r0,0x00000000" } } */
69+/* { dg-final { scan-assembler "addik\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r0,0xf0000000" } } */
70--
712.14.2
72
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0026-Fix-internal-compiler-error-with-msmall-divides.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0026-Fix-internal-compiler-error-with-msmall-divides.patch
deleted file mode 100644
index 7ea28ee8..00000000
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0026-Fix-internal-compiler-error-with-msmall-divides.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From 2149d85f1f7375dd97bf961b2bdb693d6d931c13 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:46 -0700
4Subject: [PATCH] Fix internal compiler error with msmall-divides
5
6This patch will fix the internal error microblaze_expand_divide function
7which comes because of rtx PLUS where the mem_rtx is of type SI and the
8operand is of type QImode. This patch modifies the mem_rtx as QImode and
9Plus as QImode to fix the error.
10
11ChangeLog:
12
132016-02-23 Nagaraju Mekala <nagaraju.mekala@xilinx.com>
14 Ajit Agarwal <ajitkum@xilinx.com>
15
16 * microblaze.c (microblaze_expand_divide): Update
17
18Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
19Signed-off-by: Ajit Agarwal <ajitkum@xilinx.com>
20Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
21Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
22Upstream-Status: Pending
23---
24 gcc/config/microblaze/microblaze.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
28index 96bf6e1cab..a41121264e 100644
29--- a/gcc/config/microblaze/microblaze.c
30+++ b/gcc/config/microblaze/microblaze.c
31@@ -3719,7 +3719,7 @@ microblaze_expand_divide (rtx operands[])
32 emit_insn (gen_ashlsi3_bshift (regt1, operands[1], GEN_INT(4)));
33 emit_insn (gen_addsi3 (regt1, regt1, operands[2]));
34 mem_rtx = gen_rtx_MEM (QImode,
35- gen_rtx_PLUS (Pmode, regt1, div_table_rtx));
36+ gen_rtx_PLUS (QImode, regt1, div_table_rtx));
37
38 insn = emit_insn (gen_zero_extendqisi2(operands[0],mem_rtx));
39 jump = emit_jump_insn_after (gen_jump (div_end_label), insn);
40--
412.14.2
42
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0033-MicroBlaze-fix-signed-bit-fields-with-bit-field-inst.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0033-MicroBlaze-fix-signed-bit-fields-with-bit-field-inst.patch
deleted file mode 100644
index eaae5667..00000000
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0033-MicroBlaze-fix-signed-bit-fields-with-bit-field-inst.patch
+++ /dev/null
@@ -1,51 +0,0 @@
1From e2a7a582945d24ede55393462a3360f377f45478 Mon Sep 17 00:00:00 2001
2From: Nathan Rossi <nathan@nathanrossi.com>
3Date: Sun, 5 Nov 2017 23:03:54 +1000
4Subject: [PATCH] MicroBlaze fix signed bit fields with bit field instructions
5
6The 'extv' definition is expected to sign extended the result based on
7the width of the bit field.
8
9 https://gcc.gnu.org/onlinedocs/gccint/Standard-Names.html#index-extvm-instruction-pattern
10
11The MicroBlaze 'bsefi' instruction does not sign extended, it zero
12extends. There is no option for the instruction to sign extended the
13result and no simple instruction or expression to implement a variant
14length sign extend (only sext8/sext16 instructions exist).
15
16As such these definitions needs to be changed to the zero extended
17variant of 'extv' which is 'extzv'. This change updates the existing
18definitions to allow for signed bit fields to function correctly and be
19sign extended.
20
21Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
22Upstream-Status: Pending
23---
24 gcc/config/microblaze/microblaze.md | 4 ++--
25 1 file changed, 2 insertions(+), 2 deletions(-)
26
27diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
28index ef53c3069e..b52be42d6e 100644
29--- a/gcc/config/microblaze/microblaze.md
30+++ b/gcc/config/microblaze/microblaze.md
31@@ -2476,7 +2476,7 @@
32 DONE;
33 }")
34
35-(define_expand "extvsi"
36+(define_expand "extzvsi"
37 [(set (match_operand:SI 0 "register_operand" "r")
38 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
39 (match_operand:SI 2 "immediate_operand" "I")
40@@ -2485,7 +2485,7 @@
41 ""
42 )
43
44-(define_insn "extv_32"
45+(define_insn "extzv_32"
46 [(set (match_operand:SI 0 "register_operand" "=r")
47 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
48 (match_operand:SI 2 "immediate_operand" "I")
49--
502.14.2
51
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0001-LOCAL-Testsuite-builtins-tests-require-fpic.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0001-LOCAL-Testsuite-builtins-tests-require-fpic.patch
new file mode 100644
index 00000000..5d29531d
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0001-LOCAL-Testsuite-builtins-tests-require-fpic.patch
@@ -0,0 +1,35 @@
1From 7fbf19ba660c72a1d4817780cad5c4ae52cbe0b5 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 11 Jan 2017 13:13:57 +0530
4Subject: [PATCH 01/54] LOCAL]: Testsuite - builtins tests require fpic
5 Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
6
7Conflicts:
8
9 gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
10---
11 gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp | 8 ++++++++
12 1 file changed, 8 insertions(+)
13
14diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
15index 9f0b24a..1cb4f97 100644
16--- a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
17+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
18@@ -48,6 +48,14 @@ if { [istarget *-*-eabi*]
19 lappend additional_flags "-Wl,--allow-multiple-definition"
20 }
21
22+<<<<<<< HEAD
23+=======
24+if [istarget "microblaze*-*-linux*"] {
25+ lappend additional_flags "-Wl,-zmuldefs"
26+ lappend additional_flags "-fPIC"
27+}
28+
29+>>>>>>> 6ef6e5b... [LOCAL]: Testsuite - builtins tests require fpic
30 foreach src [lsort [find $srcdir/$subdir *.c]] {
31 if {![string match *-lib.c $src] && [runtest_file_p $runtests $src]} {
32 c-torture-execute [list $src \
33--
342.7.4
35
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0002-LOCAL-Quick-fail-g-.dg-opt-memcpy1.C.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0002-LOCAL-Quick-fail-g-.dg-opt-memcpy1.C.patch
new file mode 100644
index 00000000..503b1ecf
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0002-LOCAL-Quick-fail-g-.dg-opt-memcpy1.C.patch
@@ -0,0 +1,31 @@
1From 4b675eeabceea22ec51abfa7c37e11a631e58659 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 11 Jan 2017 14:31:10 +0530
4Subject: [PATCH 02/54] [LOCAL]: Quick fail g++.dg/opt/memcpy1.C This
5 particular testcase fails with a timeout. Instead, fail it at compile-time
6 for microblaze. This speeds up the testsuite without removing it from the
7 FAIL reports.
8
9Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10---
11 gcc/testsuite/g++.dg/opt/memcpy1.C | 4 ++++
12 1 file changed, 4 insertions(+)
13
14diff --git a/gcc/testsuite/g++.dg/opt/memcpy1.C b/gcc/testsuite/g++.dg/opt/memcpy1.C
15index 66411cd..d951fee 100644
16--- a/gcc/testsuite/g++.dg/opt/memcpy1.C
17+++ b/gcc/testsuite/g++.dg/opt/memcpy1.C
18@@ -4,6 +4,10 @@
19 // { dg-do compile }
20 // { dg-options "-O" }
21
22+#if defined (__MICROBLAZE__)
23+#error "too slow on mb. Investigate."
24+#endif
25+
26 typedef unsigned char uint8_t;
27 typedef uint8_t uint8;
28 __extension__ typedef __SIZE_TYPE__ size_t;
29--
302.7.4
31
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0003-LOCAL-Testsuite-explicitly-add-fivopts-for-tests-tha.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0003-LOCAL-Testsuite-explicitly-add-fivopts-for-tests-tha.patch
new file mode 100644
index 00000000..39058496
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0003-LOCAL-Testsuite-explicitly-add-fivopts-for-tests-tha.patch
@@ -0,0 +1,116 @@
1From 03d4d7335be2b2f72c199ab5177685b6dfd1a9d6 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 11 Jan 2017 15:28:38 +0530
4Subject: [PATCH 03/54] [LOCAL]: Testsuite - explicitly add -fivopts for tests
5 that depend on it (test gcc/testsuite/gcc.dg/tree-ssa/ivopts-lt.c doesnt
6 exist in 4.6 branch)
7
8Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
9---
10 gcc/testsuite/g++.dg/tree-ssa/ivopts-2.C | 2 +-
11 gcc/testsuite/g++.dg/tree-ssa/ivopts-3.C | 2 +-
12 gcc/testsuite/gcc.dg/tree-ssa/loop-2.c | 2 +-
13 gcc/testsuite/gcc.dg/tree-ssa/loop-4.c | 2 +-
14 gcc/testsuite/gcc.dg/tree-ssa/loop-5.c | 2 +-
15 gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c | 2 +-
16 gcc/testsuite/gcc.dg/tree-ssa/pr19590.c | 2 +-
17 gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c | 2 +-
18 8 files changed, 8 insertions(+), 8 deletions(-)
19
20diff --git a/gcc/testsuite/g++.dg/tree-ssa/ivopts-2.C b/gcc/testsuite/g++.dg/tree-ssa/ivopts-2.C
21index 438db88..ede883e 100644
22--- a/gcc/testsuite/g++.dg/tree-ssa/ivopts-2.C
23+++ b/gcc/testsuite/g++.dg/tree-ssa/ivopts-2.C
24@@ -1,5 +1,5 @@
25 /* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
26-/* { dg-options "-O2 -fdump-tree-ivopts-details" } */
27+/* { dg-options "-O2 -fivopts -fdump-tree-ivopts-details" } */
28
29 void test (int *b, int *e, int stride)
30 {
31diff --git a/gcc/testsuite/g++.dg/tree-ssa/ivopts-3.C b/gcc/testsuite/g++.dg/tree-ssa/ivopts-3.C
32index 07ff1b7..a09710c 100644
33--- a/gcc/testsuite/g++.dg/tree-ssa/ivopts-3.C
34+++ b/gcc/testsuite/g++.dg/tree-ssa/ivopts-3.C
35@@ -1,5 +1,5 @@
36 // { dg-do compile }
37-// { dg-options "-O2 -fdump-tree-ivopts-details" }
38+// { dg-options "-O2 -fivopts -fdump-tree-ivopts-details" }
39
40 class MinimalVec3
41 {
42diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-2.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-2.c
43index bda2516..22c8a5d 100644
44--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-2.c
45+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-2.c
46@@ -1,7 +1,7 @@
47 /* A test for strength reduction and induction variable elimination. */
48
49 /* { dg-do compile } */
50-/* { dg-options "-O1 -fdump-tree-optimized" } */
51+/* { dg-options "-O1 -fivopts -fdump-tree-optimized" } */
52 /* { dg-require-effective-target size32plus } */
53
54 /* Size of this structure should be sufficiently weird so that no memory
55diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-4.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-4.c
56index f0770ab..65d74c8 100644
57--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-4.c
58+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-4.c
59@@ -1,7 +1,7 @@
60 /* A test for strength reduction and induction variable elimination. */
61
62 /* { dg-do compile } */
63-/* { dg-options "-O1 -fdump-tree-optimized" } */
64+/* { dg-options "-O1 -fivopts -fdump-tree-optimized" } */
65 /* { dg-require-effective-target size32plus } */
66
67 /* Size of this structure should be sufficiently weird so that no memory
68diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c
69index 5f42857..9bc86ee 100644
70--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c
71+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-5.c
72@@ -1,7 +1,7 @@
73 /* A test for induction variable merging. */
74
75 /* { dg-do compile } */
76-/* { dg-options "-O1 -fdump-tree-optimized" } */
77+/* { dg-options "-O1 -fivopts -fdump-tree-optimized" } */
78
79 void foo(long);
80
81diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c
82index 0fa5600..94caa44 100644
83--- a/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c
84+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr19210-1.c
85@@ -1,5 +1,5 @@
86 /* { dg-do compile } */
87-/* { dg-options "-O2 -fopt-info-loop-missed -Wunsafe-loop-optimizations" } */
88+/* { dg-options "-O2 -fivopts -fopt-info-loop-missed -Wunsafe-loop-optimizations" } */
89 extern void g(void);
90
91 void
92diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr19590.c b/gcc/testsuite/gcc.dg/tree-ssa/pr19590.c
93index 2c6cfc6..648e6e6 100644
94--- a/gcc/testsuite/gcc.dg/tree-ssa/pr19590.c
95+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr19590.c
96@@ -1,5 +1,5 @@
97 /* { dg-do compile } */
98-/* { dg-options "-O2 -fdump-tree-ivopts" } */
99+/* { dg-options "-O2 -fivopts -fdump-tree-ivopts" } */
100
101 void vnum_test8(int *data)
102 {
103diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c
104index e911bfc..5d3e7e0 100644
105--- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c
106+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c
107@@ -1,5 +1,5 @@
108 /* { dg-do compile } */
109-/* { dg-options "-Os -fdump-tree-optimized" } */
110+/* { dg-options "-Os -fivopts -fdump-tree-optimized" } */
111
112 /* Slightly changed testcase from PR middle-end/40815. */
113 void bar(char*, char*, int);
114--
1152.7.4
116
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0004-LOCAL-For-dejagnu-static-testing-on-qemu-suppress-wa.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0004-LOCAL-For-dejagnu-static-testing-on-qemu-suppress-wa.patch
new file mode 100644
index 00000000..e16528b6
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0004-LOCAL-For-dejagnu-static-testing-on-qemu-suppress-wa.patch
@@ -0,0 +1,35 @@
1From a4c99f7f7775f105eb6f1dfbdf304e6b7e498e2e Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 11 Jan 2017 15:46:28 +0530
4Subject: [PATCH 04/54] [LOCAL]: For dejagnu static testing on qemu, suppress
5 warnings about multiple definitions from the test function and libc in line
6 with method used by powerpc. Dynamic linking and using a qemu binary which
7 understands sysroot resolves all test failures with builtins
8
9Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
10---
11 gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp | 4 ----
12 1 file changed, 4 deletions(-)
13
14diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
15index 1cb4f97..bdfa08a 100644
16--- a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
17+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
18@@ -48,14 +48,10 @@ if { [istarget *-*-eabi*]
19 lappend additional_flags "-Wl,--allow-multiple-definition"
20 }
21
22-<<<<<<< HEAD
23-=======
24 if [istarget "microblaze*-*-linux*"] {
25 lappend additional_flags "-Wl,-zmuldefs"
26- lappend additional_flags "-fPIC"
27 }
28
29->>>>>>> 6ef6e5b... [LOCAL]: Testsuite - builtins tests require fpic
30 foreach src [lsort [find $srcdir/$subdir *.c]] {
31 if {![string match *-lib.c $src] && [runtest_file_p $runtests $src]} {
32 c-torture-execute [list $src \
33--
342.7.4
35
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0006-Add-MicroBlaze-to-target-supports-for-atomic-builtin.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0005-Patch-testsuite-Add-MicroBlaze-to-target-supports-fo.patch
index 6fad8bf7..33688f14 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0006-Add-MicroBlaze-to-target-supports-for-atomic-builtin.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0005-Patch-testsuite-Add-MicroBlaze-to-target-supports-fo.patch
@@ -1,7 +1,8 @@
1From 8bcdd551f7fe585126ea3173ece976fbc646c34a Mon Sep 17 00:00:00 2001 1From 6b0de6811796b6834d426263eaa855b65c9b3389 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:20 -0700 3Date: Wed, 11 Jan 2017 15:50:35 +0530
4Subject: [PATCH] Add MicroBlaze to target-supports for atomic builtin tests 4Subject: [PATCH 05/54] [Patch, testsuite]: Add MicroBlaze to target-supports
5 for atomic buil. .tin tests
5 6
6MicroBlaze added to supported targets for atomic builtin tests. 7MicroBlaze added to supported targets for atomic builtin tests.
7 8
@@ -13,18 +14,15 @@ Changelog/testsuite
13 check_effective_target_sync_int_long. 14 check_effective_target_sync_int_long.
14 15
15Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 16Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
16Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
17Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
18Upstream-Status: Pending
19--- 17---
20 gcc/testsuite/lib/target-supports.exp | 1 + 18 gcc/testsuite/lib/target-supports.exp | 1 +
21 1 file changed, 1 insertion(+) 19 1 file changed, 1 insertion(+)
22 20
23diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp 21diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
24index 342af270ab..b0f510e596 100644 22index c591acd..94353cc 100644
25--- a/gcc/testsuite/lib/target-supports.exp 23--- a/gcc/testsuite/lib/target-supports.exp
26+++ b/gcc/testsuite/lib/target-supports.exp 24+++ b/gcc/testsuite/lib/target-supports.exp
27@@ -6715,6 +6715,7 @@ proc check_effective_target_sync_int_long { } { 25@@ -7428,6 +7428,7 @@ proc check_effective_target_sync_int_long { } {
28 && [check_effective_target_arm_acq_rel]) 26 && [check_effective_target_arm_acq_rel])
29 || [istarget bfin*-*linux*] 27 || [istarget bfin*-*linux*]
30 || [istarget hppa*-*linux*] 28 || [istarget hppa*-*linux*]
@@ -33,5 +31,5 @@ index 342af270ab..b0f510e596 100644
33 || [istarget powerpc*-*-*] 31 || [istarget powerpc*-*-*]
34 || [istarget crisv32-*-*] || [istarget cris-*-*] 32 || [istarget crisv32-*-*] || [istarget cris-*-*]
35-- 33--
362.14.2 342.7.4
37 35
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0005-Testsuite-explicitly-add-fivopts-for-tests-that-depe.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0005-Testsuite-explicitly-add-fivopts-for-tests-that-depe.patch
index b428d121..b428d121 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0005-Testsuite-explicitly-add-fivopts-for-tests-that-depe.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0005-Testsuite-explicitly-add-fivopts-for-tests-that-depe.patch
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0007-Update-MicroBlaze-strings-test-for-new-scan-assembly.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0006-Patch-testsuite-Update-MicroBlaze-strings-test.patch
index 069329fc..3e2368f2 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0007-Update-MicroBlaze-strings-test-for-new-scan-assembly.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0006-Patch-testsuite-Update-MicroBlaze-strings-test.patch
@@ -1,8 +1,8 @@
1From 4622988b62335af6ef17d58bf10940419fd0f99f Mon Sep 17 00:00:00 2001 1From 0d2cca275f3e85ae42dac7888d862975d65ffb36 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:21 -0700 3Date: Wed, 11 Jan 2017 16:20:01 +0530
4Subject: [PATCH] Update MicroBlaze strings test for new scan-assembly output 4Subject: [PATCH 06/54] [Patch, testsuite]: Update MicroBlaze strings test for
5 resulting in use of $LC label 5 new scan-assembly output resulting in use of $LC label
6 6
7ChangeLog/testsuite 7ChangeLog/testsuite
8 8
@@ -12,15 +12,12 @@ ChangeLog/testsuite
12 to include $LC label. 12 to include $LC label.
13 13
14Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 14Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
15Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
16Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
17Upstream-Status: Pending
18--- 15---
19 gcc/testsuite/gcc.target/microblaze/others/strings1.c | 6 ++++-- 16 gcc/testsuite/gcc.target/microblaze/others/strings1.c | 6 ++++--
20 1 file changed, 4 insertions(+), 2 deletions(-) 17 1 file changed, 4 insertions(+), 2 deletions(-)
21 18
22diff --git a/gcc/testsuite/gcc.target/microblaze/others/strings1.c b/gcc/testsuite/gcc.target/microblaze/others/strings1.c 19diff --git a/gcc/testsuite/gcc.target/microblaze/others/strings1.c b/gcc/testsuite/gcc.target/microblaze/others/strings1.c
23index 7a63faf79f..0403b7bdca 100644 20index 7a63faf..0403b7b 100644
24--- a/gcc/testsuite/gcc.target/microblaze/others/strings1.c 21--- a/gcc/testsuite/gcc.target/microblaze/others/strings1.c
25+++ b/gcc/testsuite/gcc.target/microblaze/others/strings1.c 22+++ b/gcc/testsuite/gcc.target/microblaze/others/strings1.c
26@@ -1,13 +1,15 @@ 23@@ -1,13 +1,15 @@
@@ -42,5 +39,5 @@ index 7a63faf79f..0403b7bdca 100644
42 somefunc (string2); 39 somefunc (string2);
43 } 40 }
44-- 41--
452.14.2 422.7.4
46 43
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0008-Allow-MicroBlaze-.weakext-pattern-in-testsuite.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0007-Patch-testsuite-Allow-MicroBlaze-.weakext-pattern-in.patch
index dbfeb52b..bcd5dbad 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0008-Allow-MicroBlaze-.weakext-pattern-in-testsuite.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0007-Patch-testsuite-Allow-MicroBlaze-.weakext-pattern-in.patch
@@ -1,11 +1,9 @@
1From 037809e91bfed9c501ecd5272ff6d3ce96edf76c Mon Sep 17 00:00:00 2001 1From b6f828da3caa827d8ccc08bbf260a2a01b2b2613 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:22 -0700 3Date: Thu, 12 Jan 2017 16:14:15 +0530
4Subject: [PATCH] Allow MicroBlaze .weakext pattern in testsuite 4Subject: [PATCH 07/54] [Patch, testsuite]: Allow MicroBlaze .weakext pattern
5 5 in regex match Extend regex pattern to include optional ext at the end of
6Allow MicroBlaze .weakext pattern in regex match Extend regex pattern to 6 .weak to match the MicroBlaze weak label .weakext
7include optional ext at the end of .weak to match the MicroBlaze weak
8label .weakext
9 7
10ChangeLog/testsuite 8ChangeLog/testsuite
11 9
@@ -16,9 +14,10 @@ ChangeLog/testsuite
16 * gcc/testsuite/g++.dg/abi/thunk4.C: Likewise. 14 * gcc/testsuite/g++.dg/abi/thunk4.C: Likewise.
17 15
18Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 16Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
19Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com> 17
20Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> 18Conflicts:
21Upstream-Status: Pending 19
20 gcc/testsuite/g++.dg/abi/rtti3.C
22--- 21---
23 gcc/testsuite/g++.dg/abi/rtti3.C | 4 ++-- 22 gcc/testsuite/g++.dg/abi/rtti3.C | 4 ++--
24 gcc/testsuite/g++.dg/abi/thunk3.C | 2 +- 23 gcc/testsuite/g++.dg/abi/thunk3.C | 2 +-
@@ -26,13 +25,13 @@ Upstream-Status: Pending
26 3 files changed, 4 insertions(+), 4 deletions(-) 25 3 files changed, 4 insertions(+), 4 deletions(-)
27 26
28diff --git a/gcc/testsuite/g++.dg/abi/rtti3.C b/gcc/testsuite/g++.dg/abi/rtti3.C 27diff --git a/gcc/testsuite/g++.dg/abi/rtti3.C b/gcc/testsuite/g++.dg/abi/rtti3.C
29index 0316bcb5de..5a39a0811f 100644 28index 0cc7d3e..f284cd9 100644
30--- a/gcc/testsuite/g++.dg/abi/rtti3.C 29--- a/gcc/testsuite/g++.dg/abi/rtti3.C
31+++ b/gcc/testsuite/g++.dg/abi/rtti3.C 30+++ b/gcc/testsuite/g++.dg/abi/rtti3.C
32@@ -3,8 +3,8 @@ 31@@ -3,8 +3,8 @@
33 32
34 // { dg-require-weak "" } 33 // { dg-require-weak "" }
35 // { dg-skip-if "Linkonce not weak" { *-*-mingw* *-*-cygwin } { "*" } { "" } } 34 // { dg-skip-if "Linkonce not weak" { *-*-mingw* *-*-cygwin } }
36-// { dg-final { scan-assembler ".weak\[ \t\]_?_ZTSPP1A" { target { ! { *-*-darwin* hppa*-*-hpux* } } } } } 35-// { dg-final { scan-assembler ".weak\[ \t\]_?_ZTSPP1A" { target { ! { *-*-darwin* hppa*-*-hpux* } } } } }
37-// { dg-final { scan-assembler-not ".weak\[ \t\]_?_ZTIPP1A" { target { ! { *-*-darwin* } } } } } 36-// { dg-final { scan-assembler-not ".weak\[ \t\]_?_ZTIPP1A" { target { ! { *-*-darwin* } } } } }
38+// { dg-final { scan-assembler ".weak(ext)?\[ \t\]_?_ZTSPP1A" { target { ! { *-*-darwin* } } } } } 37+// { dg-final { scan-assembler ".weak(ext)?\[ \t\]_?_ZTSPP1A" { target { ! { *-*-darwin* } } } } }
@@ -41,7 +40,7 @@ index 0316bcb5de..5a39a0811f 100644
41 // { dg-final { scan-assembler-not ".weak_definition\[ \t\]_?_ZTIPP1A" { target { *-*-darwin* } } } } 40 // { dg-final { scan-assembler-not ".weak_definition\[ \t\]_?_ZTIPP1A" { target { *-*-darwin* } } } }
42 41
43diff --git a/gcc/testsuite/g++.dg/abi/thunk3.C b/gcc/testsuite/g++.dg/abi/thunk3.C 42diff --git a/gcc/testsuite/g++.dg/abi/thunk3.C b/gcc/testsuite/g++.dg/abi/thunk3.C
44index f2347f79ec..dcec8a771a 100644 43index f2347f7..dcec8a7 100644
45--- a/gcc/testsuite/g++.dg/abi/thunk3.C 44--- a/gcc/testsuite/g++.dg/abi/thunk3.C
46+++ b/gcc/testsuite/g++.dg/abi/thunk3.C 45+++ b/gcc/testsuite/g++.dg/abi/thunk3.C
47@@ -1,5 +1,5 @@ 46@@ -1,5 +1,5 @@
@@ -52,17 +51,17 @@ index f2347f79ec..dcec8a771a 100644
52 51
53 struct Base 52 struct Base
54diff --git a/gcc/testsuite/g++.dg/abi/thunk4.C b/gcc/testsuite/g++.dg/abi/thunk4.C 53diff --git a/gcc/testsuite/g++.dg/abi/thunk4.C b/gcc/testsuite/g++.dg/abi/thunk4.C
55index fa5fbd4327..79cb311cab 100644 54index 6e8f124..d1d34fe 100644
56--- a/gcc/testsuite/g++.dg/abi/thunk4.C 55--- a/gcc/testsuite/g++.dg/abi/thunk4.C
57+++ b/gcc/testsuite/g++.dg/abi/thunk4.C 56+++ b/gcc/testsuite/g++.dg/abi/thunk4.C
58@@ -1,6 +1,6 @@ 57@@ -1,6 +1,6 @@
59 // { dg-require-weak "" } 58 // { dg-require-weak "" }
60 // { dg-skip-if "Linkonce not weak" { *-*-mingw* *-*-cygwin } { "*" } { "" } } 59 // { dg-skip-if "Linkonce not weak" { *-*-mingw* *-*-cygwin } }
61-// { dg-final { scan-assembler ".weak\[ \t\]_?_ZThn._N7Derived3FooEv" { target { ! { *-*-darwin* } } } } } 60-// { dg-final { scan-assembler ".weak\[ \t\]_?_ZThn._N7Derived3FooEv" { target { ! { *-*-darwin* } } } } }
62+// { dg-final { scan-assembler ".weak(ext)?\[ \t\]_?_ZThn._N7Derived3FooEv" { target { ! { *-*-darwin* } } } } } 61+// { dg-final { scan-assembler ".weak(ext)?\[ \t\]_?_ZThn._N7Derived3FooEv" { target { ! { *-*-darwin* } } } } }
63 // { dg-final { scan-assembler ".weak_definition\[ \t\]_?_ZThn._N7Derived3FooEv" { target { *-*-darwin* } } } } 62 // { dg-final { scan-assembler ".weak_definition\[ \t\]_?_ZThn._N7Derived3FooEv" { target { *-*-darwin* } } } }
64 63
65 struct Base 64 struct Base
66-- 65--
672.14.2 662.7.4
68 67
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0009-Add-MicroBlaze-to-check_profiling_available-Testsuit.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0008-Patch-testsuite-Add-MicroBlaze-to-check_profiling_av.patch
index 6b9dd991..6232535d 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0009-Add-MicroBlaze-to-check_profiling_available-Testsuit.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0008-Patch-testsuite-Add-MicroBlaze-to-check_profiling_av.patch
@@ -1,25 +1,21 @@
1From 23a04c06c2a689fed151eeb94c45ea9b512036ae Mon Sep 17 00:00:00 2001 1From d27a2545486da9c6a4d3d5ca06b4affb83f8d0a1 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:23 -0700 3Date: Thu, 12 Jan 2017 16:34:27 +0530
4Subject: [PATCH] Add MicroBlaze to check_profiling_available Testsuite 4Subject: [PATCH 08/54] [Patch, testsuite]: Add MicroBlaze to
5 5 check_profiling_available Testsuite, add microblaze*-*-* target in
6Add MicroBlaze to check_profiling_available Testsuite, add 6 check_profiling_available inline with other archs setting
7microblaze*-*-* target in check_profiling_available inline with other 7 profiling_available_saved to 0
8archs setting profiling_available_saved to 0
9 8
10Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 9Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
11Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
12Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
13Upstream-Status: Pending
14--- 10---
15 gcc/testsuite/lib/target-supports.exp | 1 + 11 gcc/testsuite/lib/target-supports.exp | 1 +
16 1 file changed, 1 insertion(+) 12 1 file changed, 1 insertion(+)
17 13
18diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp 14diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
19index b0f510e596..fffb690e49 100644 15index 94353cc..ecfbe4d 100644
20--- a/gcc/testsuite/lib/target-supports.exp 16--- a/gcc/testsuite/lib/target-supports.exp
21+++ b/gcc/testsuite/lib/target-supports.exp 17+++ b/gcc/testsuite/lib/target-supports.exp
22@@ -625,6 +625,7 @@ proc check_profiling_available { test_what } { 18@@ -676,6 +676,7 @@ proc check_profiling_available { test_what } {
23 || [istarget m68k-*-elf] 19 || [istarget m68k-*-elf]
24 || [istarget m68k-*-uclinux*] 20 || [istarget m68k-*-uclinux*]
25 || [istarget mips*-*-elf*] 21 || [istarget mips*-*-elf*]
@@ -28,5 +24,5 @@ index b0f510e596..fffb690e49 100644
28 || [istarget mn10300-*-elf*] 24 || [istarget mn10300-*-elf*]
29 || [istarget moxie-*-elf*] 25 || [istarget moxie-*-elf*]
30-- 26--
312.14.2 272.7.4
32 28
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0010-Fix-atomic-side-effects.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0009-Patch-microblaze-Fix-atomic-side-effects.patch
index c21ca816..db730f43 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0010-Fix-atomic-side-effects.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0009-Patch-microblaze-Fix-atomic-side-effects.patch
@@ -1,25 +1,21 @@
1From c1e8a1419e8f5d18e7135fb4fe3bf21941125008 Mon Sep 17 00:00:00 2001 1From 8711bdfe27bce04d35ba93a1d18ccccd61371829 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:24 -0700 3Date: Thu, 12 Jan 2017 16:41:43 +0530
4Subject: [PATCH] Fix atomic side effects. 4Subject: [PATCH 09/54] [Patch, microblaze]: Fix atomic side effects. In
5 5 atomic_compare_and_swapsi, add side effects to prevent incorrect assumptions
6In atomic_compare_and_swapsi, add side effects to prevent incorrect 6 during optimization. Previously, the outputs were considered unused; this
7assumptions during optimization. Previously, the outputs were considered 7 generated assembly code with undefined side effects after invocation of the
8unused; this generated assembly code with undefined side effects after 8 atomic.
9invocation of the atomic.
10 9
11Signed-off-by: Kirk Meyer <kirk.meyer@sencore.com> 10Signed-off-by: Kirk Meyer <kirk.meyer@sencore.com>
12Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 11Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
13Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
14Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
15Upstream-Status: Pending
16--- 12---
17 gcc/config/microblaze/microblaze.md | 3 +++ 13 gcc/config/microblaze/microblaze.md | 3 +++
18 gcc/config/microblaze/sync.md | 21 +++++++++++++-------- 14 gcc/config/microblaze/sync.md | 21 +++++++++++++--------
19 2 files changed, 16 insertions(+), 8 deletions(-) 15 2 files changed, 16 insertions(+), 8 deletions(-)
20 16
21diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md 17diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
22index 8a372d7ebb..59d629b559 100644 18index f698e54..93f5fa2 100644
23--- a/gcc/config/microblaze/microblaze.md 19--- a/gcc/config/microblaze/microblaze.md
24+++ b/gcc/config/microblaze/microblaze.md 20+++ b/gcc/config/microblaze/microblaze.md
25@@ -41,6 +41,9 @@ 21@@ -41,6 +41,9 @@
@@ -33,7 +29,7 @@ index 8a372d7ebb..59d629b559 100644
33 29
34 (define_c_enum "unspec" [ 30 (define_c_enum "unspec" [
35diff --git a/gcc/config/microblaze/sync.md b/gcc/config/microblaze/sync.md 31diff --git a/gcc/config/microblaze/sync.md b/gcc/config/microblaze/sync.md
36index 8125bd8d63..edf4bdd811 100644 32index b34bd54..8e694e9 100644
37--- a/gcc/config/microblaze/sync.md 33--- a/gcc/config/microblaze/sync.md
38+++ b/gcc/config/microblaze/sync.md 34+++ b/gcc/config/microblaze/sync.md
39@@ -18,14 +18,19 @@ 35@@ -18,14 +18,19 @@
@@ -65,5 +61,5 @@ index 8125bd8d63..edf4bdd811 100644
65 "" 61 ""
66 { 62 {
67-- 63--
682.14.2 642.7.4
69 65
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0011-Fix-atomic-boolean-return-value.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0010-Patch-microblaze-Fix-atomic-boolean-return-value.patch
index f4bc16e8..5058529a 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0011-Fix-atomic-boolean-return-value.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0010-Patch-microblaze-Fix-atomic-boolean-return-value.patch
@@ -1,22 +1,18 @@
1From a5957bdf7acfde0a65eeba90bae11f5619bf96af Mon Sep 17 00:00:00 2001 1From 92015c19e5d1baabd62067bf1cfc4522e85d1b25 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:25 -0700 3Date: Thu, 12 Jan 2017 16:45:45 +0530
4Subject: [PATCH] Fix atomic boolean return value. 4Subject: [PATCH 10/54] [Patch, microblaze]: Fix atomic boolean return value.
5 5 In atomic_compare_and_swapsi, fix boolean return value. Previously, it
6In atomic_compare_and_swapsi, fix boolean return value. Previously, it 6 contained zero if successful and non-zero if unsuccessful.
7contained zero if successful and non-zero if unsuccessful.
8 7
9Signed-off-by: Kirk Meyer <kirk.meyer@sencore.com> 8Signed-off-by: Kirk Meyer <kirk.meyer@sencore.com>
10Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 9Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
11Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
12Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
13Upstream-Status: Pending
14--- 10---
15 gcc/config/microblaze/sync.md | 7 ++++--- 11 gcc/config/microblaze/sync.md | 7 ++++---
16 1 file changed, 4 insertions(+), 3 deletions(-) 12 1 file changed, 4 insertions(+), 3 deletions(-)
17 13
18diff --git a/gcc/config/microblaze/sync.md b/gcc/config/microblaze/sync.md 14diff --git a/gcc/config/microblaze/sync.md b/gcc/config/microblaze/sync.md
19index edf4bdd811..aadb414728 100644 15index 8e694e9..8ddb10d 100644
20--- a/gcc/config/microblaze/sync.md 16--- a/gcc/config/microblaze/sync.md
21+++ b/gcc/config/microblaze/sync.md 17+++ b/gcc/config/microblaze/sync.md
22@@ -34,15 +34,16 @@ 18@@ -34,15 +34,16 @@
@@ -40,5 +36,5 @@ index edf4bdd811..aadb414728 100644
40 } 36 }
41 ) 37 )
42-- 38--
432.14.2 392.7.4
44 40
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0011-Patch-microblaze-Fix-the-Microblaze-crash-with-msmal.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0011-Patch-microblaze-Fix-the-Microblaze-crash-with-msmal.patch
new file mode 100644
index 00000000..2451c938
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0011-Patch-microblaze-Fix-the-Microblaze-crash-with-msmal.patch
@@ -0,0 +1,33 @@
1From 658476aef537c0c2d031eb1c7a001f00c1d9bf7b Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Thu, 12 Jan 2017 16:50:17 +0530
4Subject: [PATCH 11/54] [Patch, microblaze]: Fix the Microblaze crash with
5 msmall-divides flag Compiler is crashing when we use msmall-divides and
6 mxl-barrel-shift flag. This is because when use above flags
7 microblaze_expand_divide function will be called for division operation. In
8 microblaze_expand_divide function we are using sub_reg but MicroBlaze doesn't
9 have subreg register due to this compiler was crashing. Changed the logic to
10 avoid sub_reg call
11
12Signed-off-by:Nagaraju Mekala <nmekala@xilix.com>
13---
14 gcc/config/microblaze/microblaze.c | 3 +--
15 1 file changed, 1 insertion(+), 2 deletions(-)
16
17diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
18index 9a4a287..cbe8cb7 100644
19--- a/gcc/config/microblaze/microblaze.c
20+++ b/gcc/config/microblaze/microblaze.c
21@@ -3575,8 +3575,7 @@ microblaze_expand_divide (rtx operands[])
22 mem_rtx = gen_rtx_MEM (QImode,
23 gen_rtx_PLUS (Pmode, regt1, div_table_rtx));
24
25- insn = emit_insn (gen_movqi (regqi, mem_rtx));
26- insn = emit_insn (gen_movsi (operands[0], gen_rtx_SUBREG (SImode, regqi, 0)));
27+ insn = emit_insn (gen_zero_extendqisi2(operands[0],mem_rtx));
28 jump = emit_jump_insn_after (gen_jump (div_end_label), insn);
29 JUMP_LABEL (jump) = div_end_label;
30 LABEL_NUSES (div_end_label) = 1;
31--
322.7.4
33
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0013-Add-MicroBlaze-ashrsi_3_with_size_opt.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0012-Patch-microblaze-Added-ashrsi3_with_size_opt.patch
index 6005e216..b58df873 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0013-Add-MicroBlaze-ashrsi_3_with_size_opt.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0012-Patch-microblaze-Added-ashrsi3_with_size_opt.patch
@@ -1,26 +1,21 @@
1From c32df2ec3d269d19b631a17cea2b6d19bbb98c27 Mon Sep 17 00:00:00 2001 1From 64f1a238641616c9cca5823d7ca99e76a7c2a490 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:27 -0700 3Date: Thu, 12 Jan 2017 16:52:56 +0530
4Subject: [PATCH] Add MicroBlaze ashrsi_3_with_size_opt 4Subject: [PATCH 12/54] [Patch, microblaze]: Added ashrsi3_with_size_opt Added
5 ashrsi3_with_size_opt pattern to optimize the sra instructions when the -Os
6 optimization is used. lshrsi3_with_size_opt is being removed as it has
7 conflicts with unsigned int variables
5 8
6Added ashrsi3_with_size_opt Added ashrsi3_with_size_opt pattern to 9Signed-off-by:Nagaraju Mekala <nmekala@xilix.com>
7optimize the sra instructions when the -Os optimization is used.
8lshrsi3_with_size_opt is being removed as it has conflicts with unsigned
9int variables
10
11Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
12Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
13Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
14Upstream-Status: Pending
15--- 10---
16 gcc/config/microblaze/microblaze.md | 21 +++++++++++++++++++++ 11 gcc/config/microblaze/microblaze.md | 21 +++++++++++++++++++++
17 1 file changed, 21 insertions(+) 12 1 file changed, 21 insertions(+)
18 13
19diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md 14diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
20index 59d629b559..8c0a97e032 100644 15index 93f5fa2..fe90a14 100644
21--- a/gcc/config/microblaze/microblaze.md 16--- a/gcc/config/microblaze/microblaze.md
22+++ b/gcc/config/microblaze/microblaze.md 17+++ b/gcc/config/microblaze/microblaze.md
23@@ -1505,6 +1505,27 @@ 18@@ -1506,6 +1506,27 @@
24 (set_attr "length" "4,4")] 19 (set_attr "length" "4,4")]
25 ) 20 )
26 21
@@ -49,5 +44,5 @@ index 59d629b559..8c0a97e032 100644
49 [(set (match_operand:SI 0 "register_operand" "=&d") 44 [(set (match_operand:SI 0 "register_operand" "=&d")
50 (ashiftrt:SI (match_operand:SI 1 "register_operand" "d") 45 (ashiftrt:SI (match_operand:SI 1 "register_operand" "d")
51-- 46--
522.14.2 472.7.4
53 48
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0015-MicroBlaze-fixed-missing-save-of-r18-in-fast_interru.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0013-Patch-microblaze-Fixed-missing-save-of-r18-in-fast_i.patch
index e75bebeb..6af0f10e 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0015-MicroBlaze-fixed-missing-save-of-r18-in-fast_interru.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0013-Patch-microblaze-Fixed-missing-save-of-r18-in-fast_i.patch
@@ -1,12 +1,10 @@
1From 79ea36649467aea6045a49c7d016f8f9245efb8c Mon Sep 17 00:00:00 2001 1From ed23e22fb25a2d3dc357c0743f51b2735fc46a6a Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:29 -0700 3Date: Thu, 12 Jan 2017 17:50:03 +0530
4Subject: [PATCH] MicroBlaze fixed missing save of r18 in fast_interrupt 4Subject: [PATCH 13/54] [Patch, microblaze]: Fixed missing save of r18 in
5 5 fast_interrupt. Register 18 is used as a clobber register, and must be stored
6Fixed missing save of r18 in fast_interrupt. Register 18 is used as a 6 when entering a fast_interrupt. Before this fix, register 18 was only saved
7clobber register, and must be stored when entering a fast_interrupt. 7 if it was used directly in the interrupt function.
8Before this fix, register 18 was only saved if it was used directly in
9the interrupt function.
10 8
11However, if the fast_interrupt function called a function that used 9However, if the fast_interrupt function called a function that used
12r18, the register would not be saved, and thus be mangled 10r18, the register would not be saved, and thus be mangled
@@ -21,18 +19,15 @@ Changelog
21 19
22Signed-off-by: Klaus Petersen <klauspetersen@gmail.com> 20Signed-off-by: Klaus Petersen <klauspetersen@gmail.com>
23Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 21Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
24Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
25Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
26Upstream-Status: Pending
27--- 22---
28 gcc/config/microblaze/microblaze.c | 2 +- 23 gcc/config/microblaze/microblaze.c | 2 +-
29 1 file changed, 1 insertion(+), 1 deletion(-) 24 1 file changed, 1 insertion(+), 1 deletion(-)
30 25
31diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c 26diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
32index 15080db539..558796cad9 100644 27index cbe8cb7..6f0b4f4 100644
33--- a/gcc/config/microblaze/microblaze.c 28--- a/gcc/config/microblaze/microblaze.c
34+++ b/gcc/config/microblaze/microblaze.c 29+++ b/gcc/config/microblaze/microblaze.c
35@@ -1943,7 +1943,7 @@ microblaze_must_save_register (int regno) 30@@ -1967,7 +1967,7 @@ microblaze_must_save_register (int regno)
36 { 31 {
37 if (df_regs_ever_live_p (regno) 32 if (df_regs_ever_live_p (regno)
38 || regno == MB_ABI_MSR_SAVE_REG 33 || regno == MB_ABI_MSR_SAVE_REG
@@ -42,5 +37,5 @@ index 15080db539..558796cad9 100644
42 || regno == MB_ABI_EXCEPTION_RETURN_ADDR_REGNUM))) 37 || regno == MB_ABI_EXCEPTION_RETURN_ADDR_REGNUM)))
43 return 1; 38 return 1;
44-- 39--
452.14.2 402.7.4
46 41
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0016-MicroBlaze-use-bralid-for-profiler-calls.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0014-Patch-microblaze-Use-bralid-for-profiler-calls.patch
index f5de718e..f47265b0 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0016-MicroBlaze-use-bralid-for-profiler-calls.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0014-Patch-microblaze-Use-bralid-for-profiler-calls.patch
@@ -1,21 +1,18 @@
1From 6ed57ee8219e5d09a294b329dd7c531a1868dc8a Mon Sep 17 00:00:00 2001 1From 582558f3c18d096885ab24e645899f310b148b5c Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:31 -0700 3Date: Tue, 17 Jan 2017 10:57:19 +0530
4Subject: [PATCH] MicroBlaze use bralid for profiler calls 4Subject: [PATCH 14/54] [Patch, microblaze]: Use bralid for profiler calls
5 Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
5 6
6Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
7Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
8Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
9Upstream-Status: Pending
10--- 7---
11 gcc/config/microblaze/microblaze.h | 2 +- 8 gcc/config/microblaze/microblaze.h | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-) 9 1 file changed, 1 insertion(+), 1 deletion(-)
13 10
14diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h 11diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
15index ccd77e8b4d..0dd8b853e2 100644 12index 0d3718f..88e0351 100644
16--- a/gcc/config/microblaze/microblaze.h 13--- a/gcc/config/microblaze/microblaze.h
17+++ b/gcc/config/microblaze/microblaze.h 14+++ b/gcc/config/microblaze/microblaze.h
18@@ -519,7 +519,7 @@ typedef struct microblaze_args 15@@ -486,7 +486,7 @@ typedef struct microblaze_args
19 16
20 #define FUNCTION_PROFILER(FILE, LABELNO) { \ 17 #define FUNCTION_PROFILER(FILE, LABELNO) { \
21 { \ 18 { \
@@ -25,5 +22,5 @@ index ccd77e8b4d..0dd8b853e2 100644
25 } 22 }
26 23
27-- 24--
282.14.2 252.7.4
29 26
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0015-Patch-microblaze-Disable-fivopts-by-default.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0015-Patch-microblaze-Disable-fivopts-by-default.patch
new file mode 100644
index 00000000..acfa083f
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0015-Patch-microblaze-Disable-fivopts-by-default.patch
@@ -0,0 +1,42 @@
1From b60068cbdd3c830e541fbd35f2ed119245911461 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 17 Jan 2017 11:10:21 +0530
4Subject: [PATCH 15/54] [Patch, microblaze]: Disable fivopts by default Turn
5 off ivopts by default. Interferes with cse.
6
7Changelog
8
92013-03-18 Edgar E. Iglesias <edgar.iglesias@xilinx.com>
10
11 * gcc/common/config/microblaze/microblaze-common.c
12 (microblaze_option_optimization_table): Disable fivopts by default.
13
14Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
15Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
16---
17 gcc/common/config/microblaze/microblaze-common.c | 9 +++++++++
18 1 file changed, 9 insertions(+)
19
20diff --git a/gcc/common/config/microblaze/microblaze-common.c b/gcc/common/config/microblaze/microblaze-common.c
21index 3e75675..fe45f2e 100644
22--- a/gcc/common/config/microblaze/microblaze-common.c
23+++ b/gcc/common/config/microblaze/microblaze-common.c
24@@ -24,6 +24,15 @@
25 #include "common/common-target.h"
26 #include "common/common-target-def.h"
27
28+/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
29+static const struct default_options microblaze_option_optimization_table[] =
30+ {
31+ /* Turn off ivopts by default. It messes up cse. */
32+ { OPT_LEVELS_ALL, OPT_fivopts, NULL, 0 },
33+ { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
34+ { OPT_LEVELS_NONE, 0, NULL, 0 }
35+ };
36+
37 #undef TARGET_DEFAULT_TARGET_FLAGS
38 #define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
39
40--
412.7.4
42
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0014-Removed-MicroBlaze-moddi3-routinue.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0016-Patch-microblaze-Removed-moddi3-routinue.patch
index b0195718..dbd7b2e2 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0014-Removed-MicroBlaze-moddi3-routinue.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0016-Patch-microblaze-Removed-moddi3-routinue.patch
@@ -1,30 +1,25 @@
1From a68e94fc57bcf60cb730894e49dde55d081397f5 Mon Sep 17 00:00:00 2001 1From 640628680ff6f028ad6d5fef2e41da29664f036f Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:28 -0700 3Date: Thu, 12 Jan 2017 17:36:16 +0530
4Subject: [PATCH] Removed MicroBlaze moddi3 routinue 4Subject: [PATCH 16/54] [Patch, microblaze]: Removed moddi3 routinue Using the
5 default moddi3 function as the existing implementation has many bugs
5 6
6Removed moddi3 routinue Using the default moddi3 function as the 7Signed-off-by:Nagaraju <nmekala@xilix.com>
7existing implementation has many bugs
8
9Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
10Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
11Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
12Upstream-Status: Pending
13--- 8---
14 libgcc/config/microblaze/moddi3.S | 115 ---------------------------------- 9 libgcc/config/microblaze/moddi3.S | 121 ----------------------------------
15 libgcc/config/microblaze/t-microblaze | 3 +- 10 libgcc/config/microblaze/t-microblaze | 3 +-
16 2 files changed, 1 insertion(+), 117 deletions(-) 11 2 files changed, 1 insertion(+), 123 deletions(-)
17 delete mode 100644 libgcc/config/microblaze/moddi3.S 12 delete mode 100644 libgcc/config/microblaze/moddi3.S
18 13
19diff --git a/libgcc/config/microblaze/moddi3.S b/libgcc/config/microblaze/moddi3.S 14diff --git a/libgcc/config/microblaze/moddi3.S b/libgcc/config/microblaze/moddi3.S
20deleted file mode 100644 15deleted file mode 100644
21index bcea079476..0000000000 16index a8f17d7..0000000
22--- a/libgcc/config/microblaze/moddi3.S 17--- a/libgcc/config/microblaze/moddi3.S
23+++ /dev/null 18+++ /dev/null
24@@ -1,115 +0,0 @@ 19@@ -1,121 +0,0 @@
25-################################### 20-###################################
26-# 21-#
27-# Copyright (C) 2009-2017 Free Software Foundation, Inc. 22-# Copyright (C) 2009-2018 Free Software Foundation, Inc.
28-# 23-#
29-# Contributed by Michael Eager <eager@eagercon.com>. 24-# Contributed by Michael Eager <eager@eagercon.com>.
30-# 25-#
@@ -54,6 +49,12 @@ index bcea079476..0000000000
54-####################################### 49-#######################################
55- 50-
56- 51-
52-/* An executable stack is *not* required for these functions. */
53-#ifdef __linux__
54-.section .note.GNU-stack,"",%progbits
55-.previous
56-#endif
57-
57- .globl __moddi3 58- .globl __moddi3
58- .ent __moddi3 59- .ent __moddi3
59-__moddi3: 60-__moddi3:
@@ -138,7 +139,7 @@ index bcea079476..0000000000
138- .end __moddi3 139- .end __moddi3
139- 140-
140diff --git a/libgcc/config/microblaze/t-microblaze b/libgcc/config/microblaze/t-microblaze 141diff --git a/libgcc/config/microblaze/t-microblaze b/libgcc/config/microblaze/t-microblaze
141index 96959f0292..8d954a4957 100644 142index 96959f0..8d954a4 100644
142--- a/libgcc/config/microblaze/t-microblaze 143--- a/libgcc/config/microblaze/t-microblaze
143+++ b/libgcc/config/microblaze/t-microblaze 144+++ b/libgcc/config/microblaze/t-microblaze
144@@ -1,8 +1,7 @@ 145@@ -1,8 +1,7 @@
@@ -152,5 +153,5 @@ index 96959f0292..8d954a4957 100644
152 $(srcdir)/config/microblaze/muldi3_hard.S \ 153 $(srcdir)/config/microblaze/muldi3_hard.S \
153 $(srcdir)/config/microblaze/mulsi3.S \ 154 $(srcdir)/config/microblaze/mulsi3.S \
154-- 155--
1552.14.2 1562.7.4
156 157
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0018-Add-INIT_PRIORITY-support-Added-TARGET_ASM_CONSTRUCT.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0017-Patch-microblaze-Add-INIT_PRIORITY-support.patch
index 5239d2bd..6fb1b32f 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0018-Add-INIT_PRIORITY-support-Added-TARGET_ASM_CONSTRUCT.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0017-Patch-microblaze-Add-INIT_PRIORITY-support.patch
@@ -1,8 +1,8 @@
1From 02d8afd50a868e827ac8b6b6243c69922cd694ed Mon Sep 17 00:00:00 2001 1From c0e74b79cc1db2f68dd560154225da1e5ddfd920 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:34 -0700 3Date: Tue, 17 Jan 2017 14:41:58 +0530
4Subject: [PATCH] Add INIT_PRIORITY support Added TARGET_ASM_CONSTRUCTOR and 4Subject: [PATCH 17/54] [Patch, microblaze]: Add INIT_PRIORITY support Added
5 TARGET_ASM_DESTRUCTOR macros. 5 TARGET_ASM_CONSTRUCTOR and TARGET_ASM_DESTRUCTOR macros.
6 6
7These macros allows users to control the order of initialization 7These macros allows users to control the order of initialization
8of objects defined at namespace scope with the init_priority 8of objects defined at namespace scope with the init_priority
@@ -19,20 +19,17 @@ Changelog
19 microblaze_asm_destructor. Define TARGET_ASM_CONSTRUCTOR and 19 microblaze_asm_destructor. Define TARGET_ASM_CONSTRUCTOR and
20 TARGET_ASM_DESTRUCTOR. 20 TARGET_ASM_DESTRUCTOR.
21 21
22Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com> 22Signed-off-by:nagaraju <nmekala@xilix.com>
23Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 23Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
24Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
25Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
26Upstream-Status: Pending
27--- 24---
28 gcc/config/microblaze/microblaze.c | 53 ++++++++++++++++++++++++++++++++++++++ 25 gcc/config/microblaze/microblaze.c | 53 ++++++++++++++++++++++++++++++++++++++
29 1 file changed, 53 insertions(+) 26 1 file changed, 53 insertions(+)
30 27
31diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c 28diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
32index 558796cad9..c1b0172bcf 100644 29index 6f0b4f4..53b44df 100644
33--- a/gcc/config/microblaze/microblaze.c 30--- a/gcc/config/microblaze/microblaze.c
34+++ b/gcc/config/microblaze/microblaze.c 31+++ b/gcc/config/microblaze/microblaze.c
35@@ -2530,6 +2530,53 @@ print_operand_address (FILE * file, rtx addr) 32@@ -2554,6 +2554,53 @@ print_operand_address (FILE * file, rtx addr)
36 } 33 }
37 } 34 }
38 35
@@ -86,7 +83,7 @@ index 558796cad9..c1b0172bcf 100644
86 /* Emit either a label, .comm, or .lcomm directive, and mark that the symbol 83 /* Emit either a label, .comm, or .lcomm directive, and mark that the symbol
87 is used, so that we don't emit an .extern for it in 84 is used, so that we don't emit an .extern for it in
88 microblaze_asm_file_end. */ 85 microblaze_asm_file_end. */
89@@ -3775,6 +3822,12 @@ microblaze_machine_dependent_reorg (void) 86@@ -3841,6 +3888,12 @@ microblaze_starting_frame_offset (void)
90 #undef TARGET_ATTRIBUTE_TABLE 87 #undef TARGET_ATTRIBUTE_TABLE
91 #define TARGET_ATTRIBUTE_TABLE microblaze_attribute_table 88 #define TARGET_ATTRIBUTE_TABLE microblaze_attribute_table
92 89
@@ -100,5 +97,5 @@ index 558796cad9..c1b0172bcf 100644
100 #define TARGET_IN_SMALL_DATA_P microblaze_elf_in_small_data_p 97 #define TARGET_IN_SMALL_DATA_P microblaze_elf_in_small_data_p
101 98
102-- 99--
1032.14.2 1002.7.4
104 101
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0019-MicroBlaze-add-optimized-lshrsi3-When-barrel-shifter.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0018-Patch-microblaze-Add-optimized-lshrsi3.patch
index 049ce3fe..ab2473a3 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0019-MicroBlaze-add-optimized-lshrsi3-When-barrel-shifter.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0018-Patch-microblaze-Add-optimized-lshrsi3.patch
@@ -1,12 +1,9 @@
1From 0b2061ac7706df97da3e8b3c01c6a5cfc504c16e Mon Sep 17 00:00:00 2001 1From 2cba68c3e27ffaea77cc5469233cf4dcb9383142 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:35 -0700 3Date: Tue, 17 Jan 2017 15:23:57 +0530
4Subject: [PATCH] MicroBlaze add optimized lshrsi3 When barrel shifter is not 4Subject: [PATCH 18/54] [Patch, microblaze]: Add optimized lshrsi3 When barrel
5 present 5 shifter is not present, the immediate value is greater than #5 and
6 6 optimization is -OS, the compiler will generate shift operation using loop.
7Add optimized lshrsi3 When barrel shifter is not present, the immediate
8value is greater than #5 and optimization is -OS, the compiler will
9generate shift operation using loop.
10 7
11Changelog 8Changelog
12 9
@@ -20,11 +17,8 @@ ChangeLog/testsuite
20 17
21 * gcc/testsuite/gcc.target/microblaze/others/lshrsi_Os_1.c: New test. 18 * gcc/testsuite/gcc.target/microblaze/others/lshrsi_Os_1.c: New test.
22 19
23Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com> 20Signed-off-by:Nagaraju <nmekala@xilix.com>
24Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 21Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
25Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
26Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
27Upstream-Status: Pending
28--- 22---
29 gcc/config/microblaze/microblaze.md | 21 +++++++++++++++++++++ 23 gcc/config/microblaze/microblaze.md | 21 +++++++++++++++++++++
30 .../gcc.target/microblaze/others/lshrsi_Os_1.c | 13 +++++++++++++ 24 .../gcc.target/microblaze/others/lshrsi_Os_1.c | 13 +++++++++++++
@@ -32,10 +26,10 @@ Upstream-Status: Pending
32 create mode 100644 gcc/testsuite/gcc.target/microblaze/others/lshrsi_Os_1.c 26 create mode 100644 gcc/testsuite/gcc.target/microblaze/others/lshrsi_Os_1.c
33 27
34diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md 28diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
35index 8c0a97e032..abbe97c15f 100644 29index fe90a14..c063ffc 100644
36--- a/gcc/config/microblaze/microblaze.md 30--- a/gcc/config/microblaze/microblaze.md
37+++ b/gcc/config/microblaze/microblaze.md 31+++ b/gcc/config/microblaze/microblaze.md
38@@ -1615,6 +1615,27 @@ 32@@ -1616,6 +1616,27 @@
39 (set_attr "length" "4,4")] 33 (set_attr "length" "4,4")]
40 ) 34 )
41 35
@@ -65,7 +59,7 @@ index 8c0a97e032..abbe97c15f 100644
65 (lshiftrt:SI (match_operand:SI 1 "register_operand" "d") 59 (lshiftrt:SI (match_operand:SI 1 "register_operand" "d")
66diff --git a/gcc/testsuite/gcc.target/microblaze/others/lshrsi_Os_1.c b/gcc/testsuite/gcc.target/microblaze/others/lshrsi_Os_1.c 60diff --git a/gcc/testsuite/gcc.target/microblaze/others/lshrsi_Os_1.c b/gcc/testsuite/gcc.target/microblaze/others/lshrsi_Os_1.c
67new file mode 100644 61new file mode 100644
68index 0000000000..32a3be7c76 62index 0000000..32a3be7
69--- /dev/null 63--- /dev/null
70+++ b/gcc/testsuite/gcc.target/microblaze/others/lshrsi_Os_1.c 64+++ b/gcc/testsuite/gcc.target/microblaze/others/lshrsi_Os_1.c
71@@ -0,0 +1,13 @@ 65@@ -0,0 +1,13 @@
@@ -83,5 +77,5 @@ index 0000000000..32a3be7c76
83+/* { dg-final { scan-assembler "bneid\tr18,.-4" } } */ 77+/* { dg-final { scan-assembler "bneid\tr18,.-4" } } */
84+/* { dg-final { scan-assembler "\srl\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])" } } */ 78+/* { dg-final { scan-assembler "\srl\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])" } } */
85-- 79--
862.14.2 802.7.4
87 81
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0019-Patch-microblaze-Modified-trap-instruction.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0019-Patch-microblaze-Modified-trap-instruction.patch
new file mode 100644
index 00000000..5afcff43
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0019-Patch-microblaze-Modified-trap-instruction.patch
@@ -0,0 +1,29 @@
1From e8b05b5105655d276c93864ab90e15bfbe46cf74 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 17 Jan 2017 15:42:15 +0530
4Subject: [PATCH 19/54] [Patch, microblaze]: Modified trap instruction The
5 instruction was wrongly written to brki r0,-1 it should be bri r0. Modified
6 with the correct instruction
7
8Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
9 :Ajit Agarwal <ajitkum@xilinx.com>
10---
11 gcc/config/microblaze/microblaze.md | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
15index c063ffc..7bbdbe1 100644
16--- a/gcc/config/microblaze/microblaze.md
17+++ b/gcc/config/microblaze/microblaze.md
18@@ -2344,7 +2344,7 @@
19 (define_insn "trap"
20 [(trap_if (const_int 1) (const_int 0))]
21 ""
22- "brki\tr0,-1"
23+ "bri\t0"
24 [(set_attr "type" "trap")]
25 )
26
27--
282.7.4
29
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0021-Reducing-Stack-space-for-arguments-Currently-in-Micr.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0020-Patch-microblaze-Reducing-Stack-space-for-arguments.patch
index ead929ab..6e07ac4f 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0021-Reducing-Stack-space-for-arguments-Currently-in-Micr.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0020-Patch-microblaze-Reducing-Stack-space-for-arguments.patch
@@ -1,26 +1,20 @@
1From f5416ee7ddc6e4853e57ed15fb2bf630de2c3b12 Mon Sep 17 00:00:00 2001 1From 0cc6aabbd3f7b331c3995f11efec545499297358 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:37 -0700 3Date: Tue, 17 Jan 2017 16:42:44 +0530
4Subject: [PATCH] Reducing Stack space for arguments Currently in Microblaze 4Subject: [PATCH 20/54] [Patch, microblaze]: Reducing Stack space for arguments
5 target stack space 5 Currently in Microblaze target stack space for arguments in register is being
6 allocated even if there are no arguments in the function. This patch will
7 optimize the extra 24 bytes that are being allocated.
6 8
7Reducing Stack space for arguments Currently in Microblaze target stack 9Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
8space for arguments in register is being allocated even if there are no 10 :Ajit Agarwal <ajitkum@xilinx.com>
9arguments in the function. This patch will optimize the extra 24 bytes
10that are being allocated.
11 11
12ChangeLog: 12ChangeLog:
132015-04-17 Nagaraju Mekala <nagaraju.mekala@xilinx.com> 132015-04-17 Nagaraju Mekala <nmekala@xilix.com>
14 Ajit Agarwal <ajitkum@xilinx.com> 14 Ajit Agarwal <ajitkum@xilinx.com>
15 15
16 * microblaze.c (microblaze_parm_needs_stack, microblaze_function_parms_need_stack): New 16 *microblaze.c (microblaze_parm_needs_stack, microblaze_function_parms_need_stack): New
17 * microblaze.c (REG_PARM_STACK_SPACE): Modify 17 *microblaze.c (REG_PARM_STACK_SPACE): Modify
18
19Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
20Signed-off-by: Ajit Agarwal <ajitkum@xilinx.com>
21Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
22Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
23Upstream-Status: Pending
24--- 18---
25 gcc/config/microblaze/microblaze-protos.h | 1 + 19 gcc/config/microblaze/microblaze-protos.h | 1 +
26 gcc/config/microblaze/microblaze.c | 134 +++++++++++++++++++++++++++++- 20 gcc/config/microblaze/microblaze.c | 134 +++++++++++++++++++++++++++++-
@@ -28,10 +22,10 @@ Upstream-Status: Pending
28 3 files changed, 136 insertions(+), 3 deletions(-) 22 3 files changed, 136 insertions(+), 3 deletions(-)
29 23
30diff --git a/gcc/config/microblaze/microblaze-protos.h b/gcc/config/microblaze/microblaze-protos.h 24diff --git a/gcc/config/microblaze/microblaze-protos.h b/gcc/config/microblaze/microblaze-protos.h
31index b56e052ae4..a1408629cc 100644 25index 4cbba0c..f8a56f7 100644
32--- a/gcc/config/microblaze/microblaze-protos.h 26--- a/gcc/config/microblaze/microblaze-protos.h
33+++ b/gcc/config/microblaze/microblaze-protos.h 27+++ b/gcc/config/microblaze/microblaze-protos.h
34@@ -57,6 +57,7 @@ extern int symbol_mentioned_p (rtx); 28@@ -58,6 +58,7 @@ extern int symbol_mentioned_p (rtx);
35 extern int label_mentioned_p (rtx); 29 extern int label_mentioned_p (rtx);
36 extern bool microblaze_cannot_force_const_mem (machine_mode, rtx); 30 extern bool microblaze_cannot_force_const_mem (machine_mode, rtx);
37 extern void microblaze_eh_return (rtx op0); 31 extern void microblaze_eh_return (rtx op0);
@@ -40,10 +34,10 @@ index b56e052ae4..a1408629cc 100644
40 34
41 /* Declare functions in microblaze-c.c. */ 35 /* Declare functions in microblaze-c.c. */
42diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c 36diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
43index c1b0172bcf..f46dffff0d 100644 37index 53b44df..0dec362 100644
44--- a/gcc/config/microblaze/microblaze.c 38--- a/gcc/config/microblaze/microblaze.c
45+++ b/gcc/config/microblaze/microblaze.c 39+++ b/gcc/config/microblaze/microblaze.c
46@@ -1965,6 +1965,138 @@ microblaze_must_save_register (int regno) 40@@ -1989,6 +1989,138 @@ microblaze_must_save_register (int regno)
47 return 0; 41 return 0;
48 } 42 }
49 43
@@ -182,7 +176,7 @@ index c1b0172bcf..f46dffff0d 100644
182 /* Return the bytes needed to compute the frame pointer from the current 176 /* Return the bytes needed to compute the frame pointer from the current
183 stack pointer. 177 stack pointer.
184 178
185@@ -3275,7 +3407,7 @@ microblaze_asm_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, 179@@ -3298,7 +3430,7 @@ microblaze_asm_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
186 emit_insn (gen_indirect_jump (temp2)); 180 emit_insn (gen_indirect_jump (temp2));
187 181
188 /* Run just enough of rest_of_compilation. This sequence was 182 /* Run just enough of rest_of_compilation. This sequence was
@@ -192,10 +186,10 @@ index c1b0172bcf..f46dffff0d 100644
192 shorten_branches (insn); 186 shorten_branches (insn);
193 final_start_function (insn, file, 1); 187 final_start_function (insn, file, 1);
194diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h 188diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
195index 0dd8b853e2..82e7e890be 100644 189index 88e0351..9f74ec8 100644
196--- a/gcc/config/microblaze/microblaze.h 190--- a/gcc/config/microblaze/microblaze.h
197+++ b/gcc/config/microblaze/microblaze.h 191+++ b/gcc/config/microblaze/microblaze.h
198@@ -467,9 +467,9 @@ extern struct microblaze_frame_info current_frame_info; 192@@ -434,9 +434,9 @@ extern struct microblaze_frame_info current_frame_info;
199 193
200 #define ARG_POINTER_CFA_OFFSET(FNDECL) 0 194 #define ARG_POINTER_CFA_OFFSET(FNDECL) 0
201 195
@@ -208,5 +202,5 @@ index 0dd8b853e2..82e7e890be 100644
208 #define STACK_BOUNDARY 32 202 #define STACK_BOUNDARY 32
209 203
210-- 204--
2112.14.2 2052.7.4
212 206
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0021-Patch-microblaze-Add-cbranchsi4_reg.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0021-Patch-microblaze-Add-cbranchsi4_reg.patch
new file mode 100644
index 00000000..b04ee580
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0021-Patch-microblaze-Add-cbranchsi4_reg.patch
@@ -0,0 +1,159 @@
1From f846bd900d5277dd9defb5fe0625f97e3417ee61 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 17 Jan 2017 17:04:37 +0530
4Subject: [PATCH 21/54] [Patch, microblaze]: Add cbranchsi4_reg This patch
5 optimizes the generation of pcmpne/pcmpeq instruction if the compare
6 instruction has no immediate values.For the immediate values the xor
7 instruction is generated
8
9Signed-off-by: Nagaraju Mekala <nmekala@xilix.com>
10Signed-off-by: Ajit Agarwal <ajitkum@xilinx.com>
11
12ChangeLog:
132015-01-13 Nagaraju Mekala <nmekala@xilix.com>
14 Ajit Agarwal <ajitkum@xilinx.com>
15
16 *microblaze.md (cbranchsi4_reg): New
17 *microblaze.c (microblaze_expand_conditional_branch_reg): New
18
19Conflicts:
20
21 gcc/config/microblaze/microblaze-protos.h
22---
23 gcc/config/microblaze/microblaze-protos.h | 2 +-
24 gcc/testsuite/gcc.target/microblaze/isa/fcmp1.c | 2 +-
25 gcc/testsuite/gcc.target/microblaze/isa/fcmp2.c | 2 +-
26 gcc/testsuite/gcc.target/microblaze/isa/fcmp3.c | 2 +-
27 gcc/testsuite/gcc.target/microblaze/isa/fcmp4.c | 2 +-
28 gcc/testsuite/gcc.target/microblaze/isa/nofcmp.c | 14 +++++++-------
29 gcc/testsuite/gcc.target/microblaze/isa/vanilla.c | 12 ++++++------
30 gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c | 2 +-
31 8 files changed, 19 insertions(+), 19 deletions(-)
32
33diff --git a/gcc/config/microblaze/microblaze-protos.h b/gcc/config/microblaze/microblaze-protos.h
34index f8a56f7..c39e2e9 100644
35--- a/gcc/config/microblaze/microblaze-protos.h
36+++ b/gcc/config/microblaze/microblaze-protos.h
37@@ -32,7 +32,7 @@ extern int microblaze_expand_shift (rtx *);
38 extern bool microblaze_expand_move (machine_mode, rtx *);
39 extern bool microblaze_expand_block_move (rtx, rtx, rtx, rtx);
40 extern void microblaze_expand_divide (rtx *);
41-extern void microblaze_expand_conditional_branch (machine_mode, rtx *);
42+extern void microblaze_expand_conditional_branch (enum machine_mode, rtx *);
43 extern void microblaze_expand_conditional_branch_reg (machine_mode, rtx *);
44 extern void microblaze_expand_conditional_branch_sf (rtx *);
45 extern int microblaze_can_use_return_insn (void);
46diff --git a/gcc/testsuite/gcc.target/microblaze/isa/fcmp1.c b/gcc/testsuite/gcc.target/microblaze/isa/fcmp1.c
47index 4041a24..ccc6a46 100644
48--- a/gcc/testsuite/gcc.target/microblaze/isa/fcmp1.c
49+++ b/gcc/testsuite/gcc.target/microblaze/isa/fcmp1.c
50@@ -6,5 +6,5 @@ void float_func ()
51 {
52 /* { dg-final { scan-assembler "fcmp\.(le|gt)\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
53 if (f2 <= f3)
54- print ("le");
55+ f2 = f3;
56 }
57diff --git a/gcc/testsuite/gcc.target/microblaze/isa/fcmp2.c b/gcc/testsuite/gcc.target/microblaze/isa/fcmp2.c
58index 3902b83..1dd5fe6 100644
59--- a/gcc/testsuite/gcc.target/microblaze/isa/fcmp2.c
60+++ b/gcc/testsuite/gcc.target/microblaze/isa/fcmp2.c
61@@ -6,5 +6,5 @@ void float_func ()
62 {
63 /* { dg-final { scan-assembler "fcmp\.(lt|ge)\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
64 if (f2 < f3)
65- print ("lt");
66+ f2 = f3;
67 }
68diff --git a/gcc/testsuite/gcc.target/microblaze/isa/fcmp3.c b/gcc/testsuite/gcc.target/microblaze/isa/fcmp3.c
69index 8555974..d6f80fb 100644
70--- a/gcc/testsuite/gcc.target/microblaze/isa/fcmp3.c
71+++ b/gcc/testsuite/gcc.target/microblaze/isa/fcmp3.c
72@@ -6,5 +6,5 @@ void float_func ()
73 {
74 /* { dg-final { scan-assembler "fcmp\.(eq|ne)\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
75 if (f2 == f3)
76- print ("eq");
77+ f1 = f2 + f3;
78 }
79diff --git a/gcc/testsuite/gcc.target/microblaze/isa/fcmp4.c b/gcc/testsuite/gcc.target/microblaze/isa/fcmp4.c
80index 79cc5f9..d117724 100644
81--- a/gcc/testsuite/gcc.target/microblaze/isa/fcmp4.c
82+++ b/gcc/testsuite/gcc.target/microblaze/isa/fcmp4.c
83@@ -5,5 +5,5 @@ void float_func(float f1, float f2, float f3)
84 /* { dg-final { scan-assembler "fcmp\.eq\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
85 /* { dg-final { scan-assembler "fcmp\.le\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r(\[0-9]\|\[1-2]\[0-9]\|3\[0-1])\[^0-9]" } } */
86 if(f1==f2 && f1<=f3)
87- print ("f1 eq f2 && f1 le f3");
88+ f2 = f3;
89 }
90diff --git a/gcc/testsuite/gcc.target/microblaze/isa/nofcmp.c b/gcc/testsuite/gcc.target/microblaze/isa/nofcmp.c
91index ebfb170..7582297 100644
92--- a/gcc/testsuite/gcc.target/microblaze/isa/nofcmp.c
93+++ b/gcc/testsuite/gcc.target/microblaze/isa/nofcmp.c
94@@ -5,17 +5,17 @@ volatile float f1, f2, f3;
95 void float_func ()
96 {
97 /* { dg-final { scan-assembler-not "fcmp" } } */
98- if (f2 <= f3)
99- print ("le");
100+ if (f2 <= f3)
101+ f1 = f3;
102 else if (f2 == f3)
103- print ("eq");
104+ f1 = f3;
105 else if (f2 < f3)
106- print ("lt");
107+ f1 = f3;
108 else if (f2 > f3)
109- print ("gt");
110+ f1 = f3;
111 else if (f2 >= f3)
112- print ("ge");
113+ f1 = f3;
114 else if (f2 != f3)
115- print ("ne");
116+ f1 = f3;
117
118 }
119diff --git a/gcc/testsuite/gcc.target/microblaze/isa/vanilla.c b/gcc/testsuite/gcc.target/microblaze/isa/vanilla.c
120index 1d6ba80..532c035 100644
121--- a/gcc/testsuite/gcc.target/microblaze/isa/vanilla.c
122+++ b/gcc/testsuite/gcc.target/microblaze/isa/vanilla.c
123@@ -74,16 +74,16 @@ void float_cmp_func ()
124 {
125 /* { dg-final { scan-assembler-not "fcmp" } } */
126 if (f2 <= f3)
127- print ("le");
128+ f1 = f3;
129 else if (f2 == f3)
130- print ("eq");
131+ f1 = f3;
132 else if (f2 < f3)
133- print ("lt");
134+ f1 = f3;
135 else if (f2 > f3)
136- print ("gt");
137+ f1 = f3;
138 else if (f2 >= f3)
139- print ("ge");
140+ f1 = f3;
141 else if (f2 != f3)
142- print ("ne");
143+ f1 = f3;
144
145 }
146diff --git a/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c b/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c
147index fdcde1f..580b4db 100644
148--- a/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c
149+++ b/gcc/testsuite/gcc.target/microblaze/others/builtin-trap.c
150@@ -5,4 +5,4 @@ void trap ()
151 __builtin_trap ();
152 }
153
154-/* { dg-final { scan-assembler "brki\tr0,-1" } } */
155\ No newline at end of file
156+/* { dg-final { scan-assembler "bri\t0" } } */
157--
1582.7.4
159
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0022-Patch-microblaze-Inline-Expansion-of-fsqrt-builtin.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0022-Patch-microblaze-Inline-Expansion-of-fsqrt-builtin.patch
new file mode 100644
index 00000000..beeb80fd
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0022-Patch-microblaze-Inline-Expansion-of-fsqrt-builtin.patch
@@ -0,0 +1,58 @@
1From 7d70a287544dd915b66a5658a3857ebecb8b3583 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 17 Jan 2017 17:11:04 +0530
4Subject: [PATCH 22/54] [Patch,microblaze]: Inline Expansion of fsqrt builtin.
5 The changes are made in the patch for the inline expansion of the fsqrt
6 builtin with fqrt instruction. The sqrt math function takes double as
7 argument and return double as argument. The pattern is selected while
8 expanding the unary op through expand_unop which passes DFmode and the DFmode
9 pattern was not there returning zero. Thus the sqrt math function is not
10 inlined and expanded. The pattern with DFmode argument is added. Also the
11 source and destination argument is not same the DF through two different
12 consecutive registers with lower 32 bit is the argument passed to sqrt and
13 the higher 32 bit is zero. If the source and destinations are different the
14 DFmode 64 bits registers is not set properly giving the problem in runtime.
15 Such changes are taken care in the implementation of the pattern for DFmode
16 for inline expansion of the sqrt.
17
18ChangeLog:
192015-06-16 Ajit Agarwal <ajitkum@xilinx.com>
20 Nagaraju Mekala <nmekala@xilinx.com>
21
22 * config/microblaze/microblaze.md (sqrtdf2): New
23 pattern.
24
25Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
26 Nagaraju Mekala nmekala@xilinx.com
27---
28 gcc/config/microblaze/microblaze.md | 14 ++++++++++++++
29 1 file changed, 14 insertions(+)
30
31diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
32index 7bbdbe1..3a53e24 100644
33--- a/gcc/config/microblaze/microblaze.md
34+++ b/gcc/config/microblaze/microblaze.md
35@@ -449,6 +449,20 @@
36 (set_attr "mode" "SF")
37 (set_attr "length" "4")])
38
39+(define_insn "sqrtdf2"
40+ [(set (match_operand:DF 0 "register_operand" "=d")
41+ (sqrt:DF (match_operand:DF 1 "register_operand" "dG")))]
42+ "TARGET_HARD_FLOAT && TARGET_FLOAT_SQRT"
43+ {
44+ if (REGNO (operands[0]) == REGNO (operands[1]))
45+ return "fsqrt\t%0,%1";
46+ else
47+ return "fsqrt\t%0,%1\n\taddk\t%D0,%D1,r0";
48+ }
49+ [(set_attr "type" "fsqrt")
50+ (set_attr "mode" "SF")
51+ (set_attr "length" "4")])
52+
53 (define_insn "fix_truncsfsi2"
54 [(set (match_operand:SI 0 "register_operand" "=d")
55 (fix:SI (match_operand:SF 1 "register_operand" "d")))]
56--
572.7.4
58
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0023-Patch-OPT-Update-heuristics-for-loop-invariant-for-a.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0023-Patch-OPT-Update-heuristics-for-loop-invariant-for-a.patch
new file mode 100644
index 00000000..8f5bed52
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0023-Patch-OPT-Update-heuristics-for-loop-invariant-for-a.patch
@@ -0,0 +1,47 @@
1From a28768eec0a9d5137196bed8e8c6d284cf4c3cbc Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 17 Jan 2017 17:33:31 +0530
4Subject: [PATCH 23/54] [Patch] OPT: Update heuristics for loop-invariant for
5 address arithme. .tic.
6
7The changes are made in the patch to update the heuristics
8for loop invariant for address arithmetic. The heuristics is
9changed to calculate the estimated register pressure cost when
10ira based register pressure is not enabled. The estimated
11register pressure cost modifies the existing calculation cost
12associated to perform the Loop invariant code motion for address
13arithmetic.
14
15ChangeLog:
162015-06-17 Ajit Agarwal <ajitkum@xilinx.com>
17 Nagaraju Mekala <nmekala@xilinx.com>
18
19 * loop-invariant.c (gain_for_invariant): update the
20 heuristics for estimate_reg_pressure_cost.
21
22Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
23 Nagaraju Mekala nmekala@xilinx.com
24---
25 gcc/loop-invariant.c | 6 ++----
26 1 file changed, 2 insertions(+), 4 deletions(-)
27
28diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
29index bd31a51..8e22ca0 100644
30--- a/gcc/loop-invariant.c
31+++ b/gcc/loop-invariant.c
32@@ -1466,10 +1466,8 @@ gain_for_invariant (struct invariant *inv, unsigned *regs_needed,
33
34 if (! flag_ira_loop_pressure)
35 {
36- size_cost = (estimate_reg_pressure_cost (new_regs[0] + regs_needed[0],
37- regs_used, speed, call_p)
38- - estimate_reg_pressure_cost (new_regs[0],
39- regs_used, speed, call_p));
40+ size_cost = estimate_reg_pressure_cost (regs_needed[0],
41+ regs_used, speed, call_p);
42 }
43 else if (ret < 0)
44 return -1;
45--
462.7.4
47
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-8/0024-PATCH-microblaze.md-Improve-adddi3-and-subdi3-insn-d.patch
index 03ea8b19..85a749e5 100644
--- 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-8/0024-PATCH-microblaze.md-Improve-adddi3-and-subdi3-insn-d.patch
@@ -1,16 +1,14 @@
1From 2d90c10cf4d95999f68f474305828c7dfc51af18 Mon Sep 17 00:00:00 2001 1From be9c512be09fa4ef67870ab0456eb3781394dac3 Mon Sep 17 00:00:00 2001
2From: Nathan Rossi <nathan@nathanrossi.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Thu, 12 Nov 2015 16:09:31 +1000 3Date: Tue, 17 Jan 2017 18:07:24 +0530
4Subject: [PATCH] microblaze.md: Improve 'adddi3' and 'subdi3' insn definitions 4Subject: [PATCH 24/54] [PATCH] microblaze.md: Improve 'adddi3' and 'subdi3'
5 5 insn definitions Change adddi3 to handle DI immediates as the second operand,
6Change adddi3 to handle DI immediates as the second operand, this 6 this requires modification to the output template however reduces the need to
7requires modification to the output template however reduces the need to 7 specify seperate templates for 16-bit positive/negative immediate operands.
8specify seperate templates for 16-bit positive/negative immediate 8 The use of 32-bit immediates for the addi and addic instructions is handled
9operands. The use of 32-bit immediates for the addi and addic 9 by the assembler, which will emit the imm instructions when required. This
10instructions is handled by the assembler, which will emit the imm 10 conveniently handles the optimizable cases where the immediate constant value
11instructions when required. This conveniently handles the optimizable 11 does not need the higher half words of the operands upper/lower words.
12cases where the immediate constant value does not need the higher half
13words of the operands upper/lower words.
14 12
15Change the constraints of the subdi3 instruction definition such that it 13Change the constraints of the subdi3 instruction definition such that it
16does not match the second operand as an immediate value. This is because 14does not match the second operand as an immediate value. This is because
@@ -20,16 +18,15 @@ instruction to perform a forward arithmetic subtraction (it only
20provides reverse 'rD = IMM - rA'). 18provides reverse 'rD = IMM - rA').
21 19
22Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> 20Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
23Upstream-Status: Unsubmitted
24--- 21---
25 gcc/config/microblaze/microblaze.md | 13 ++++++------- 22 gcc/config/microblaze/microblaze.md | 13 ++++++-------
26 1 file changed, 6 insertions(+), 7 deletions(-) 23 1 file changed, 6 insertions(+), 7 deletions(-)
27 24
28diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md 25diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
29index b3a0011fd7..8a372d7ebb 100644 26index 3a53e24..949e103 100644
30--- a/gcc/config/microblaze/microblaze.md 27--- a/gcc/config/microblaze/microblaze.md
31+++ b/gcc/config/microblaze/microblaze.md 28+++ b/gcc/config/microblaze/microblaze.md
32@@ -483,17 +483,16 @@ 29@@ -500,17 +500,16 @@
33 ;; Adding 2 DI operands in register or reg/imm 30 ;; Adding 2 DI operands in register or reg/imm
34 31
35 (define_insn "adddi3" 32 (define_insn "adddi3"
@@ -52,7 +49,7 @@ index b3a0011fd7..8a372d7ebb 100644
52 49
53 ;;---------------------------------------------------------------- 50 ;;----------------------------------------------------------------
54 ;; Subtraction 51 ;; Subtraction
55@@ -530,7 +529,7 @@ 52@@ -547,7 +546,7 @@
56 (define_insn "subdi3" 53 (define_insn "subdi3"
57 [(set (match_operand:DI 0 "register_operand" "=&d") 54 [(set (match_operand:DI 0 "register_operand" "=&d")
58 (minus:DI (match_operand:DI 1 "register_operand" "d") 55 (minus:DI (match_operand:DI 1 "register_operand" "d")
@@ -62,5 +59,5 @@ index b3a0011fd7..8a372d7ebb 100644
62 "rsub\t%L0,%L2,%L1\;rsubc\t%M0,%M2,%M1" 59 "rsub\t%L0,%L2,%L1\;rsubc\t%M0,%M2,%M1"
63 [(set_attr "type" "darith") 60 [(set_attr "type" "darith")
64-- 61--
652.14.2 622.7.4
66 63
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0023-Update-MicroBlaze-ashlsi3-movsf-patterns.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0025-Patch-microblaze-Update-ashlsi3-movsf-patterns.patch
index d8eb7695..17f25448 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0023-Update-MicroBlaze-ashlsi3-movsf-patterns.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0025-Patch-microblaze-Update-ashlsi3-movsf-patterns.patch
@@ -1,42 +1,36 @@
1From f269f552e1abf182dc3749e0f29b1529fc82644a Mon Sep 17 00:00:00 2001 1From c8ee051fa3e0ad05b19eb6141a7cb72245b412b7 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:42 -0700 3Date: Tue, 17 Jan 2017 18:18:41 +0530
4Subject: [PATCH] Update MicroBlaze ashlsi3 & movsf patterns 4Subject: [PATCH 25/54] [Patch, microblaze]: Update ashlsi3 & movsf patterns
5 This patch removes the use of HOST_WIDE_INT_PRINT_HEX macro in print_operand
6 of ashlsi3_with_mul_nodelay,ashlsi3_with_mul_delay and movsf_internal
7 patterns beacuse HOST_WIDE_INT_PRINT_HEX is generating 64-bit value which our
8 instruction doesn't support so using gen_int_mode function
5 9
6This patch removes the use of HOST_WIDE_INT_PRINT_HEX macro in 10Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
7print_operand of ashlsi3_with_mul_nodelay,ashlsi3_with_mul_delay and 11 :Ajit Agarwal <ajitkum@xilinx.com>
8movsf_internal patterns beacuse HOST_WIDE_INT_PRINT_HEX is generating
964-bit value which our instruction doesn't support so using gen_int_mode
10function
11 12
12ChangeLog: 13ChangeLog:
142016-01-07 Nagaraju Mekala <nmekala@xilix.com>
15 Ajit Agarwal <ajitkum@xilinx.com>
13 16
142016-01-07 Nagaraju Mekala <nagaraju.mekala@xilinx.com> 17 *microblaze.md (ashlsi3_with_mul_nodelay,
15 Ajit Agarwal <ajitkum@xilinx.com>
16
17 * microblaze.md (ashlsi3_with_mul_nodelay,
18 ashlsi3_with_mul_delay, 18 ashlsi3_with_mul_delay,
19 movsf_internal): 19 movsf_internal):
20 Updated the patterns to use gen_int_mode function 20 Updated the patterns to use gen_int_mode function
21 * microblaze.c (print_operand): 21 *microblaze.c (print_operand):
22 updated the 'F' case to use "unsinged int" instead 22 updated the 'F' case to use "unsinged int" instead
23 of HOST_WIDE_INT_PRINT_HEX 23 of HOST_WIDE_INT_PRINT_HEX
24
25Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
26Signed-off-by: Ajit Agarwal <ajitkum@xilinx.com>
27Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
28Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
29Upstream-Status: Pending
30--- 24---
31 gcc/config/microblaze/microblaze.c | 2 +- 25 gcc/config/microblaze/microblaze.c | 2 +-
32 gcc/config/microblaze/microblaze.md | 10 ++++++++-- 26 gcc/config/microblaze/microblaze.md | 10 ++++++++--
33 2 files changed, 9 insertions(+), 3 deletions(-) 27 2 files changed, 9 insertions(+), 3 deletions(-)
34 28
35diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c 29diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
36index f46dffff0d..663b20a022 100644 30index 0dec362..daf0269 100644
37--- a/gcc/config/microblaze/microblaze.c 31--- a/gcc/config/microblaze/microblaze.c
38+++ b/gcc/config/microblaze/microblaze.c 32+++ b/gcc/config/microblaze/microblaze.c
39@@ -2507,7 +2507,7 @@ print_operand (FILE * file, rtx op, int letter) 33@@ -2531,7 +2531,7 @@ print_operand (FILE * file, rtx op, int letter)
40 unsigned long value_long; 34 unsigned long value_long;
41 REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (op), 35 REAL_VALUE_TO_TARGET_SINGLE (*CONST_DOUBLE_REAL_VALUE (op),
42 value_long); 36 value_long);
@@ -46,7 +40,7 @@ index f46dffff0d..663b20a022 100644
46 else 40 else
47 { 41 {
48diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md 42diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
49index 13f8803428..b9c62b6d0f 100644 43index 949e103..bc675ca 100644
50--- a/gcc/config/microblaze/microblaze.md 44--- a/gcc/config/microblaze/microblaze.md
51+++ b/gcc/config/microblaze/microblaze.md 45+++ b/gcc/config/microblaze/microblaze.md
52@@ -1366,7 +1366,10 @@ 46@@ -1366,7 +1366,10 @@
@@ -74,5 +68,5 @@ index 13f8803428..b9c62b6d0f 100644
74 [(set_attr "type" "no_delay_arith") 68 [(set_attr "type" "no_delay_arith")
75 (set_attr "mode" "SI") 69 (set_attr "mode" "SI")
76-- 70--
772.14.2 712.7.4
78 72
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0024-8-stage-pipeline-for-microblaze.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0026-Patch-microblaze-8-stage-pipeline-for-microblaze.patch
index 6faa6251..506714bd 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0024-8-stage-pipeline-for-microblaze.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0026-Patch-microblaze-8-stage-pipeline-for-microblaze.patch
@@ -1,27 +1,25 @@
1From 17353cc4ba521f5ad928a1ede61cf03110e366ae Mon Sep 17 00:00:00 2001 1From 64e76f3be6ad78044ea2b89b555a07758c2b2950 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:43 -0700 3Date: Tue, 17 Jan 2017 19:50:34 +0530
4Subject: [PATCH] 8-stage pipeline for microblaze 4Subject: [PATCH 26/54] [Patch, microblaze]: 8-stage pipeline for microblaze
5 This patch adds the support for the 8-stage pipeline. The new 8-stage
6 pipeline reduces the latencies of float & integer division drastically
5 7
6This patch adds the support for the 8-stage pipeline. The new 8-stage 8Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
7pipeline reduces the latencies of float & integer division drastically
8 9
9ChangeLog: 10ChangeLog:
112016-01-18 Nagaraju Mekala <nmekala@xilix.com>
10 12
112016-01-18 Nagaraju Mekala <nagaraju.mekala@xilinx.com> 13 *microblaze.md (define_automaton mbpipe_8): New
12 14
13 * microblaze.md (define_automaton mbpipe_8): New 15 *microblaze.c (microblaze_option_override): Update
14 * microblaze.c (microblaze_option_override): Update 16 Updated the logic to generate only when MB version is 10.0
15 Updated the logic to generate only when MB version is 10.0
16 * microblaze.h (pipeline_type): Update
17 Update the enum with MICROBLAZE_PIPE_8
18 * microblaze.opt (mxl-frequency): New
19 New flag added for 8-stage pipeline
20 17
21Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com> 18 *microblaze.h (pipeline_type): Update
22Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com> 19 Update the enum with MICROBLAZE_PIPE_8
23Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> 20
24Upstream-Status: Pending 21 *microblaze.opt (mxl-frequency): New
22 New flag added for 8-stage pipeline
25--- 23---
26 gcc/config/microblaze/microblaze.c | 13 ++++++ 24 gcc/config/microblaze/microblaze.c | 13 ++++++
27 gcc/config/microblaze/microblaze.h | 3 +- 25 gcc/config/microblaze/microblaze.h | 3 +-
@@ -30,10 +28,10 @@ Upstream-Status: Pending
30 4 files changed, 96 insertions(+), 3 deletions(-) 28 4 files changed, 96 insertions(+), 3 deletions(-)
31 29
32diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c 30diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
33index 663b20a022..e7697bf30d 100644 31index daf0269..3832d16 100644
34--- a/gcc/config/microblaze/microblaze.c 32--- a/gcc/config/microblaze/microblaze.c
35+++ b/gcc/config/microblaze/microblaze.c 33+++ b/gcc/config/microblaze/microblaze.c
36@@ -1773,6 +1773,19 @@ microblaze_option_override (void) 34@@ -1772,6 +1772,19 @@ microblaze_option_override (void)
37 warning (0, "-mxl-reorder requires -mxl-pattern-compare for -mcpu=v8.30.a"); 35 warning (0, "-mxl-reorder requires -mxl-pattern-compare for -mcpu=v8.30.a");
38 TARGET_REORDER = 0; 36 TARGET_REORDER = 0;
39 } 37 }
@@ -54,7 +52,7 @@ index 663b20a022..e7697bf30d 100644
54 if (TARGET_MULTIPLY_HIGH && TARGET_SOFT_MUL) 52 if (TARGET_MULTIPLY_HIGH && TARGET_SOFT_MUL)
55 error ("-mxl-multiply-high requires -mno-xl-soft-mul"); 53 error ("-mxl-multiply-high requires -mno-xl-soft-mul");
56diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h 54diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
57index 82e7e890be..3f48e48f10 100644 55index 9f74ec8..2ac5aeec 100644
58--- a/gcc/config/microblaze/microblaze.h 56--- a/gcc/config/microblaze/microblaze.h
59+++ b/gcc/config/microblaze/microblaze.h 57+++ b/gcc/config/microblaze/microblaze.h
60@@ -27,7 +27,8 @@ 58@@ -27,7 +27,8 @@
@@ -68,7 +66,7 @@ index 82e7e890be..3f48e48f10 100644
68 66
69 #define MICROBLAZE_MASK_NO_UNSAFE_DELAY 0x00000001 67 #define MICROBLAZE_MASK_NO_UNSAFE_DELAY 0x00000001
70diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md 68diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
71index b9c62b6d0f..61d6412dac 100644 69index bc675ca..6395533 100644
72--- a/gcc/config/microblaze/microblaze.md 70--- a/gcc/config/microblaze/microblaze.md
73+++ b/gcc/config/microblaze/microblaze.md 71+++ b/gcc/config/microblaze/microblaze.md
74@@ -35,6 +35,7 @@ 72@@ -35,6 +35,7 @@
@@ -179,7 +177,7 @@ index b9c62b6d0f..61d6412dac 100644
179 (set_attr "length" "4")]) 177 (set_attr "length" "4")])
180 178
181diff --git a/gcc/config/microblaze/microblaze.opt b/gcc/config/microblaze/microblaze.opt 179diff --git a/gcc/config/microblaze/microblaze.opt b/gcc/config/microblaze/microblaze.opt
182index 8847c3daf8..85a9929d74 100644 180index 8242998..c8e6f00 100644
183--- a/gcc/config/microblaze/microblaze.opt 181--- a/gcc/config/microblaze/microblaze.opt
184+++ b/gcc/config/microblaze/microblaze.opt 182+++ b/gcc/config/microblaze/microblaze.opt
185@@ -129,3 +129,7 @@ Use hardware prefetch instruction 183@@ -129,3 +129,7 @@ Use hardware prefetch instruction
@@ -191,5 +189,5 @@ index 8847c3daf8..85a9929d74 100644
191+Target Mask(AREA_OPTIMIZED_2) 189+Target Mask(AREA_OPTIMIZED_2)
192+Use 8 stage pipeline (frequency optimization) 190+Use 8 stage pipeline (frequency optimization)
193-- 191--
1942.14.2 1922.7.4
195 193
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0027-Patch-rtl-Optimization-Better-register-pressure-esti.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0027-Patch-rtl-Optimization-Better-register-pressure-esti.patch
new file mode 100644
index 00000000..95b9b2aa
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0027-Patch-rtl-Optimization-Better-register-pressure-esti.patch
@@ -0,0 +1,142 @@
1From 5147c831c6a78d9b95138b679bb2ca7624abc3a1 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 18 Jan 2017 11:08:40 +0530
4Subject: [PATCH 27/54] [Patch,rtl Optimization]: Better register pressure
5 estimate for loop . .invariant code motion
6
7Calculate the loop liveness used for regs for calculating the register pressure
8in the cost estimation. Loop liveness is based on the following properties.
9We only need to find the set of objects that are live at the birth or the header
10of the loop. We don't need to calculate the live through the loop by considering
11live in and live out of all the basic blocks of the loop. This is based on the
12point that the set of objects that are live-in at the birth or header of the loop
13will be live-in at every node in the loop.
14
15If a v live is out at the header of the loop then the variable is live-in at every node
16in the loop. To prove this, consider a loop L with header h such that the variable v
17defined at d is live-in at h. Since v is live at h, d is not part of L. This follows i
18from the dominance property, i.e. h is strictly dominated by d. Furthermore, there
19exists a path from h to a use of v which does not go through d. For every node p in
20the loop, since the loop is strongly connected and node is a component of the CFG,
21there exists a path, consisting only of nodes of L from p to h. Concatenating these
22two paths proves that v is live-in and live-out of p.
23
24Calculate the live-out and live-in for the exit edge of the loop. This patch considers
25liveness for not only the loop latch but also the liveness outside the loops.
26
27ChangeLog:
282016-01-22 Ajit Agarwal <ajitkum@xilinx.com>
29
30 * loop-invariant.c
31 (find_invariants_to_move): Add the logic of regs_used based
32 on liveness.
33 * cfgloopanal.c
34 (estimate_reg_pressure_cost): Update the heuristics in presence
35 of call_p.
36
37Signed-off-by:Ajit Agarwal ajitkum@xilinx.com.
38---
39 gcc/cfgloopanal.c | 4 +++-
40 gcc/loop-invariant.c | 63 +++++++++++++++++++++++++++++++++++++++-------------
41 2 files changed, 50 insertions(+), 17 deletions(-)
42
43diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c
44index 3af0b2d..123dc6b 100644
45--- a/gcc/cfgloopanal.c
46+++ b/gcc/cfgloopanal.c
47@@ -411,7 +411,9 @@ estimate_reg_pressure_cost (unsigned n_new, unsigned n_old, bool speed,
48 if (regs_needed + target_res_regs <= available_regs)
49 return 0;
50
51- if (regs_needed <= available_regs)
52+ if ((regs_needed <= available_regs)
53+ || (call_p && (regs_needed <=
54+ (available_regs + target_clobbered_regs))))
55 /* If we are close to running out of registers, try to preserve
56 them. */
57 cost = target_reg_cost [speed] * n_new;
58diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
59index 8e22ca0..c9ec8df 100644
60--- a/gcc/loop-invariant.c
61+++ b/gcc/loop-invariant.c
62@@ -1520,7 +1520,7 @@ gain_for_invariant (struct invariant *inv, unsigned *regs_needed,
63 size_cost = 0;
64 }
65
66- return comp_cost - size_cost;
67+ return comp_cost - size_cost + 1;
68 }
69
70 /* Finds invariant with best gain for moving. Returns the gain, stores
71@@ -1614,22 +1614,53 @@ find_invariants_to_move (bool speed, bool call_p)
72 /* REGS_USED is actually never used when the flag is on. */
73 regs_used = 0;
74 else
75- /* We do not really do a good job in estimating number of
76- registers used; we put some initial bound here to stand for
77- induction variables etc. that we do not detect. */
78+ /* The logic used in estimating the number of regs_used is changed.
79+ Now it will be based on liveness of the loop. */
80 {
81- unsigned int n_regs = DF_REG_SIZE (df);
82-
83- regs_used = 2;
84-
85- for (i = 0; i < n_regs; i++)
86- {
87- if (!DF_REGNO_FIRST_DEF (i) && DF_REGNO_LAST_USE (i))
88- {
89- /* This is a value that is used but not changed inside loop. */
90- regs_used++;
91- }
92- }
93+ int i;
94+ edge e;
95+ vec<edge> edges;
96+ bitmap_head regs_live;
97+
98+ bitmap_initialize (&regs_live, &reg_obstack);
99+ edges = get_loop_exit_edges (curr_loop);
100+
101+ /* Loop liveness is based on the following properties.
102+ We only need to find the set of objects that are live at the
103+ birth or the header of the loop.
104+ We don't need to calculate the live through the loop considering
105+ live-in and live-out of all the basic blocks of the loop. This is
106+ based on the point that the set of objects that are live-in at the
107+ birth or header of the loop will be live-in at every block in the
108+ loop.
109+
110+ If a v live out at the header of the loop then the variable is
111+ live-in at every node in the Loop. To prove this, consider a loop
112+ L with header h such that the variable v defined at d is live-in
113+ at h. Since v is live at h, d is not part of L. This follows from
114+ the dominance property, i.e. h is strictly dominated by d. Furthermore,
115+ there exists a path from h to a use of v which does not go through d.
116+ For every node of the loop, p, since the loop is strongly connected
117+ component of the CFG, there exists a path, consisting only of nodes
118+ of L from p to h. Concatenating these two paths prove that v is
119+ live-in and live-out of p. */
120+
121+ bitmap_ior_into (&regs_live, DF_LR_IN (curr_loop->header));
122+ bitmap_ior_into (&regs_live, DF_LR_OUT (curr_loop->header));
123+
124+ /* Calculate the live-out and live-in for the exit edge of the loop.
125+ This considers liveness for not only the loop latch but also the
126+ liveness outside the loops. */
127+
128+ FOR_EACH_VEC_ELT (edges, i, e)
129+ {
130+ bitmap_ior_into (&regs_live, DF_LR_OUT (e->src));
131+ bitmap_ior_into (&regs_live, DF_LR_IN (e->dest));
132+ }
133+
134+ regs_used = bitmap_count_bits (&regs_live) + 2;
135+ bitmap_clear (&regs_live);
136+ edges.release ();
137 }
138
139 if (! flag_ira_loop_pressure)
140--
1412.7.4
142
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0028-Patch-microblaze-Correct-the-const-high-double-immed.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0028-Patch-microblaze-Correct-the-const-high-double-immed.patch
new file mode 100644
index 00000000..3643ff19
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0028-Patch-microblaze-Correct-the-const-high-double-immed.patch
@@ -0,0 +1,69 @@
1From 2715b235b3db423bf35b9304a2ba5daa86b1680e Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 18 Jan 2017 11:25:48 +0530
4Subject: [PATCH 28/54] [Patch, microblaze]: Correct the const high double
5 immediate value With this patch the loading of the DI mode immediate values
6 will be using REAL_VALUE_FROM_CONST_DOUBLE and REAL_VALUE_TO_TARGET_DOUBLE
7 functions, as CONST_DOUBLE_HIGH was returning the sign extension value even
8 of the unsigned long long constants also
9
10Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
11 Ajit Agarwal <ajitkum@xilinx.com>
12
13ChangeLog:
142016-02-03 Nagaraju Mekala <nmekala@xilix.com>
15 Ajit Agarwal <ajitkum@xilinx.com>
16
17 *microblaze.c (print_operand): Use REAL_VALUE_FROM_CONST_DOUBLE &
18 REAL_VALUE_TO_TARGET_DOUBLE
19 *long.c (new): Added new testcase
20---
21 gcc/config/microblaze/microblaze.c | 8 ++++++--
22 gcc/testsuite/gcc.target/microblaze/long.c | 10 ++++++++++
23 2 files changed, 16 insertions(+), 2 deletions(-)
24 create mode 100644 gcc/testsuite/gcc.target/microblaze/long.c
25
26diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
27index 3832d16..29cd54f 100644
28--- a/gcc/config/microblaze/microblaze.c
29+++ b/gcc/config/microblaze/microblaze.c
30@@ -2517,14 +2517,18 @@ print_operand (FILE * file, rtx op, int letter)
31 else if (letter == 'h' || letter == 'j')
32 {
33 long val[2];
34+ long l[2];
35 if (code == CONST_DOUBLE)
36 {
37 if (GET_MODE (op) == DFmode)
38 REAL_VALUE_TO_TARGET_DOUBLE (*CONST_DOUBLE_REAL_VALUE (op), val);
39 else
40 {
41- val[0] = CONST_DOUBLE_HIGH (op);
42- val[1] = CONST_DOUBLE_LOW (op);
43+ REAL_VALUE_TYPE rv;
44+ REAL_VALUE_FROM_CONST_DOUBLE (rv, op);
45+ REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
46+ val[1] = l[WORDS_BIG_ENDIAN == 0];
47+ val[0] = l[WORDS_BIG_ENDIAN != 0];
48 }
49 }
50 else if (code == CONST_INT)
51diff --git a/gcc/testsuite/gcc.target/microblaze/long.c b/gcc/testsuite/gcc.target/microblaze/long.c
52new file mode 100644
53index 0000000..4d45186
54--- /dev/null
55+++ b/gcc/testsuite/gcc.target/microblaze/long.c
56@@ -0,0 +1,10 @@
57+/* { dg-options "-O0" } */
58+#define BASEADDR 0xF0000000ULL
59+int main ()
60+{
61+ unsigned long long start;
62+ start = (unsigned long long) BASEADDR;
63+ return 0;
64+}
65+/* { dg-final { scan-assembler "addik\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r0,0x00000000" } } */
66+/* { dg-final { scan-assembler "addik\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r0,0xf0000000" } } */
67--
682.7.4
69
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0029-Fix-microblaze-Fix-internal-compiler-error-with-msma.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0029-Fix-microblaze-Fix-internal-compiler-error-with-msma.patch
new file mode 100644
index 00000000..b4b9d2ec
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0029-Fix-microblaze-Fix-internal-compiler-error-with-msma.patch
@@ -0,0 +1,36 @@
1From 7e025a0b22eee87bf9597267918bd16fc87c85c2 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 18 Jan 2017 11:49:58 +0530
4Subject: [PATCH 29/54] [Fix, microblaze]: Fix internal compiler error with
5 msmall-divides This patch will fix the internal error
6 microblaze_expand_divide function which comes because of rtx PLUS where the
7 mem_rtx is of type SI and the operand is of type QImode. This patch modifies
8 the mem_rtx as QImode and Plus as QImode to fix the error.
9
10Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
11 Ajit Agarwal <ajitkum@xilinx.com>
12ChangeLog:
13 2016-02-23 Nagaraju Mekala <nmekala@xilix.com>
14 Ajit Agarwal <ajitkum@xilinx.com>
15
16 *microblaze.c (microblaze_expand_divide): Update
17---
18 gcc/config/microblaze/microblaze.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
22index 29cd54f..f8a417c 100644
23--- a/gcc/config/microblaze/microblaze.c
24+++ b/gcc/config/microblaze/microblaze.c
25@@ -3769,7 +3769,7 @@ microblaze_expand_divide (rtx operands[])
26 emit_insn (gen_ashlsi3_bshift (regt1, operands[1], GEN_INT(4)));
27 emit_insn (gen_addsi3 (regt1, regt1, operands[2]));
28 mem_rtx = gen_rtx_MEM (QImode,
29- gen_rtx_PLUS (Pmode, regt1, div_table_rtx));
30+ gen_rtx_PLUS (QImode, regt1, div_table_rtx));
31
32 insn = emit_insn (gen_zero_extendqisi2(operands[0],mem_rtx));
33 jump = emit_jump_insn_after (gen_jump (div_end_label), insn);
34--
352.7.4
36
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0027-Fix-the-calculation-of-high-word-in-a-long-long-64-b.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0030-patch-microblaze-Fix-the-calculation-of-high-word-in.patch
index 97422aea..52fd4bea 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0027-Fix-the-calculation-of-high-word-in-a-long-long-64-b.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0030-patch-microblaze-Fix-the-calculation-of-high-word-in.patch
@@ -1,7 +1,8 @@
1From 34049c9fcaa256befad032cbcd8aa74beecf13dc Mon Sep 17 00:00:00 2001 1From 27a69d1873221747121360d0a1dffc4336a1d0cc Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:47 -0700 3Date: Wed, 18 Jan 2017 12:03:39 +0530
4Subject: [PATCH] Fix the calculation of high word in a long long 64-bit 4Subject: [PATCH 30/54] [patch,microblaze]: Fix the calculation of high word in
5 a long long 6. .4-bit
5 6
6This patch will change the calculation of high word in a long long 64-bit. 7This patch will change the calculation of high word in a long long 64-bit.
7Earlier to this patch the high word of long long word (0xF0000000ULL) is 8Earlier to this patch the high word of long long word (0xF0000000ULL) is
@@ -11,29 +12,25 @@ removes the condition of checking high word = 0 & low word < 0.
11This check is not required for the correctness of calculating 32-bit high 12This check is not required for the correctness of calculating 32-bit high
12and low words in a 64-bit long long. 13and low words in a 64-bit long long.
13 14
14ChangeLog: 15Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
15 16 Ajit Agarwal <ajitkum@xilinx.com>
162016-03-01 Nagaraju Mekala <nagaraju.mekala@xilinx.com>
17 Ajit Agarwal <ajitkum@xilinx.com>
18 17
19 * config/microblaze/microblaze.c (print_operand): Remove the 18ChangeLog:
20 condition of checking high word = 0 & low word < 0. 192016-03-01 Nagaraju Mekala <nmekala@xilix.com>
21 * testsuite/gcc.target/microblaze/others/long.c: Add -O0 option. 20 Ajit Agarwal <ajitkum@xilinx.com>
22 21
23Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com> 22 *config/microblaze/microblaze.c (print_operand): Remove the condition of checking
24Signed-off-by: Ajit Agarwal <ajitkum@xilinx.com> 23 high word = 0 & low word < 0.
25Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com> 24 *testsuite/gcc.target/microblaze/others/long.c: Add -O0 option.
26Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
27Upstream-Status: Pending
28--- 25---
29 gcc/config/microblaze/microblaze.c | 3 --- 26 gcc/config/microblaze/microblaze.c | 3 ---
30 1 file changed, 3 deletions(-) 27 1 file changed, 3 deletions(-)
31 28
32diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c 29diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
33index a41121264e..2ed64971fb 100644 30index f8a417c..70d8d03 100644
34--- a/gcc/config/microblaze/microblaze.c 31--- a/gcc/config/microblaze/microblaze.c
35+++ b/gcc/config/microblaze/microblaze.c 32+++ b/gcc/config/microblaze/microblaze.c
36@@ -2509,9 +2509,6 @@ print_operand (FILE * file, rtx op, int letter) 33@@ -2535,9 +2535,6 @@ print_operand (FILE * file, rtx op, int letter)
37 { 34 {
38 val[0] = (INTVAL (op) & 0xffffffff00000000LL) >> 32; 35 val[0] = (INTVAL (op) & 0xffffffff00000000LL) >> 32;
39 val[1] = INTVAL (op) & 0x00000000ffffffffLL; 36 val[1] = INTVAL (op) & 0x00000000ffffffffLL;
@@ -44,5 +41,5 @@ index a41121264e..2ed64971fb 100644
44 fprintf (file, "0x%8.8lx", (letter == 'h') ? val[0] : val[1]); 41 fprintf (file, "0x%8.8lx", (letter == 'h') ? val[0] : val[1]);
45 } 42 }
46-- 43--
472.14.2 442.7.4
48 45
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0028-Add-new-bit-field-instructions.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0031-Patch-microblaze-Add-new-bit-field-instructions.patch
index 02940e2f..57144523 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0028-Add-new-bit-field-instructions.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0031-Patch-microblaze-Add-new-bit-field-instructions.patch
@@ -1,32 +1,26 @@
1From 90b6f833bd59f89d4192a3dc787fc2c9115b9c00 Mon Sep 17 00:00:00 2001 1From 35569bb20a5bb881f7f275d901a0be3408b16622 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:48 -0700 3Date: Wed, 18 Jan 2017 12:14:51 +0530
4Subject: [PATCH] Add new bit-field instructions 4Subject: [PATCH 31/54] [Patch, microblaze]: Add new bit-field instructions
5 This patches adds new bsefi and bsifi instructions. BSEFI- The instruction
6 shall extract a bit field from a register and place it right-adjusted in the
7 destination register. The other bits in the destination register shall be set
8 to zero BSIFI- The instruction shall insert a right-adjusted bit field from a
9 register at another position in the destination register. The rest of the
10 bits in the destination register shall be unchanged
5 11
6This patches adds new bsefi and bsifi instructions. BSEFI- The 12Signed-off-by :Nagaraju Mekala <nmekala@xilix.com>
7instruction shall extract a bit field from a register and place it
8right-adjusted in the destination register. The other bits in the
9destination register shall be set to zero BSIFI- The instruction shall
10insert a right-adjusted bit field from a register at another position in
11the destination register. The rest of the bits in the destination
12register shall be unchanged
13 13
14ChangeLog: 14ChangeLog:
15 2016-02-03 Nagaraju Mekala <nmekala@xilix.com>
15 16
162016-02-03 Nagaraju Mekala <nagaraju.mekala@xilinx.com> 17 *microblaze.md (Update): Added new patterns
17
18 * microblaze.md (Update): Added new patterns
19
20Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
21Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
22Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
23Upstream-Status: Pending
24--- 18---
25 gcc/config/microblaze/microblaze.md | 73 +++++++++++++++++++++++++++++++++++++ 19 gcc/config/microblaze/microblaze.md | 73 +++++++++++++++++++++++++++++++++++++
26 1 file changed, 73 insertions(+) 20 1 file changed, 73 insertions(+)
27 21
28diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md 22diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
29index 61d6412dac..7a00629922 100644 23index 6395533..5a2dd13 100644
30--- a/gcc/config/microblaze/microblaze.md 24--- a/gcc/config/microblaze/microblaze.md
31+++ b/gcc/config/microblaze/microblaze.md 25+++ b/gcc/config/microblaze/microblaze.md
32@@ -980,6 +980,8 @@ 26@@ -980,6 +980,8 @@
@@ -122,5 +116,5 @@ index 61d6412dac..7a00629922 100644
122+ 116+
123 (include "sync.md") 117 (include "sync.md")
124-- 118--
1252.14.2 1192.7.4
126 120
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0029-Fix-bug-in-MB-version-calculation.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0032-Patch-microblaze-Fix-bug-in-MB-version-calculation.patch
index c3e4bc9e..dce1bc58 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0029-Fix-bug-in-MB-version-calculation.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0032-Patch-microblaze-Fix-bug-in-MB-version-calculation.patch
@@ -1,24 +1,21 @@
1From 3eada9d81437d378ef24f11a8bd046fee5b3505a Mon Sep 17 00:00:00 2001 1From 3db8f0c3124d3001d3c10e6d400943f3ec57616b Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:49 -0700 3Date: Wed, 18 Jan 2017 12:42:10 +0530
4Subject: [PATCH] Fix bug in MB version calculation 4Subject: [PATCH 32/54] [Patch, microblaze]: Fix bug in MB version calculation
5 This patch fixes the bug in microblaze_version_to_int function. Earlier the
6 conversion of vXX.YY.Z to int has a bug which is fixed now.
5 7
6This patch fixes the bug in microblaze_version_to_int function. Earlier 8Signed-off-by : Mahesh Bodapati <mbodapat@xilinx.com>
7the conversion of vXX.YY.Z to int has a bug which is fixed now. 9 Nagaraju Mekala <nmekala@xilix.com>
8
9Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
10Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
11Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
12Upstream-Status: Pending
13--- 10---
14 gcc/config/microblaze/microblaze.c | 147 ++++++++++++++++++------------------- 11 gcc/config/microblaze/microblaze.c | 147 ++++++++++++++++++-------------------
15 1 file changed, 70 insertions(+), 77 deletions(-) 12 1 file changed, 70 insertions(+), 77 deletions(-)
16 13
17diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c 14diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
18index 2ed64971fb..55dba83882 100644 15index 70d8d03..30a0fcf 100644
19--- a/gcc/config/microblaze/microblaze.c 16--- a/gcc/config/microblaze/microblaze.c
20+++ b/gcc/config/microblaze/microblaze.c 17+++ b/gcc/config/microblaze/microblaze.c
21@@ -239,6 +239,63 @@ section *sdata2_section; 18@@ -238,6 +238,63 @@ section *sdata2_section;
22 #define TARGET_HAVE_TLS true 19 #define TARGET_HAVE_TLS true
23 #endif 20 #endif
24 21
@@ -82,7 +79,7 @@ index 2ed64971fb..55dba83882 100644
82 /* Return truth value if a CONST_DOUBLE is ok to be a legitimate constant. */ 79 /* Return truth value if a CONST_DOUBLE is ok to be a legitimate constant. */
83 static bool 80 static bool
84 microblaze_const_double_ok (rtx op, machine_mode mode) 81 microblaze_const_double_ok (rtx op, machine_mode mode)
85@@ -1267,8 +1324,7 @@ microblaze_rtx_costs (rtx x, machine_mode mode, int outer_code ATTRIBUTE_UNUSED, 82@@ -1266,8 +1323,7 @@ microblaze_rtx_costs (rtx x, machine_mode mode, int outer_code ATTRIBUTE_UNUSED,
86 { 83 {
87 if (TARGET_BARREL_SHIFT) 84 if (TARGET_BARREL_SHIFT)
88 { 85 {
@@ -92,7 +89,7 @@ index 2ed64971fb..55dba83882 100644
92 *total = COSTS_N_INSNS (1); 89 *total = COSTS_N_INSNS (1);
93 else 90 else
94 *total = COSTS_N_INSNS (2); 91 *total = COSTS_N_INSNS (2);
95@@ -1329,8 +1385,7 @@ microblaze_rtx_costs (rtx x, machine_mode mode, int outer_code ATTRIBUTE_UNUSED, 92@@ -1328,8 +1384,7 @@ microblaze_rtx_costs (rtx x, machine_mode mode, int outer_code ATTRIBUTE_UNUSED,
96 } 93 }
97 else if (!TARGET_SOFT_MUL) 94 else if (!TARGET_SOFT_MUL)
98 { 95 {
@@ -102,7 +99,7 @@ index 2ed64971fb..55dba83882 100644
102 *total = COSTS_N_INSNS (1); 99 *total = COSTS_N_INSNS (1);
103 else 100 else
104 *total = COSTS_N_INSNS (3); 101 *total = COSTS_N_INSNS (3);
105@@ -1610,72 +1665,13 @@ function_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode, 102@@ -1609,72 +1664,13 @@ function_arg_partial_bytes (cumulative_args_t cum_v, machine_mode mode,
106 return 0; 103 return 0;
107 } 104 }
108 105
@@ -176,7 +173,7 @@ index 2ed64971fb..55dba83882 100644
176 173
177 microblaze_section_threshold = (global_options_set.x_g_switch_value 174 microblaze_section_threshold = (global_options_set.x_g_switch_value
178 ? g_switch_value 175 ? g_switch_value
179@@ -1696,13 +1692,13 @@ microblaze_option_override (void) 176@@ -1695,13 +1691,13 @@ microblaze_option_override (void)
180 /* Check the MicroBlaze CPU version for any special action to be done. */ 177 /* Check the MicroBlaze CPU version for any special action to be done. */
181 if (microblaze_select_cpu == NULL) 178 if (microblaze_select_cpu == NULL)
182 microblaze_select_cpu = MICROBLAZE_DEFAULT_CPU; 179 microblaze_select_cpu = MICROBLAZE_DEFAULT_CPU;
@@ -193,7 +190,7 @@ index 2ed64971fb..55dba83882 100644
193 if (ver < 0) 190 if (ver < 0)
194 { 191 {
195 /* No hardware exceptions in earlier versions. So no worries. */ 192 /* No hardware exceptions in earlier versions. So no worries. */
196@@ -1713,8 +1709,7 @@ microblaze_option_override (void) 193@@ -1712,8 +1708,7 @@ microblaze_option_override (void)
197 microblaze_pipe = MICROBLAZE_PIPE_3; 194 microblaze_pipe = MICROBLAZE_PIPE_3;
198 } 195 }
199 else if (ver == 0 196 else if (ver == 0
@@ -203,7 +200,7 @@ index 2ed64971fb..55dba83882 100644
203 { 200 {
204 #if 0 201 #if 0
205 microblaze_select_flags |= (MICROBLAZE_MASK_NO_UNSAFE_DELAY); 202 microblaze_select_flags |= (MICROBLAZE_MASK_NO_UNSAFE_DELAY);
206@@ -1731,11 +1726,9 @@ microblaze_option_override (void) 203@@ -1730,11 +1725,9 @@ microblaze_option_override (void)
207 #endif 204 #endif
208 microblaze_no_unsafe_delay = 0; 205 microblaze_no_unsafe_delay = 0;
209 microblaze_pipe = MICROBLAZE_PIPE_5; 206 microblaze_pipe = MICROBLAZE_PIPE_5;
@@ -218,7 +215,7 @@ index 2ed64971fb..55dba83882 100644
218 { 215 {
219 /* Pattern compares are to be turned on by default only when 216 /* Pattern compares are to be turned on by default only when
220 compiling for MB v5.00.'z'. */ 217 compiling for MB v5.00.'z'. */
221@@ -1743,7 +1736,7 @@ microblaze_option_override (void) 218@@ -1742,7 +1735,7 @@ microblaze_option_override (void)
222 } 219 }
223 } 220 }
224 221
@@ -227,7 +224,7 @@ index 2ed64971fb..55dba83882 100644
227 if (ver < 0) 224 if (ver < 0)
228 { 225 {
229 if (TARGET_MULTIPLY_HIGH) 226 if (TARGET_MULTIPLY_HIGH)
230@@ -1751,7 +1744,7 @@ microblaze_option_override (void) 227@@ -1750,7 +1743,7 @@ microblaze_option_override (void)
231 "-mxl-multiply-high can be used only with -mcpu=v6.00.a or greater"); 228 "-mxl-multiply-high can be used only with -mcpu=v6.00.a or greater");
232 } 229 }
233 230
@@ -236,7 +233,7 @@ index 2ed64971fb..55dba83882 100644
236 microblaze_has_clz = 1; 233 microblaze_has_clz = 1;
237 if (ver < 0) 234 if (ver < 0)
238 { 235 {
239@@ -1760,7 +1753,7 @@ microblaze_option_override (void) 236@@ -1759,7 +1752,7 @@ microblaze_option_override (void)
240 } 237 }
241 238
242 /* TARGET_REORDER defaults to 2 if -mxl-reorder not specified. */ 239 /* TARGET_REORDER defaults to 2 if -mxl-reorder not specified. */
@@ -246,5 +243,5 @@ index 2ed64971fb..55dba83882 100644
246 { 243 {
247 if (TARGET_REORDER == 1) 244 if (TARGET_REORDER == 1)
248-- 245--
2492.14.2 2462.7.4
250 247
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0030-MicroBlaze-fixing-the-bug-in-the-bit-field-instructi.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0033-Fixing-the-bug-in-the-bit-field-instruction.patch
index 1d877be6..15111477 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0030-MicroBlaze-fixing-the-bug-in-the-bit-field-instructi.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0033-Fixing-the-bug-in-the-bit-field-instruction.patch
@@ -1,23 +1,19 @@
1From 0c740ddd203433ef8d979348c085269f8b97cbfc Mon Sep 17 00:00:00 2001 1From f3e259923788176ebb323155cc089e68c6de0895 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:50 -0700 3Date: Wed, 18 Jan 2017 13:57:48 +0530
4Subject: [PATCH] MicroBlaze fixing the bug in the bit-field instruction. 4Subject: [PATCH 33/54] Fixing the bug in the bit-field instruction. Bit field
5 instruction should be generated only if mcpu >10.0
5 6
6Bit field instruction should be generated only if mcpu >10.0
7
8Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com>
9Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
10Upstream-Status: Pending
11--- 7---
12 gcc/config/microblaze/microblaze.c | 3 +++ 8 gcc/config/microblaze/microblaze.c | 3 +++
13 gcc/config/microblaze/microblaze.h | 2 ++ 9 gcc/config/microblaze/microblaze.h | 2 ++
14 2 files changed, 5 insertions(+) 10 2 files changed, 5 insertions(+)
15 11
16diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c 12diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
17index 55dba83882..4f6d399bba 100644 13index 30a0fcf..835e906 100644
18--- a/gcc/config/microblaze/microblaze.c 14--- a/gcc/config/microblaze/microblaze.c
19+++ b/gcc/config/microblaze/microblaze.c 15+++ b/gcc/config/microblaze/microblaze.c
20@@ -159,6 +159,9 @@ int microblaze_no_unsafe_delay; 16@@ -163,6 +163,9 @@ int microblaze_no_unsafe_delay;
21 /* Set to one if the targeted core has the CLZ insn. */ 17 /* Set to one if the targeted core has the CLZ insn. */
22 int microblaze_has_clz = 0; 18 int microblaze_has_clz = 0;
23 19
@@ -28,7 +24,7 @@ index 55dba83882..4f6d399bba 100644
28 version having only a particular type of pipeline. There can still be 24 version having only a particular type of pipeline. There can still be
29 options on the CPU to scale pipeline features up or down. :( 25 options on the CPU to scale pipeline features up or down. :(
30diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h 26diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
31index 3f48e48f10..712525f856 100644 27index 2ac5aeec..991d0f7 100644
32--- a/gcc/config/microblaze/microblaze.h 28--- a/gcc/config/microblaze/microblaze.h
33+++ b/gcc/config/microblaze/microblaze.h 29+++ b/gcc/config/microblaze/microblaze.h
34@@ -44,6 +44,7 @@ extern int microblaze_dbx_regno[]; 30@@ -44,6 +44,7 @@ extern int microblaze_dbx_regno[];
@@ -48,5 +44,5 @@ index 3f48e48f10..712525f856 100644
48 /* The default is to support PIC. */ 44 /* The default is to support PIC. */
49 #define TARGET_SUPPORTS_PIC 1 45 #define TARGET_SUPPORTS_PIC 1
50-- 46--
512.14.2 472.7.4
52 48
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0034-Patch-microblaze-Macros-used-in-Xilinx-internal-patc.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0034-Patch-microblaze-Macros-used-in-Xilinx-internal-patc.patch
new file mode 100644
index 00000000..f22f2f3f
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0034-Patch-microblaze-Macros-used-in-Xilinx-internal-patc.patch
@@ -0,0 +1,32 @@
1From 52cf8e91f06ce9259d4d94bb8ea5cb327825b806 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 18 Jan 2017 20:57:10 +0530
4Subject: [PATCH 34/54] [Patch, microblaze]: Macros used in Xilinx internal
5 patches has been removed in gcc 6.2 version so modified the code accordingly.
6
7---
8 gcc/config/microblaze/microblaze.c | 8 +++-----
9 1 file changed, 3 insertions(+), 5 deletions(-)
10
11diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
12index 835e906..2e3b4c9 100644
13--- a/gcc/config/microblaze/microblaze.c
14+++ b/gcc/config/microblaze/microblaze.c
15@@ -2520,11 +2520,9 @@ print_operand (FILE * file, rtx op, int letter)
16 REAL_VALUE_TO_TARGET_DOUBLE (*CONST_DOUBLE_REAL_VALUE (op), val);
17 else
18 {
19- REAL_VALUE_TYPE rv;
20- REAL_VALUE_FROM_CONST_DOUBLE (rv, op);
21- REAL_VALUE_TO_TARGET_DOUBLE (rv, l);
22- val[1] = l[WORDS_BIG_ENDIAN == 0];
23- val[0] = l[WORDS_BIG_ENDIAN != 0];
24+ REAL_VALUE_TO_TARGET_DOUBLE (*CONST_DOUBLE_REAL_VALUE (op), l);
25+ val[1] = l[WORDS_BIG_ENDIAN == 0];
26+ val[0] = l[WORDS_BIG_ENDIAN != 0];
27 }
28 }
29 else if (code == CONST_INT)
30--
312.7.4
32
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0031-Fixing-the-issue-with-MicroBlaze-builtin_alloc.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0035-Fixing-the-issue-with-the-builtin_alloc.patch
index 3786a71a..00d67bcf 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0031-Fixing-the-issue-with-MicroBlaze-builtin_alloc.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0035-Fixing-the-issue-with-the-builtin_alloc.patch
@@ -1,21 +1,17 @@
1From fdb99f97b41f7cd06b81e668b88463d0fc2cbe87 Mon Sep 17 00:00:00 2001 1From 727b0f7ae03279177559f5d85d8920352bd853b2 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nagaraju.mekala@xilinx.com> 2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Sat, 26 Aug 2017 19:21:54 -0700 3Date: Thu, 23 Feb 2017 17:09:04 +0530
4Subject: [PATCH] Fixing the issue with MicroBlaze builtin_alloc 4Subject: [PATCH 35/54] Fixing the issue with the builtin_alloc. register r18
5 was not properly handling the stack pattern which was resolved by using free
6 available register
5 7
6Fixing the issue with the builtin_alloc. Register r18 was not properly 8signed-off-by:nagaraju mekala <nmekala@xilinx.com>
7handling the stack pattern which was resolved by using free available
8register
9
10Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
11Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
12Upstream-Status: Pending
13--- 9---
14 gcc/config/microblaze/microblaze.md | 8 ++++---- 10 gcc/config/microblaze/microblaze.md | 8 ++++----
15 1 file changed, 4 insertions(+), 4 deletions(-) 11 1 file changed, 4 insertions(+), 4 deletions(-)
16 12
17diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md 13diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
18index 7a00629922..68c3b22bd4 100644 14index 5a2dd13..8072ffc 100644
19--- a/gcc/config/microblaze/microblaze.md 15--- a/gcc/config/microblaze/microblaze.md
20+++ b/gcc/config/microblaze/microblaze.md 16+++ b/gcc/config/microblaze/microblaze.md
21@@ -2076,10 +2076,10 @@ 17@@ -2076,10 +2076,10 @@
@@ -44,5 +40,5 @@ index 7a00629922..68c3b22bd4 100644
44 } 40 }
45 ) 41 )
46-- 42--
472.14.2 432.7.4
48 44
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0036-Patch-Microblaze-reverting-the-cost-check-before-pro.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0036-Patch-Microblaze-reverting-the-cost-check-before-pro.patch
new file mode 100644
index 00000000..54ccd9a0
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0036-Patch-Microblaze-reverting-the-cost-check-before-pro.patch
@@ -0,0 +1,49 @@
1From 7156e379a67fa47a5fb9ede1448c0d528dbda65b Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Thu, 2 Mar 2017 19:02:31 +0530
4Subject: [PATCH 36/54] [Patch,Microblaze]:reverting the cost check before
5 propagating constants.
6
7---
8 gcc/cprop.c | 4 ++++
9 1 file changed, 4 insertions(+)
10
11diff --git a/gcc/cprop.c b/gcc/cprop.c
12index e4df509..deb706b 100644
13--- a/gcc/cprop.c
14+++ b/gcc/cprop.c
15@@ -733,6 +733,7 @@ try_replace_reg (rtx from, rtx to, rtx_insn *insn)
16 int success = 0;
17 rtx set = single_set (insn);
18
19+#if 0
20 bool check_rtx_costs = true;
21 bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn));
22 int old_cost = set ? set_rtx_cost (set, speed) : 0;
23@@ -744,6 +745,7 @@ try_replace_reg (rtx from, rtx to, rtx_insn *insn)
24 && (GET_CODE (XEXP (note, 0)) == CONST
25 || CONSTANT_P (XEXP (note, 0)))))
26 check_rtx_costs = false;
27+#endif
28
29 /* Usually we substitute easy stuff, so we won't copy everything.
30 We however need to take care to not duplicate non-trivial CONST
31@@ -752,6 +754,7 @@ try_replace_reg (rtx from, rtx to, rtx_insn *insn)
32
33 validate_replace_src_group (from, to, insn);
34
35+#if 0
36 /* If TO is a constant, check the cost of the set after propagation
37 to the cost of the set before the propagation. If the cost is
38 higher, then do not replace FROM with TO. */
39@@ -764,6 +767,7 @@ try_replace_reg (rtx from, rtx to, rtx_insn *insn)
40 return false;
41 }
42
43+#endif
44
45 if (num_changes_pending () && apply_change_group ())
46 success = 1;
47--
482.7.4
49
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0032-MicroBlaze-remove-bitfield-instructions-macros.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0037-Patch-Microblaze-update-in-constraints-for-bitfield-.patch
index 29bc752e..26b685a5 100644
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0032-MicroBlaze-remove-bitfield-instructions-macros.patch
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0037-Patch-Microblaze-update-in-constraints-for-bitfield-.patch
@@ -1,30 +1,25 @@
1From 646fe1dbaca06f2fe2df4c0da3fa20e0aff0a4ec Mon Sep 17 00:00:00 2001 1From 149cf4619622d27641a2886cd8bf38a49ad88f87 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nagaraju.mekala@xilinx.com> 2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Sat, 26 Aug 2017 19:21:56 -0700 3Date: Mon, 19 Feb 2018 18:06:16 +0530
4Subject: [PATCH] MicroBlaze remove bitfield instructions macros 4Subject: [PATCH 37/54] [Patch,Microblaze]: update in constraints for bitfield
5 insert and extract instructions.
5 6
6Remove the conditions in the bit field expand macros to generate the
7instructions in structure bit-field usecases
8
9ChangeLog:
10
112018-08-16 Nagaraju Mekala <nagaraju.mekala@xilinx.com>
12
13 * gcc/config/microblaze/microblaze.md:
14 remove the expand constraints
15
16Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
17Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
18Upstream-Status: Pending
19--- 7---
20 gcc/config/microblaze/microblaze.md | 40 +++++-------------------------------- 8 gcc/config/microblaze/microblaze.md | 43 ++++++-------------------------------
21 1 file changed, 5 insertions(+), 35 deletions(-) 9 1 file changed, 7 insertions(+), 36 deletions(-)
22 10
23diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md 11diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
24index 68c3b22bd4..ef53c3069e 100644 12index 8072ffc..9bb87ec 100644
25--- a/gcc/config/microblaze/microblaze.md 13--- a/gcc/config/microblaze/microblaze.md
26+++ b/gcc/config/microblaze/microblaze.md 14+++ b/gcc/config/microblaze/microblaze.md
27@@ -2482,25 +2482,8 @@ 15@@ -2476,33 +2476,17 @@
16 DONE;
17 }")
18
19-(define_expand "extvsi"
20+(define_expand "extzvsi"
21 [(set (match_operand:SI 0 "register_operand" "r")
22 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
28 (match_operand:SI 2 "immediate_operand" "I") 23 (match_operand:SI 2 "immediate_operand" "I")
29 (match_operand:SI 3 "immediate_operand" "I")))] 24 (match_operand:SI 3 "immediate_operand" "I")))]
30 "TARGET_HAS_BITFIELD" 25 "TARGET_HAS_BITFIELD"
@@ -50,13 +45,16 @@ index 68c3b22bd4..ef53c3069e 100644
50+"" 45+""
51+) 46+)
52 47
53 (define_insn "extv_32" 48-(define_insn "extv_32"
49+
50+(define_insn "extzv_32"
54 [(set (match_operand:SI 0 "register_operand" "=r") 51 [(set (match_operand:SI 0 "register_operand" "=r")
55@@ -2518,22 +2501,9 @@ 52 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
56 (match_operand:SI 1 "immediate_operand" "I") 53 (match_operand:SI 2 "immediate_operand" "I")
54@@ -2519,21 +2503,8 @@
57 (match_operand:SI 2 "immediate_operand" "I")) 55 (match_operand:SI 2 "immediate_operand" "I"))
58 (match_operand:SI 3 "register_operand" "r"))] 56 (match_operand:SI 3 "register_operand" "r"))]
59- "TARGET_HAS_BITFIELD" 57 "TARGET_HAS_BITFIELD"
60- " 58- "
61-{ 59-{
62- unsigned HOST_WIDE_INT len = UINTVAL (operands[1]); 60- unsigned HOST_WIDE_INT len = UINTVAL (operands[1]);
@@ -72,12 +70,11 @@ index 68c3b22bd4..ef53c3069e 100644
72- operands[2], operands[3])); 70- operands[2], operands[3]));
73- DONE; 71- DONE;
74-}") 72-}")
75+"TARGET_HAS_BITFIELD"
76+"" 73+""
77+) 74+)
78 75
79 (define_insn "insv_32" 76 (define_insn "insv_32"
80 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r") 77 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r")
81-- 78--
822.14.2 792.7.4
83 80
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0038-Patch-Microblaze-Removed-fsqrt-generation-for-double.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0038-Patch-Microblaze-Removed-fsqrt-generation-for-double.patch
new file mode 100644
index 00000000..d8ae6c15
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0038-Patch-Microblaze-Removed-fsqrt-generation-for-double.patch
@@ -0,0 +1,38 @@
1From 5494699756f8e1dba6848fcf09780a031139c232 Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 4 Jun 2018 10:10:18 +0530
4Subject: [PATCH 38/54] [Patch,Microblaze] : Removed fsqrt generation for
5 double values.
6
7---
8 gcc/config/microblaze/microblaze.md | 14 --------------
9 1 file changed, 14 deletions(-)
10
11diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
12index 9bb87ec..a93ddd0 100644
13--- a/gcc/config/microblaze/microblaze.md
14+++ b/gcc/config/microblaze/microblaze.md
15@@ -524,20 +524,6 @@
16 (set_attr "mode" "SF")
17 (set_attr "length" "4")])
18
19-(define_insn "sqrtdf2"
20- [(set (match_operand:DF 0 "register_operand" "=d")
21- (sqrt:DF (match_operand:DF 1 "register_operand" "dG")))]
22- "TARGET_HARD_FLOAT && TARGET_FLOAT_SQRT"
23- {
24- if (REGNO (operands[0]) == REGNO (operands[1]))
25- return "fsqrt\t%0,%1";
26- else
27- return "fsqrt\t%0,%1\n\taddk\t%D0,%D1,r0";
28- }
29- [(set_attr "type" "fsqrt")
30- (set_attr "mode" "SF")
31- (set_attr "length" "4")])
32-
33 (define_insn "fix_truncsfsi2"
34 [(set (match_operand:SI 0 "register_operand" "=d")
35 (fix:SI (match_operand:SF 1 "register_operand" "d")))]
36--
372.7.4
38
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0039-Intial-commit-of-64-bit-Microblaze.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0039-Intial-commit-of-64-bit-Microblaze.patch
new file mode 100644
index 00000000..88497a8e
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0039-Intial-commit-of-64-bit-Microblaze.patch
@@ -0,0 +1,810 @@
1From 6e8b37bf54646c38fb4071d542a60ea92715df9b Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Tue, 3 Apr 2018 16:48:39 +0530
4Subject: [PATCH 39/54] Intial commit of 64-bit Microblaze
5
6---
7 gcc/config/microblaze/microblaze-protos.h | 1 +
8 gcc/config/microblaze/microblaze.c | 109 +++++++--
9 gcc/config/microblaze/microblaze.h | 4 +-
10 gcc/config/microblaze/microblaze.md | 370 +++++++++++++++++++++++++++++-
11 gcc/config/microblaze/microblaze.opt | 9 +-
12 gcc/config/microblaze/t-microblaze | 7 +-
13 6 files changed, 461 insertions(+), 39 deletions(-)
14
15diff --git a/gcc/config/microblaze/microblaze-protos.h b/gcc/config/microblaze/microblaze-protos.h
16index c39e2e9..a5ed62e 100644
17--- a/gcc/config/microblaze/microblaze-protos.h
18+++ b/gcc/config/microblaze/microblaze-protos.h
19@@ -35,6 +35,7 @@ extern void microblaze_expand_divide (rtx *);
20 extern void microblaze_expand_conditional_branch (enum machine_mode, rtx *);
21 extern void microblaze_expand_conditional_branch_reg (machine_mode, rtx *);
22 extern void microblaze_expand_conditional_branch_sf (rtx *);
23+extern void microblaze_expand_conditional_branch_df (rtx *);
24 extern int microblaze_can_use_return_insn (void);
25 extern void print_operand (FILE *, rtx, int);
26 extern void print_operand_address (FILE *, rtx);
27diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
28index 2e3b4c9..2079ae9 100644
29--- a/gcc/config/microblaze/microblaze.c
30+++ b/gcc/config/microblaze/microblaze.c
31@@ -3457,11 +3457,11 @@ microblaze_expand_move (machine_mode mode, rtx operands[])
32 op0 = operands[0];
33 op1 = operands[1];
34
35- if (!register_operand (op0, SImode)
36- && !register_operand (op1, SImode)
37+ if (!register_operand (op0, mode)
38+ && !register_operand (op1, mode)
39 && (GET_CODE (op1) != CONST_INT || INTVAL (op1) != 0))
40 {
41- rtx temp = force_reg (SImode, op1);
42+ rtx temp = force_reg (mode, op1);
43 emit_move_insn (op0, temp);
44 return true;
45 }
46@@ -3499,12 +3499,12 @@ microblaze_expand_move (machine_mode mode, rtx operands[])
47 && (flag_pic == 2 || microblaze_tls_symbol_p (p0)
48 || !SMALL_INT (p1)))))
49 {
50- rtx temp = force_reg (SImode, p0);
51+ rtx temp = force_reg (mode, p0);
52 rtx temp2 = p1;
53
54 if (flag_pic && reload_in_progress)
55 df_set_regs_ever_live (PIC_OFFSET_TABLE_REGNUM, true);
56- emit_move_insn (op0, gen_rtx_PLUS (SImode, temp, temp2));
57+ emit_move_insn (op0, gen_rtx_PLUS (mode, temp, temp2));
58 return true;
59 }
60 }
61@@ -3635,7 +3635,7 @@ microblaze_expand_conditional_branch (machine_mode mode, rtx operands[])
62 rtx cmp_op0 = operands[1];
63 rtx cmp_op1 = operands[2];
64 rtx label1 = operands[3];
65- rtx comp_reg = gen_reg_rtx (SImode);
66+ rtx comp_reg = gen_reg_rtx (mode);
67 rtx condition;
68
69 gcc_assert ((GET_CODE (cmp_op0) == REG) || (GET_CODE (cmp_op0) == SUBREG));
70@@ -3644,23 +3644,36 @@ microblaze_expand_conditional_branch (machine_mode mode, rtx operands[])
71 if (cmp_op1 == const0_rtx)
72 {
73 comp_reg = cmp_op0;
74- condition = gen_rtx_fmt_ee (signed_condition (code), SImode, comp_reg, const0_rtx);
75- emit_jump_insn (gen_condjump (condition, label1));
76+ condition = gen_rtx_fmt_ee (signed_condition (code), mode, comp_reg, const0_rtx);
77+ if (mode == SImode)
78+ emit_jump_insn (gen_condjump (condition, label1));
79+ else
80+ emit_jump_insn (gen_long_condjump (condition, label1));
81+
82 }
83
84 else if (code == EQ || code == NE)
85 {
86 /* Use xor for equal/not-equal comparison. */
87- emit_insn (gen_xorsi3 (comp_reg, cmp_op0, cmp_op1));
88- condition = gen_rtx_fmt_ee (signed_condition (code), SImode, comp_reg, const0_rtx);
89- emit_jump_insn (gen_condjump (condition, label1));
90+ if (mode == SImode)
91+ emit_insn (gen_xorsi3 (comp_reg, cmp_op0, cmp_op1));
92+ else
93+ emit_insn (gen_xordi3 (comp_reg, cmp_op0, cmp_op1));
94+ condition = gen_rtx_fmt_ee (signed_condition (code), mode, comp_reg, const0_rtx);
95+ if (mode == SImode)
96+ emit_jump_insn (gen_condjump (condition, label1));
97+ else
98+ emit_jump_insn (gen_long_condjump (condition, label1));
99 }
100 else
101 {
102 /* Generate compare and branch in single instruction. */
103 cmp_op1 = force_reg (mode, cmp_op1);
104 condition = gen_rtx_fmt_ee (code, mode, cmp_op0, cmp_op1);
105- emit_jump_insn (gen_branch_compare(condition, cmp_op0, cmp_op1, label1));
106+ if (mode == SImode)
107+ emit_jump_insn (gen_branch_compare(condition, cmp_op0, cmp_op1, label1));
108+ else
109+ emit_jump_insn (gen_long_branch_compare(condition, cmp_op0, cmp_op1, label1));
110 }
111 }
112
113@@ -3671,7 +3684,7 @@ microblaze_expand_conditional_branch_reg (machine_mode mode, rtx operands[])
114 rtx cmp_op0 = operands[1];
115 rtx cmp_op1 = operands[2];
116 rtx label1 = operands[3];
117- rtx comp_reg = gen_reg_rtx (SImode);
118+ rtx comp_reg = gen_reg_rtx (mode);
119 rtx condition;
120
121 gcc_assert ((GET_CODE (cmp_op0) == REG)
122@@ -3682,30 +3695,63 @@ microblaze_expand_conditional_branch_reg (machine_mode mode, rtx operands[])
123 {
124 comp_reg = cmp_op0;
125 condition = gen_rtx_fmt_ee (signed_condition (code),
126- SImode, comp_reg, const0_rtx);
127- emit_jump_insn (gen_condjump (condition, label1));
128+ mode, comp_reg, const0_rtx);
129+ if (mode == SImode)
130+ emit_jump_insn (gen_condjump (condition, label1));
131+ else
132+ emit_jump_insn (gen_long_condjump (condition, label1));
133 }
134 else if (code == EQ)
135 {
136- emit_insn (gen_seq_internal_pat (comp_reg,
137- cmp_op0, cmp_op1));
138- condition = gen_rtx_EQ (SImode, comp_reg, const0_rtx);
139- emit_jump_insn (gen_condjump (condition, label1));
140+ if (mode == SImode)
141+ {
142+ emit_insn (gen_seq_internal_pat (comp_reg, cmp_op0,
143+ cmp_op1));
144+ }
145+ else
146+ {
147+ emit_insn (gen_seq_internal_pat (comp_reg, cmp_op0,
148+ cmp_op1));
149+ }
150+ condition = gen_rtx_EQ (mode, comp_reg, const0_rtx);
151+ if (mode == SImode)
152+ emit_jump_insn (gen_condjump (condition, label1));
153+ else
154+ emit_jump_insn (gen_long_condjump (condition, label1));
155+
156 }
157 else if (code == NE)
158 {
159- emit_insn (gen_sne_internal_pat (comp_reg, cmp_op0,
160- cmp_op1));
161- condition = gen_rtx_NE (SImode, comp_reg, const0_rtx);
162- emit_jump_insn (gen_condjump (condition, label1));
163+ if (mode == SImode)
164+ {
165+ emit_insn (gen_sne_internal_pat (comp_reg, cmp_op0,
166+ cmp_op1));
167+ }
168+ else
169+ {
170+ emit_insn (gen_sne_internal_pat (comp_reg, cmp_op0,
171+ cmp_op1));
172+ }
173+ condition = gen_rtx_NE (mode, comp_reg, const0_rtx);
174+ if (mode == SImode)
175+ emit_jump_insn (gen_condjump (condition, label1));
176+ else
177+ emit_jump_insn (gen_long_condjump (condition, label1));
178 }
179 else
180 {
181 /* Generate compare and branch in single instruction. */
182 cmp_op1 = force_reg (mode, cmp_op1);
183 condition = gen_rtx_fmt_ee (code, mode, cmp_op0, cmp_op1);
184- emit_jump_insn (gen_branch_compare (condition, cmp_op0,
185- cmp_op1, label1));
186+ if (mode == SImode)
187+ emit_jump_insn (gen_branch_compare (condition, cmp_op0,
188+ cmp_op1, label1));
189+ else
190+ {
191+ emit_jump_insn (gen_long_branch_compare (condition, cmp_op0,
192+ cmp_op1, label1));
193+ }
194+
195 }
196 }
197
198@@ -3722,6 +3768,19 @@ microblaze_expand_conditional_branch_sf (rtx operands[])
199 emit_jump_insn (gen_condjump (condition, operands[3]));
200 }
201
202+void
203+microblaze_expand_conditional_branch_df (rtx operands[])
204+{
205+ rtx condition;
206+ rtx cmp_op0 = XEXP (operands[0], 0);
207+ rtx cmp_op1 = XEXP (operands[0], 1);
208+ rtx comp_reg = gen_reg_rtx (DImode);
209+
210+ emit_insn (gen_cstoredf4 (comp_reg, operands[0], cmp_op0, cmp_op1));
211+ condition = gen_rtx_NE (DImode, comp_reg, const0_rtx);
212+ emit_jump_insn (gen_long_condjump (condition, operands[3]));
213+}
214+
215 /* Implement TARGET_FRAME_POINTER_REQUIRED. */
216
217 static bool
218diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
219index 991d0f7..72fbee5 100644
220--- a/gcc/config/microblaze/microblaze.h
221+++ b/gcc/config/microblaze/microblaze.h
222@@ -102,6 +102,7 @@ extern enum pipeline_type microblaze_pipe;
223 #define ASM_SPEC "\
224 %(target_asm_spec) \
225 %{mbig-endian:-EB} \
226+%{m64:-m64} \
227 %{mlittle-endian:-EL}"
228
229 /* Extra switches sometimes passed to the linker. */
230@@ -110,6 +111,7 @@ extern enum pipeline_type microblaze_pipe;
231 #define LINK_SPEC "%{shared:-shared} -N -relax \
232 %{mbig-endian:-EB --oformat=elf32-microblaze} \
233 %{mlittle-endian:-EL --oformat=elf32-microblazeel} \
234+ %{m64:-EL --oformat=elf64-microblazeel} \
235 %{Zxl-mode-xmdstub:-defsym _TEXT_START_ADDR=0x800} \
236 %{mxl-mode-xmdstub:-defsym _TEXT_START_ADDR=0x800} \
237 %{mxl-gp-opt:%{G*}} %{!mxl-gp-opt: -G 0} \
238@@ -217,7 +219,7 @@ extern enum pipeline_type microblaze_pipe;
239 #define MIN_UNITS_PER_WORD 4
240 #define INT_TYPE_SIZE 32
241 #define SHORT_TYPE_SIZE 16
242-#define LONG_TYPE_SIZE 32
243+#define LONG_TYPE_SIZE 64
244 #define LONG_LONG_TYPE_SIZE 64
245 #define FLOAT_TYPE_SIZE 32
246 #define DOUBLE_TYPE_SIZE 64
247diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
248index a93ddd0..6976b37 100644
249--- a/gcc/config/microblaze/microblaze.md
250+++ b/gcc/config/microblaze/microblaze.md
251@@ -495,7 +495,6 @@
252 (set_attr "mode" "SF")
253 (set_attr "length" "4")])
254
255-
256 (define_insn "divsf3"
257 [(set (match_operand:SF 0 "register_operand" "=d")
258 (div:SF (match_operand:SF 1 "register_operand" "d")
259@@ -506,6 +505,7 @@
260 (set_attr "mode" "SF")
261 (set_attr "length" "4")])
262
263+
264 (define_insn "sqrtsf2"
265 [(set (match_operand:SF 0 "register_operand" "=d")
266 (sqrt:SF (match_operand:SF 1 "register_operand" "d")))]
267@@ -560,6 +560,18 @@
268
269 ;; Adding 2 DI operands in register or reg/imm
270
271+(define_insn "adddi3_long"
272+ [(set (match_operand:DI 0 "register_operand" "=d,d")
273+ (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%dJ,dJ")
274+ (match_operand:DI 2 "arith_plus_operand" "d,K")))]
275+ "TARGET_MB_64"
276+ "@
277+ addlk\t%0,%z1,%2
278+ addlik\t%0,%z1,%2"
279+ [(set_attr "type" "arith,arith")
280+ (set_attr "mode" "DI,DI")
281+ (set_attr "length" "4,4")])
282+
283 (define_insn "adddi3"
284 [(set (match_operand:DI 0 "register_operand" "=d,d")
285 (plus:DI (match_operand:DI 1 "register_operand" "%d,d")
286@@ -604,6 +616,18 @@
287 ;; Double Precision Subtraction
288 ;;----------------------------------------------------------------
289
290+(define_insn "subdi3_long"
291+ [(set (match_operand:DI 0 "register_operand" "=d,d")
292+ (minus:DI (match_operand:DI 1 "register_operand" "d,d")
293+ (match_operand:DI 2 "register_operand" "d,n")))]
294+ "TARGET_MB_64"
295+ "@
296+ rsubl\t%0,%2,%1
297+ addlik\t%0,%z1,-%2"
298+ [(set_attr "type" "darith")
299+ (set_attr "mode" "DI,DI")
300+ (set_attr "length" "4,4")])
301+
302 (define_insn "subdi3"
303 [(set (match_operand:DI 0 "register_operand" "=&d")
304 (minus:DI (match_operand:DI 1 "register_operand" "d")
305@@ -793,6 +817,15 @@
306 (set_attr "mode" "SI")
307 (set_attr "length" "4")])
308
309+(define_insn "negdi2_long"
310+ [(set (match_operand:DI 0 "register_operand" "=d")
311+ (neg:DI (match_operand:DI 1 "register_operand" "d")))]
312+ "TARGET_MB_64"
313+ "rsubl\t%0,%1,r0"
314+ [(set_attr "type" "darith")
315+ (set_attr "mode" "DI")
316+ (set_attr "length" "4")])
317+
318 (define_insn "negdi2"
319 [(set (match_operand:DI 0 "register_operand" "=d")
320 (neg:DI (match_operand:DI 1 "register_operand" "d")))]
321@@ -812,6 +845,15 @@
322 (set_attr "mode" "SI")
323 (set_attr "length" "4")])
324
325+(define_insn "one_cmpldi2_long"
326+ [(set (match_operand:DI 0 "register_operand" "=d")
327+ (not:DI (match_operand:DI 1 "register_operand" "d")))]
328+ "TARGET_MB_64"
329+ "xorli\t%0,%1,-1"
330+ [(set_attr "type" "arith")
331+ (set_attr "mode" "DI")
332+ (set_attr "length" "4")])
333+
334 (define_insn "*one_cmpldi2"
335 [(set (match_operand:DI 0 "register_operand" "=d")
336 (not:DI (match_operand:DI 1 "register_operand" "d")))]
337@@ -838,6 +880,20 @@
338 ;; Logical
339 ;;----------------------------------------------------------------
340
341+(define_insn "anddi3"
342+ [(set (match_operand:DI 0 "register_operand" "=d,d")
343+ (and:DI (match_operand:DI 1 "arith_operand" "d,d")
344+ (match_operand:DI 2 "arith_operand" "d,K")))]
345+ "TARGET_MB_64"
346+ "@
347+ andl\t%0,%1,%2
348+ andli\t%0,%1,%2 #andl1"
349+ ;; andli\t%0,%1,%2 #andl3
350+ ;; andli\t%0,%1,%2 #andl2
351+ [(set_attr "type" "arith,arith")
352+ (set_attr "mode" "DI,DI")
353+ (set_attr "length" "4,4")])
354+
355 (define_insn "andsi3"
356 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
357 (and:SI (match_operand:SI 1 "arith_operand" "%d,d,d,d")
358@@ -853,6 +909,18 @@
359 (set_attr "length" "4,8,8,8")])
360
361
362+(define_insn "iordi3"
363+ [(set (match_operand:DI 0 "register_operand" "=d,d")
364+ (ior:DI (match_operand:DI 1 "arith_operand" "d,d")
365+ (match_operand:DI 2 "arith_operand" "d,K")))]
366+ "TARGET_MB_64"
367+ "@
368+ orl\t%0,%1,%2
369+ orli\t%0,%1,%2 #andl1"
370+ [(set_attr "type" "arith,arith")
371+ (set_attr "mode" "DI,DI")
372+ (set_attr "length" "4,4")])
373+
374 (define_insn "iorsi3"
375 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
376 (ior:SI (match_operand:SI 1 "arith_operand" "%d,d,d,d")
377@@ -867,6 +935,19 @@
378 (set_attr "mode" "SI,SI,SI,SI")
379 (set_attr "length" "4,8,8,8")])
380
381+(define_insn "xordi3"
382+ [(set (match_operand:DI 0 "register_operand" "=d,d")
383+ (xor:DI (match_operand:DI 1 "arith_operand" "%d,d")
384+ (match_operand:DI 2 "arith_operand" "d,K")))]
385+ "TARGET_MB_64"
386+ "@
387+ xorl\t%0,%1,%2
388+ xorli\t%0,%1,%2 #andl1"
389+ [(set_attr "type" "arith,arith")
390+ (set_attr "mode" "DI,DI")
391+ (set_attr "length" "4,4")])
392+
393+
394 (define_insn "xorsi3"
395 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
396 (xor:SI (match_operand:SI 1 "arith_operand" "%d,d,d")
397@@ -935,6 +1016,26 @@
398 (set_attr "mode" "SI")
399 (set_attr "length" "4")])
400
401+;;(define_expand "extendqidi2"
402+;; [(set (match_operand:DI 0 "register_operand" "=d")
403+;; (sign_extend:DI (match_operand:QI 1 "general_operand" "d")))]
404+;; "TARGET_MB_64"
405+;; {
406+;; if (GET_CODE (operands[1]) != REG)
407+;; FAIL;
408+;; }
409+;;)
410+
411+
412+;;(define_insn "extendqidi2"
413+;; [(set (match_operand:DI 0 "register_operand" "=d")
414+;; (sign_extend:DI (match_operand:QI 1 "register_operand" "d")))]
415+;; "TARGET_MB_64"
416+;; "sextl8\t%0,%1"
417+;; [(set_attr "type" "arith")
418+;; (set_attr "mode" "DI")
419+;; (set_attr "length" "4")])
420+
421 (define_insn "extendhisi2"
422 [(set (match_operand:SI 0 "register_operand" "=d")
423 (sign_extend:SI (match_operand:HI 1 "register_operand" "d")))]
424@@ -944,6 +1045,16 @@
425 (set_attr "mode" "SI")
426 (set_attr "length" "4")])
427
428+(define_insn "extendhidi2"
429+ [(set (match_operand:DI 0 "register_operand" "=d")
430+ (sign_extend:DI (match_operand:HI 1 "register_operand" "d")))]
431+ "TARGET_MB_64"
432+ "sextl16\t%0,%1"
433+ [(set_attr "type" "arith")
434+ (set_attr "mode" "DI")
435+ (set_attr "length" "4")])
436+
437+
438 ;; Those for integer source operand are ordered
439 ;; widest source type first.
440
441@@ -1009,7 +1120,6 @@
442 )
443
444
445-
446 (define_insn "*movdi_internal"
447 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,R,o")
448 (match_operand:DI 1 "general_operand" " d,i,J,R,o,d,d"))]
449@@ -1421,6 +1531,36 @@
450 (set_attr "length" "4,4")]
451 )
452
453+;; Barrel shift left
454+(define_expand "ashldi3"
455+ [(set (match_operand:DI 0 "register_operand" "=&d")
456+ (ashift:DI (match_operand:DI 1 "register_operand" "d")
457+ (match_operand:DI 2 "arith_operand" "")))]
458+"TARGET_MB_64"
459+{
460+;;if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 65)
461+if (INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 65)
462+ {
463+ emit_insn(gen_ashldi3_long (operands[0], operands[1],operands[2]));
464+ DONE;
465+ }
466+else
467+ FAIL;
468+}
469+)
470+
471+(define_insn "ashldi3_long"
472+ [(set (match_operand:DI 0 "register_operand" "=d,d")
473+ (ashift:DI (match_operand:DI 1 "register_operand" "d,d")
474+ (match_operand:DI 2 "arith_operand" "I,d")))]
475+ "TARGET_MB_64"
476+ "@
477+ bsllli\t%0,%1,%2
478+ bslll\t%0,%1,%2"
479+ [(set_attr "type" "bshift,bshift")
480+ (set_attr "mode" "DI,DI")
481+ (set_attr "length" "4,4")]
482+)
483 ;; The following patterns apply when there is no barrel shifter present
484
485 (define_insn "*ashlsi3_with_mul_delay"
486@@ -1546,6 +1686,36 @@
487 ;;----------------------------------------------------------------
488 ;; 32-bit right shifts
489 ;;----------------------------------------------------------------
490+;; Barrel shift left
491+(define_expand "ashrdi3"
492+ [(set (match_operand:DI 0 "register_operand" "=&d")
493+ (ashiftrt:DI (match_operand:DI 1 "register_operand" "d")
494+ (match_operand:DI 2 "arith_operand" "")))]
495+"TARGET_MB_64"
496+{
497+;;if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 65)
498+if (INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 65)
499+ {
500+ emit_insn(gen_ashrdi3_long (operands[0], operands[1],operands[2]));
501+ DONE;
502+ }
503+else
504+ FAIL;
505+}
506+)
507+
508+(define_insn "ashrdi3_long"
509+ [(set (match_operand:DI 0 "register_operand" "=d,d")
510+ (ashiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
511+ (match_operand:DI 2 "arith_operand" "I,d")))]
512+ "TARGET_MB_64"
513+ "@
514+ bslrai\t%0,%1,%2
515+ bslra\t%0,%1,%2"
516+ [(set_attr "type" "bshift,bshift")
517+ (set_attr "mode" "DI,DI")
518+ (set_attr "length" "4,4")]
519+ )
520 (define_expand "ashrsi3"
521 [(set (match_operand:SI 0 "register_operand" "=&d")
522 (ashiftrt:SI (match_operand:SI 1 "register_operand" "d")
523@@ -1655,6 +1825,36 @@
524 ;;----------------------------------------------------------------
525 ;; 32-bit right shifts (logical)
526 ;;----------------------------------------------------------------
527+;; Barrel shift left
528+(define_expand "lshrdi3"
529+ [(set (match_operand:DI 0 "register_operand" "=&d")
530+ (lshiftrt:DI (match_operand:DI 1 "register_operand" "d")
531+ (match_operand:DI 2 "arith_operand" "")))]
532+"TARGET_MB_64"
533+{
534+;;if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 65)
535+if (INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 65)
536+ {
537+ emit_insn(gen_lshrdi3_long (operands[0], operands[1],operands[2]));
538+ DONE;
539+ }
540+else
541+ FAIL;
542+}
543+)
544+
545+(define_insn "lshrdi3_long"
546+ [(set (match_operand:DI 0 "register_operand" "=d,d")
547+ (lshiftrt:DI (match_operand:DI 1 "register_operand" "d,d")
548+ (match_operand:DI 2 "arith_operand" "I,d")))]
549+ "TARGET_MB_64"
550+ "@
551+ bslrli\t%0,%1,%2
552+ bslrl\t%0,%1,%2"
553+ [(set_attr "type" "bshift,bshift")
554+ (set_attr "mode" "DI,DI")
555+ (set_attr "length" "4,4")]
556+ )
557
558 (define_expand "lshrsi3"
559 [(set (match_operand:SI 0 "register_operand" "=&d")
560@@ -1801,6 +2001,8 @@
561 (set_attr "length" "4")]
562 )
563
564+
565+
566 ;;----------------------------------------------------------------
567 ;; Setting a register from an floating point comparison.
568 ;;----------------------------------------------------------------
569@@ -1816,6 +2018,18 @@
570 (set_attr "length" "4")]
571 )
572
573+(define_insn "cstoredf4"
574+ [(set (match_operand:DI 0 "register_operand" "=r")
575+ (match_operator:DI 1 "ordered_comparison_operator"
576+ [(match_operand:DF 2 "register_operand" "r")
577+ (match_operand:DF 3 "register_operand" "r")]))]
578+ "TARGET_MB_64"
579+ "dcmp.%C1\t%0,%3,%2"
580+ [(set_attr "type" "fcmp")
581+ (set_attr "mode" "DF")
582+ (set_attr "length" "4")]
583+)
584+
585 ;;----------------------------------------------------------------
586 ;; Conditional branches
587 ;;----------------------------------------------------------------
588@@ -1928,6 +2142,115 @@
589 (set_attr "length" "12")]
590 )
591
592+
593+(define_expand "cbranchdi4"
594+ [(set (pc)
595+ (if_then_else (match_operator 0 "ordered_comparison_operator"
596+ [(match_operand:DI 1 "register_operand")
597+ (match_operand:DI 2 "arith_operand" "I,i")])
598+ (label_ref (match_operand 3 ""))
599+ (pc)))]
600+ "TARGET_MB_64"
601+{
602+ microblaze_expand_conditional_branch (DImode, operands);
603+ DONE;
604+})
605+
606+(define_expand "cbranchdi4_reg"
607+ [(set (pc)
608+ (if_then_else (match_operator 0 "ordered_comparison_operator"
609+ [(match_operand:DI 1 "register_operand")
610+ (match_operand:DI 2 "register_operand")])
611+ (label_ref (match_operand 3 ""))
612+ (pc)))]
613+ "TARGET_MB_64"
614+{
615+ microblaze_expand_conditional_branch_reg (DImode, operands);
616+ DONE;
617+})
618+
619+(define_expand "cbranchdf4"
620+ [(set (pc)
621+ (if_then_else (match_operator 0 "ordered_comparison_operator"
622+ [(match_operand:DF 1 "register_operand")
623+ (match_operand:DF 2 "register_operand")])
624+ (label_ref (match_operand 3 ""))
625+ (pc)))]
626+ "TARGET_MB_64"
627+{
628+ microblaze_expand_conditional_branch_df (operands);
629+ DONE;
630+
631+})
632+
633+;; Used to implement comparison instructions
634+(define_expand "long_condjump"
635+ [(set (pc)
636+ (if_then_else (match_operand 0)
637+ (label_ref (match_operand 1))
638+ (pc)))])
639+
640+(define_insn "long_branch_zero"
641+ [(set (pc)
642+ (if_then_else (match_operator:DI 0 "ordered_comparison_operator"
643+ [(match_operand:DI 1 "register_operand" "d")
644+ (const_int 0)])
645+ (match_operand:DI 2 "pc_or_label_operand" "")
646+ (match_operand:DI 3 "pc_or_label_operand" "")))
647+ ]
648+ "TARGET_MB_64"
649+ {
650+ if (operands[3] == pc_rtx)
651+ return "beal%C0i%?\t%z1,%2";
652+ else
653+ return "beal%N0i%?\t%z1,%3";
654+ }
655+ [(set_attr "type" "branch")
656+ (set_attr "mode" "none")
657+ (set_attr "length" "4")]
658+)
659+
660+(define_insn "long_branch_compare"
661+ [(set (pc)
662+ (if_then_else (match_operator:DI 0 "cmp_op"
663+ [(match_operand:DI 1 "register_operand" "d")
664+ (match_operand:DI 2 "register_operand" "d")
665+ ])
666+ (label_ref (match_operand 3))
667+ (pc)))
668+ (clobber(reg:DI R_TMP))]
669+ "TARGET_MB_64"
670+ {
671+ operands[4] = gen_rtx_REG (DImode, MB_ABI_ASM_TEMP_REGNUM);
672+ enum rtx_code code = GET_CODE (operands[0]);
673+
674+ if (code == GT || code == LE)
675+ {
676+ output_asm_insn ("cmpl\tr18,%z1,%z2", operands);
677+ code = swap_condition (code);
678+ }
679+ else if (code == GTU || code == LEU)
680+ {
681+ output_asm_insn ("cmplu\tr18,%z1,%z2", operands);
682+ code = swap_condition (code);
683+ }
684+ else if (code == GE || code == LT)
685+ {
686+ output_asm_insn ("cmpl\tr18,%z2,%z1", operands);
687+ }
688+ else if (code == GEU || code == LTU)
689+ {
690+ output_asm_insn ("cmplu\tr18,%z2,%z1", operands);
691+ }
692+
693+ operands[0] = gen_rtx_fmt_ee (signed_condition (code), DImode, operands[4], const0_rtx);
694+ return "beal%C0i%?\tr18,%3";
695+ }
696+ [(set_attr "type" "branch")
697+ (set_attr "mode" "none")
698+ (set_attr "length" "12")]
699+)
700+
701 ;;----------------------------------------------------------------
702 ;; Unconditional branches
703 ;;----------------------------------------------------------------
704@@ -2462,17 +2785,33 @@
705 DONE;
706 }")
707
708-(define_expand "extzvsi"
709+(define_expand "extvsi"
710 [(set (match_operand:SI 0 "register_operand" "r")
711 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
712 (match_operand:SI 2 "immediate_operand" "I")
713 (match_operand:SI 3 "immediate_operand" "I")))]
714 "TARGET_HAS_BITFIELD"
715-""
716-)
717-
718+"
719+{
720+ unsigned HOST_WIDE_INT len = UINTVAL (operands[2]);
721+ unsigned HOST_WIDE_INT pos = UINTVAL (operands[3]);
722+
723+ if ((len == 0) || (pos + len > 32) )
724+ FAIL;
725+
726+ ;;if (!register_operand (operands[1], VOIDmode))
727+ ;; FAIL;
728+ if (operands[0] == operands[1])
729+ FAIL;
730+ if (GET_CODE (operands[1]) == ASHIFT)
731+ FAIL;
732+;; operands[2] = GEN_INT(INTVAL(operands[2])+1 );
733+ emit_insn (gen_extv_32 (operands[0], operands[1],
734+ operands[2], operands[3]));
735+ DONE;
736+}")
737
738-(define_insn "extzv_32"
739+(define_insn "extv_32"
740 [(set (match_operand:SI 0 "register_operand" "=r")
741 (zero_extract:SI (match_operand:SI 1 "register_operand" "r")
742 (match_operand:SI 2 "immediate_operand" "I")
743@@ -2489,8 +2828,21 @@
744 (match_operand:SI 2 "immediate_operand" "I"))
745 (match_operand:SI 3 "register_operand" "r"))]
746 "TARGET_HAS_BITFIELD"
747-""
748-)
749+ "
750+{
751+ unsigned HOST_WIDE_INT len = UINTVAL (operands[1]);
752+ unsigned HOST_WIDE_INT pos = UINTVAL (operands[2]);
753+
754+ if (len <= 0 || pos + len > 32)
755+ FAIL;
756+
757+ ;;if (!register_operand (operands[0], VOIDmode))
758+ ;; FAIL;
759+
760+ emit_insn (gen_insv_32 (operands[0], operands[1],
761+ operands[2], operands[3]));
762+ DONE;
763+}")
764
765 (define_insn "insv_32"
766 [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r")
767diff --git a/gcc/config/microblaze/microblaze.opt b/gcc/config/microblaze/microblaze.opt
768index c8e6f00..cdcae00 100644
769--- a/gcc/config/microblaze/microblaze.opt
770+++ b/gcc/config/microblaze/microblaze.opt
771@@ -125,11 +125,16 @@ Description for mxl-mode-novectors.
772
773 mxl-prefetch
774 Target Mask(PREFETCH)
775-Use hardware prefetch instruction
776+Use hardware prefetch instruction.
777
778 mxl-mode-xilkernel
779 Target
780
781 mxl-frequency
782 Target Mask(AREA_OPTIMIZED_2)
783-Use 8 stage pipeline (frequency optimization)
784+Use 8 stage pipeline (frequency optimization).
785+
786+m64
787+Target Mask(MB_64)
788+MicroBlaze 64-bit mode.
789+
790diff --git a/gcc/config/microblaze/t-microblaze b/gcc/config/microblaze/t-microblaze
791index 41fa9a9..e9a1921 100644
792--- a/gcc/config/microblaze/t-microblaze
793+++ b/gcc/config/microblaze/t-microblaze
794@@ -1,8 +1,11 @@
795-MULTILIB_OPTIONS = mxl-barrel-shift mno-xl-soft-mul mxl-multiply-high mlittle-endian
796-MULTILIB_DIRNAMES = bs m mh le
797+MULTILIB_OPTIONS = mxl-barrel-shift mno-xl-soft-mul mxl-multiply-high mlittle-endian m64
798+MULTILIB_DIRNAMES = bs m mh le m64
799 MULTILIB_EXCEPTIONS = *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high
800 MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/mlittle-endian
801+MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/m64
802 MULTILIB_EXCEPTIONS += mxl-multiply-high/mlittle-endian
803+MULTILIB_EXCEPTIONS += mxl-multiply-high/m64
804+MULTILIB_EXCEPTIONS += *mxl-multiply-high/mlittle-endian/m64
805
806 # Extra files
807 microblaze-c.o: $(srcdir)/config/microblaze/microblaze-c.c \
808--
8092.7.4
810
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0040-Added-load-store-pattern-movdi-and-also-adding-missi.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0040-Added-load-store-pattern-movdi-and-also-adding-missi.patch
new file mode 100644
index 00000000..1157a82f
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0040-Added-load-store-pattern-movdi-and-also-adding-missi.patch
@@ -0,0 +1,83 @@
1From 5526d87787d61990be3187b230fae4d0591d0651 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Wed, 4 Apr 2018 16:41:41 +0530
4Subject: [PATCH 40/54] Added load store pattern movdi and also adding missing
5 files
6
7---
8 gcc/config/microblaze/constraints.md | 5 +++++
9 gcc/config/microblaze/microblaze.md | 26 ++++++++++++++++++++++++++
10 gcc/config/microblaze/t-microblaze | 4 ++--
11 3 files changed, 33 insertions(+), 2 deletions(-)
12
13diff --git a/gcc/config/microblaze/constraints.md b/gcc/config/microblaze/constraints.md
14index ae14944..a06b4d8 100644
15--- a/gcc/config/microblaze/constraints.md
16+++ b/gcc/config/microblaze/constraints.md
17@@ -52,6 +52,11 @@
18 (and (match_code "const_int")
19 (match_test "ival > 0 && ival < 0x10000")))
20
21+(define_constraint "K"
22+ "A constant in the range 0xffffff8000000000L to 0x0000007fffffffffL (inclusive)."
23+ (and (match_code "const_int")
24+ (match_test "ival > (long)0xffffff8000000000L && ival < (long)0x0000007fffffffffL")))
25+
26 ;; Define floating point constraints
27
28 (define_constraint "G"
29diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
30index 6976b37..0cd0441 100644
31--- a/gcc/config/microblaze/microblaze.md
32+++ b/gcc/config/microblaze/microblaze.md
33@@ -1120,6 +1120,32 @@
34 )
35
36
37+(define_insn "*movdi_internal_64"
38+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,R,o")
39+ (match_operand:DI 1 "general_operand" " d,K,J,R,o,d,d"))]
40+ "TARGET_MB_64 && (INTVAL(operands[1]) < 0x7fffffffff) && (INTVAL(operands[1]) > 0xffffff8000000000)"
41+ {
42+ switch (which_alternative)
43+ {
44+ case 0:
45+ return "addlk\t%0,%1";
46+ case 1:
47+ return "addlik\t%0,r0,%1";
48+ case 2:
49+ return "addlk\t%0,r0,r0";
50+ case 3:
51+ case 4:
52+ return "lli\t%0,%1";
53+ case 5:
54+ case 6:
55+ return "sli\t%1,%0";
56+ }
57+ return "unreachable";
58+ }
59+ [(set_attr "type" "no_delay_move,no_delay_arith,no_delay_arith,no_delay_load,no_delay_load,no_delay_store,no_delay_store")
60+ (set_attr "mode" "DI")
61+ (set_attr "length" "8,8,8,8,12,8,12")])
62+
63 (define_insn "*movdi_internal"
64 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,R,o")
65 (match_operand:DI 1 "general_operand" " d,i,J,R,o,d,d"))]
66diff --git a/gcc/config/microblaze/t-microblaze b/gcc/config/microblaze/t-microblaze
67index e9a1921..7671f63 100644
68--- a/gcc/config/microblaze/t-microblaze
69+++ b/gcc/config/microblaze/t-microblaze
70@@ -4,8 +4,8 @@ MULTILIB_EXCEPTIONS = *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high
71 MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/mlittle-endian
72 MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/m64
73 MULTILIB_EXCEPTIONS += mxl-multiply-high/mlittle-endian
74-MULTILIB_EXCEPTIONS += mxl-multiply-high/m64
75-MULTILIB_EXCEPTIONS += *mxl-multiply-high/mlittle-endian/m64
76+#MULTILIB_EXCEPTIONS += mxl-multiply-high/m64
77+#MULTILIB_EXCEPTIONS += *mxl-multiply-high/mlittle-endian/m64
78
79 # Extra files
80 microblaze-c.o: $(srcdir)/config/microblaze/microblaze-c.c \
81--
822.7.4
83
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0041-Intial-commit-for-64bit-MB-sources.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0041-Intial-commit-for-64bit-MB-sources.patch
new file mode 100644
index 00000000..411958e7
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0041-Intial-commit-for-64bit-MB-sources.patch
@@ -0,0 +1,2463 @@
1From eee9b7f7423823b133d6a5e5382863502433bdc6 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Fri, 27 Jul 2018 15:23:41 +0530
4Subject: [PATCH 41/54] Intial commit for 64bit-MB sources. Need to cleanup the
5 code later.
6
7---
8 gcc/config/microblaze/constraints.md | 2 +-
9 gcc/config/microblaze/microblaze-c.c | 6 +
10 gcc/config/microblaze/microblaze.c | 218 ++++++++----
11 gcc/config/microblaze/microblaze.h | 63 ++--
12 gcc/config/microblaze/microblaze.md | 606 ++++++++++++++++++++++++--------
13 gcc/config/microblaze/t-microblaze | 7 +-
14 libgcc/config/microblaze/crti.S | 4 +-
15 libgcc/config/microblaze/crtn.S | 4 +-
16 libgcc/config/microblaze/divdi3.S | 98 ++++++
17 libgcc/config/microblaze/divdi3_table.c | 62 ++++
18 libgcc/config/microblaze/moddi3.S | 97 +++++
19 libgcc/config/microblaze/muldi3.S | 73 ++++
20 libgcc/config/microblaze/t-microblaze | 11 +-
21 libgcc/config/microblaze/udivdi3.S | 107 ++++++
22 libgcc/config/microblaze/umoddi3.S | 110 ++++++
23 15 files changed, 1232 insertions(+), 236 deletions(-)
24 create mode 100644 libgcc/config/microblaze/divdi3.S
25 create mode 100644 libgcc/config/microblaze/divdi3_table.c
26 create mode 100644 libgcc/config/microblaze/moddi3.S
27 create mode 100644 libgcc/config/microblaze/muldi3.S
28 create mode 100644 libgcc/config/microblaze/udivdi3.S
29 create mode 100644 libgcc/config/microblaze/umoddi3.S
30
31diff --git a/gcc/config/microblaze/constraints.md b/gcc/config/microblaze/constraints.md
32index a06b4d8..867a7b5 100644
33--- a/gcc/config/microblaze/constraints.md
34+++ b/gcc/config/microblaze/constraints.md
35@@ -55,7 +55,7 @@
36 (define_constraint "K"
37 "A constant in the range 0xffffff8000000000L to 0x0000007fffffffffL (inclusive)."
38 (and (match_code "const_int")
39- (match_test "ival > (long)0xffffff8000000000L && ival < (long)0x0000007fffffffffL")))
40+ (match_test "ival > (long)-549755813888 && ival < (long)549755813887")))
41
42 ;; Define floating point constraints
43
44diff --git a/gcc/config/microblaze/microblaze-c.c b/gcc/config/microblaze/microblaze-c.c
45index 7b020b5..d8a1d13 100644
46--- a/gcc/config/microblaze/microblaze-c.c
47+++ b/gcc/config/microblaze/microblaze-c.c
48@@ -100,4 +100,10 @@ microblaze_cpp_define (cpp_reader *pfile)
49 builtin_define ("HAVE_HW_FPU_SQRT");
50 builtin_define ("__HAVE_HW_FPU_SQRT__");
51 }
52+ if (TARGET_MB_64)
53+ {
54+ builtin_define ("__arch64__");
55+ builtin_define ("__microblaze64__");
56+ builtin_define ("__MICROBLAZE64__");
57+ }
58 }
59diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
60index 2079ae9..ba7ade4 100644
61--- a/gcc/config/microblaze/microblaze.c
62+++ b/gcc/config/microblaze/microblaze.c
63@@ -382,10 +382,10 @@ simple_memory_operand (rtx op, machine_mode mode ATTRIBUTE_UNUSED)
64 {
65 return 1;
66 }
67- else if (GET_CODE (plus0) == REG && GET_CODE (plus1) == REG)
68+ /*else if (GET_CODE (plus0) == REG && GET_CODE (plus1) == REG)
69 {
70 return 1;
71- }
72+ }*/
73 else
74 return 0;
75
76@@ -433,7 +433,7 @@ double_memory_operand (rtx op, machine_mode mode)
77 return 1;
78
79 return memory_address_p ((GET_MODE_CLASS (mode) == MODE_INT
80- ? E_SImode : E_SFmode),
81+ ? Pmode : E_SFmode),
82 plus_constant (Pmode, addr, 4));
83 }
84
85@@ -680,7 +680,7 @@ microblaze_legitimize_tls_address(rtx x, rtx reg)
86 /* Load the addend. */
87 addend = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, x, GEN_INT (TLS_DTPREL)),
88 UNSPEC_TLS);
89- addend = force_reg (SImode, gen_rtx_CONST (SImode, addend));
90+ addend = force_reg (Pmode, gen_rtx_CONST (Pmode, addend));
91 dest = gen_rtx_PLUS (Pmode, dest, addend);
92 break;
93
94@@ -698,7 +698,7 @@ microblaze_classify_unspec (struct microblaze_address_info *info, rtx x)
95
96 if (XINT (x, 1) == UNSPEC_GOTOFF)
97 {
98- info->regA = gen_rtx_REG (SImode, PIC_OFFSET_TABLE_REGNUM);
99+ info->regA = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
100 info->type = ADDRESS_GOTOFF;
101 }
102 else if (XINT (x, 1) == UNSPEC_PLT)
103@@ -1230,8 +1230,16 @@ microblaze_block_move_loop (rtx dest, rtx src, HOST_WIDE_INT length)
104 emit_move_insn (dest_reg, plus_constant (Pmode, dest_reg, MAX_MOVE_BYTES));
105
106 /* Emit the test & branch. */
107- emit_insn (gen_cbranchsi4 (gen_rtx_NE (SImode, src_reg, final_src),
108+
109+ if (TARGET_MB_64) {
110+ emit_insn (gen_cbranchdi4 (gen_rtx_NE (Pmode, src_reg, final_src),
111+ src_reg, final_src, label));
112+ }
113+ else {
114+ emit_insn (gen_cbranchsi4 (gen_rtx_NE (Pmode, src_reg, final_src),
115 src_reg, final_src, label));
116+
117+ }
118
119 /* Mop up any left-over bytes. */
120 if (leftover)
121@@ -1561,14 +1569,20 @@ microblaze_function_arg_advance (cumulative_args_t cum_v,
122 break;
123
124 case E_DFmode:
125- cum->arg_words += 2;
126+ if (TARGET_MB_64)
127+ cum->arg_words++;
128+ else
129+ cum->arg_words += 2;
130 if (!cum->gp_reg_found && cum->arg_number <= 2)
131 cum->fp_code += 2 << ((cum->arg_number - 1) * 2);
132 break;
133
134 case E_DImode:
135 cum->gp_reg_found = 1;
136- cum->arg_words += 2;
137+ if (TARGET_MB_64)
138+ cum->arg_words++;
139+ else
140+ cum->arg_words += 2;
141 break;
142
143 case E_QImode:
144@@ -2219,7 +2233,7 @@ compute_frame_size (HOST_WIDE_INT size)
145
146 if (regno != MB_ABI_SUB_RETURN_ADDR_REGNUM)
147 /* Don't account for link register. It is accounted specially below. */
148- gp_reg_size += GET_MODE_SIZE (SImode);
149+ gp_reg_size += GET_MODE_SIZE (Pmode);
150
151 mask |= (1L << (regno - GP_REG_FIRST));
152 }
153@@ -2487,7 +2501,7 @@ print_operand (FILE * file, rtx op, int letter)
154
155 if ((letter == 'M' && !WORDS_BIG_ENDIAN)
156 || (letter == 'L' && WORDS_BIG_ENDIAN) || letter == 'D')
157- regnum++;
158+ regnum++;
159
160 fprintf (file, "%s", reg_names[regnum]);
161 }
162@@ -2513,6 +2527,7 @@ print_operand (FILE * file, rtx op, int letter)
163 else if (letter == 'h' || letter == 'j')
164 {
165 long val[2];
166+ int val1[2];
167 long l[2];
168 if (code == CONST_DOUBLE)
169 {
170@@ -2525,12 +2540,12 @@ print_operand (FILE * file, rtx op, int letter)
171 val[0] = l[WORDS_BIG_ENDIAN != 0];
172 }
173 }
174- else if (code == CONST_INT)
175+ else if (code == CONST_INT || code == CONST)// || code == SYMBOL_REF ||code == LABEL_REF)
176 {
177- val[0] = (INTVAL (op) & 0xffffffff00000000LL) >> 32;
178- val[1] = INTVAL (op) & 0x00000000ffffffffLL;
179+ val1[0] = (INTVAL (op) & 0xffffffff00000000LL) >> 32;
180+ val1[1] = INTVAL (op) & 0x00000000ffffffffLL;
181 }
182- fprintf (file, "0x%8.8lx", (letter == 'h') ? val[0] : val[1]);
183+ fprintf (file, "0x%8.8lx", (letter == 'h') ? val1[0] : val1[1]);
184 }
185 else if (code == CONST_DOUBLE)
186 {
187@@ -2713,7 +2728,10 @@ microblaze_asm_constructor (rtx symbol ATTRIBUTE_UNUSED, int priority)
188
189 switch_to_section (get_section (section, 0, NULL));
190 assemble_align (POINTER_SIZE);
191- fputs ("\t.word\t", asm_out_file);
192+ if (TARGET_MB_64)
193+ fputs ("\t.dword\t", asm_out_file);
194+ else
195+ fputs ("\t.word\t", asm_out_file);
196 output_addr_const (asm_out_file, symbol);
197 fputs ("\n", asm_out_file);
198 }
199@@ -2736,7 +2754,10 @@ microblaze_asm_destructor (rtx symbol, int priority)
200
201 switch_to_section (get_section (section, 0, NULL));
202 assemble_align (POINTER_SIZE);
203- fputs ("\t.word\t", asm_out_file);
204+ if (TARGET_MB_64)
205+ fputs ("\t.dword\t", asm_out_file);
206+ else
207+ fputs ("\t.word\t", asm_out_file);
208 output_addr_const (asm_out_file, symbol);
209 fputs ("\n", asm_out_file);
210 }
211@@ -2802,7 +2823,7 @@ save_restore_insns (int prologue)
212 /* For interrupt_handlers, need to save/restore the MSR. */
213 if (microblaze_is_interrupt_variant ())
214 {
215- isr_mem_rtx = gen_rtx_MEM (SImode,
216+ isr_mem_rtx = gen_rtx_MEM (Pmode,
217 gen_rtx_PLUS (Pmode, base_reg_rtx,
218 GEN_INT (current_frame_info.
219 gp_offset -
220@@ -2810,8 +2831,8 @@ save_restore_insns (int prologue)
221
222 /* Do not optimize in flow analysis. */
223 MEM_VOLATILE_P (isr_mem_rtx) = 1;
224- isr_reg_rtx = gen_rtx_REG (SImode, MB_ABI_MSR_SAVE_REG);
225- isr_msr_rtx = gen_rtx_REG (SImode, ST_REG);
226+ isr_reg_rtx = gen_rtx_REG (Pmode, MB_ABI_MSR_SAVE_REG);
227+ isr_msr_rtx = gen_rtx_REG (Pmode, ST_REG);
228 }
229
230 if (microblaze_is_interrupt_variant () && !prologue)
231@@ -2819,8 +2840,8 @@ save_restore_insns (int prologue)
232 emit_move_insn (isr_reg_rtx, isr_mem_rtx);
233 emit_move_insn (isr_msr_rtx, isr_reg_rtx);
234 /* Do not optimize in flow analysis. */
235- emit_insn (gen_rtx_USE (SImode, isr_reg_rtx));
236- emit_insn (gen_rtx_USE (SImode, isr_msr_rtx));
237+ emit_insn (gen_rtx_USE (Pmode, isr_reg_rtx));
238+ emit_insn (gen_rtx_USE (Pmode, isr_msr_rtx));
239 }
240
241 for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++)
242@@ -2831,9 +2852,9 @@ save_restore_insns (int prologue)
243 /* Don't handle here. Already handled as the first register. */
244 continue;
245
246- reg_rtx = gen_rtx_REG (SImode, regno);
247+ reg_rtx = gen_rtx_REG (Pmode, regno);
248 insn = gen_rtx_PLUS (Pmode, base_reg_rtx, GEN_INT (gp_offset));
249- mem_rtx = gen_rtx_MEM (SImode, insn);
250+ mem_rtx = gen_rtx_MEM (Pmode, insn);
251 if (microblaze_is_interrupt_variant () || save_volatiles)
252 /* Do not optimize in flow analysis. */
253 MEM_VOLATILE_P (mem_rtx) = 1;
254@@ -2848,7 +2869,7 @@ save_restore_insns (int prologue)
255 insn = emit_move_insn (reg_rtx, mem_rtx);
256 }
257
258- gp_offset += GET_MODE_SIZE (SImode);
259+ gp_offset += GET_MODE_SIZE (Pmode);
260 }
261 }
262
263@@ -2858,8 +2879,8 @@ save_restore_insns (int prologue)
264 emit_move_insn (isr_mem_rtx, isr_reg_rtx);
265
266 /* Do not optimize in flow analysis. */
267- emit_insn (gen_rtx_USE (SImode, isr_reg_rtx));
268- emit_insn (gen_rtx_USE (SImode, isr_msr_rtx));
269+ emit_insn (gen_rtx_USE (Pmode, isr_reg_rtx));
270+ emit_insn (gen_rtx_USE (Pmode, isr_msr_rtx));
271 }
272
273 /* Done saving and restoring */
274@@ -2949,7 +2970,10 @@ microblaze_elf_asm_cdtor (rtx symbol, int priority, bool is_ctor)
275
276 switch_to_section (s);
277 assemble_align (POINTER_SIZE);
278- fputs ("\t.word\t", asm_out_file);
279+ if (TARGET_MB_64)
280+ fputs ("\t.dword\t", asm_out_file);
281+ else
282+ fputs ("\t.word\t", asm_out_file);
283 output_addr_const (asm_out_file, symbol);
284 fputs ("\n", asm_out_file);
285 }
286@@ -3095,10 +3119,10 @@ microblaze_expand_prologue (void)
287 {
288 if (offset != 0)
289 ptr = gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (offset));
290- emit_move_insn (gen_rtx_MEM (SImode, ptr),
291- gen_rtx_REG (SImode, regno));
292+ emit_move_insn (gen_rtx_MEM (Pmode, ptr),
293+ gen_rtx_REG (Pmode, regno));
294
295- offset += GET_MODE_SIZE (SImode);
296+ offset += GET_MODE_SIZE (Pmode);
297 }
298
299 }
300@@ -3108,15 +3132,23 @@ microblaze_expand_prologue (void)
301 rtx fsiz_rtx = GEN_INT (fsiz);
302
303 rtx_insn *insn = NULL;
304- insn = emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx,
305+ if (TARGET_MB_64)
306+ {
307+
308+ insn = emit_insn (gen_subdi3 (stack_pointer_rtx, stack_pointer_rtx,
309 fsiz_rtx));
310+ }
311+ else {
312+ insn = emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx,
313+ fsiz_rtx));
314+ }
315 if (insn)
316 RTX_FRAME_RELATED_P (insn) = 1;
317
318 /* Handle SUB_RETURN_ADDR_REGNUM specially at first. */
319 if (!crtl->is_leaf || interrupt_handler)
320 {
321- mem_rtx = gen_rtx_MEM (SImode,
322+ mem_rtx = gen_rtx_MEM (Pmode,
323 gen_rtx_PLUS (Pmode, stack_pointer_rtx,
324 const0_rtx));
325
326@@ -3124,7 +3156,7 @@ microblaze_expand_prologue (void)
327 /* Do not optimize in flow analysis. */
328 MEM_VOLATILE_P (mem_rtx) = 1;
329
330- reg_rtx = gen_rtx_REG (SImode, MB_ABI_SUB_RETURN_ADDR_REGNUM);
331+ reg_rtx = gen_rtx_REG (Pmode, MB_ABI_SUB_RETURN_ADDR_REGNUM);
332 insn = emit_move_insn (mem_rtx, reg_rtx);
333 RTX_FRAME_RELATED_P (insn) = 1;
334 }
335@@ -3224,12 +3256,12 @@ microblaze_expand_epilogue (void)
336 if (!crtl->is_leaf || interrupt_handler)
337 {
338 mem_rtx =
339- gen_rtx_MEM (SImode,
340+ gen_rtx_MEM (Pmode,
341 gen_rtx_PLUS (Pmode, stack_pointer_rtx, const0_rtx));
342 if (interrupt_handler)
343 /* Do not optimize in flow analysis. */
344 MEM_VOLATILE_P (mem_rtx) = 1;
345- reg_rtx = gen_rtx_REG (SImode, MB_ABI_SUB_RETURN_ADDR_REGNUM);
346+ reg_rtx = gen_rtx_REG (Pmode, MB_ABI_SUB_RETURN_ADDR_REGNUM);
347 emit_move_insn (reg_rtx, mem_rtx);
348 }
349
350@@ -3245,15 +3277,25 @@ microblaze_expand_epilogue (void)
351 /* _restore_ registers for epilogue. */
352 save_restore_insns (0);
353 emit_insn (gen_blockage ());
354- emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, fsiz_rtx));
355+ if (TARGET_MB_64)
356+ emit_insn (gen_adddi3 (stack_pointer_rtx, stack_pointer_rtx, fsiz_rtx));
357+ else
358+ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, fsiz_rtx));
359 }
360
361 if (crtl->calls_eh_return)
362- emit_insn (gen_addsi3 (stack_pointer_rtx,
363+ if (TARGET_MB_64) {
364+ emit_insn (gen_adddi3 (stack_pointer_rtx,
365 stack_pointer_rtx,
366- gen_raw_REG (SImode,
367+ gen_raw_REG (Pmode,
368 MB_EH_STACKADJ_REGNUM)));
369-
370+ }
371+ else {
372+ emit_insn (gen_addsi3 (stack_pointer_rtx,
373+ stack_pointer_rtx,
374+ gen_raw_REG (Pmode,
375+ MB_EH_STACKADJ_REGNUM)));
376+ }
377 emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, GP_REG_FIRST +
378 MB_ABI_SUB_RETURN_ADDR_REGNUM)));
379 }
380@@ -3402,9 +3444,14 @@ microblaze_asm_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
381 else
382 this_rtx = gen_rtx_REG (Pmode, MB_ABI_FIRST_ARG_REGNUM);
383
384- /* Apply the constant offset, if required. */
385+ /* Apply the constant offset, if required. */
386 if (delta)
387- emit_insn (gen_addsi3 (this_rtx, this_rtx, GEN_INT (delta)));
388+ {
389+ if (TARGET_MB_64)
390+ emit_insn (gen_adddi3 (this_rtx, this_rtx, GEN_INT (delta)));
391+ else
392+ emit_insn (gen_addsi3 (this_rtx, this_rtx, GEN_INT (delta)));
393+ }
394
395 /* Apply the offset from the vtable, if required. */
396 if (vcall_offset)
397@@ -3417,7 +3464,10 @@ microblaze_asm_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
398 rtx loc = gen_rtx_PLUS (Pmode, temp1, vcall_offset_rtx);
399 emit_move_insn (temp1, gen_rtx_MEM (Pmode, loc));
400
401- emit_insn (gen_addsi3 (this_rtx, this_rtx, temp1));
402+ if (TARGET_MB_64)
403+ emit_insn (gen_adddi3 (this_rtx, this_rtx, temp1));
404+ else
405+ emit_insn (gen_addsi3 (this_rtx, this_rtx, temp1));
406 }
407
408 /* Generate a tail call to the target function. */
409@@ -3564,7 +3614,7 @@ microblaze_eh_return (rtx op0)
410 /* Queue an .ident string in the queue of top-level asm statements.
411 If the string size is below the threshold, put it into .sdata2.
412 If the front-end is done, we must be being called from toplev.c.
413- In that case, do nothing. */
414+ In that case, do nothing. */
415 void
416 microblaze_asm_output_ident (const char *string)
417 {
418@@ -3619,9 +3669,9 @@ microblaze_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
419 emit_block_move (m_tramp, assemble_trampoline_template (),
420 GEN_INT (6*UNITS_PER_WORD), BLOCK_OP_NORMAL);
421
422- mem = adjust_address (m_tramp, SImode, 16);
423+ mem = adjust_address (m_tramp, Pmode, 16);
424 emit_move_insn (mem, chain_value);
425- mem = adjust_address (m_tramp, SImode, 20);
426+ mem = adjust_address (m_tramp, Pmode, 20);
427 emit_move_insn (mem, fnaddr);
428 }
429
430@@ -3645,7 +3695,7 @@ microblaze_expand_conditional_branch (machine_mode mode, rtx operands[])
431 {
432 comp_reg = cmp_op0;
433 condition = gen_rtx_fmt_ee (signed_condition (code), mode, comp_reg, const0_rtx);
434- if (mode == SImode)
435+ if (mode == Pmode)
436 emit_jump_insn (gen_condjump (condition, label1));
437 else
438 emit_jump_insn (gen_long_condjump (condition, label1));
439@@ -3764,7 +3814,7 @@ microblaze_expand_conditional_branch_sf (rtx operands[])
440 rtx comp_reg = gen_reg_rtx (SImode);
441
442 emit_insn (gen_cstoresf4 (comp_reg, operands[0], cmp_op0, cmp_op1));
443- condition = gen_rtx_NE (SImode, comp_reg, const0_rtx);
444+ condition = gen_rtx_NE (Pmode, comp_reg, const0_rtx);
445 emit_jump_insn (gen_condjump (condition, operands[3]));
446 }
447
448@@ -3774,10 +3824,10 @@ microblaze_expand_conditional_branch_df (rtx operands[])
449 rtx condition;
450 rtx cmp_op0 = XEXP (operands[0], 0);
451 rtx cmp_op1 = XEXP (operands[0], 1);
452- rtx comp_reg = gen_reg_rtx (DImode);
453+ rtx comp_reg = gen_reg_rtx (Pmode);
454
455 emit_insn (gen_cstoredf4 (comp_reg, operands[0], cmp_op0, cmp_op1));
456- condition = gen_rtx_NE (DImode, comp_reg, const0_rtx);
457+ condition = gen_rtx_NE (Pmode, comp_reg, const0_rtx);
458 emit_jump_insn (gen_long_condjump (condition, operands[3]));
459 }
460
461@@ -3798,8 +3848,8 @@ microblaze_expand_divide (rtx operands[])
462 {
463 /* Table lookup software divides. Works for all (nr/dr) where (0 <= nr,dr <= 15). */
464
465- rtx regt1 = gen_reg_rtx (SImode);
466- rtx reg18 = gen_rtx_REG (SImode, R_TMP);
467+ rtx regt1 = gen_reg_rtx (Pmode);
468+ rtx reg18 = gen_rtx_REG (Pmode, R_TMP);
469 rtx regqi = gen_reg_rtx (QImode);
470 rtx_code_label *div_label = gen_label_rtx ();
471 rtx_code_label *div_end_label = gen_label_rtx ();
472@@ -3807,17 +3857,31 @@ microblaze_expand_divide (rtx operands[])
473 rtx mem_rtx;
474 rtx ret;
475 rtx_insn *jump, *cjump, *insn;
476-
477- insn = emit_insn (gen_iorsi3 (regt1, operands[1], operands[2]));
478- cjump = emit_jump_insn_after (gen_cbranchsi4 (
479- gen_rtx_GTU (SImode, regt1, GEN_INT (15)),
480+
481+ if (TARGET_MB_64) {
482+ insn = emit_insn (gen_iordi3 (regt1, operands[1], operands[2]));
483+ cjump = emit_jump_insn_after (gen_cbranchdi4 (
484+ gen_rtx_GTU (Pmode, regt1, GEN_INT (15)),
485+ regt1, GEN_INT (15), div_label), insn);
486+ }
487+ else {
488+ insn = emit_insn (gen_iorsi3 (regt1, operands[1], operands[2]));
489+ cjump = emit_jump_insn_after (gen_cbranchsi4 (
490+ gen_rtx_GTU (Pmode, regt1, GEN_INT (15)),
491 regt1, GEN_INT (15), div_label), insn);
492+ }
493 LABEL_NUSES (div_label) = 1;
494 JUMP_LABEL (cjump) = div_label;
495- emit_insn (gen_rtx_CLOBBER (SImode, reg18));
496+ emit_insn (gen_rtx_CLOBBER (Pmode, reg18));
497
498- emit_insn (gen_ashlsi3_bshift (regt1, operands[1], GEN_INT(4)));
499- emit_insn (gen_addsi3 (regt1, regt1, operands[2]));
500+ if (TARGET_MB_64) {
501+ emit_insn (gen_ashldi3_long (regt1, operands[1], GEN_INT(4)));
502+ emit_insn (gen_adddi3 (regt1, regt1, operands[2]));
503+ }
504+ else {
505+ emit_insn (gen_ashlsi3_bshift (regt1, operands[1], GEN_INT(4)));
506+ emit_insn (gen_addsi3 (regt1, regt1, operands[2]));
507+ }
508 mem_rtx = gen_rtx_MEM (QImode,
509 gen_rtx_PLUS (QImode, regt1, div_table_rtx));
510
511@@ -3964,7 +4028,7 @@ insert_wic_for_ilb_runout (rtx_insn *first)
512 {
513 insn =
514 emit_insn_before (gen_iprefetch
515- (gen_int_mode (addr_offset, SImode)),
516+ (gen_int_mode (addr_offset, Pmode)),
517 before_4);
518 recog_memoized (insn);
519 INSN_LOCATION (insn) = INSN_LOCATION (before_4);
520@@ -3974,7 +4038,27 @@ insert_wic_for_ilb_runout (rtx_insn *first)
521 }
522 }
523 }
524-
525+
526+/* Set the names for various arithmetic operations according to the
527+ * MICROBLAZE ABI. */
528+static void
529+microblaze_init_libfuncs (void)
530+{
531+ set_optab_libfunc (smod_optab, SImode, "__modsi3");
532+ set_optab_libfunc (sdiv_optab, SImode, "__divsi3");
533+ set_optab_libfunc (smul_optab, SImode, "__mulsi3");
534+ set_optab_libfunc (umod_optab, SImode, "__umodsi3");
535+ set_optab_libfunc (udiv_optab, SImode, "__udivsi3");
536+
537+ if (TARGET_MB_64)
538+ {
539+ set_optab_libfunc (smod_optab, DImode, "__moddi3");
540+ set_optab_libfunc (sdiv_optab, DImode, "__divdi3");
541+ set_optab_libfunc (smul_optab, DImode, "__muldi3");
542+ set_optab_libfunc (umod_optab, DImode, "__umoddi3");
543+ set_optab_libfunc (udiv_optab, DImode, "__udivdi3");
544+ }
545+}
546 /* Insert instruction prefetch instruction at the fall
547 through path of the function call. */
548
549@@ -4127,6 +4211,17 @@ microblaze_starting_frame_offset (void)
550 #undef TARGET_LRA_P
551 #define TARGET_LRA_P hook_bool_void_false
552
553+#ifdef TARGET_MB_64
554+#undef TARGET_ASM_ALIGNED_DI_OP
555+#define TARGET_ASM_ALIGNED_DI_OP "\t.dword\t"
556+
557+#undef TARGET_ASM_ALIGNED_HI_OP
558+#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
559+
560+#undef TARGET_ASM_ALIGNED_SI_OP
561+#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
562+#endif
563+
564 #undef TARGET_FRAME_POINTER_REQUIRED
565 #define TARGET_FRAME_POINTER_REQUIRED microblaze_frame_pointer_required
566
567@@ -4136,6 +4231,9 @@ microblaze_starting_frame_offset (void)
568 #undef TARGET_TRAMPOLINE_INIT
569 #define TARGET_TRAMPOLINE_INIT microblaze_trampoline_init
570
571+#undef TARGET_INIT_LIBFUNCS
572+#define TARGET_INIT_LIBFUNCS microblaze_init_libfuncs
573+
574 #undef TARGET_PROMOTE_FUNCTION_MODE
575 #define TARGET_PROMOTE_FUNCTION_MODE default_promote_function_mode_always_promote
576
577diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
578index 72fbee5..1e60513 100644
579--- a/gcc/config/microblaze/microblaze.h
580+++ b/gcc/config/microblaze/microblaze.h
581@@ -173,7 +173,6 @@ extern enum pipeline_type microblaze_pipe;
582
583 /* Generate DWARF exception handling info. */
584 #define DWARF2_UNWIND_INFO 1
585-
586 /* Don't generate .loc operations. */
587 #define DWARF2_ASM_LINE_DEBUG_INFO 0
588
589@@ -206,38 +205,51 @@ extern enum pipeline_type microblaze_pipe;
590 ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
591
592 /* Use DWARF 2 debugging information by default. */
593-#define DWARF2_DEBUGGING_INFO
594+#define DWARF2_DEBUGGING_INFO 1
595 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
596+#define DWARF2_ADDR_SIZE 4
597
598 /* Target machine storage layout */
599
600 #define BITS_BIG_ENDIAN 0
601 #define BYTES_BIG_ENDIAN (TARGET_LITTLE_ENDIAN == 0)
602 #define WORDS_BIG_ENDIAN (BYTES_BIG_ENDIAN)
603-#define BITS_PER_WORD 32
604-#define UNITS_PER_WORD 4
605+//#define BITS_PER_WORD 64
606+//Revisit
607+#define MAX_BITS_PER_WORD 64
608+#define UNITS_PER_WORD (TARGET_MB_64 ? 8 : 4)
609+//#define MIN_UNITS_PER_WORD (TARGET_MB_64 ? 8 : 4)
610+//#define UNITS_PER_WORD 4
611 #define MIN_UNITS_PER_WORD 4
612 #define INT_TYPE_SIZE 32
613 #define SHORT_TYPE_SIZE 16
614-#define LONG_TYPE_SIZE 64
615+#define LONG_TYPE_SIZE (TARGET_MB_64 ? 64 : 32)
616 #define LONG_LONG_TYPE_SIZE 64
617 #define FLOAT_TYPE_SIZE 32
618 #define DOUBLE_TYPE_SIZE 64
619 #define LONG_DOUBLE_TYPE_SIZE 64
620-#define POINTER_SIZE 32
621-#define PARM_BOUNDARY 32
622-#define FUNCTION_BOUNDARY 32
623-#define EMPTY_FIELD_BOUNDARY 32
624+#define POINTER_SIZE (TARGET_MB_64 ? 64 : 32)
625+//#define WIDEST_HARDWARE_FP_SIZE 64
626+//#define POINTERS_EXTEND_UNSIGNED 1
627+#define PARM_BOUNDARY (TARGET_MB_64 ? 64 : 32)
628+#define FUNCTION_BOUNDARY (TARGET_MB_64 ? 64 : 32)
629+#define EMPTY_FIELD_BOUNDARY (TARGET_MB_64 ? 64 : 32)
630 #define STRUCTURE_SIZE_BOUNDARY 8
631-#define BIGGEST_ALIGNMENT 32
632+#define BIGGEST_ALIGNMENT (TARGET_MB_64 ? 64 : 32)
633 #define STRICT_ALIGNMENT 1
634 #define PCC_BITFIELD_TYPE_MATTERS 1
635
636+//#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TARGET_MB_64 ? TImode : DImode)
637 #undef SIZE_TYPE
638-#define SIZE_TYPE "unsigned int"
639+#define SIZE_TYPE (TARGET_MB_64 ? "long unsigned int" : "unsigned int")
640
641 #undef PTRDIFF_TYPE
642-#define PTRDIFF_TYPE "int"
643+#define PTRDIFF_TYPE (TARGET_MB_64 ? "long int" : "int")
644+
645+/*#undef INTPTR_TYPE
646+#define INTPTR_TYPE (TARGET_MB_64 ? "long int" : "int")*/
647+#undef UINTPTR_TYPE
648+#define UINTPTR_TYPE (TARGET_MB_64 ? "long unsigned int" : "unsigned int")
649
650 #define DATA_ALIGNMENT(TYPE, ALIGN) \
651 ((((ALIGN) < BITS_PER_WORD) \
652@@ -253,12 +265,12 @@ extern enum pipeline_type microblaze_pipe;
653 #define WORD_REGISTER_OPERATIONS 1
654
655 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
656-
657+/*
658 #define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \
659 if (GET_MODE_CLASS (MODE) == MODE_INT \
660- && GET_MODE_SIZE (MODE) < 4) \
661- (MODE) = SImode;
662-
663+ && GET_MODE_SIZE (MODE) < (TARGET_MB_64 ? 8 : 4)) \
664+ (MODE) = TARGET_MB_64 ? DImode : SImode;
665+*/
666 /* Standard register usage. */
667
668 /* On the MicroBlaze, we have 32 integer registers */
669@@ -438,13 +450,16 @@ extern struct microblaze_frame_info current_frame_info;
670 #define FIRST_PARM_OFFSET(FNDECL) (UNITS_PER_WORD)
671
672 #define ARG_POINTER_CFA_OFFSET(FNDECL) 0
673+#define DWARF_CIE_DATA_ALIGNMENT -1
674
675 #define REG_PARM_STACK_SPACE(FNDECL) microblaze_reg_parm_stack_space(FNDECL)
676
677 #define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 1
678
679-#define STACK_BOUNDARY 32
680+#define STACK_BOUNDARY (TARGET_MB_64 ? 64 : 32)
681
682+#define PREFERRED_STACK_BOUNDARY (TARGET_MB_64 ? 64 : 32)
683+
684 #define NUM_OF_ARGS 6
685
686 #define GP_RETURN (GP_REG_FIRST + MB_ABI_INT_RETURN_VAL_REGNUM)
687@@ -455,12 +470,15 @@ extern struct microblaze_frame_info current_frame_info;
688 #define MAX_ARGS_IN_REGISTERS MB_ABI_MAX_ARG_REGS
689
690 #define LIBCALL_VALUE(MODE) \
691+ gen_rtx_REG (MODE,GP_RETURN)
692+
693+/*#define LIBCALL_VALUE(MODE) \
694 gen_rtx_REG ( \
695 ((GET_MODE_CLASS (MODE) != MODE_INT \
696 || GET_MODE_SIZE (MODE) >= 4) \
697 ? (MODE) \
698 : SImode), GP_RETURN)
699-
700+*/
701 /* 1 if N is a possible register number for a function value.
702 On the MicroBlaze, R2 R3 are the only register thus used.
703 Currently, R2 are only implemented here (C has no complex type) */
704@@ -500,7 +518,7 @@ typedef struct microblaze_args
705 /* 4 insns + 2 words of data. */
706 #define TRAMPOLINE_SIZE (6 * 4)
707
708-#define TRAMPOLINE_ALIGNMENT 32
709+#define TRAMPOLINE_ALIGNMENT 64
710
711 #define REGNO_OK_FOR_BASE_P(regno) microblaze_regno_ok_for_base_p ((regno), 1)
712
713@@ -533,13 +551,13 @@ typedef struct microblaze_args
714 addresses which require two reload registers. */
715 #define LEGITIMATE_PIC_OPERAND_P(X) microblaze_legitimate_pic_operand (X)
716
717-#define CASE_VECTOR_MODE (SImode)
718+#define CASE_VECTOR_MODE (TARGET_MB_64? DImode:SImode)
719
720 #ifndef DEFAULT_SIGNED_CHAR
721 #define DEFAULT_SIGNED_CHAR 1
722 #endif
723
724-#define MOVE_MAX 4
725+#define MOVE_MAX (TARGET_MB_64 ? 8 : 4)
726 #define MAX_MOVE_MAX 8
727
728 #define SLOW_BYTE_ACCESS 1
729@@ -549,7 +567,7 @@ typedef struct microblaze_args
730
731 #define SHIFT_COUNT_TRUNCATED 1
732
733-#define Pmode SImode
734+#define Pmode (TARGET_MB_64? DImode:SImode)
735
736 #define FUNCTION_MODE SImode
737
738@@ -711,6 +729,7 @@ do { \
739
740 #undef TARGET_ASM_OUTPUT_IDENT
741 #define TARGET_ASM_OUTPUT_IDENT microblaze_asm_output_ident
742+//#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive
743
744 /* Default to -G 8 */
745 #ifndef MICROBLAZE_DEFAULT_GVALUE
746diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
747index 0cd0441..0f41ac6 100644
748--- a/gcc/config/microblaze/microblaze.md
749+++ b/gcc/config/microblaze/microblaze.md
750@@ -26,6 +26,7 @@
751 ;; Constants
752 ;;----------------------------------------------------
753 (define_constants [
754+ (R_Z 0) ;; For reg r0
755 (R_SP 1) ;; Stack pointer reg
756 (R_SR 15) ;; Sub-routine return addr reg
757 (R_IR 14) ;; Interrupt return addr reg
758@@ -539,6 +540,7 @@
759
760 ;; Add 2 SImode integers [ src1 = reg ; src2 = arith ; dest = reg ]
761 ;; Leave carry as is
762+
763 (define_insn "addsi3"
764 [(set (match_operand:SI 0 "register_operand" "=d,d,d")
765 (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%dJ,dJ,dJ")
766@@ -560,23 +562,38 @@
767
768 ;; Adding 2 DI operands in register or reg/imm
769
770-(define_insn "adddi3_long"
771+(define_expand "adddi3"
772+ [(set (match_operand:DI 0 "register_operand" "")
773+ (plus:DI (match_operand:DI 1 "register_operand" "")
774+ (match_operand:DI 2 "arith_plus_operand" "")))]
775+""
776+{
777+ if (TARGET_MB_64)
778+ {
779+ if (GET_CODE (operands[2]) == CONST_INT &&
780+ INTVAL(operands[2]) < (long)-549755813888 &&
781+ INTVAL(operands[2]) > (long)549755813887)
782+ FAIL;
783+ }
784+})
785+
786+(define_insn "*adddi3_long"
787 [(set (match_operand:DI 0 "register_operand" "=d,d")
788- (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%dJ,dJ")
789+ (plus:DI (match_operand:DI 1 "register_operand" "%d,d")
790 (match_operand:DI 2 "arith_plus_operand" "d,K")))]
791 "TARGET_MB_64"
792 "@
793- addlk\t%0,%z1,%2
794- addlik\t%0,%z1,%2"
795- [(set_attr "type" "arith,arith")
796- (set_attr "mode" "DI,DI")
797+ addlk\t%0,%1,%2
798+ addlik\t%0,%1,%2 #N10"
799+ [(set_attr "type" "darith,no_delay_arith")
800+ (set_attr "mode" "DI")
801 (set_attr "length" "4,4")])
802
803-(define_insn "adddi3"
804+(define_insn "*adddi3_all"
805 [(set (match_operand:DI 0 "register_operand" "=d,d")
806 (plus:DI (match_operand:DI 1 "register_operand" "%d,d")
807 (match_operand:DI 2 "arith_operand" "d,i")))]
808- ""
809+ "!TARGET_MB_64"
810 "@
811 add\t%L0,%L1,%L2\;addc\t%M0,%M1,%M2
812 addi\t%L0,%L1,%j2\;addic\t%M0,%M1,%h2"
813@@ -603,7 +620,7 @@
814 (define_insn "iprefetch"
815 [(unspec [(match_operand:SI 0 "const_int_operand" "n")] UNSPEC_IPREFETCH)
816 (clobber (mem:BLK (scratch)))]
817- "TARGET_PREFETCH"
818+ "TARGET_PREFETCH && !TARGET_MB_64"
819 {
820 operands[2] = gen_rtx_REG (SImode, MB_ABI_ASM_TEMP_REGNUM);
821 return "mfs\t%2,rpc\n\twic\t%2,r0";
822@@ -616,23 +633,33 @@
823 ;; Double Precision Subtraction
824 ;;----------------------------------------------------------------
825
826-(define_insn "subdi3_long"
827- [(set (match_operand:DI 0 "register_operand" "=d,d")
828- (minus:DI (match_operand:DI 1 "register_operand" "d,d")
829- (match_operand:DI 2 "register_operand" "d,n")))]
830+(define_expand "subdi3"
831+ [(set (match_operand:DI 0 "register_operand" "")
832+ (minus:DI (match_operand:DI 1 "register_operand" "")
833+ (match_operand:DI 2 "arith_operand" "")))]
834+""
835+"
836+{
837+}")
838+
839+(define_insn "subsidi3"
840+ [(set (match_operand:DI 0 "register_operand" "=d,d,d")
841+ (minus:DI (match_operand:DI 1 "register_operand" "d,d,d")
842+ (match_operand:DI 2 "arith_operand" "d,K,n")))]
843 "TARGET_MB_64"
844 "@
845 rsubl\t%0,%2,%1
846- addlik\t%0,%z1,-%2"
847- [(set_attr "type" "darith")
848- (set_attr "mode" "DI,DI")
849- (set_attr "length" "4,4")])
850+ addik\t%0,%z1,-%2
851+ addik\t%0,%z1,-%2"
852+ [(set_attr "type" "arith,no_delay_arith,no_delay_arith")
853+ (set_attr "mode" "DI")
854+ (set_attr "length" "4,4,4")])
855
856-(define_insn "subdi3"
857+(define_insn "subdi3_small"
858 [(set (match_operand:DI 0 "register_operand" "=&d")
859 (minus:DI (match_operand:DI 1 "register_operand" "d")
860 (match_operand:DI 2 "register_operand" "d")))]
861- ""
862+ "!TARGET_MB_64"
863 "rsub\t%L0,%L2,%L1\;rsubc\t%M0,%M2,%M1"
864 [(set_attr "type" "darith")
865 (set_attr "mode" "DI")
866@@ -661,7 +688,7 @@
867 (mult:DI
868 (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))
869 (sign_extend:DI (match_operand:SI 2 "register_operand" "d"))))]
870- "!TARGET_SOFT_MUL && TARGET_MULTIPLY_HIGH"
871+ "!TARGET_SOFT_MUL && TARGET_MULTIPLY_HIGH && !TARGET_MB_64"
872 "mul\t%L0,%1,%2\;mulh\t%M0,%1,%2"
873 [(set_attr "type" "no_delay_arith")
874 (set_attr "mode" "DI")
875@@ -672,7 +699,7 @@
876 (mult:DI
877 (zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
878 (zero_extend:DI (match_operand:SI 2 "register_operand" "d"))))]
879- "!TARGET_SOFT_MUL && TARGET_MULTIPLY_HIGH"
880+ "!TARGET_SOFT_MUL && TARGET_MULTIPLY_HIGH && !TARGET_MB_64"
881 "mul\t%L0,%1,%2\;mulhu\t%M0,%1,%2"
882 [(set_attr "type" "no_delay_arith")
883 (set_attr "mode" "DI")
884@@ -683,7 +710,7 @@
885 (mult:DI
886 (zero_extend:DI (match_operand:SI 1 "register_operand" "d"))
887 (sign_extend:DI (match_operand:SI 2 "register_operand" "d"))))]
888- "!TARGET_SOFT_MUL && TARGET_MULTIPLY_HIGH"
889+ "!TARGET_SOFT_MUL && TARGET_MULTIPLY_HIGH && !TARGET_MB_64"
890 "mul\t%L0,%1,%2\;mulhsu\t%M0,%2,%1"
891 [(set_attr "type" "no_delay_arith")
892 (set_attr "mode" "DI")
893@@ -787,7 +814,7 @@
894 (match_operand:SI 4 "arith_operand")])
895 (label_ref (match_operand 5))
896 (pc)))]
897- "TARGET_HARD_FLOAT"
898+ "TARGET_HARD_FLOAT && !TARGET_MB_64"
899 [(set (match_dup 1) (match_dup 3))]
900
901 {
902@@ -817,6 +844,15 @@
903 (set_attr "mode" "SI")
904 (set_attr "length" "4")])
905
906+(define_insn "negsi_long"
907+ [(set (match_operand:SI 0 "register_operand" "=d")
908+ (neg:SI (match_operand:DI 1 "register_operand" "d")))]
909+ ""
910+ "rsubk\t%0,%1,r0"
911+ [(set_attr "type" "arith")
912+ (set_attr "mode" "SI")
913+ (set_attr "length" "4")])
914+
915 (define_insn "negdi2_long"
916 [(set (match_operand:DI 0 "register_operand" "=d")
917 (neg:DI (match_operand:DI 1 "register_operand" "d")))]
918@@ -845,16 +881,24 @@
919 (set_attr "mode" "SI")
920 (set_attr "length" "4")])
921
922-(define_insn "one_cmpldi2_long"
923+(define_expand "one_cmpldi2"
924+ [(set (match_operand:DI 0 "register_operand" "")
925+ (not:DI (match_operand:DI 1 "register_operand" "")))]
926+ ""
927+ "
928+{
929+}")
930+
931+(define_insn ""
932 [(set (match_operand:DI 0 "register_operand" "=d")
933- (not:DI (match_operand:DI 1 "register_operand" "d")))]
934+ (not:DI (match_operand:DI 1 "arith_operand" "d")))]
935 "TARGET_MB_64"
936 "xorli\t%0,%1,-1"
937- [(set_attr "type" "arith")
938+ [(set_attr "type" "no_delay_arith")
939 (set_attr "mode" "DI")
940 (set_attr "length" "4")])
941
942-(define_insn "*one_cmpldi2"
943+(define_insn ""
944 [(set (match_operand:DI 0 "register_operand" "=d")
945 (not:DI (match_operand:DI 1 "register_operand" "d")))]
946 ""
947@@ -869,7 +913,8 @@
948 (not:DI (match_operand:DI 1 "register_operand" "")))]
949 "reload_completed
950 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
951- && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))"
952+ && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
953+ && !TARGET_MB_64"
954
955 [(set (subreg:SI (match_dup 0) 0) (not:SI (subreg:SI (match_dup 1) 0)))
956 (set (subreg:SI (match_dup 0) 4) (not:SI (subreg:SI (match_dup 1) 4)))]
957@@ -881,18 +926,17 @@
958 ;;----------------------------------------------------------------
959
960 (define_insn "anddi3"
961- [(set (match_operand:DI 0 "register_operand" "=d,d")
962- (and:DI (match_operand:DI 1 "arith_operand" "d,d")
963- (match_operand:DI 2 "arith_operand" "d,K")))]
964+ [(set (match_operand:DI 0 "register_operand" "=d,d,d")
965+ (and:DI (match_operand:DI 1 "arith_operand" "d,d,d")
966+ (match_operand:DI 2 "arith_operand" "d,K,I")))]
967 "TARGET_MB_64"
968 "@
969 andl\t%0,%1,%2
970- andli\t%0,%1,%2 #andl1"
971- ;; andli\t%0,%1,%2 #andl3
972- ;; andli\t%0,%1,%2 #andl2
973- [(set_attr "type" "arith,arith")
974- (set_attr "mode" "DI,DI")
975- (set_attr "length" "4,4")])
976+ andli\t%0,%1,%2 #andl2
977+ andli\t%0,%1,%2 #andl3"
978+ [(set_attr "type" "arith,no_delay_arith,no_delay_arith")
979+ (set_attr "mode" "DI,DI,DI")
980+ (set_attr "length" "4,4,4")])
981
982 (define_insn "andsi3"
983 [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
984@@ -917,7 +961,7 @@
985 "@
986 orl\t%0,%1,%2
987 orli\t%0,%1,%2 #andl1"
988- [(set_attr "type" "arith,arith")
989+ [(set_attr "type" "arith,no_delay_arith")
990 (set_attr "mode" "DI,DI")
991 (set_attr "length" "4,4")])
992
993@@ -943,7 +987,7 @@
994 "@
995 xorl\t%0,%1,%2
996 xorli\t%0,%1,%2 #andl1"
997- [(set_attr "type" "arith,arith")
998+ [(set_attr "type" "arith,no_delay_arith")
999 (set_attr "mode" "DI,DI")
1000 (set_attr "length" "4,4")])
1001
1002@@ -1016,26 +1060,6 @@
1003 (set_attr "mode" "SI")
1004 (set_attr "length" "4")])
1005
1006-;;(define_expand "extendqidi2"
1007-;; [(set (match_operand:DI 0 "register_operand" "=d")
1008-;; (sign_extend:DI (match_operand:QI 1 "general_operand" "d")))]
1009-;; "TARGET_MB_64"
1010-;; {
1011-;; if (GET_CODE (operands[1]) != REG)
1012-;; FAIL;
1013-;; }
1014-;;)
1015-
1016-
1017-;;(define_insn "extendqidi2"
1018-;; [(set (match_operand:DI 0 "register_operand" "=d")
1019-;; (sign_extend:DI (match_operand:QI 1 "register_operand" "d")))]
1020-;; "TARGET_MB_64"
1021-;; "sextl8\t%0,%1"
1022-;; [(set_attr "type" "arith")
1023-;; (set_attr "mode" "DI")
1024-;; (set_attr "length" "4")])
1025-
1026 (define_insn "extendhisi2"
1027 [(set (match_operand:SI 0 "register_operand" "=d")
1028 (sign_extend:SI (match_operand:HI 1 "register_operand" "d")))]
1029@@ -1058,6 +1082,27 @@
1030 ;; Those for integer source operand are ordered
1031 ;; widest source type first.
1032
1033+(define_insn "extendsidi2_long"
1034+ [(set (match_operand:DI 0 "register_operand" "=d,d,d")
1035+ (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,R,m")))]
1036+ "TARGET_MB_64"
1037+ {
1038+ switch (which_alternative)
1039+ {
1040+ case 0:
1041+ return "sextl32\t%0,%1";
1042+ case 1:
1043+ case 2:
1044+ {
1045+ output_asm_insn ("ll%i1\t%0,%1", operands);
1046+ return "sextl32\t%0,%0";
1047+ }
1048+ }
1049+ }
1050+ [(set_attr "type" "multi,multi,multi")
1051+ (set_attr "mode" "DI")
1052+ (set_attr "length" "4,8,8")])
1053+
1054 (define_insn "extendsidi2"
1055 [(set (match_operand:DI 0 "register_operand" "=d,d,d")
1056 (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,R,m")))]
1057@@ -1088,68 +1133,117 @@
1058 ;; Unlike most other insns, the move insns can't be split with
1059 ;; different predicates, because register spilling and other parts of
1060 ;; the compiler, have memoized the insn number already.
1061+;; //}
1062
1063 (define_expand "movdi"
1064 [(set (match_operand:DI 0 "nonimmediate_operand" "")
1065 (match_operand:DI 1 "general_operand" ""))]
1066 ""
1067 {
1068- /* If operands[1] is a constant address illegal for pic, then we need to
1069- handle it just like microblaze_legitimize_address does. */
1070- if (flag_pic && pic_address_needs_scratch (operands[1]))
1071+ if (TARGET_MB_64)
1072+ {
1073+ if (microblaze_expand_move (DImode, operands)) DONE;
1074+ }
1075+ else
1076 {
1077+ /* If operands[1] is a constant address illegal for pic, then we need to
1078+ handle it just like microblaze_legitimize_address does. */
1079+ if (flag_pic && pic_address_needs_scratch (operands[1]))
1080+ {
1081 rtx temp = force_reg (DImode, XEXP (XEXP (operands[1], 0), 0));
1082 rtx temp2 = XEXP (XEXP (operands[1], 0), 1);
1083 emit_move_insn (operands[0], gen_rtx_PLUS (DImode, temp, temp2));
1084 DONE;
1085- }
1086-
1087-
1088- if ((reload_in_progress | reload_completed) == 0
1089- && !register_operand (operands[0], DImode)
1090- && !register_operand (operands[1], DImode)
1091- && (((GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0)
1092- && operands[1] != CONST0_RTX (DImode))))
1093- {
1094+ }
1095
1096- rtx temp = force_reg (DImode, operands[1]);
1097- emit_move_insn (operands[0], temp);
1098- DONE;
1099+ if ((reload_in_progress | reload_completed) == 0
1100+ && !register_operand (operands[0], DImode)
1101+ && !register_operand (operands[1], DImode)
1102+ && (((GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 0)
1103+ && operands[1] != CONST0_RTX (DImode))))
1104+ {
1105+ rtx temp = force_reg (DImode, operands[1]);
1106+ emit_move_insn (operands[0], temp);
1107+ DONE;
1108+ }
1109 }
1110 }
1111 )
1112
1113+;; Added for status registers
1114+(define_insn "movdi_status"
1115+ [(set (match_operand:DI 0 "register_operand" "=d,d,z")
1116+ (match_operand:DI 1 "register_operand" "z,d,d"))]
1117+ "microblaze_is_interrupt_variant () && TARGET_MB_64"
1118+ "@
1119+ mfs\t%0,%1 #mfs
1120+ addlk\t%0,%1,r0 #add movdi
1121+ mts\t%0,%1 #mts"
1122+ [(set_attr "type" "move")
1123+ (set_attr "mode" "DI")
1124+ (set_attr "length" "12")])
1125
1126-(define_insn "*movdi_internal_64"
1127- [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,R,o")
1128- (match_operand:DI 1 "general_operand" " d,K,J,R,o,d,d"))]
1129- "TARGET_MB_64 && (INTVAL(operands[1]) < 0x7fffffffff) && (INTVAL(operands[1]) > 0xffffff8000000000)"
1130+;; This move will be not be moved to delay slot.
1131+(define_insn "*movdi_internal3"
1132+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d")
1133+ (match_operand:DI 1 "immediate_operand" "J,I,Mnis"))]
1134+ "TARGET_MB_64 && (register_operand (operands[0], DImode) &&
1135+ (GET_CODE (operands[1]) == CONST_INT &&
1136+ (INTVAL (operands[1]) <= (long)549755813887 && INTVAL (operands[1]) >= (long)-549755813888)))"
1137+ "@
1138+ addlk\t%0,r0,r0\t
1139+ addlik\t%0,r0,%1\t #N1 %X1
1140+ addlik\t%0,r0,%1\t #N2 %X1"
1141+ [(set_attr "type" "arith,no_delay_arith,no_delay_arith")
1142+ (set_attr "mode" "DI")
1143+ (set_attr "length" "4")])
1144+
1145+;; This move may be used for PLT label operand
1146+(define_insn "*movdi_internal5_pltop"
1147+ [(set (match_operand:DI 0 "register_operand" "=d,d")
1148+ (match_operand:DI 1 "call_insn_operand" ""))]
1149+ "TARGET_MB_64 && (register_operand (operands[0], Pmode) &&
1150+ PLT_ADDR_P (operands[1]))"
1151+ {
1152+ gcc_unreachable ();
1153+ }
1154+ [(set_attr "type" "load")
1155+ (set_attr "mode" "DI")
1156+ (set_attr "length" "4")])
1157+
1158+(define_insn "*movdi_internal2"
1159+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d, d,d,R,m")
1160+ (match_operand:DI 1 "move_src_operand" " d,I,Mnis,R,m,dJ,dJ"))]
1161+ "TARGET_MB_64"
1162 {
1163 switch (which_alternative)
1164 {
1165 case 0:
1166- return "addlk\t%0,%1";
1167- case 1:
1168- return "addlik\t%0,r0,%1";
1169- case 2:
1170- return "addlk\t%0,r0,r0";
1171- case 3:
1172- case 4:
1173- return "lli\t%0,%1";
1174- case 5:
1175- case 6:
1176- return "sli\t%1,%0";
1177- }
1178- return "unreachable";
1179- }
1180- [(set_attr "type" "no_delay_move,no_delay_arith,no_delay_arith,no_delay_load,no_delay_load,no_delay_store,no_delay_store")
1181+ return "addlk\t%0,%1,r0";
1182+ case 1:
1183+ case 2:
1184+ if (GET_CODE (operands[1]) == CONST_INT &&
1185+ (INTVAL (operands[1]) > (long)549755813887 || INTVAL (operands[1]) < (long)-549755813888))
1186+ return "addlik\t%0,r0,%h1\n\tbsllli\t%0,%0,32\n\taddlik\t%0,%0,%j1 #li => la";
1187+ else
1188+ return "addlik\t%0,r0,%1";
1189+ case 3:
1190+ case 4:
1191+ return "ll%i1\t%0,%1";
1192+ case 5:
1193+ case 6:
1194+ return "sl%i0\t%z1,%0";
1195+ }
1196+ }
1197+ [(set_attr "type" "load,no_delay_load,no_delay_load,no_delay_load,no_delay_load,no_delay_store,no_delay_store")
1198 (set_attr "mode" "DI")
1199- (set_attr "length" "8,8,8,8,12,8,12")])
1200+ (set_attr "length" "4,4,12,4,8,4,8")])
1201+
1202
1203 (define_insn "*movdi_internal"
1204 [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,R,o")
1205 (match_operand:DI 1 "general_operand" " d,i,J,R,o,d,d"))]
1206- ""
1207+ "!TARGET_MB_64"
1208 {
1209 switch (which_alternative)
1210 {
1211@@ -1181,7 +1275,8 @@
1212 "reload_completed
1213 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1214 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1215- && (REGNO(operands[0]) == (REGNO(operands[1]) + 1))"
1216+ && (REGNO(operands[0]) == (REGNO(operands[1]) + 1))
1217+ && !(TARGET_MB_64)"
1218
1219 [(set (subreg:SI (match_dup 0) 4) (subreg:SI (match_dup 1) 4))
1220 (set (subreg:SI (match_dup 0) 0) (subreg:SI (match_dup 1) 0))]
1221@@ -1193,12 +1288,22 @@
1222 "reload_completed
1223 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1224 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1225- && (REGNO (operands[0]) != (REGNO (operands[1]) + 1))"
1226+ && (REGNO (operands[0]) != (REGNO (operands[1]) + 1))
1227+ && !(TARGET_MB_64)"
1228
1229 [(set (subreg:SI (match_dup 0) 0) (subreg:SI (match_dup 1) 0))
1230 (set (subreg:SI (match_dup 0) 4) (subreg:SI (match_dup 1) 4))]
1231 "")
1232
1233+(define_insn "movdi_long_int"
1234+ [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
1235+ (match_operand:DI 1 "general_operand" "i"))]
1236+ ""
1237+ "addlik\t%0,r0,%h1\n\tbsllli\t%0,%0,32\n\taddlik\t%0,%0,%j1 #li => la";
1238+ [(set_attr "type" "no_delay_arith")
1239+ (set_attr "mode" "DI")
1240+ (set_attr "length" "12")])
1241+
1242 ;; Unlike most other insns, the move insns can't be split with
1243 ;; different predicates, because register spilling and other parts of
1244 ;; the compiler, have memoized the insn number already.
1245@@ -1270,6 +1375,8 @@
1246 (set_attr "length" "4,4,8,4,8,4,8")])
1247
1248
1249+
1250+
1251 ;; 16-bit Integer moves
1252
1253 ;; Unlike most other insns, the move insns can't be split with
1254@@ -1302,8 +1409,8 @@
1255 "@
1256 addik\t%0,r0,%1\t# %X1
1257 addk\t%0,%1,r0
1258- lhui\t%0,%1
1259- lhui\t%0,%1
1260+ lhu%i1\t%0,%1
1261+ lhu%i1\t%0,%1
1262 sh%i0\t%z1,%0
1263 sh%i0\t%z1,%0"
1264 [(set_attr "type" "arith,move,load,no_delay_load,store,no_delay_store")
1265@@ -1346,7 +1453,7 @@
1266 lbu%i1\t%0,%1
1267 lbu%i1\t%0,%1
1268 sb%i0\t%z1,%0
1269- sbi\t%z1,%0"
1270+ sb%i0\t%z1,%0"
1271 [(set_attr "type" "arith,arith,move,load,no_delay_load,store,no_delay_store")
1272 (set_attr "mode" "QI")
1273 (set_attr "length" "4,4,8,4,8,4,8")])
1274@@ -1419,7 +1526,7 @@
1275 addik\t%0,r0,%F1
1276 lw%i1\t%0,%1
1277 sw%i0\t%z1,%0
1278- swi\t%z1,%0"
1279+ sw%i0\t%z1,%0"
1280 [(set_attr "type" "move,no_delay_load,load,no_delay_load,no_delay_load,store,no_delay_store")
1281 (set_attr "mode" "SF")
1282 (set_attr "length" "4,4,4,4,4,4,4")])
1283@@ -1458,6 +1565,33 @@
1284 ;; movdf_internal
1285 ;; Applies to both TARGET_SOFT_FLOAT and TARGET_HARD_FLOAT
1286 ;;
1287+(define_insn "*movdf_internal_64"
1288+ [(set (match_operand:DF 0 "nonimmediate_operand" "=d,d,d,d,d,m")
1289+ (match_operand:DF 1 "general_operand" "d,dG,m,F,T,d"))]
1290+ "TARGET_MB_64"
1291+ {
1292+ switch (which_alternative)
1293+ {
1294+ case 0:
1295+ return "addlk\t%0,%1,r0";
1296+ case 1:
1297+ return "addlk\t%0,r0,r0";
1298+ case 2:
1299+ case 4:
1300+ return "ll%i1\t%0,%1";
1301+ case 3:
1302+ {
1303+ return "addlik\t%0,r0,%h1 \n\tbsllli\t%0,%0,32\n\taddlik\t%0,%0,%j1 #Xfer Lo";
1304+ }
1305+ case 5:
1306+ return "sl%i0\t%1,%0";
1307+ }
1308+ gcc_unreachable ();
1309+ }
1310+ [(set_attr "type" "no_delay_move,no_delay_move,no_delay_load,no_delay_load,no_delay_load,no_delay_store")
1311+ (set_attr "mode" "DF")
1312+ (set_attr "length" "4,4,4,16,4,4")])
1313+
1314 (define_insn "*movdf_internal"
1315 [(set (match_operand:DF 0 "nonimmediate_operand" "=d,d,d,d,o")
1316 (match_operand:DF 1 "general_operand" "dG,o,F,T,d"))]
1317@@ -1492,7 +1626,8 @@
1318 "reload_completed
1319 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1320 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1321- && (REGNO (operands[0]) == (REGNO (operands[1]) + 1))"
1322+ && (REGNO (operands[0]) == (REGNO (operands[1]) + 1))
1323+ && !TARGET_MB_64"
1324 [(set (subreg:SI (match_dup 0) 4) (subreg:SI (match_dup 1) 4))
1325 (set (subreg:SI (match_dup 0) 0) (subreg:SI (match_dup 1) 0))]
1326 "")
1327@@ -1503,7 +1638,8 @@
1328 "reload_completed
1329 && GET_CODE (operands[0]) == REG && GP_REG_P (REGNO (operands[0]))
1330 && GET_CODE (operands[1]) == REG && GP_REG_P (REGNO (operands[1]))
1331- && (REGNO (operands[0]) != (REGNO (operands[1]) + 1))"
1332+ && (REGNO (operands[0]) != (REGNO (operands[1]) + 1))
1333+ && !TARGET_MB_64"
1334 [(set (subreg:SI (match_dup 0) 0) (subreg:SI (match_dup 1) 0))
1335 (set (subreg:SI (match_dup 0) 4) (subreg:SI (match_dup 1) 4))]
1336 "")
1337@@ -2003,6 +2139,31 @@ else
1338 "
1339 )
1340
1341+
1342+(define_insn "seq_internal_pat_long"
1343+ [(set (match_operand:DI 0 "register_operand" "=d")
1344+ (eq:DI
1345+ (match_operand:DI 1 "register_operand" "d")
1346+ (match_operand:DI 2 "register_operand" "d")))]
1347+ "TARGET_MB_64"
1348+ "pcmpleq\t%0,%1,%2"
1349+ [(set_attr "type" "arith")
1350+ (set_attr "mode" "DI")
1351+ (set_attr "length" "4")]
1352+)
1353+
1354+(define_insn "sne_internal_pat_long"
1355+ [(set (match_operand:DI 0 "register_operand" "=d")
1356+ (ne:DI
1357+ (match_operand:DI 1 "register_operand" "d")
1358+ (match_operand:DI 2 "register_operand" "d")))]
1359+ "TARGET_MB_64"
1360+ "pcmplne\t%0,%1,%2"
1361+ [(set_attr "type" "arith")
1362+ (set_attr "mode" "DI")
1363+ (set_attr "length" "4")]
1364+)
1365+
1366 (define_insn "seq_internal_pat"
1367 [(set (match_operand:SI 0 "register_operand" "=d")
1368 (eq:SI
1369@@ -2063,8 +2224,8 @@ else
1370 (define_expand "cbranchsi4"
1371 [(set (pc)
1372 (if_then_else (match_operator 0 "ordered_comparison_operator"
1373- [(match_operand:SI 1 "register_operand")
1374- (match_operand:SI 2 "arith_operand" "I,i")])
1375+ [(match_operand 1 "register_operand")
1376+ (match_operand 2 "arith_operand" "I,i")])
1377 (label_ref (match_operand 3 ""))
1378 (pc)))]
1379 ""
1380@@ -2076,13 +2237,13 @@ else
1381 (define_expand "cbranchsi4_reg"
1382 [(set (pc)
1383 (if_then_else (match_operator 0 "ordered_comparison_operator"
1384- [(match_operand:SI 1 "register_operand")
1385- (match_operand:SI 2 "register_operand")])
1386+ [(match_operand 1 "register_operand")
1387+ (match_operand 2 "register_operand")])
1388 (label_ref (match_operand 3 ""))
1389 (pc)))]
1390 ""
1391 {
1392- microblaze_expand_conditional_branch_reg (SImode, operands);
1393+ microblaze_expand_conditional_branch_reg (Pmode, operands);
1394 DONE;
1395 })
1396
1397@@ -2107,6 +2268,26 @@ else
1398 (label_ref (match_operand 1))
1399 (pc)))])
1400
1401+(define_insn "branch_zero64"
1402+ [(set (pc)
1403+ (if_then_else (match_operator 0 "ordered_comparison_operator"
1404+ [(match_operand 1 "register_operand" "d")
1405+ (const_int 0)])
1406+ (match_operand 2 "pc_or_label_operand" "")
1407+ (match_operand 3 "pc_or_label_operand" "")))
1408+ ]
1409+ "TARGET_MB_64"
1410+ {
1411+ if (operands[3] == pc_rtx)
1412+ return "bea%C0i%?\t%z1,%2";
1413+ else
1414+ return "bea%N0i%?\t%z1,%3";
1415+ }
1416+ [(set_attr "type" "branch")
1417+ (set_attr "mode" "none")
1418+ (set_attr "length" "4")]
1419+)
1420+
1421 (define_insn "branch_zero"
1422 [(set (pc)
1423 (if_then_else (match_operator:SI 0 "ordered_comparison_operator"
1424@@ -2127,6 +2308,47 @@ else
1425 (set_attr "length" "4")]
1426 )
1427
1428+(define_insn "branch_compare64"
1429+ [(set (pc)
1430+ (if_then_else (match_operator 0 "cmp_op"
1431+ [(match_operand 1 "register_operand" "d")
1432+ (match_operand 2 "register_operand" "d")
1433+ ])
1434+ (label_ref (match_operand 3))
1435+ (pc)))
1436+ (clobber(reg:SI R_TMP))]
1437+ "TARGET_MB_64"
1438+ {
1439+ operands[4] = gen_rtx_REG (SImode, MB_ABI_ASM_TEMP_REGNUM);
1440+ enum rtx_code code = GET_CODE (operands[0]);
1441+
1442+ if (code == GT || code == LE)
1443+ {
1444+ output_asm_insn ("cmp\tr18,%z1,%z2", operands);
1445+ code = swap_condition (code);
1446+ }
1447+ else if (code == GTU || code == LEU)
1448+ {
1449+ output_asm_insn ("cmpu\tr18,%z1,%z2", operands);
1450+ code = swap_condition (code);
1451+ }
1452+ else if (code == GE || code == LT)
1453+ {
1454+ output_asm_insn ("cmp\tr18,%z2,%z1", operands);
1455+ }
1456+ else if (code == GEU || code == LTU)
1457+ {
1458+ output_asm_insn ("cmpu\tr18,%z2,%z1", operands);
1459+ }
1460+
1461+ operands[0] = gen_rtx_fmt_ee (signed_condition (code), SImode, operands[4], const0_rtx);
1462+ return "bea%C0i%?\tr18,%3";
1463+ }
1464+ [(set_attr "type" "branch")
1465+ (set_attr "mode" "none")
1466+ (set_attr "length" "12")]
1467+)
1468+
1469 (define_insn "branch_compare"
1470 [(set (pc)
1471 (if_then_else (match_operator:SI 0 "cmp_op"
1472@@ -2310,7 +2532,7 @@ else
1473 ;; Indirect jumps. Jump to register values. Assuming absolute jumps
1474
1475 (define_insn "indirect_jump_internal1"
1476- [(set (pc) (match_operand:SI 0 "register_operand" "d"))]
1477+ [(set (pc) (match_operand 0 "register_operand" "d"))]
1478 ""
1479 "bra%?\t%0"
1480 [(set_attr "type" "jump")
1481@@ -2323,7 +2545,7 @@ else
1482 (use (label_ref (match_operand 1 "" "")))]
1483 ""
1484 {
1485- gcc_assert (GET_MODE (operands[0]) == Pmode);
1486+ //gcc_assert (GET_MODE (operands[0]) == Pmode);
1487
1488 if (!flag_pic)
1489 emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1]));
1490@@ -2335,7 +2557,7 @@ else
1491
1492 (define_insn "tablejump_internal1"
1493 [(set (pc)
1494- (match_operand:SI 0 "register_operand" "d"))
1495+ (match_operand 0 "register_operand" "d"))
1496 (use (label_ref (match_operand 1 "" "")))]
1497 ""
1498 "bra%?\t%0 "
1499@@ -2345,9 +2567,9 @@ else
1500
1501 (define_expand "tablejump_internal3"
1502 [(parallel [(set (pc)
1503- (plus:SI (match_operand:SI 0 "register_operand" "d")
1504- (label_ref:SI (match_operand:SI 1 "" ""))))
1505- (use (label_ref:SI (match_dup 1)))])]
1506+ (plus (match_operand 0 "register_operand" "d")
1507+ (label_ref (match_operand:SI 1 "" ""))))
1508+ (use (label_ref (match_dup 1)))])]
1509 ""
1510 ""
1511 )
1512@@ -2408,7 +2630,7 @@ else
1513 (minus (reg 1) (match_operand 1 "register_operand" "")))
1514 (set (reg 1)
1515 (minus (reg 1) (match_dup 1)))]
1516- ""
1517+ "!TARGET_MB_64"
1518 {
1519 rtx retaddr = gen_rtx_MEM (Pmode, stack_pointer_rtx);
1520 rtx reg = gen_reg_rtx (Pmode);
1521@@ -2433,7 +2655,7 @@ else
1522 (define_expand "save_stack_block"
1523 [(match_operand 0 "register_operand" "")
1524 (match_operand 1 "register_operand" "")]
1525- ""
1526+ "!TARGET_MB_64"
1527 {
1528 emit_move_insn (operands[0], operands[1]);
1529 DONE;
1530@@ -2443,7 +2665,7 @@ else
1531 (define_expand "restore_stack_block"
1532 [(match_operand 0 "register_operand" "")
1533 (match_operand 1 "register_operand" "")]
1534- ""
1535+ "!TARGET_MB_64"
1536 {
1537 rtx retaddr = gen_rtx_MEM (Pmode, stack_pointer_rtx);
1538 rtx rtmp = gen_rtx_REG (SImode, R_TMP);
1539@@ -2490,7 +2712,7 @@ else
1540
1541 (define_insn "<optab>_internal"
1542 [(any_return)
1543- (use (match_operand:SI 0 "register_operand" ""))]
1544+ (use (match_operand 0 "register_operand" ""))]
1545 ""
1546 {
1547 if (microblaze_is_break_handler ())
1548@@ -2523,7 +2745,7 @@ else
1549 (define_expand "call"
1550 [(parallel [(call (match_operand 0 "memory_operand" "m")
1551 (match_operand 1 "" "i"))
1552- (clobber (reg:SI R_SR))
1553+ (clobber (reg R_SR))
1554 (use (match_operand 2 "" ""))
1555 (use (match_operand 3 "" ""))])]
1556 ""
1557@@ -2543,12 +2765,12 @@ else
1558
1559 if (GET_CODE (XEXP (operands[0], 0)) == UNSPEC)
1560 emit_call_insn (gen_call_internal_plt0 (operands[0], operands[1],
1561- gen_rtx_REG (SImode,
1562+ gen_rtx_REG (Pmode,
1563 GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM),
1564 pic_offset_table_rtx));
1565 else
1566 emit_call_insn (gen_call_internal0 (operands[0], operands[1],
1567- gen_rtx_REG (SImode,
1568+ gen_rtx_REG (Pmode,
1569 GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM)));
1570
1571 DONE;
1572@@ -2558,7 +2780,7 @@ else
1573 (define_expand "call_internal0"
1574 [(parallel [(call (match_operand 0 "" "")
1575 (match_operand 1 "" ""))
1576- (clobber (match_operand:SI 2 "" ""))])]
1577+ (clobber (match_operand 2 "" ""))])]
1578 ""
1579 {
1580 }
1581@@ -2567,18 +2789,34 @@ else
1582 (define_expand "call_internal_plt0"
1583 [(parallel [(call (match_operand 0 "" "")
1584 (match_operand 1 "" ""))
1585- (clobber (match_operand:SI 2 "" ""))
1586- (use (match_operand:SI 3 "" ""))])]
1587+ (clobber (match_operand 2 "" ""))
1588+ (use (match_operand 3 "" ""))])]
1589 ""
1590 {
1591 }
1592 )
1593
1594+(define_insn "call_internal_plt_64"
1595+ [(call (mem (match_operand 0 "call_insn_plt_operand" ""))
1596+ (match_operand 1 "" "i"))
1597+ (clobber (reg R_SR))
1598+ (use (reg R_GOT))]
1599+ "flag_pic && TARGET_MB_64"
1600+ {
1601+ register rtx target2 = gen_rtx_REG (Pmode,
1602+ GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM);
1603+ gen_rtx_CLOBBER (VOIDmode, target2);
1604+ return "brealid\tr15,%0\;%#";
1605+ }
1606+ [(set_attr "type" "call")
1607+ (set_attr "mode" "none")
1608+ (set_attr "length" "4")])
1609+
1610 (define_insn "call_internal_plt"
1611- [(call (mem (match_operand:SI 0 "call_insn_plt_operand" ""))
1612- (match_operand:SI 1 "" "i"))
1613- (clobber (reg:SI R_SR))
1614- (use (reg:SI R_GOT))]
1615+ [(call (mem (match_operand 0 "call_insn_plt_operand" ""))
1616+ (match_operand 1 "" "i"))
1617+ (clobber (reg R_SR))
1618+ (use (reg R_GOT))]
1619 "flag_pic"
1620 {
1621 register rtx target2 = gen_rtx_REG (Pmode,
1622@@ -2590,10 +2828,41 @@ else
1623 (set_attr "mode" "none")
1624 (set_attr "length" "4")])
1625
1626+(define_insn "call_internal1_64"
1627+ [(call (mem (match_operand:VOID 0 "call_insn_simple_operand" "ri"))
1628+ (match_operand 1 "" "i"))
1629+ (clobber (reg R_SR))]
1630+ "TARGET_MB_64"
1631+ {
1632+ register rtx target = operands[0];
1633+ register rtx target2 = gen_rtx_REG (Pmode,
1634+ GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM);
1635+ if (GET_CODE (target) == SYMBOL_REF) {
1636+ if (microblaze_break_function_p (SYMBOL_REF_DECL (target))) {
1637+ gen_rtx_CLOBBER (VOIDmode, target2);
1638+ return "breaki\tr16,%0\;%#";
1639+ }
1640+ else {
1641+ gen_rtx_CLOBBER (VOIDmode, target2);
1642+ return "brealid\tr15,%0\;%#";
1643+ }
1644+ } else if (GET_CODE (target) == CONST_INT)
1645+ return "la\t%@,r0,%0\;brald\tr15,%@\;%#";
1646+ else if (GET_CODE (target) == REG)
1647+ return "brald\tr15,%0\;%#";
1648+ else {
1649+ fprintf (stderr,"Unsupported call insn\n");
1650+ return NULL;
1651+ }
1652+ }
1653+ [(set_attr "type" "call")
1654+ (set_attr "mode" "none")
1655+ (set_attr "length" "4")])
1656+
1657 (define_insn "call_internal1"
1658 [(call (mem (match_operand:VOID 0 "call_insn_simple_operand" "ri"))
1659- (match_operand:SI 1 "" "i"))
1660- (clobber (reg:SI R_SR))]
1661+ (match_operand 1 "" "i"))
1662+ (clobber (reg R_SR))]
1663 ""
1664 {
1665 register rtx target = operands[0];
1666@@ -2627,7 +2896,7 @@ else
1667 [(parallel [(set (match_operand 0 "register_operand" "=d")
1668 (call (match_operand 1 "memory_operand" "m")
1669 (match_operand 2 "" "i")))
1670- (clobber (reg:SI R_SR))
1671+ (clobber (reg R_SR))
1672 (use (match_operand 3 "" ""))])] ;; next_arg_reg
1673 ""
1674 {
1675@@ -2647,13 +2916,13 @@ else
1676 if (GET_CODE (XEXP (operands[1], 0)) == UNSPEC)
1677 emit_call_insn (gen_call_value_intern_plt0 (operands[0], operands[1],
1678 operands[2],
1679- gen_rtx_REG (SImode,
1680+ gen_rtx_REG (Pmode,
1681 GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM),
1682 pic_offset_table_rtx));
1683 else
1684 emit_call_insn (gen_call_value_internal (operands[0], operands[1],
1685 operands[2],
1686- gen_rtx_REG (SImode,
1687+ gen_rtx_REG (Pmode,
1688 GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM)));
1689
1690 DONE;
1691@@ -2665,7 +2934,7 @@ else
1692 [(parallel [(set (match_operand 0 "" "")
1693 (call (match_operand 1 "" "")
1694 (match_operand 2 "" "")))
1695- (clobber (match_operand:SI 3 "" ""))
1696+ (clobber (match_operand 3 "" ""))
1697 ])]
1698 ""
1699 {}
1700@@ -2675,18 +2944,35 @@ else
1701 [(parallel[(set (match_operand 0 "" "")
1702 (call (match_operand 1 "" "")
1703 (match_operand 2 "" "")))
1704- (clobber (match_operand:SI 3 "" ""))
1705- (use (match_operand:SI 4 "" ""))])]
1706+ (clobber (match_operand 3 "" ""))
1707+ (use (match_operand 4 "" ""))])]
1708 "flag_pic"
1709 {}
1710 )
1711
1712+(define_insn "call_value_intern_plt_64"
1713+ [(set (match_operand:VOID 0 "register_operand" "=d")
1714+ (call (mem (match_operand 1 "call_insn_plt_operand" ""))
1715+ (match_operand 2 "" "i")))
1716+ (clobber (match_operand 3 "register_operand" "=d"))
1717+ (use (match_operand 4 "register_operand"))]
1718+ "flag_pic && TARGET_MB_64"
1719+ {
1720+ register rtx target2=gen_rtx_REG (Pmode,GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM);
1721+
1722+ gen_rtx_CLOBBER (VOIDmode,target2);
1723+ return "brealid\tr15,%1\;%#";
1724+ }
1725+ [(set_attr "type" "call")
1726+ (set_attr "mode" "none")
1727+ (set_attr "length" "4")])
1728+
1729 (define_insn "call_value_intern_plt"
1730 [(set (match_operand:VOID 0 "register_operand" "=d")
1731- (call (mem (match_operand:SI 1 "call_insn_plt_operand" ""))
1732- (match_operand:SI 2 "" "i")))
1733- (clobber (match_operand:SI 3 "register_operand" "=d"))
1734- (use (match_operand:SI 4 "register_operand"))]
1735+ (call (mem (match_operand 1 "call_insn_plt_operand" ""))
1736+ (match_operand 2 "" "i")))
1737+ (clobber (match_operand 3 "register_operand" "=d"))
1738+ (use (match_operand 4 "register_operand"))]
1739 "flag_pic"
1740 {
1741 register rtx target2=gen_rtx_REG (Pmode,GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM);
1742@@ -2698,11 +2984,46 @@ else
1743 (set_attr "mode" "none")
1744 (set_attr "length" "4")])
1745
1746+(define_insn "call_value_intern_64"
1747+ [(set (match_operand:VOID 0 "register_operand" "=d")
1748+ (call (mem (match_operand:VOID 1 "call_insn_operand" "ri"))
1749+ (match_operand 2 "" "i")))
1750+ (clobber (match_operand 3 "register_operand" "=d"))]
1751+ "TARGET_MB_64"
1752+ {
1753+ register rtx target = operands[1];
1754+ register rtx target2=gen_rtx_REG (Pmode,GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM);
1755+
1756+ if (GET_CODE (target) == SYMBOL_REF)
1757+ {
1758+ gen_rtx_CLOBBER (VOIDmode,target2);
1759+ if (microblaze_break_function_p (SYMBOL_REF_DECL (target)))
1760+ return "breaki\tr16,%1\;%#";
1761+ else if (SYMBOL_REF_FLAGS (target) & SYMBOL_FLAG_FUNCTION)
1762+ {
1763+ return "brealid\tr15,%1\;%#";
1764+ }
1765+ else
1766+ {
1767+ return "bralid\tr15,%1\;%#";
1768+ }
1769+ }
1770+ else if (GET_CODE (target) == CONST_INT)
1771+ return "la\t%@,r0,%1\;brald\tr15,%@\;%#";
1772+ else if (GET_CODE (target) == REG)
1773+ return "brald\tr15,%1\;%#";
1774+ else
1775+ return "Unsupported call insn\n";
1776+ }
1777+ [(set_attr "type" "call")
1778+ (set_attr "mode" "none")
1779+ (set_attr "length" "4")])
1780+
1781 (define_insn "call_value_intern"
1782 [(set (match_operand:VOID 0 "register_operand" "=d")
1783 (call (mem (match_operand:VOID 1 "call_insn_operand" "ri"))
1784- (match_operand:SI 2 "" "i")))
1785- (clobber (match_operand:SI 3 "register_operand" "=d"))]
1786+ (match_operand 2 "" "i")))
1787+ (clobber (match_operand 3 "register_operand" "=d"))]
1788 ""
1789 {
1790 register rtx target = operands[1];
1791@@ -2864,7 +3185,6 @@ else
1792
1793 ;;if (!register_operand (operands[0], VOIDmode))
1794 ;; FAIL;
1795-
1796 emit_insn (gen_insv_32 (operands[0], operands[1],
1797 operands[2], operands[3]));
1798 DONE;
1799diff --git a/gcc/config/microblaze/t-microblaze b/gcc/config/microblaze/t-microblaze
1800index 7671f63..9fc80b1 100644
1801--- a/gcc/config/microblaze/t-microblaze
1802+++ b/gcc/config/microblaze/t-microblaze
1803@@ -2,10 +2,11 @@ MULTILIB_OPTIONS = mxl-barrel-shift mno-xl-soft-mul mxl-multiply-high mlittle-en
1804 MULTILIB_DIRNAMES = bs m mh le m64
1805 MULTILIB_EXCEPTIONS = *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high
1806 MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/mlittle-endian
1807-MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/m64
1808+MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/mlittle-endian/m64
1809+MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/m64 mxl-multiply-high
1810 MULTILIB_EXCEPTIONS += mxl-multiply-high/mlittle-endian
1811-#MULTILIB_EXCEPTIONS += mxl-multiply-high/m64
1812-#MULTILIB_EXCEPTIONS += *mxl-multiply-high/mlittle-endian/m64
1813+MULTILIB_EXCEPTIONS += mxl-multiply-high/m64
1814+MULTILIB_EXCEPTIONS += *mxl-multiply-high/mlittle-endian/m64
1815
1816 # Extra files
1817 microblaze-c.o: $(srcdir)/config/microblaze/microblaze-c.c \
1818diff --git a/libgcc/config/microblaze/crti.S b/libgcc/config/microblaze/crti.S
1819index 2e15be4..3386520 100644
1820--- a/libgcc/config/microblaze/crti.S
1821+++ b/libgcc/config/microblaze/crti.S
1822@@ -40,7 +40,7 @@
1823
1824 .align 2
1825 __init:
1826- addik r1, r1, -8
1827+ addik r1, r1, -16
1828 sw r15, r0, r1
1829 la r11, r0, _stack
1830 mts rshr, r11
1831@@ -51,5 +51,5 @@ __init:
1832 .global __fini
1833 .align 2
1834 __fini:
1835- addik r1, r1, -8
1836+ addik r1, r1, -16
1837 sw r15, r0, r1
1838diff --git a/libgcc/config/microblaze/crtn.S b/libgcc/config/microblaze/crtn.S
1839index cd5fd9e..04e73d7 100644
1840--- a/libgcc/config/microblaze/crtn.S
1841+++ b/libgcc/config/microblaze/crtn.S
1842@@ -33,9 +33,9 @@
1843 .section .init, "ax"
1844 lw r15, r0, r1
1845 rtsd r15, 8
1846- addik r1, r1, 8
1847+ addik r1, r1, 16
1848
1849 .section .fini, "ax"
1850 lw r15, r0, r1
1851 rtsd r15, 8
1852- addik r1, r1, 8
1853+ addik r1, r1, 16
1854diff --git a/libgcc/config/microblaze/divdi3.S b/libgcc/config/microblaze/divdi3.S
1855new file mode 100644
1856index 0000000..d37bf51
1857--- /dev/null
1858+++ b/libgcc/config/microblaze/divdi3.S
1859@@ -0,0 +1,98 @@
1860+###################################-
1861+#
1862+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
1863+#
1864+# Contributed by Michael Eager <eager@eagercon.com>.
1865+#
1866+# This file is free software; you can redistribute it and/or modify it
1867+# under the terms of the GNU General Public License as published by the
1868+# Free Software Foundation; either version 3, or (at your option) any
1869+# later version.
1870+#
1871+# GCC is distributed in the hope that it will be useful, but WITHOUT
1872+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1873+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
1874+# License for more details.
1875+#
1876+# Under Section 7 of GPL version 3, you are granted additional
1877+# permissions described in the GCC Runtime Library Exception, version
1878+# 3.1, as published by the Free Software Foundation.
1879+#
1880+# You should have received a copy of the GNU General Public License and
1881+# a copy of the GCC Runtime Library Exception along with this program;
1882+# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1883+# <http://www.gnu.org/licenses/>.
1884+#
1885+# divdi3.S
1886+#
1887+# Divide operation for 32 bit integers.
1888+# Input : Dividend in Reg r5
1889+# Divisor in Reg r6
1890+# Output: Result in Reg r3
1891+#
1892+#######################################
1893+
1894+#ifdef __arch64__
1895+ .globl __divdi3
1896+ .ent __divdi3
1897+ .type __divdi3,@function
1898+__divdi3:
1899+ .frame r1,0,r15
1900+
1901+ ADDLIK r1,r1,-32
1902+ SLI r28,r1,0
1903+ SLI r29,r1,8
1904+ SLI r30,r1,16
1905+ SLI r31,r1,24
1906+
1907+ BEALEQI r6,$LaDiv_By_Zero # Div_by_Zero # Division Error
1908+ BEALEQI r5,$LaResult_Is_Zero # Result is Zero
1909+ XORL r28,r5,r6 # Get the sign of the result
1910+ BEALGEI r5,$LaR5_Pos
1911+ RSUBLI r5,r5,0 # Make r5 positive
1912+$LaR5_Pos:
1913+ BEALGEI r6,$LaR6_Pos
1914+ RSUBLI r6,r6,0 # Make r6 positive
1915+$LaR6_Pos:
1916+ ADDLIK r30,r0,0 # Clear mod
1917+ ADDLIK r3,r0,0 # clear div
1918+ ADDLIK r29,r0,64 # Initialize the loop count
1919+
1920+ # First part try to find the first '1' in the r5
1921+$LaDIV0:
1922+ BEALLTI r5,$LaDIV2 # This traps r5 == 0x80000000
1923+$LaDIV1:
1924+ ADDL r5,r5,r5 # left shift logical r5
1925+ ADDLIK r29,r29,-1
1926+ BEALGTI r5,$LaDIV1
1927+$LaDIV2:
1928+ ADDL r5,r5,r5 # left shift logical r5 get the '1' into the Carry
1929+ ADDLC r30,r30,r30 # Move that bit into the Mod register
1930+ RSUBL r31,r6,r30 # Try to subtract (r30 a r6)
1931+ BEALLTI r31,$LaMOD_TOO_SMALL
1932+ ORL r30,r0,r31 # Move the r31 to mod since the result was positive
1933+ ADDLIK r3,r3,1
1934+$LaMOD_TOO_SMALL:
1935+ ADDLIK r29,r29,-1
1936+ BEALEQi r29,$LaLOOP_END
1937+ ADDL r3,r3,r3 # Shift in the '1' into div
1938+ BREAI $LaDIV2 # Div2
1939+$LaLOOP_END:
1940+ BEALGEI r28,$LaRETURN_HERE
1941+ RSUBLI r3,r3,0 # Negate the result
1942+ BREAI $LaRETURN_HERE
1943+$LaDiv_By_Zero:
1944+$LaResult_Is_Zero:
1945+ ORL r3,r0,r0 # set result to 0
1946+$LaRETURN_HERE:
1947+# Restore values of CSRs and that of r3 and the divisor and the dividend
1948+ LLI r28,r1,0
1949+ LLI r29,r1,8
1950+ LLI r30,r1,16
1951+ LLI r31,r1,24
1952+ ADDLIK r1,r1,32
1953+ RTSD r15,8
1954+ nop
1955+.end __divdi3
1956+ .size __divdi3, . - __divdi3
1957+#endif
1958diff --git a/libgcc/config/microblaze/divdi3_table.c b/libgcc/config/microblaze/divdi3_table.c
1959new file mode 100644
1960index 0000000..8096259
1961--- /dev/null
1962+++ b/libgcc/config/microblaze/divdi3_table.c
1963@@ -0,0 +1,62 @@
1964+/* Table for software lookup divide for Xilinx MicroBlaze.
1965+
1966+ Copyright (C) 2009-2017 Free Software Foundation, Inc.
1967+
1968+ Contributed by Michael Eager <eager@eagercon.com>.
1969+
1970+ This file is free software; you can redistribute it and/or modify it
1971+ under the terms of the GNU General Public License as published by the
1972+ Free Software Foundation; either version 3, or (at your option) any
1973+ later version.
1974+
1975+ GCC is distributed in the hope that it will be useful, but WITHOUT
1976+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1977+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
1978+ License for more details.
1979+
1980+ Under Section 7 of GPL version 3, you are granted additional
1981+ permissions described in the GCC Runtime Library Exception, version
1982+ 3.1, as published by the Free Software Foundation.
1983+
1984+ You should have received a copy of the GNU General Public License and
1985+ a copy of the GCC Runtime Library Exception along with this program;
1986+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
1987+ <http://www.gnu.org/licenses/>. */
1988+
1989+
1990+unsigned char _divdi3_table[] =
1991+{
1992+ 0, 0/1, 0/2, 0/3, 0/4, 0/5, 0/6, 0/7,
1993+ 0/8, 0/9, 0/10, 0/11, 0/12, 0/13, 0/14, 0/15,
1994+ 0, 1/1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7,
1995+ 1/8, 1/9, 1/10, 1/11, 1/12, 1/13, 1/14, 1/15,
1996+ 0, 2/1, 2/2, 2/3, 2/4, 2/5, 2/6, 2/7,
1997+ 2/8, 2/9, 2/10, 2/11, 2/12, 2/13, 2/14, 2/15,
1998+ 0, 3/1, 3/2, 3/3, 3/4, 3/5, 3/6, 3/7,
1999+ 3/8, 3/9, 3/10, 3/11, 3/12, 3/13, 3/14, 3/15,
2000+ 0, 4/1, 4/2, 4/3, 4/4, 4/5, 4/6, 4/7,
2001+ 4/8, 4/9, 4/10, 4/11, 4/12, 4/13, 4/14, 4/15,
2002+ 0, 5/1, 5/2, 5/3, 5/4, 5/5, 5/6, 5/7,
2003+ 5/8, 5/9, 5/10, 5/11, 5/12, 5/13, 5/14, 5/15,
2004+ 0, 6/1, 6/2, 6/3, 6/4, 6/5, 6/6, 6/7,
2005+ 6/8, 6/9, 6/10, 6/11, 6/12, 6/13, 6/14, 6/15,
2006+ 0, 7/1, 7/2, 7/3, 7/4, 7/5, 7/6, 7/7,
2007+ 7/8, 7/9, 7/10, 7/11, 7/12, 7/13, 7/14, 7/15,
2008+ 0, 8/1, 8/2, 8/3, 8/4, 8/5, 8/6, 8/7,
2009+ 8/8, 8/9, 8/10, 8/11, 8/12, 8/13, 8/14, 8/15,
2010+ 0, 9/1, 9/2, 9/3, 9/4, 9/5, 9/6, 9/7,
2011+ 9/8, 9/9, 9/10, 9/11, 9/12, 9/13, 9/14, 9/15,
2012+ 0, 10/1, 10/2, 10/3, 10/4, 10/5, 10/6, 10/7,
2013+ 10/8, 10/9, 10/10, 10/11, 10/12, 10/13, 10/14, 10/15,
2014+ 0, 11/1, 11/2, 11/3, 11/4, 11/5, 11/6, 11/7,
2015+ 11/8, 11/9, 11/10, 11/11, 11/12, 11/13, 11/14, 11/15,
2016+ 0, 12/1, 12/2, 12/3, 12/4, 12/5, 12/6, 12/7,
2017+ 12/8, 12/9, 12/10, 12/11, 12/12, 12/13, 12/14, 12/15,
2018+ 0, 13/1, 13/2, 13/3, 13/4, 13/5, 13/6, 13/7,
2019+ 13/8, 13/9, 13/10, 13/11, 13/12, 13/13, 13/14, 13/15,
2020+ 0, 14/1, 14/2, 14/3, 14/4, 14/5, 14/6, 14/7,
2021+ 14/8, 14/9, 14/10, 14/11, 14/12, 14/13, 14/14, 14/15,
2022+ 0, 15/1, 15/2, 15/3, 15/4, 15/5, 15/6, 15/7,
2023+ 15/8, 15/9, 15/10, 15/11, 15/12, 15/13, 15/14, 15/15,
2024+};
2025+
2026diff --git a/libgcc/config/microblaze/moddi3.S b/libgcc/config/microblaze/moddi3.S
2027new file mode 100644
2028index 0000000..5d3f7c0
2029--- /dev/null
2030+++ b/libgcc/config/microblaze/moddi3.S
2031@@ -0,0 +1,97 @@
2032+###################################
2033+#
2034+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
2035+#
2036+# Contributed by Michael Eager <eager@eagercon.com>.
2037+#
2038+# This file is free software; you can redistribute it and/or modify it
2039+# under the terms of the GNU General Public License as published by the
2040+# Free Software Foundation; either version 3, or (at your option) any
2041+# later version.
2042+#
2043+# GCC is distributed in the hope that it will be useful, but WITHOUT
2044+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
2045+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
2046+# License for more details.
2047+#
2048+# Under Section 7 of GPL version 3, you are granted additional
2049+# permissions described in the GCC Runtime Library Exception, version
2050+# 3.1, as published by the Free Software Foundation.
2051+#
2052+# You should have received a copy of the GNU General Public License and
2053+# a copy of the GCC Runtime Library Exception along with this program;
2054+# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
2055+# <http://www.gnu.org/licenses/>.
2056+#
2057+# moddi3.S
2058+#
2059+# modulo operation for 32 bit integers.
2060+# Input : op1 in Reg r5
2061+# op2 in Reg r6
2062+# Output: op1 mod op2 in Reg r3
2063+#
2064+#######################################
2065+
2066+#ifdef __arch64__
2067+ .globl __moddi3
2068+ .ent __moddi3
2069+ .type __moddi3,@function
2070+__moddi3:
2071+ .frame r1,0,r15
2072+
2073+ addlik r1,r1,-32
2074+ sli r28,r1,0
2075+ sli r29,r1,8
2076+ sli r30,r1,16
2077+ sli r31,r1,32
2078+
2079+ BEALEQI r6,$LaDiv_By_Zero # Div_by_Zero # Division Error
2080+ BEALEQI r5,$LaResult_Is_Zero # Result is Zero
2081+ ADDL r28,r5,r0 # Get the sign of the result [ Depends only on the first arg]
2082+ BEALGEI r5,$LaR5_Pos
2083+ RSUBLI r5,r5,0 # Make r5 positive
2084+$LaR5_Pos:
2085+ BEALGEI r6,$LaR6_Pos
2086+ RSUBLI r6,r6,0 # Make r6 positive
2087+$LaR6_Pos:
2088+ ADDLIK r3,r0,0 # Clear mod
2089+ ADDLIK r30,r0,0 # clear div
2090+ ADDLIK r29,r0,64 # Initialize the loop count
2091+ BEALLTI r5,$LaDIV2 # If r5 is still negative (0x80000000), skip
2092+ # the first bit search.
2093+ # First part try to find the first '1' in the r5
2094+$LaDIV1:
2095+ ADDL r5,r5,r5 # left shift logical r5
2096+ ADDLIK r29,r29,-1
2097+ BEALGEI r5,$LaDIV1 #
2098+$LaDIV2:
2099+ ADDL r5,r5,r5 # left shift logical r5 get the '1' into the Carry
2100+ ADDLC r3,r3,r3 # Move that bit into the Mod register
2101+ rSUBL r31,r6,r3 # Try to subtract (r30 a r6)
2102+ BEALLTi r31,$LaMOD_TOO_SMALL
2103+ ORL r3,r0,r31 # Move the r31 to mod since the result was positive
2104+ ADDLIK r30,r30,1
2105+$LaMOD_TOO_SMALL:
2106+ ADDLIK r29,r29,-1
2107+ BEALEQi r29,$LaLOOP_END
2108+ ADDL r30,r30,r30 # Shift in the '1' into div
2109+ BREAI $LaDIV2 # Div2
2110+$LaLOOP_END:
2111+ BEALGEI r28,$LaRETURN_HERE
2112+ rsubli r3,r3,0 # Negate the result
2113+ BREAI $LaRETURN_HERE
2114+$LaDiv_By_Zero:
2115+$LaResult_Is_Zero:
2116+ orl r3,r0,r0 # set result to 0 [Both mod as well as div are 0]
2117+$LaRETURN_HERE:
2118+# Restore values of CSRs and that of r3 and the divisor and the dividend
2119+ lli r28,r1,0
2120+ lli r29,r1,8
2121+ lli r30,r1,16
2122+ lli r31,r1,24
2123+ addlik r1,r1,32
2124+ rtsd r15,8
2125+ nop
2126+ .end __moddi3
2127+ .size __moddi3, . - __moddi3
2128+#endif
2129diff --git a/libgcc/config/microblaze/muldi3.S b/libgcc/config/microblaze/muldi3.S
2130new file mode 100644
2131index 0000000..5677841
2132--- /dev/null
2133+++ b/libgcc/config/microblaze/muldi3.S
2134@@ -0,0 +1,73 @@
2135+/*###################################-*-asm*-
2136+#
2137+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
2138+#
2139+# Contributed by Michael Eager <eager@eagercon.com>.
2140+#
2141+# This file is free software; you can redistribute it and/or modify it
2142+# under the terms of the GNU General Public License as published by the
2143+# Free Software Foundation; either version 3, or (at your option) any
2144+# later version.
2145+#
2146+# GCC is distributed in the hope that it will be useful, but WITHOUT
2147+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
2148+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
2149+# License for more details.
2150+#
2151+# Under Section 7 of GPL version 3, you are granted additional
2152+# permissions described in the GCC Runtime Library Exception, version
2153+# 3.1, as published by the Free Software Foundation.
2154+#
2155+# You should have received a copy of the GNU General Public License and
2156+# a copy of the GCC Runtime Library Exception along with this program;
2157+# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
2158+# <http://www.gnu.org/licenses/>.
2159+#
2160+# muldi3.S
2161+#
2162+# Multiply operation for 32 bit integers.
2163+# Input : Operand1 in Reg r5
2164+# Operand2 in Reg r6
2165+# Output: Result [op1 * op2] in Reg r3
2166+#
2167+#######################################*/
2168+
2169+#ifdef __arch64__
2170+ .globl __muldi3
2171+ .ent __muldi3
2172+ .type __muldi3,@function
2173+__muldi3:
2174+ .frame r1,0,r15
2175+ addl r3,r0,r0
2176+ BEALEQI r5,$L_Result_Is_Zero # Multiply by Zero
2177+ BEALEQI r6,$L_Result_Is_Zero # Multiply by Zero
2178+ XORL r4,r5,r6 # Get the sign of the result
2179+ BEALGEI r5,$L_R5_Pos
2180+ RSUBLI r5,r5,0 # Make r5 positive
2181+$L_R5_Pos:
2182+ BEALGEI r6,$L_R6_Pos
2183+ RSUBLI r6,r6,0 # Make r6 positive
2184+$L_R6_Pos:
2185+ breai $L1
2186+$L2:
2187+ addl r5,r5,r5
2188+$L1:
2189+ srll r6,r6
2190+ addlc r7,r0,r0
2191+ bealeqi r7,$L2
2192+ addl r3,r3,r5
2193+ bealnei r6,$L2
2194+ beallti r4,$L_NegateResult
2195+ rtsd r15,8
2196+ nop
2197+$L_NegateResult:
2198+ rsubl r3,r3,r0
2199+ rtsd r15,8
2200+ nop
2201+$L_Result_Is_Zero:
2202+ addli r3,r0,0
2203+ rtsd r15,8
2204+ nop
2205+ .end __muldi3
2206+ .size __muldi3, . - __muldi3
2207+#endif
2208diff --git a/libgcc/config/microblaze/t-microblaze b/libgcc/config/microblaze/t-microblaze
2209index 8d954a4..35021b2 100644
2210--- a/libgcc/config/microblaze/t-microblaze
2211+++ b/libgcc/config/microblaze/t-microblaze
2212@@ -1,11 +1,16 @@
2213-LIB2FUNCS_EXCLUDE += _divsi3 _modsi3 _mulsi3 _udivsi3 _umodsi3
2214+LIB2FUNCS_EXCLUDE += _divsi3 _modsi3 _mulsi3 _udivsi3 _umodsi3 \
2215+ _divdi3 _moddi3 _muldi3 _udivdi3 _umoddi3
2216
2217 LIB2ADD += \
2218 $(srcdir)/config/microblaze/divsi3.S \
2219+ $(srcdir)/config/microblaze/divdi3.S \
2220 $(srcdir)/config/microblaze/modsi3.S \
2221- $(srcdir)/config/microblaze/muldi3_hard.S \
2222+ $(srcdir)/config/microblaze/moddi3.S \
2223 $(srcdir)/config/microblaze/mulsi3.S \
2224+ $(srcdir)/config/microblaze/muldi3.S \
2225 $(srcdir)/config/microblaze/stack_overflow_exit.S \
2226 $(srcdir)/config/microblaze/udivsi3.S \
2227+ $(srcdir)/config/microblaze/udivdi3.S \
2228 $(srcdir)/config/microblaze/umodsi3.S \
2229- $(srcdir)/config/microblaze/divsi3_table.c
2230+ $(srcdir)/config/microblaze/umoddi3.S \
2231+ $(srcdir)/config/microblaze/divsi3_table.c \
2232diff --git a/libgcc/config/microblaze/udivdi3.S b/libgcc/config/microblaze/udivdi3.S
2233new file mode 100644
2234index 0000000..c210fbc
2235--- /dev/null
2236+++ b/libgcc/config/microblaze/udivdi3.S
2237@@ -0,0 +1,107 @@
2238+###################################-
2239+#
2240+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
2241+#
2242+# Contributed by Michael Eager <eager@eagercon.com>.
2243+#
2244+# This file is free software; you can redistribute it and/or modify it
2245+# under the terms of the GNU General Public License as published by the
2246+# Free Software Foundation; either version 3, or (at your option) any
2247+# later version.
2248+#
2249+# GCC is distributed in the hope that it will be useful, but WITHOUT
2250+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
2251+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
2252+# License for more details.
2253+#
2254+# Under Section 7 of GPL version 3, you are granted additional
2255+# permissions described in the GCC Runtime Library Exception, version
2256+# 3.1, as published by the Free Software Foundation.
2257+#
2258+# You should have received a copy of the GNU General Public License and
2259+# a copy of the GCC Runtime Library Exception along with this program;
2260+# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
2261+# <http://www.gnu.org/licenses/>.
2262+#
2263+# udivdi3.S
2264+#
2265+# Unsigned divide operation.
2266+# Input : Divisor in Reg r5
2267+# Dividend in Reg r6
2268+# Output: Result in Reg r3
2269+#
2270+#######################################
2271+
2272+#ifdef __arch64__
2273+ .globl __udivdi3
2274+ .ent __udivdi3
2275+ .type __udivdi3,@function
2276+__udivdi3:
2277+ .frame r1,0,r15
2278+
2279+ ADDlIK r1,r1,-24
2280+ SLI r29,r1,0
2281+ SLI r30,r1,8
2282+ SLI r31,r1,16
2283+
2284+ BEALEQI r6,$LaDiv_By_Zero # Div_by_Zero # Division Error
2285+ ADDLIK r30,r0,0 # Clear mod
2286+ BEALEQI r5,$LaResult_Is_Zero # Result is Zero
2287+ ADDLIK r29,r0,64 # Initialize the loop count
2288+
2289+ # Check if r6 and r5 are equal # if yes, return 1
2290+ RSUBL r18,r5,r6
2291+ ADDLIK r3,r0,1
2292+ BEALEQI r18,$LaRETURN_HERE
2293+
2294+ # Check if (uns)r6 is greater than (uns)r5. In that case, just return 0
2295+ XORL r18,r5,r6
2296+ ADDL r3,r0,r0 # We would anyways clear r3
2297+ BEALGEI r18,$LRSUBL
2298+ BEALLTI r6,$LaRETURN_HERE # r6[bit 31 = 1] hence is greater
2299+ BREAI $LCheckr6
2300+$LRSUBL:
2301+ RSUBL r18,r6,r5 # MICROBLAZEcmp
2302+ BEALLTI r18,$LaRETURN_HERE
2303+
2304+ # If r6 [bit 31] is set, then return result as 1
2305+$LCheckr6:
2306+ BEALGTI r6,$LaDIV0
2307+ ADDLIK r3,r0,1
2308+ BREAI $LaRETURN_HERE
2309+
2310+ # First part try to find the first '1' in the r5
2311+$LaDIV0:
2312+ BEALLTI r5,$LaDIV2
2313+$LaDIV1:
2314+ ADDL r5,r5,r5 # left shift logical r5
2315+ ADDLIK r29,r29,-1
2316+ BEALGTI r5,$LaDIV1
2317+$LaDIV2:
2318+ ADDL r5,r5,r5 # left shift logical r5 get the '1' into the Carry
2319+ ADDLC r30,r30,r30 # Move that bit into the Mod register
2320+ RSUBL r31,r6,r30 # Try to subtract (r30 a r6)
2321+ BEALLTI r31,$LaMOD_TOO_SMALL
2322+ ORL r30,r0,r31 # Move the r31 to mod since the result was positive
2323+ ADDLIK r3,r3,1
2324+$LaMOD_TOO_SMALL:
2325+ ADDLIK r29,r29,-1
2326+ BEALEQi r29,$LaLOOP_END
2327+ ADDL r3,r3,r3 # Shift in the '1' into div
2328+ BREAI $LaDIV2 # Div2
2329+$LaLOOP_END:
2330+ BREAI $LaRETURN_HERE
2331+$LaDiv_By_Zero:
2332+$LaResult_Is_Zero:
2333+ ORL r3,r0,r0 # set result to 0
2334+$LaRETURN_HERE:
2335+ # Restore values of CSRs and that of r3 and the divisor and the dividend
2336+ LLI r29,r1,0
2337+ LLI r30,r1,8
2338+ LLI r31,r1,16
2339+ ADDLIK r1,r1,24
2340+ RTSD r15,8
2341+ NOP
2342+ .end __udivdi3
2343+ .size __udivdi3, . - __udivdi3
2344+#endif
2345diff --git a/libgcc/config/microblaze/umoddi3.S b/libgcc/config/microblaze/umoddi3.S
2346new file mode 100644
2347index 0000000..7f5cd23
2348--- /dev/null
2349+++ b/libgcc/config/microblaze/umoddi3.S
2350@@ -0,0 +1,110 @@
2351+###################################
2352+#
2353+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
2354+#
2355+# Contributed by Michael Eager <eager@eagercon.com>.
2356+#
2357+# This file is free software; you can redistribute it and/or modify it
2358+# under the terms of the GNU General Public License as published by the
2359+# Free Software Foundation; either version 3, or (at your option) any
2360+# later version.
2361+#
2362+# GCC is distributed in the hope that it will be useful, but WITHOUT
2363+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
2364+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
2365+# License for more details.
2366+#
2367+# Under Section 7 of GPL version 3, you are granted additional
2368+# permissions described in the GCC Runtime Library Exception, version
2369+# 3.1, as published by the Free Software Foundation.
2370+#
2371+# You should have received a copy of the GNU General Public License and
2372+# a copy of the GCC Runtime Library Exception along with this program;
2373+# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
2374+# <http://www.gnu.org/licenses/>.
2375+#
2376+# umoddi3.S
2377+#
2378+# Unsigned modulo operation for 32 bit integers.
2379+# Input : op1 in Reg r5
2380+# op2 in Reg r6
2381+# Output: op1 mod op2 in Reg r3
2382+#
2383+#######################################
2384+
2385+#ifdef __arch64__
2386+ .globl __umoddi3
2387+ .ent __umoddi3
2388+ .type __umoddi3,@function
2389+__umoddi3:
2390+ .frame r1,0,r15
2391+
2392+ addlik r1,r1,-24
2393+ sli r29,r1,0
2394+ sli r30,r1,8
2395+ sli r31,r1,16
2396+
2397+ BEALEQI r6,$LaDiv_By_Zero # Div_by_Zero # Division Error
2398+ ADDLIK r3,r0,0 # Clear div
2399+ BEALEQI r5,$LaResult_Is_Zero # Result is Zero
2400+ ADDLIK r30,r0,0 # clear mod
2401+ ADDLIK r29,r0,64 # Initialize the loop count
2402+
2403+# Check if r6 and r5 are equal # if yes, return 0
2404+ rsubl r18,r5,r6
2405+ bealeqi r18,$LaRETURN_HERE
2406+
2407+# Check if (uns)r6 is greater than (uns)r5. In that case, just return r5
2408+ xorl r18,r5,r6
2409+ addlik r3,r5,0
2410+ bealgei r18,$LRSUB
2411+ beallti r6,$LaRETURN_HERE
2412+ breai $LCheckr6
2413+$LRSUB:
2414+ rsubl r18,r5,r6 # MICROBLAZEcmp
2415+ bealgti r18,$LaRETURN_HERE
2416+
2417+# If r6 [bit 31] is set, then return result as r5-r6
2418+$LCheckr6:
2419+ addlik r3,r0,0
2420+ bealgti r6,$LaDIV0
2421+ addlik r18,r0,0x7fffffff
2422+ andl r5,r5,r18
2423+ andl r6,r6,r18
2424+ breaid $LaRETURN_HERE
2425+ rsubl r3,r6,r5
2426+# First part: try to find the first '1' in the r5
2427+$LaDIV0:
2428+ BEALLTI r5,$LaDIV2
2429+$LaDIV1:
2430+ ADDL r5,r5,r5 # left shift logical r5
2431+ ADDLIK r29,r29,-1
2432+ BEALGEI r5,$LaDIV1 #
2433+$LaDIV2:
2434+ ADDL r5,r5,r5 # left shift logical r5 get the '1' into the Carry
2435+ ADDLC r3,r3,r3 # Move that bit into the Mod register
2436+ rSUBL r31,r6,r3 # Try to subtract (r3 a r6)
2437+ BEALLTi r31,$LaMOD_TOO_SMALL
2438+ ORL r3,r0,r31 # Move the r31 to mod since the result was positive
2439+ ADDLIK r30,r30,1
2440+$LaMOD_TOO_SMALL:
2441+ ADDLIK r29,r29,-1
2442+ BEALEQi r29,$LaLOOP_END
2443+ ADDL r30,r30,r30 # Shift in the '1' into div
2444+ BREAI $LaDIV2 # Div2
2445+$LaLOOP_END:
2446+ BREAI $LaRETURN_HERE
2447+$LaDiv_By_Zero:
2448+$LaResult_Is_Zero:
2449+ orl r3,r0,r0 # set result to 0
2450+$LaRETURN_HERE:
2451+# Restore values of CSRs and that of r3 and the divisor and the dividend
2452+ lli r29,r1,0
2453+ lli r30,r1,8
2454+ lli r31,r1,16
2455+ addlik r1,r1,24
2456+ rtsd r15,8
2457+ nop
2458+.end __umoddi3
2459+ .size __umoddi3, . - __umoddi3
2460+#endif
2461--
24622.7.4
2463
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0042-re-arrangement-of-the-compare-branches.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0042-re-arrangement-of-the-compare-branches.patch
new file mode 100644
index 00000000..c33b247b
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0042-re-arrangement-of-the-compare-branches.patch
@@ -0,0 +1,268 @@
1From 9e45ca7bd65fe327e01e93d3c539c9d8cf049b79 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Fri, 3 Aug 2018 15:41:39 +0530
4Subject: [PATCH 42/54] re-arrangement of the compare branches
5
6---
7 gcc/config/microblaze/microblaze.c | 28 ++-----
8 gcc/config/microblaze/microblaze.md | 141 +++++++++++++++++-------------------
9 2 files changed, 73 insertions(+), 96 deletions(-)
10
11diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
12index ba7ade4..fab79d9 100644
13--- a/gcc/config/microblaze/microblaze.c
14+++ b/gcc/config/microblaze/microblaze.c
15@@ -3695,11 +3695,7 @@ microblaze_expand_conditional_branch (machine_mode mode, rtx operands[])
16 {
17 comp_reg = cmp_op0;
18 condition = gen_rtx_fmt_ee (signed_condition (code), mode, comp_reg, const0_rtx);
19- if (mode == Pmode)
20- emit_jump_insn (gen_condjump (condition, label1));
21- else
22- emit_jump_insn (gen_long_condjump (condition, label1));
23-
24+ emit_jump_insn (gen_condjump (condition, label1));
25 }
26
27 else if (code == EQ || code == NE)
28@@ -3710,10 +3706,7 @@ microblaze_expand_conditional_branch (machine_mode mode, rtx operands[])
29 else
30 emit_insn (gen_xordi3 (comp_reg, cmp_op0, cmp_op1));
31 condition = gen_rtx_fmt_ee (signed_condition (code), mode, comp_reg, const0_rtx);
32- if (mode == SImode)
33- emit_jump_insn (gen_condjump (condition, label1));
34- else
35- emit_jump_insn (gen_long_condjump (condition, label1));
36+ emit_jump_insn (gen_condjump (condition, label1));
37 }
38 else
39 {
40@@ -3746,10 +3739,7 @@ microblaze_expand_conditional_branch_reg (machine_mode mode, rtx operands[])
41 comp_reg = cmp_op0;
42 condition = gen_rtx_fmt_ee (signed_condition (code),
43 mode, comp_reg, const0_rtx);
44- if (mode == SImode)
45- emit_jump_insn (gen_condjump (condition, label1));
46- else
47- emit_jump_insn (gen_long_condjump (condition, label1));
48+ emit_jump_insn (gen_condjump (condition, label1));
49 }
50 else if (code == EQ)
51 {
52@@ -3764,10 +3754,7 @@ microblaze_expand_conditional_branch_reg (machine_mode mode, rtx operands[])
53 cmp_op1));
54 }
55 condition = gen_rtx_EQ (mode, comp_reg, const0_rtx);
56- if (mode == SImode)
57- emit_jump_insn (gen_condjump (condition, label1));
58- else
59- emit_jump_insn (gen_long_condjump (condition, label1));
60+ emit_jump_insn (gen_condjump (condition, label1));
61
62 }
63 else if (code == NE)
64@@ -3783,10 +3770,7 @@ microblaze_expand_conditional_branch_reg (machine_mode mode, rtx operands[])
65 cmp_op1));
66 }
67 condition = gen_rtx_NE (mode, comp_reg, const0_rtx);
68- if (mode == SImode)
69- emit_jump_insn (gen_condjump (condition, label1));
70- else
71- emit_jump_insn (gen_long_condjump (condition, label1));
72+ emit_jump_insn (gen_condjump (condition, label1));
73 }
74 else
75 {
76@@ -3828,7 +3812,7 @@ microblaze_expand_conditional_branch_df (rtx operands[])
77
78 emit_insn (gen_cstoredf4 (comp_reg, operands[0], cmp_op0, cmp_op1));
79 condition = gen_rtx_NE (Pmode, comp_reg, const0_rtx);
80- emit_jump_insn (gen_long_condjump (condition, operands[3]));
81+ emit_jump_insn (gen_condjump (condition, operands[3]));
82 }
83
84 /* Implement TARGET_FRAME_POINTER_REQUIRED. */
85diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
86index 0f41ac6..2213d6e 100644
87--- a/gcc/config/microblaze/microblaze.md
88+++ b/gcc/config/microblaze/microblaze.md
89@@ -2268,7 +2268,27 @@ else
90 (label_ref (match_operand 1))
91 (pc)))])
92
93-(define_insn "branch_zero64"
94+(define_insn "branch_zero_64"
95+ [(set (pc)
96+ (if_then_else (match_operator:SI 0 "ordered_comparison_operator"
97+ [(match_operand:SI 1 "register_operand" "d")
98+ (const_int 0)])
99+ (match_operand:SI 2 "pc_or_label_operand" "")
100+ (match_operand:SI 3 "pc_or_label_operand" "")))
101+ ]
102+ "TARGET_MB_64"
103+ {
104+ if (operands[3] == pc_rtx)
105+ return "bea%C0i%?\t%z1,%2";
106+ else
107+ return "bea%N0i%?\t%z1,%3";
108+ }
109+ [(set_attr "type" "branch")
110+ (set_attr "mode" "none")
111+ (set_attr "length" "4")]
112+)
113+
114+(define_insn "long_branch_zero"
115 [(set (pc)
116 (if_then_else (match_operator 0 "ordered_comparison_operator"
117 [(match_operand 1 "register_operand" "d")
118@@ -2279,9 +2299,9 @@ else
119 "TARGET_MB_64"
120 {
121 if (operands[3] == pc_rtx)
122- return "bea%C0i%?\t%z1,%2";
123+ return "beal%C0i%?\t%z1,%2";
124 else
125- return "bea%N0i%?\t%z1,%3";
126+ return "beal%N0i%?\t%z1,%3";
127 }
128 [(set_attr "type" "branch")
129 (set_attr "mode" "none")
130@@ -2310,9 +2330,9 @@ else
131
132 (define_insn "branch_compare64"
133 [(set (pc)
134- (if_then_else (match_operator 0 "cmp_op"
135- [(match_operand 1 "register_operand" "d")
136- (match_operand 2 "register_operand" "d")
137+ (if_then_else (match_operator:SI 0 "cmp_op"
138+ [(match_operand:SI 1 "register_operand" "d")
139+ (match_operand:SI 2 "register_operand" "d")
140 ])
141 (label_ref (match_operand 3))
142 (pc)))
143@@ -2349,6 +2369,47 @@ else
144 (set_attr "length" "12")]
145 )
146
147+(define_insn "long_branch_compare"
148+ [(set (pc)
149+ (if_then_else (match_operator 0 "cmp_op"
150+ [(match_operand 1 "register_operand" "d")
151+ (match_operand 2 "register_operand" "d")
152+ ])
153+ (label_ref (match_operand 3))
154+ (pc)))
155+ (clobber(reg:DI R_TMP))]
156+ "TARGET_MB_64"
157+ {
158+ operands[4] = gen_rtx_REG (DImode, MB_ABI_ASM_TEMP_REGNUM);
159+ enum rtx_code code = GET_CODE (operands[0]);
160+
161+ if (code == GT || code == LE)
162+ {
163+ output_asm_insn ("cmpl\tr18,%z1,%z2", operands);
164+ code = swap_condition (code);
165+ }
166+ else if (code == GTU || code == LEU)
167+ {
168+ output_asm_insn ("cmplu\tr18,%z1,%z2", operands);
169+ code = swap_condition (code);
170+ }
171+ else if (code == GE || code == LT)
172+ {
173+ output_asm_insn ("cmpl\tr18,%z2,%z1", operands);
174+ }
175+ else if (code == GEU || code == LTU)
176+ {
177+ output_asm_insn ("cmplu\tr18,%z2,%z1", operands);
178+ }
179+
180+ operands[0] = gen_rtx_fmt_ee (signed_condition (code), DImode, operands[4], const0_rtx);
181+ return "beal%C0i%?\tr18,%3";
182+ }
183+ [(set_attr "type" "branch")
184+ (set_attr "mode" "none")
185+ (set_attr "length" "12")]
186+)
187+
188 (define_insn "branch_compare"
189 [(set (pc)
190 (if_then_else (match_operator:SI 0 "cmp_op"
191@@ -2431,74 +2492,6 @@ else
192
193 })
194
195-;; Used to implement comparison instructions
196-(define_expand "long_condjump"
197- [(set (pc)
198- (if_then_else (match_operand 0)
199- (label_ref (match_operand 1))
200- (pc)))])
201-
202-(define_insn "long_branch_zero"
203- [(set (pc)
204- (if_then_else (match_operator:DI 0 "ordered_comparison_operator"
205- [(match_operand:DI 1 "register_operand" "d")
206- (const_int 0)])
207- (match_operand:DI 2 "pc_or_label_operand" "")
208- (match_operand:DI 3 "pc_or_label_operand" "")))
209- ]
210- "TARGET_MB_64"
211- {
212- if (operands[3] == pc_rtx)
213- return "beal%C0i%?\t%z1,%2";
214- else
215- return "beal%N0i%?\t%z1,%3";
216- }
217- [(set_attr "type" "branch")
218- (set_attr "mode" "none")
219- (set_attr "length" "4")]
220-)
221-
222-(define_insn "long_branch_compare"
223- [(set (pc)
224- (if_then_else (match_operator:DI 0 "cmp_op"
225- [(match_operand:DI 1 "register_operand" "d")
226- (match_operand:DI 2 "register_operand" "d")
227- ])
228- (label_ref (match_operand 3))
229- (pc)))
230- (clobber(reg:DI R_TMP))]
231- "TARGET_MB_64"
232- {
233- operands[4] = gen_rtx_REG (DImode, MB_ABI_ASM_TEMP_REGNUM);
234- enum rtx_code code = GET_CODE (operands[0]);
235-
236- if (code == GT || code == LE)
237- {
238- output_asm_insn ("cmpl\tr18,%z1,%z2", operands);
239- code = swap_condition (code);
240- }
241- else if (code == GTU || code == LEU)
242- {
243- output_asm_insn ("cmplu\tr18,%z1,%z2", operands);
244- code = swap_condition (code);
245- }
246- else if (code == GE || code == LT)
247- {
248- output_asm_insn ("cmpl\tr18,%z2,%z1", operands);
249- }
250- else if (code == GEU || code == LTU)
251- {
252- output_asm_insn ("cmplu\tr18,%z2,%z1", operands);
253- }
254-
255- operands[0] = gen_rtx_fmt_ee (signed_condition (code), DImode, operands[4], const0_rtx);
256- return "beal%C0i%?\tr18,%3";
257- }
258- [(set_attr "type" "branch")
259- (set_attr "mode" "none")
260- (set_attr "length" "12")]
261-)
262-
263 ;;----------------------------------------------------------------
264 ;; Unconditional branches
265 ;;----------------------------------------------------------------
266--
2672.7.4
268
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0043-Patch-Microblaze-previous-commit-broke-the-handling-.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0043-Patch-Microblaze-previous-commit-broke-the-handling-.patch
new file mode 100644
index 00000000..d1cf4579
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0043-Patch-Microblaze-previous-commit-broke-the-handling-.patch
@@ -0,0 +1,28 @@
1From 0c132e74714d217108d65fca630ab497a0d8821a Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 8 Aug 2018 17:37:26 +0530
4Subject: [PATCH 43/54] [Patch,Microblaze] : previous commit broke the
5 handling of SI Branch compare for Microblaze 32-bit..
6
7---
8 gcc/config/microblaze/microblaze.md | 4 ++--
9 1 file changed, 2 insertions(+), 2 deletions(-)
10
11diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
12index 2213d6e..53ea401 100644
13--- a/gcc/config/microblaze/microblaze.md
14+++ b/gcc/config/microblaze/microblaze.md
15@@ -2224,8 +2224,8 @@ else
16 (define_expand "cbranchsi4"
17 [(set (pc)
18 (if_then_else (match_operator 0 "ordered_comparison_operator"
19- [(match_operand 1 "register_operand")
20- (match_operand 2 "arith_operand" "I,i")])
21+ [(match_operand:SI 1 "register_operand")
22+ (match_operand:SI 2 "arith_operand" "I,i")])
23 (label_ref (match_operand 3 ""))
24 (pc)))]
25 ""
26--
272.7.4
28
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0044-Patch-Microblaze-Support-of-multilibs-with-m64.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0044-Patch-Microblaze-Support-of-multilibs-with-m64.patch
new file mode 100644
index 00000000..68791cb2
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0044-Patch-Microblaze-Support-of-multilibs-with-m64.patch
@@ -0,0 +1,73 @@
1From 259ed1ee33625964f5bc394ae660103b6c35510f Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Tue, 11 Sep 2018 13:43:48 +0530
4Subject: [PATCH 44/54] [Patch, Microblaze] : Support of multilibs with m64 ...
5
6---
7 gcc/config/microblaze/microblaze-c.c | 1 +
8 gcc/config/microblaze/t-microblaze | 15 ++++++---------
9 libgcc/config/microblaze/t-microblaze | 11 +++--------
10 3 files changed, 10 insertions(+), 17 deletions(-)
11
12diff --git a/gcc/config/microblaze/microblaze-c.c b/gcc/config/microblaze/microblaze-c.c
13index d8a1d13..6586575 100644
14--- a/gcc/config/microblaze/microblaze-c.c
15+++ b/gcc/config/microblaze/microblaze-c.c
16@@ -102,6 +102,7 @@ microblaze_cpp_define (cpp_reader *pfile)
17 }
18 if (TARGET_MB_64)
19 {
20+ builtin_define ("__microblaze64");
21 builtin_define ("__arch64__");
22 builtin_define ("__microblaze64__");
23 builtin_define ("__MICROBLAZE64__");
24diff --git a/gcc/config/microblaze/t-microblaze b/gcc/config/microblaze/t-microblaze
25index 9fc80b1..35ab965 100644
26--- a/gcc/config/microblaze/t-microblaze
27+++ b/gcc/config/microblaze/t-microblaze
28@@ -1,12 +1,9 @@
29-MULTILIB_OPTIONS = mxl-barrel-shift mno-xl-soft-mul mxl-multiply-high mlittle-endian m64
30-MULTILIB_DIRNAMES = bs m mh le m64
31-MULTILIB_EXCEPTIONS = *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high
32-MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/mlittle-endian
33-MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/mlittle-endian/m64
34-MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/m64 mxl-multiply-high
35-MULTILIB_EXCEPTIONS += mxl-multiply-high/mlittle-endian
36-MULTILIB_EXCEPTIONS += mxl-multiply-high/m64
37-MULTILIB_EXCEPTIONS += *mxl-multiply-high/mlittle-endian/m64
38+MULTILIB_OPTIONS = m64 mxl-barrel-shift mlittle-endian mno-xl-soft-mul mxl-multiply-high
39+MULTILIB_DIRNAMES = m64 bs le m mh
40+MULTILIB_EXCEPTIONS = *m64/mxl-multiply-high mxl-multiply-high
41+MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high
42+MULTILIB_EXCEPTIONS += *mlittle-endian/mxl-multiply-high mxl-multiply-high
43+MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mlittle-endian/mxl-multiply-high
44
45 # Extra files
46 microblaze-c.o: $(srcdir)/config/microblaze/microblaze-c.c \
47diff --git a/libgcc/config/microblaze/t-microblaze b/libgcc/config/microblaze/t-microblaze
48index 35021b2..8d954a4 100644
49--- a/libgcc/config/microblaze/t-microblaze
50+++ b/libgcc/config/microblaze/t-microblaze
51@@ -1,16 +1,11 @@
52-LIB2FUNCS_EXCLUDE += _divsi3 _modsi3 _mulsi3 _udivsi3 _umodsi3 \
53- _divdi3 _moddi3 _muldi3 _udivdi3 _umoddi3
54+LIB2FUNCS_EXCLUDE += _divsi3 _modsi3 _mulsi3 _udivsi3 _umodsi3
55
56 LIB2ADD += \
57 $(srcdir)/config/microblaze/divsi3.S \
58- $(srcdir)/config/microblaze/divdi3.S \
59 $(srcdir)/config/microblaze/modsi3.S \
60- $(srcdir)/config/microblaze/moddi3.S \
61+ $(srcdir)/config/microblaze/muldi3_hard.S \
62 $(srcdir)/config/microblaze/mulsi3.S \
63- $(srcdir)/config/microblaze/muldi3.S \
64 $(srcdir)/config/microblaze/stack_overflow_exit.S \
65 $(srcdir)/config/microblaze/udivsi3.S \
66- $(srcdir)/config/microblaze/udivdi3.S \
67 $(srcdir)/config/microblaze/umodsi3.S \
68- $(srcdir)/config/microblaze/umoddi3.S \
69- $(srcdir)/config/microblaze/divsi3_table.c \
70+ $(srcdir)/config/microblaze/divsi3_table.c
71--
722.7.4
73
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0045-Fixed-issues-like.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0045-Fixed-issues-like.patch
new file mode 100644
index 00000000..8c0bde71
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0045-Fixed-issues-like.patch
@@ -0,0 +1,70 @@
1From 654582846ebf847b52e769eb6e015c8e486461d6 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Tue, 11 Sep 2018 14:58:00 +0530
4Subject: [PATCH 45/54] Fixed issues like: 1 Interrupt alignment issue 2 Sign
5 extension issue
6
7---
8 gcc/config/microblaze/microblaze.c | 16 ++++++++++------
9 gcc/config/microblaze/microblaze.md | 2 +-
10 2 files changed, 11 insertions(+), 7 deletions(-)
11
12diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
13index fab79d9..6b6ca61 100644
14--- a/gcc/config/microblaze/microblaze.c
15+++ b/gcc/config/microblaze/microblaze.c
16@@ -2241,9 +2241,14 @@ compute_frame_size (HOST_WIDE_INT size)
17
18 total_size += gp_reg_size;
19
20- /* Add 4 bytes for MSR. */
21+ /* Add 4/8 bytes for MSR. */
22 if (microblaze_is_interrupt_variant ())
23- total_size += 4;
24+ {
25+ if (TARGET_MB_64)
26+ total_size += 8;
27+ else
28+ total_size += 4;
29+ }
30
31 /* No space to be allocated for link register in leaf functions with no other
32 stack requirements. */
33@@ -2527,7 +2532,6 @@ print_operand (FILE * file, rtx op, int letter)
34 else if (letter == 'h' || letter == 'j')
35 {
36 long val[2];
37- int val1[2];
38 long l[2];
39 if (code == CONST_DOUBLE)
40 {
41@@ -2542,10 +2546,10 @@ print_operand (FILE * file, rtx op, int letter)
42 }
43 else if (code == CONST_INT || code == CONST)// || code == SYMBOL_REF ||code == LABEL_REF)
44 {
45- val1[0] = (INTVAL (op) & 0xffffffff00000000LL) >> 32;
46- val1[1] = INTVAL (op) & 0x00000000ffffffffLL;
47+ val[0] = (INTVAL (op) & 0xffffffff00000000LL) >> 32;
48+ val[1] = INTVAL (op) & 0x00000000ffffffffLL;
49 }
50- fprintf (file, "0x%8.8lx", (letter == 'h') ? val1[0] : val1[1]);
51+ fprintf (file, "0x%8.8lx", (letter == 'h') ? val[0] : val[1]);
52 }
53 else if (code == CONST_DOUBLE)
54 {
55diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
56index 53ea401..3a6943b 100644
57--- a/gcc/config/microblaze/microblaze.md
58+++ b/gcc/config/microblaze/microblaze.md
59@@ -1094,7 +1094,7 @@
60 case 1:
61 case 2:
62 {
63- output_asm_insn ("ll%i1\t%0,%1", operands);
64+ output_asm_insn ("lw%i1\t%0,%1", operands);
65 return "sextl32\t%0,%0";
66 }
67 }
68--
692.7.4
70
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0046-Fixed-below-issues.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0046-Fixed-below-issues.patch
new file mode 100644
index 00000000..22bb5b2f
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0046-Fixed-below-issues.patch
@@ -0,0 +1,306 @@
1From 48f9f9a1c6809b14e7cfdd2343df92c0de18d730 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Fri, 28 Sep 2018 11:59:12 +0530
4Subject: [PATCH 46/54] Fixed below issues: - Floating point print issues in
5 64bit mode - Dejagnu Jump related issues - Added dbl instruction
6
7---
8 gcc/config/microblaze/microblaze.c | 12 ++++-
9 gcc/config/microblaze/microblaze.h | 7 +++
10 gcc/config/microblaze/microblaze.md | 89 ++++++++++++++++++++++++++++++-------
11 libgcc/config/microblaze/crti.S | 24 +++++++++-
12 libgcc/config/microblaze/crtn.S | 13 ++++++
13 5 files changed, 127 insertions(+), 18 deletions(-)
14
15diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
16index 6b6ca61..33d183e 100644
17--- a/gcc/config/microblaze/microblaze.c
18+++ b/gcc/config/microblaze/microblaze.c
19@@ -2536,7 +2536,12 @@ print_operand (FILE * file, rtx op, int letter)
20 if (code == CONST_DOUBLE)
21 {
22 if (GET_MODE (op) == DFmode)
23- REAL_VALUE_TO_TARGET_DOUBLE (*CONST_DOUBLE_REAL_VALUE (op), val);
24+ {
25+ if (TARGET_MB_64)
26+ REAL_VALUE_TO_TARGET_LONG_DOUBLE (*CONST_DOUBLE_REAL_VALUE (op), val);
27+ else
28+ REAL_VALUE_TO_TARGET_DOUBLE (*CONST_DOUBLE_REAL_VALUE (op), val);
29+ }
30 else
31 {
32 REAL_VALUE_TO_TARGET_DOUBLE (*CONST_DOUBLE_REAL_VALUE (op), l);
33@@ -3874,7 +3879,10 @@ microblaze_expand_divide (rtx operands[])
34 gen_rtx_PLUS (QImode, regt1, div_table_rtx));
35
36 insn = emit_insn (gen_zero_extendqisi2(operands[0],mem_rtx));
37- jump = emit_jump_insn_after (gen_jump (div_end_label), insn);
38+ if (TARGET_MB_64)
39+ jump = emit_jump_insn_after (gen_jump_64 (div_end_label), insn);
40+ else
41+ jump = emit_jump_insn_after (gen_jump (div_end_label), insn);
42 JUMP_LABEL (jump) = div_end_label;
43 LABEL_NUSES (div_end_label) = 1;
44 emit_barrier ();
45diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
46index 1e60513..e34f549 100644
47--- a/gcc/config/microblaze/microblaze.h
48+++ b/gcc/config/microblaze/microblaze.h
49@@ -892,10 +892,17 @@ do { \
50 /* We do this to save a few 10s of code space that would be taken up
51 by the call_FUNC () wrappers, used by the generic CRT_CALL_STATIC_FUNCTION
52 definition in crtstuff.c. */
53+#ifdef __arch64__
54+#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
55+ asm ( SECTION_OP "\n" \
56+ "\tbrealid r15, " #FUNC "\n\t nop\n" \
57+ TEXT_SECTION_ASM_OP);
58+#else
59 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
60 asm ( SECTION_OP "\n" \
61 "\tbrlid r15, " #FUNC "\n\t nop\n" \
62 TEXT_SECTION_ASM_OP);
63+#endif
64
65 /* We need to group -lm as well, since some Newlib math functions
66 reference __errno! */
67diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
68index 3a6943b..2669a28 100644
69--- a/gcc/config/microblaze/microblaze.md
70+++ b/gcc/config/microblaze/microblaze.md
71@@ -525,6 +525,15 @@
72 (set_attr "mode" "SF")
73 (set_attr "length" "4")])
74
75+(define_insn "floatdidf2"
76+ [(set (match_operand:DF 0 "register_operand" "=d")
77+ (float:DF (match_operand:DI 1 "register_operand" "d")))]
78+ "TARGET_MB_64"
79+ "dbl\t%0,%1"
80+ [(set_attr "type" "fcvt")
81+ (set_attr "mode" "DF")
82+ (set_attr "length" "4")])
83+
84 (define_insn "fix_truncsfsi2"
85 [(set (match_operand:SI 0 "register_operand" "=d")
86 (fix:SI (match_operand:SF 1 "register_operand" "d")))]
87@@ -1298,7 +1307,7 @@
88 (define_insn "movdi_long_int"
89 [(set (match_operand:DI 0 "nonimmediate_operand" "=d")
90 (match_operand:DI 1 "general_operand" "i"))]
91- ""
92+ "TARGET_MB_64"
93 "addlik\t%0,r0,%h1\n\tbsllli\t%0,%0,32\n\taddlik\t%0,%0,%j1 #li => la";
94 [(set_attr "type" "no_delay_arith")
95 (set_attr "mode" "DI")
96@@ -1581,7 +1590,7 @@
97 return "ll%i1\t%0,%1";
98 case 3:
99 {
100- return "addlik\t%0,r0,%h1 \n\tbsllli\t%0,%0,32\n\taddlik\t%0,%0,%j1 #Xfer Lo";
101+ return "addlik\t%0,r0,%j1 \n\tbsllli\t%0,%0,32\n\taddlik\t%0,%0,%h1 #Xfer Lo";
102 }
103 case 5:
104 return "sl%i0\t%1,%0";
105@@ -2371,9 +2380,9 @@ else
106
107 (define_insn "long_branch_compare"
108 [(set (pc)
109- (if_then_else (match_operator 0 "cmp_op"
110- [(match_operand 1 "register_operand" "d")
111- (match_operand 2 "register_operand" "d")
112+ (if_then_else (match_operator:DI 0 "cmp_op"
113+ [(match_operand:DI 1 "register_operand" "d")
114+ (match_operand:DI 2 "register_operand" "d")
115 ])
116 (label_ref (match_operand 3))
117 (pc)))
118@@ -2495,6 +2504,20 @@ else
119 ;;----------------------------------------------------------------
120 ;; Unconditional branches
121 ;;----------------------------------------------------------------
122+(define_insn "jump_64"
123+ [(set (pc)
124+ (label_ref (match_operand 0 "" "")))]
125+ "TARGET_MB_64"
126+ {
127+ if (GET_CODE (operands[0]) == REG)
128+ return "brea%?\t%0";
129+ else
130+ return "breai%?\t%l0";
131+ }
132+ [(set_attr "type" "jump")
133+ (set_attr "mode" "none")
134+ (set_attr "length" "4")])
135+
136 (define_insn "jump"
137 [(set (pc)
138 (label_ref (match_operand 0 "" "")))]
139@@ -2538,19 +2561,28 @@ else
140 (use (label_ref (match_operand 1 "" "")))]
141 ""
142 {
143- //gcc_assert (GET_MODE (operands[0]) == Pmode);
144-
145+ gcc_assert (GET_MODE (operands[0]) == Pmode);
146+
147 if (!flag_pic)
148- emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1]));
149- else
150- emit_jump_insn (gen_tablejump_internal3 (operands[0], operands[1]));
151+ {
152+ if (!TARGET_MB_64)
153+ emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1]));
154+ else
155+ emit_jump_insn (gen_tablejump_internal2 (operands[0], operands[1]));
156+ }
157+ else {
158+ if (!TARGET_MB_64)
159+ emit_jump_insn (gen_tablejump_internal3 (operands[0], operands[1]));
160+ else
161+ emit_jump_insn (gen_tablejump_internal4 (operands[0], operands[1]));
162+ }
163 DONE;
164 }
165 )
166
167 (define_insn "tablejump_internal1"
168 [(set (pc)
169- (match_operand 0 "register_operand" "d"))
170+ (match_operand:SI 0 "register_operand" "d"))
171 (use (label_ref (match_operand 1 "" "")))]
172 ""
173 "bra%?\t%0 "
174@@ -2558,11 +2590,21 @@ else
175 (set_attr "mode" "none")
176 (set_attr "length" "4")])
177
178+(define_insn "tablejump_internal2"
179+ [(set (pc)
180+ (match_operand:DI 0 "register_operand" "d"))
181+ (use (label_ref (match_operand 1 "" "")))]
182+ "TARGET_MB_64"
183+ "bra%?\t%0 "
184+ [(set_attr "type" "jump")
185+ (set_attr "mode" "none")
186+ (set_attr "length" "4")])
187+
188 (define_expand "tablejump_internal3"
189 [(parallel [(set (pc)
190- (plus (match_operand 0 "register_operand" "d")
191- (label_ref (match_operand:SI 1 "" ""))))
192- (use (label_ref (match_dup 1)))])]
193+ (plus:SI (match_operand:SI 0 "register_operand" "d")
194+ (label_ref:SI (match_operand:SI 1 "" ""))))
195+ (use (label_ref:SI (match_dup 1)))])]
196 ""
197 ""
198 )
199@@ -2593,6 +2635,23 @@ else
200 ""
201 )
202
203+(define_insn ""
204+ [(set (pc)
205+ (plus:DI (match_operand:DI 0 "register_operand" "d")
206+ (label_ref:DI (match_operand 1 "" ""))))
207+ (use (label_ref:DI (match_dup 1)))]
208+ "TARGET_MB_64 && NEXT_INSN (as_a <rtx_insn *> (operands[1])) != 0
209+ && GET_CODE (PATTERN (NEXT_INSN (as_a <rtx_insn *> (operands[1])))) == ADDR_DIFF_VEC
210+ && flag_pic"
211+ {
212+ output_asm_insn ("addlk\t%0,%0,r20",operands);
213+ return "bra%?\t%0";
214+}
215+ [(set_attr "type" "jump")
216+ (set_attr "mode" "none")
217+ (set_attr "length" "4")])
218+
219+
220 ;;----------------------------------------------------------------
221 ;; Function prologue/epilogue and stack allocation
222 ;;----------------------------------------------------------------
223@@ -3097,7 +3156,7 @@ else
224 ;; The insn to set GOT. The hardcoded number "8" accounts for $pc difference
225 ;; between "mfs" and "addik" instructions.
226 (define_insn "set_got"
227- [(set (match_operand:SI 0 "register_operand" "=r")
228+ [(set (match_operand 0 "register_operand" "=r")
229 (unspec:SI [(const_int 0)] UNSPEC_SET_GOT))]
230 ""
231 "mfs\t%0,rpc\n\taddik\t%0,%0,_GLOBAL_OFFSET_TABLE_+8"
232diff --git a/libgcc/config/microblaze/crti.S b/libgcc/config/microblaze/crti.S
233index 3386520..3d4cde2 100644
234--- a/libgcc/config/microblaze/crti.S
235+++ b/libgcc/config/microblaze/crti.S
236@@ -33,11 +33,32 @@
237 .section .init, "ax"
238 .global __init
239
240+#ifdef __arch64__
241 .weak _stack
242- .set _stack, 0xffffffff
243+ .set _stack, 0xffffffffffffffff
244 .weak _stack_end
245 .set _stack_end, 0
246
247+ .align 3
248+__init:
249+ addlik r1, r1, -32
250+ sl r15, r0, r1
251+ addlik r11, r0, _stack
252+ mts rshr, r11
253+ addlik r11, r0, _stack_end
254+ mts rslr, r11
255+
256+ .section .fini, "ax"
257+ .global __fini
258+ .align 3
259+__fini:
260+ addlik r1, r1, -32
261+ sl r15, r0, r1
262+#else
263+ .weak _stack
264+ .set _stack, 0xffffffff
265+ .weak _stack_end
266+ .set _stack_end, 0
267 .align 2
268 __init:
269 addik r1, r1, -16
270@@ -53,3 +74,4 @@ __init:
271 __fini:
272 addik r1, r1, -16
273 sw r15, r0, r1
274+#endif
275diff --git a/libgcc/config/microblaze/crtn.S b/libgcc/config/microblaze/crtn.S
276index 04e73d7..c262ce0 100644
277--- a/libgcc/config/microblaze/crtn.S
278+++ b/libgcc/config/microblaze/crtn.S
279@@ -29,7 +29,19 @@
280 .section .note.GNU-stack,"",%progbits
281 .previous
282 #endif
283+#ifdef __arch64__
284+ .section .init, "ax"
285+ ll r15, r0, r1
286+ addlik r1, r1, 32
287+ rtsd r15, 8
288+ nop
289
290+ .section .fini, "ax"
291+ ll r15, r0, r1
292+ addlik r1, r1, 32
293+ rtsd r15, 8
294+ nop
295+#else
296 .section .init, "ax"
297 lw r15, r0, r1
298 rtsd r15, 8
299@@ -39,3 +51,4 @@
300 lw r15, r0, r1
301 rtsd r15, 8
302 addik r1, r1, 16
303+#endif
304--
3052.7.4
306
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0047-Added-double-arith-instructions.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0047-Added-double-arith-instructions.patch
new file mode 100644
index 00000000..f28d9f51
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0047-Added-double-arith-instructions.patch
@@ -0,0 +1,135 @@
1From b09721c830dd0831f50084e2e64920f83618e3f4 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Tue, 9 Oct 2018 10:07:08 +0530
4Subject: [PATCH 47/54] -Added double arith instructions -Fixed prologue stack
5 pointer decrement issue
6
7---
8 gcc/config/microblaze/microblaze.md | 78 ++++++++++++++++++++++++++++++++-----
9 gcc/config/microblaze/t-microblaze | 7 ++++
10 2 files changed, 76 insertions(+), 9 deletions(-)
11
12diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
13index 2669a28..dca61d6 100644
14--- a/gcc/config/microblaze/microblaze.md
15+++ b/gcc/config/microblaze/microblaze.md
16@@ -525,6 +525,66 @@
17 (set_attr "mode" "SF")
18 (set_attr "length" "4")])
19
20+(define_insn "fix_truncsfsi2"
21+ [(set (match_operand:SI 0 "register_operand" "=d")
22+ (fix:SI (match_operand:SF 1 "register_operand" "d")))]
23+ "TARGET_HARD_FLOAT && TARGET_FLOAT_CONVERT"
24+ "fint\t%0,%1"
25+ [(set_attr "type" "fint")
26+ (set_attr "mode" "SF")
27+ (set_attr "length" "4")])
28+
29+
30+(define_insn "adddf3"
31+ [(set (match_operand:DF 0 "register_operand" "=d")
32+ (plus:DF (match_operand:DF 1 "register_operand" "d")
33+ (match_operand:DF 2 "register_operand" "d")))]
34+ "TARGET_MB_64"
35+ "dadd\t%0,%1,%2"
36+ [(set_attr "type" "fadd")
37+ (set_attr "mode" "DF")
38+ (set_attr "length" "4")])
39+
40+(define_insn "subdf3"
41+ [(set (match_operand:DF 0 "register_operand" "=d")
42+ (minus:DF (match_operand:DF 1 "register_operand" "d")
43+ (match_operand:DF 2 "register_operand" "d")))]
44+ "TARGET_MB_64"
45+ "drsub\t%0,%2,%1"
46+ [(set_attr "type" "frsub")
47+ (set_attr "mode" "DF")
48+ (set_attr "length" "4")])
49+
50+(define_insn "muldf3"
51+ [(set (match_operand:DF 0 "register_operand" "=d")
52+ (mult:DF (match_operand:DF 1 "register_operand" "d")
53+ (match_operand:DF 2 "register_operand" "d")))]
54+ "TARGET_MB_64"
55+ "dmul\t%0,%1,%2"
56+ [(set_attr "type" "fmul")
57+ (set_attr "mode" "DF")
58+ (set_attr "length" "4")])
59+
60+(define_insn "divdf3"
61+ [(set (match_operand:DF 0 "register_operand" "=d")
62+ (div:DF (match_operand:DF 1 "register_operand" "d")
63+ (match_operand:DF 2 "register_operand" "d")))]
64+ "TARGET_MB_64"
65+ "ddiv\t%0,%2,%1"
66+ [(set_attr "type" "fdiv")
67+ (set_attr "mode" "DF")
68+ (set_attr "length" "4")])
69+
70+
71+(define_insn "sqrtdf2"
72+ [(set (match_operand:DF 0 "register_operand" "=d")
73+ (sqrt:DF (match_operand:DF 1 "register_operand" "d")))]
74+ "TARGET_MB_64"
75+ "dsqrt\t%0,%1"
76+ [(set_attr "type" "fsqrt")
77+ (set_attr "mode" "DF")
78+ (set_attr "length" "4")])
79+
80 (define_insn "floatdidf2"
81 [(set (match_operand:DF 0 "register_operand" "=d")
82 (float:DF (match_operand:DI 1 "register_operand" "d")))]
83@@ -534,13 +594,13 @@
84 (set_attr "mode" "DF")
85 (set_attr "length" "4")])
86
87-(define_insn "fix_truncsfsi2"
88- [(set (match_operand:SI 0 "register_operand" "=d")
89- (fix:SI (match_operand:SF 1 "register_operand" "d")))]
90- "TARGET_HARD_FLOAT && TARGET_FLOAT_CONVERT"
91- "fint\t%0,%1"
92- [(set_attr "type" "fint")
93- (set_attr "mode" "SF")
94+(define_insn "floatdfdi2"
95+ [(set (match_operand:DI 0 "register_operand" "=d")
96+ (float:DI (match_operand:DF 1 "register_operand" "d")))]
97+ "TARGET_MB_64"
98+ "dlong\t%0,%1"
99+ [(set_attr "type" "fcvt")
100+ (set_attr "mode" "DI")
101 (set_attr "length" "4")])
102
103 ;;----------------------------------------------------------------
104@@ -658,8 +718,8 @@
105 "TARGET_MB_64"
106 "@
107 rsubl\t%0,%2,%1
108- addik\t%0,%z1,-%2
109- addik\t%0,%z1,-%2"
110+ addlik\t%0,%z1,-%2
111+ addlik\t%0,%z1,-%2"
112 [(set_attr "type" "arith,no_delay_arith,no_delay_arith")
113 (set_attr "mode" "DI")
114 (set_attr "length" "4,4,4")])
115diff --git a/gcc/config/microblaze/t-microblaze b/gcc/config/microblaze/t-microblaze
116index 35ab965..dfef45c 100644
117--- a/gcc/config/microblaze/t-microblaze
118+++ b/gcc/config/microblaze/t-microblaze
119@@ -1,6 +1,13 @@
120 MULTILIB_OPTIONS = m64 mxl-barrel-shift mlittle-endian mno-xl-soft-mul mxl-multiply-high
121 MULTILIB_DIRNAMES = m64 bs le m mh
122 MULTILIB_EXCEPTIONS = *m64/mxl-multiply-high mxl-multiply-high
123+MULTILIB_EXCEPTIONS += *m64
124+MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift
125+MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul
126+MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mno-xl-soft-mul
127+MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul
128+MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mno-xl-soft-mul/mxl-multiply-high
129+MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul/mxl-multiply-high
130 MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high
131 MULTILIB_EXCEPTIONS += *mlittle-endian/mxl-multiply-high mxl-multiply-high
132 MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mlittle-endian/mxl-multiply-high
133--
1342.7.4
135
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0048-Fixed-the-issue-in-the-delay-slot-with-swap-instruct.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0048-Fixed-the-issue-in-the-delay-slot-with-swap-instruct.patch
new file mode 100644
index 00000000..9a214d55
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0048-Fixed-the-issue-in-the-delay-slot-with-swap-instruct.patch
@@ -0,0 +1,37 @@
1From 1ed548dd5993b8c3e58ef393467bdeea49c437be Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Fri, 12 Oct 2018 16:07:36 +0530
4Subject: [PATCH 48/54] Fixed the issue in the delay slot with swap
5 instructions
6
7---
8 gcc/config/microblaze/microblaze.md | 6 ++++++
9 1 file changed, 6 insertions(+)
10
11diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
12index dca61d6..d037843 100644
13--- a/gcc/config/microblaze/microblaze.md
14+++ b/gcc/config/microblaze/microblaze.md
15@@ -441,6 +441,9 @@
16 (bswap:SI (match_operand:SI 1 "register_operand" "r")))]
17 "TARGET_REORDER"
18 "swapb %0, %1"
19+ [(set_attr "type" "no_delay_arith")
20+ (set_attr "mode" "SI")
21+ (set_attr "length" "4")]
22 )
23
24 (define_insn "bswaphi2"
25@@ -449,6 +452,9 @@
26 "TARGET_REORDER"
27 "swapb %0, %1
28 swaph %0, %0"
29+ [(set_attr "type" "no_delay_arith")
30+ (set_attr "mode" "SI")
31+ (set_attr "length" "8")]
32 )
33
34 ;;----------------------------------------------------------------
35--
362.7.4
37
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0049-Fixed-the-load-store-issue-with-the-32bit-arith-libr.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0049-Fixed-the-load-store-issue-with-the-32bit-arith-libr.patch
new file mode 100644
index 00000000..a682bc19
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0049-Fixed-the-load-store-issue-with-the-32bit-arith-libr.patch
@@ -0,0 +1,256 @@
1From 1c889b64454f63f164f34d79d891d91b0bb4731f Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Sat, 13 Oct 2018 21:12:43 +0530
4Subject: [PATCH 49/54] Fixed the load store issue with the 32bit arith
5 libraries
6
7---
8 libgcc/config/microblaze/divsi3.S | 25 ++++++++++++++++++++++++-
9 libgcc/config/microblaze/modsi3.S | 26 +++++++++++++++++++++++++-
10 libgcc/config/microblaze/mulsi3.S | 3 +++
11 libgcc/config/microblaze/udivsi3.S | 24 +++++++++++++++++++++++-
12 libgcc/config/microblaze/umodsi3.S | 24 +++++++++++++++++++++++-
13 5 files changed, 98 insertions(+), 4 deletions(-)
14
15diff --git a/libgcc/config/microblaze/divsi3.S b/libgcc/config/microblaze/divsi3.S
16index 663d398..7e7d875 100644
17--- a/libgcc/config/microblaze/divsi3.S
18+++ b/libgcc/config/microblaze/divsi3.S
19@@ -41,6 +41,17 @@
20 .globl __divsi3
21 .ent __divsi3
22 .type __divsi3,@function
23+#ifdef __arch64__
24+ .align 3
25+__divsi3:
26+ .frame r1,0,r15
27+
28+ ADDIK r1,r1,-32
29+ SLI r28,r1,0
30+ SLI r29,r1,8
31+ SLI r30,r1,16
32+ SLI r31,r1,24
33+#else
34 __divsi3:
35 .frame r1,0,r15
36
37@@ -49,7 +60,7 @@ __divsi3:
38 SWI r29,r1,4
39 SWI r30,r1,8
40 SWI r31,r1,12
41-
42+#endif
43 BEQI r6,$LaDiv_By_Zero # Div_by_Zero # Division Error
44 BEQI r5,$LaResult_Is_Zero # Result is Zero
45 BGEID r5,$LaR5_Pos
46@@ -89,6 +100,17 @@ $LaLOOP_END:
47 $LaDiv_By_Zero:
48 $LaResult_Is_Zero:
49 OR r3,r0,r0 # set result to 0
50+#ifdef __arch64__
51+$LaRETURN_HERE:
52+# Restore values of CSRs and that of r3 and the divisor and the dividend
53+ LLI r28,r1,0
54+ LLI r29,r1,8
55+ LLI r30,r1,16
56+ LLI r31,r1,24
57+ ADDLIK r1,r1,32
58+ RTSD r15,8
59+ NOP
60+#else
61 $LaRETURN_HERE:
62 # Restore values of CSRs and that of r3 and the divisor and the dividend
63 LWI r28,r1,0
64@@ -97,6 +119,7 @@ $LaRETURN_HERE:
65 LWI r31,r1,12
66 RTSD r15,8
67 ADDIK r1,r1,16
68+#endif
69 .end __divsi3
70 .size __divsi3, . - __divsi3
71
72diff --git a/libgcc/config/microblaze/modsi3.S b/libgcc/config/microblaze/modsi3.S
73index 71b56e30..7e85064 100644
74--- a/libgcc/config/microblaze/modsi3.S
75+++ b/libgcc/config/microblaze/modsi3.S
76@@ -41,6 +41,17 @@
77 .globl __modsi3
78 .ent __modsi3
79 .type __modsi3,@function
80+#ifdef __arch64__
81+ .align 3
82+__modsi3:
83+ .frame r1,0,r15
84+
85+ addlik r1,r1,-32
86+ sli r28,r1,0
87+ sli r29,r1,8
88+ sli r30,r1,16
89+ sli r31,r1,24
90+#else
91 __modsi3:
92 .frame r1,0,r15
93
94@@ -49,6 +60,7 @@ __modsi3:
95 swi r29,r1,4
96 swi r30,r1,8
97 swi r31,r1,12
98+#endif
99
100 BEQI r6,$LaDiv_By_Zero # Div_by_Zero # Division Error
101 BEQI r5,$LaResult_Is_Zero # Result is Zero
102@@ -88,6 +100,18 @@ $LaLOOP_END:
103 $LaDiv_By_Zero:
104 $LaResult_Is_Zero:
105 or r3,r0,r0 # set result to 0 [Both mod as well as div are 0]
106+
107+#ifdef __arch64__
108+$LaRETURN_HERE:
109+# Restore values of CSRs and that of r3 and the divisor and the dividend
110+ lli r28,r1,0
111+ lli r29,r1,8
112+ lli r30,r1,16
113+ lli r31,r1,24
114+ addik r1,r1,32
115+ rtsd r15,8
116+ nop
117+#else
118 $LaRETURN_HERE:
119 # Restore values of CSRs and that of r3 and the divisor and the dividend
120 lwi r28,r1,0
121@@ -95,7 +119,7 @@ $LaRETURN_HERE:
122 lwi r30,r1,8
123 lwi r31,r1,12
124 rtsd r15,8
125- addik r1,r1,16
126+#endif
127 .end __modsi3
128 .size __modsi3, . - __modsi3
129
130diff --git a/libgcc/config/microblaze/mulsi3.S b/libgcc/config/microblaze/mulsi3.S
131index 40b0b15..31a73c2 100644
132--- a/libgcc/config/microblaze/mulsi3.S
133+++ b/libgcc/config/microblaze/mulsi3.S
134@@ -41,6 +41,9 @@
135 .globl __mulsi3
136 .ent __mulsi3
137 .type __mulsi3,@function
138+#ifdef __arch64__
139+ .align 3
140+#endif
141 __mulsi3:
142 .frame r1,0,r15
143 add r3,r0,r0
144diff --git a/libgcc/config/microblaze/udivsi3.S b/libgcc/config/microblaze/udivsi3.S
145index 2aef8ed..94adb6a 100644
146--- a/libgcc/config/microblaze/udivsi3.S
147+++ b/libgcc/config/microblaze/udivsi3.S
148@@ -41,6 +41,16 @@
149 .globl __udivsi3
150 .ent __udivsi3
151 .type __udivsi3,@function
152+#ifdef __arch64__
153+ .align 3
154+__udivsi3:
155+ .frame r1,0,r15
156+
157+ ADDLIK r1,r1,-24
158+ SLI r29,r1,0
159+ SLI r30,r1,8
160+ SLI r31,r1,16
161+#else
162 __udivsi3:
163 .frame r1,0,r15
164
165@@ -48,7 +58,7 @@ __udivsi3:
166 SWI r29,r1,0
167 SWI r30,r1,4
168 SWI r31,r1,8
169-
170+#endif
171 BEQI r6,$LaDiv_By_Zero # Div_by_Zero # Division Error
172 BEQID r5,$LaResult_Is_Zero # Result is Zero
173 ADDIK r30,r0,0 # Clear mod
174@@ -98,6 +108,17 @@ $LaLOOP_END:
175 $LaDiv_By_Zero:
176 $LaResult_Is_Zero:
177 OR r3,r0,r0 # set result to 0
178+
179+#ifdef __arch64__
180+$LaRETURN_HERE:
181+ # Restore values of CSRs and that of r3 and the divisor and the dividend
182+ LLI r29,r1,0
183+ LLI r30,r1,8
184+ LLI r31,r1,16
185+ ADDIK r1,r1,24
186+ RTSD r15,8
187+ NOP
188+#else
189 $LaRETURN_HERE:
190 # Restore values of CSRs and that of r3 and the divisor and the dividend
191 LWI r29,r1,0
192@@ -105,5 +126,6 @@ $LaRETURN_HERE:
193 LWI r31,r1,8
194 RTSD r15,8
195 ADDIK r1,r1,12
196+#endif
197 .end __udivsi3
198 .size __udivsi3, . - __udivsi3
199diff --git a/libgcc/config/microblaze/umodsi3.S b/libgcc/config/microblaze/umodsi3.S
200index a2582d0..00b3bdf 100644
201--- a/libgcc/config/microblaze/umodsi3.S
202+++ b/libgcc/config/microblaze/umodsi3.S
203@@ -41,6 +41,16 @@
204 .globl __umodsi3
205 .ent __umodsi3
206 .type __umodsi3,@function
207+#ifdef __arch64__
208+ .align 3
209+__umodsi3:
210+ .frame r1,0,r15
211+
212+ addik r1,r1,-24
213+ swi r29,r1,0
214+ swi r30,r1,8
215+ swi r31,r1,16
216+#else
217 __umodsi3:
218 .frame r1,0,r15
219
220@@ -48,7 +58,7 @@ __umodsi3:
221 swi r29,r1,0
222 swi r30,r1,4
223 swi r31,r1,8
224-
225+#endif
226 BEQI r6,$LaDiv_By_Zero # Div_by_Zero # Division Error
227 BEQId r5,$LaResult_Is_Zero # Result is Zero
228 ADDIK r3,r0,0 # Clear div
229@@ -101,6 +111,17 @@ $LaLOOP_END:
230 $LaDiv_By_Zero:
231 $LaResult_Is_Zero:
232 or r3,r0,r0 # set result to 0
233+
234+#ifdef __arch64__
235+$LaRETURN_HERE:
236+# Restore values of CSRs and that of r3 and the divisor and the dividend
237+ lli r29,r1,0
238+ lli r30,r1,8
239+ lli r31,r1,16
240+ addlik r1,r1,24
241+ rtsd r15,8
242+ nop
243+#else
244 $LaRETURN_HERE:
245 # Restore values of CSRs and that of r3 and the divisor and the dividend
246 lwi r29,r1,0
247@@ -108,5 +129,6 @@ $LaRETURN_HERE:
248 lwi r31,r1,8
249 rtsd r15,8
250 addik r1,r1,12
251+#endif
252 .end __umodsi3
253 .size __umodsi3, . - __umodsi3
254--
2552.7.4
256
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0050-extending-the-Dwarf-support-to-64bit-Microblaze.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0050-extending-the-Dwarf-support-to-64bit-Microblaze.patch
new file mode 100644
index 00000000..95a26db2
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0050-extending-the-Dwarf-support-to-64bit-Microblaze.patch
@@ -0,0 +1,25 @@
1From 751a01ce1eeaffcd41c504b9bf44868345b45da0 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Mon, 15 Oct 2018 12:00:10 +0530
4Subject: [PATCH 50/54] extending the Dwarf support to 64bit Microblaze
5
6---
7 gcc/config/microblaze/microblaze.h | 2 +-
8 1 file changed, 1 insertion(+), 1 deletion(-)
9
10diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
11index e34f549..0a5ff0a 100644
12--- a/gcc/config/microblaze/microblaze.h
13+++ b/gcc/config/microblaze/microblaze.h
14@@ -207,7 +207,7 @@ extern enum pipeline_type microblaze_pipe;
15 /* Use DWARF 2 debugging information by default. */
16 #define DWARF2_DEBUGGING_INFO 1
17 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
18-#define DWARF2_ADDR_SIZE 4
19+#define DWARF2_ADDR_SIZE (TARGET_MB_64 ? 8 : 4)
20
21 /* Target machine storage layout */
22
23--
242.7.4
25
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0051-fixing-the-typo-errors-in-umodsi3-file.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0051-fixing-the-typo-errors-in-umodsi3-file.patch
new file mode 100644
index 00000000..574037ec
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0051-fixing-the-typo-errors-in-umodsi3-file.patch
@@ -0,0 +1,29 @@
1From 295046d0a63148fb5a685ae2bd7a06489274c72a Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Tue, 16 Oct 2018 07:55:46 +0530
4Subject: [PATCH 51/54] fixing the typo errors in umodsi3 file
5
6---
7 libgcc/config/microblaze/umodsi3.S | 6 +++---
8 1 file changed, 3 insertions(+), 3 deletions(-)
9
10diff --git a/libgcc/config/microblaze/umodsi3.S b/libgcc/config/microblaze/umodsi3.S
11index 00b3bdf..9bf65c3 100644
12--- a/libgcc/config/microblaze/umodsi3.S
13+++ b/libgcc/config/microblaze/umodsi3.S
14@@ -47,9 +47,9 @@ __umodsi3:
15 .frame r1,0,r15
16
17 addik r1,r1,-24
18- swi r29,r1,0
19- swi r30,r1,8
20- swi r31,r1,16
21+ sli r29,r1,0
22+ sli r30,r1,8
23+ sli r31,r1,16
24 #else
25 __umodsi3:
26 .frame r1,0,r15
27--
282.7.4
29
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0052-fixing-the-32bit-LTO-related-issue9-1014024.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0052-fixing-the-32bit-LTO-related-issue9-1014024.patch
new file mode 100644
index 00000000..95d39bb2
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0052-fixing-the-32bit-LTO-related-issue9-1014024.patch
@@ -0,0 +1,68 @@
1From d55eff09f175ddbc66e4e800fa5650ce9e2f599e Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Wed, 17 Oct 2018 16:56:14 +0530
4Subject: [PATCH 52/54] fixing the 32bit LTO related issue9(1014024)
5
6---
7 gcc/config/microblaze/microblaze.h | 24 ++++++++++++++----------
8 1 file changed, 14 insertions(+), 10 deletions(-)
9
10diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
11index 0a5ff0a..740b8d9 100644
12--- a/gcc/config/microblaze/microblaze.h
13+++ b/gcc/config/microblaze/microblaze.h
14@@ -265,12 +265,14 @@ extern enum pipeline_type microblaze_pipe;
15 #define WORD_REGISTER_OPERATIONS 1
16
17 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
18-/*
19-#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \
20- if (GET_MODE_CLASS (MODE) == MODE_INT \
21- && GET_MODE_SIZE (MODE) < (TARGET_MB_64 ? 8 : 4)) \
22- (MODE) = TARGET_MB_64 ? DImode : SImode;
23-*/
24+
25+#ifndef __arch64__
26+#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \
27+ if (GET_MODE_CLASS (MODE) == MODE_INT \
28+ && GET_MODE_SIZE (MODE) < 4) \
29+ (MODE) = SImode;
30+#endif
31+
32 /* Standard register usage. */
33
34 /* On the MicroBlaze, we have 32 integer registers */
35@@ -469,16 +471,18 @@ extern struct microblaze_frame_info current_frame_info;
36
37 #define MAX_ARGS_IN_REGISTERS MB_ABI_MAX_ARG_REGS
38
39+#ifdef __aarch64__
40 #define LIBCALL_VALUE(MODE) \
41 gen_rtx_REG (MODE,GP_RETURN)
42-
43-/*#define LIBCALL_VALUE(MODE) \
44+#else
45+#define LIBCALL_VALUE(MODE) \
46 gen_rtx_REG ( \
47 ((GET_MODE_CLASS (MODE) != MODE_INT \
48 || GET_MODE_SIZE (MODE) >= 4) \
49 ? (MODE) \
50 : SImode), GP_RETURN)
51-*/
52+#endif
53+
54 /* 1 if N is a possible register number for a function value.
55 On the MicroBlaze, R2 R3 are the only register thus used.
56 Currently, R2 are only implemented here (C has no complex type) */
57@@ -518,7 +522,7 @@ typedef struct microblaze_args
58 /* 4 insns + 2 words of data. */
59 #define TRAMPOLINE_SIZE (6 * 4)
60
61-#define TRAMPOLINE_ALIGNMENT 64
62+#define TRAMPOLINE_ALIGNMENT (TARGET_MB_64 ? 64 : 32)
63
64 #define REGNO_OK_FOR_BASE_P(regno) microblaze_regno_ok_for_base_p ((regno), 1)
65
66--
672.7.4
68
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0053-Fixed-the-missing-stack-adjustment-in-prologue-of-mo.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0053-Fixed-the-missing-stack-adjustment-in-prologue-of-mo.patch
new file mode 100644
index 00000000..e992075b
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0053-Fixed-the-missing-stack-adjustment-in-prologue-of-mo.patch
@@ -0,0 +1,25 @@
1From 3e7161218dc8b4dd84ad8d31f6dbaa7c256e7a82 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Fri, 19 Oct 2018 14:26:25 +0530
4Subject: [PATCH 53/54] Fixed the missing stack adjustment in prologue of
5 modsi3 function
6
7---
8 libgcc/config/microblaze/modsi3.S | 1 +
9 1 file changed, 1 insertion(+)
10
11diff --git a/libgcc/config/microblaze/modsi3.S b/libgcc/config/microblaze/modsi3.S
12index 7e85064..46ff34a 100644
13--- a/libgcc/config/microblaze/modsi3.S
14+++ b/libgcc/config/microblaze/modsi3.S
15@@ -119,6 +119,7 @@ $LaRETURN_HERE:
16 lwi r30,r1,8
17 lwi r31,r1,12
18 rtsd r15,8
19+ addik r1,r1,16
20 #endif
21 .end __modsi3
22 .size __modsi3, . - __modsi3
23--
242.7.4
25
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0054-Patch-Microblaze-corrected-SPN-for-dlong-instruction.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0054-Patch-Microblaze-corrected-SPN-for-dlong-instruction.patch
new file mode 100644
index 00000000..afb88d35
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0054-Patch-Microblaze-corrected-SPN-for-dlong-instruction.patch
@@ -0,0 +1,29 @@
1From a89b3e6902d7835129ad178f6af896eba15c5d5e Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Wed, 24 Oct 2018 18:31:04 +0530
4Subject: [PATCH 54/54] [Patch,Microblaze] : corrected SPN for dlong
5 instruction mapping.
6
7---
8 gcc/config/microblaze/microblaze.md | 4 ++--
9 1 file changed, 2 insertions(+), 2 deletions(-)
10
11diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
12index d037843..cbd7e77 100644
13--- a/gcc/config/microblaze/microblaze.md
14+++ b/gcc/config/microblaze/microblaze.md
15@@ -600,9 +600,9 @@
16 (set_attr "mode" "DF")
17 (set_attr "length" "4")])
18
19-(define_insn "floatdfdi2"
20+(define_insn "fix_truncdfdi2"
21 [(set (match_operand:DI 0 "register_operand" "=d")
22- (float:DI (match_operand:DF 1 "register_operand" "d")))]
23+ (fix:DI (fix:DF (match_operand:DF 1 "register_operand" "d"))))]
24 "TARGET_MB_64"
25 "dlong\t%0,%1"
26 [(set_attr "type" "fcvt")
27--
282.7.4
29
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_7.%.bbappend b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_7.%.bbappend
deleted file mode 100644
index 9770af61..00000000
--- a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_7.%.bbappend
+++ /dev/null
@@ -1,38 +0,0 @@
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-PR-target-83013.patch \
7 file://0004-dejagnu-static-testing-on-qemu-suppress-warnings.patch \
8 file://0005-Testsuite-explicitly-add-fivopts-for-tests-that-depe.patch \
9 file://0006-Add-MicroBlaze-to-target-supports-for-atomic-builtin.patch \
10 file://0007-Update-MicroBlaze-strings-test-for-new-scan-assembly.patch \
11 file://0008-Allow-MicroBlaze-.weakext-pattern-in-testsuite.patch \
12 file://0009-Add-MicroBlaze-to-check_profiling_available-Testsuit.patch \
13 file://0010-Fix-atomic-side-effects.patch \
14 file://0011-Fix-atomic-boolean-return-value.patch \
15 file://0012-Fix-the-Microblaze-crash-with-msmall-divides-flag.patch \
16 file://0013-Add-MicroBlaze-ashrsi_3_with_size_opt.patch \
17 file://0014-Removed-MicroBlaze-moddi3-routinue.patch \
18 file://0015-MicroBlaze-fixed-missing-save-of-r18-in-fast_interru.patch \
19 file://0016-MicroBlaze-use-bralid-for-profiler-calls.patch \
20 file://0017-Disable-fivopts-by-default-Turn-off-ivopts-by-defaul.patch \
21 file://0018-Add-INIT_PRIORITY-support-Added-TARGET_ASM_CONSTRUCT.patch \
22 file://0019-MicroBlaze-add-optimized-lshrsi3-When-barrel-shifter.patch \
23 file://0020-Modified-MicroBlaze-trap-instruction.patch \
24 file://0021-Reducing-Stack-space-for-arguments-Currently-in-Micr.patch \
25 file://0022-Inline-Expansion-of-fsqrt-builtin.patch \
26 file://0023-Update-MicroBlaze-ashlsi3-movsf-patterns.patch \
27 file://0024-8-stage-pipeline-for-microblaze.patch \
28 file://0025-MicroBlaze-correct-the-const-high-double-immediate-v.patch \
29 file://0026-Fix-internal-compiler-error-with-msmall-divides.patch \
30 file://0027-Fix-the-calculation-of-high-word-in-a-long-long-64-b.patch \
31 file://0028-Add-new-bit-field-instructions.patch \
32 file://0029-Fix-bug-in-MB-version-calculation.patch \
33 file://0030-MicroBlaze-fixing-the-bug-in-the-bit-field-instructi.patch \
34 file://0031-Fixing-the-issue-with-MicroBlaze-builtin_alloc.patch \
35 file://0032-MicroBlaze-remove-bitfield-instructions-macros.patch \
36 file://0033-MicroBlaze-fix-signed-bit-fields-with-bit-field-inst.patch \
37 "
38
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_8.%.bbappend b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_8.%.bbappend
new file mode 100644
index 00000000..a1148a8f
--- /dev/null
+++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-source_8.%.bbappend
@@ -0,0 +1,58 @@
1# Add MicroBlaze Patches (only when using MicroBlaze)
2FILESEXTRAPATHS_append_microblaze := "${THISDIR}/gcc-8:"
3SRC_URI_append_microblaze = " \
4file://0001-LOCAL-Testsuite-builtins-tests-require-fpic.patch \
5 file://0002-LOCAL-Quick-fail-g-.dg-opt-memcpy1.C.patch \
6 file://0003-LOCAL-Testsuite-explicitly-add-fivopts-for-tests-tha.patch \
7 file://0004-LOCAL-For-dejagnu-static-testing-on-qemu-suppress-wa.patch \
8 file://0005-Patch-testsuite-Add-MicroBlaze-to-target-supports-fo.patch \
9 file://0006-Patch-testsuite-Update-MicroBlaze-strings-test.patch \
10 file://0007-Patch-testsuite-Allow-MicroBlaze-.weakext-pattern-in.patch \
11 file://0008-Patch-testsuite-Add-MicroBlaze-to-check_profiling_av.patch \
12 file://0009-Patch-microblaze-Fix-atomic-side-effects.patch \
13 file://0010-Patch-microblaze-Fix-atomic-boolean-return-value.patch \
14 file://0011-Patch-microblaze-Fix-the-Microblaze-crash-with-msmal.patch \
15 file://0012-Patch-microblaze-Added-ashrsi3_with_size_opt.patch \
16 file://0013-Patch-microblaze-Fixed-missing-save-of-r18-in-fast_i.patch \
17 file://0014-Patch-microblaze-Use-bralid-for-profiler-calls.patch \
18 file://0015-Patch-microblaze-Disable-fivopts-by-default.patch \
19 file://0016-Patch-microblaze-Removed-moddi3-routinue.patch \
20 file://0017-Patch-microblaze-Add-INIT_PRIORITY-support.patch \
21 file://0018-Patch-microblaze-Add-optimized-lshrsi3.patch \
22 file://0019-Patch-microblaze-Modified-trap-instruction.patch \
23 file://0020-Patch-microblaze-Reducing-Stack-space-for-arguments.patch \
24 file://0021-Patch-microblaze-Add-cbranchsi4_reg.patch \
25 file://0022-Patch-microblaze-Inline-Expansion-of-fsqrt-builtin.patch \
26 file://0023-Patch-OPT-Update-heuristics-for-loop-invariant-for-a.patch \
27 file://0024-PATCH-microblaze.md-Improve-adddi3-and-subdi3-insn-d.patch \
28 file://0025-Patch-microblaze-Update-ashlsi3-movsf-patterns.patch \
29 file://0026-Patch-microblaze-8-stage-pipeline-for-microblaze.patch \
30 file://0027-Patch-rtl-Optimization-Better-register-pressure-esti.patch \
31 file://0028-Patch-microblaze-Correct-the-const-high-double-immed.patch \
32 file://0029-Fix-microblaze-Fix-internal-compiler-error-with-msma.patch \
33 file://0030-patch-microblaze-Fix-the-calculation-of-high-word-in.patch \
34 file://0031-Patch-microblaze-Add-new-bit-field-instructions.patch \
35 file://0032-Patch-microblaze-Fix-bug-in-MB-version-calculation.patch \
36 file://0033-Fixing-the-bug-in-the-bit-field-instruction.patch \
37 file://0034-Patch-microblaze-Macros-used-in-Xilinx-internal-patc.patch \
38 file://0035-Fixing-the-issue-with-the-builtin_alloc.patch \
39 file://0036-Patch-Microblaze-reverting-the-cost-check-before-pro.patch \
40 file://0037-Patch-Microblaze-update-in-constraints-for-bitfield-.patch \
41 file://0038-Patch-Microblaze-Removed-fsqrt-generation-for-double.patch \
42 file://0039-Intial-commit-of-64-bit-Microblaze.patch \
43 file://0040-Added-load-store-pattern-movdi-and-also-adding-missi.patch \
44 file://0041-Intial-commit-for-64bit-MB-sources.patch \
45 file://0042-re-arrangement-of-the-compare-branches.patch \
46 file://0043-Patch-Microblaze-previous-commit-broke-the-handling-.patch \
47 file://0044-Patch-Microblaze-Support-of-multilibs-with-m64.patch \
48 file://0045-Fixed-issues-like.patch \
49 file://0046-Fixed-below-issues.patch \
50 file://0047-Added-double-arith-instructions.patch \
51 file://0048-Fixed-the-issue-in-the-delay-slot-with-swap-instruct.patch \
52 file://0049-Fixed-the-load-store-issue-with-the-32bit-arith-libr.patch \
53 file://0050-extending-the-Dwarf-support-to-64bit-Microblaze.patch \
54 file://0051-fixing-the-typo-errors-in-umodsi3-file.patch \
55 file://0052-fixing-the-32bit-LTO-related-issue9-1014024.patch \
56 file://0053-Fixed-the-missing-stack-adjustment-in-prologue-of-mo.patch \
57 file://0054-Patch-Microblaze-corrected-SPN-for-dlong-instruction.patch \
58"