diff options
author | Mark Hatle <mark.hatle@xilinx.com> | 2021-08-11 11:51:32 -0700 |
---|---|---|
committer | Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> | 2021-09-28 08:17:31 -0700 |
commit | b08cd732a8f0f94c5047b526ce546f87f51b856b (patch) | |
tree | 93f008ed7a966490f1d42d6b9c5ae6d6571efc43 /meta-microblaze/recipes-devtools | |
parent | ef500e812ad927d7681dc409abf042d4aa5742c6 (diff) | |
download | meta-xilinx-b08cd732a8f0f94c5047b526ce546f87f51b856b.tar.gz |
gcc: Fix performance degradation on Microblaze 64
Issue: TSR-974519
Added zero_extendqidi2 and zero_extendhidi2 patterns
in GCC 10.2,commit 0a237a9: Do not propagate results from inner
REGS to paradoxical SUBREGs and this commit is causing the MB 64
compiler to generate extra instructions.
Signed-off-by: Mark Hatle <mark.hatle@xilinx.com>
Diffstat (limited to 'meta-microblaze/recipes-devtools')
-rw-r--r-- | meta-microblaze/recipes-devtools/gcc/gcc-10/0056-Patch-MicroBlaze-Added-zero_extendqidi2-and-zero_ext.patch | 51 | ||||
-rw-r--r-- | meta-microblaze/recipes-devtools/gcc/gcc-source_11.%.bbappend | 1 |
2 files changed, 52 insertions, 0 deletions
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-10/0056-Patch-MicroBlaze-Added-zero_extendqidi2-and-zero_ext.patch b/meta-microblaze/recipes-devtools/gcc/gcc-10/0056-Patch-MicroBlaze-Added-zero_extendqidi2-and-zero_ext.patch new file mode 100644 index 00000000..0af64096 --- /dev/null +++ b/meta-microblaze/recipes-devtools/gcc/gcc-10/0056-Patch-MicroBlaze-Added-zero_extendqidi2-and-zero_ext.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From 9ffd7d3ba55a9dc63093f16a02b8d5634ffd2a39 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mahesh Bodapati <mbodapat@xilinx.com> | ||
3 | Date: Wed, 11 Aug 2021 15:31:47 +0530 | ||
4 | Subject: [PATCH] [Patch,MicroBlaze] : Added zero_extendqidi2 and | ||
5 | zero_extendhidi2 patterns to resolve TSR-974519. in GCC 10.2,commit | ||
6 | 0a237a94c206b53eb: Do not propagate results from inner REGS to paradoxical | ||
7 | SUBREGs and this commit is causing the MB 64 compiler to generate extra | ||
8 | instructions. | ||
9 | |||
10 | --- | ||
11 | gcc/config/microblaze/microblaze.md | 24 ++++++++++++++++++++++++ | ||
12 | 1 file changed, 24 insertions(+) | ||
13 | |||
14 | diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md | ||
15 | index 71ac46dfb6c..b34e963e176 100644 | ||
16 | --- a/gcc/config/microblaze/microblaze.md | ||
17 | +++ b/gcc/config/microblaze/microblaze.md | ||
18 | @@ -1191,6 +1191,30 @@ | ||
19 | (set_attr "mode" "SI,SI,SI") | ||
20 | (set_attr "length" "4,4,8")]) | ||
21 | |||
22 | +(define_insn "zero_extendhidi2" | ||
23 | + [(set (match_operand:DI 0 "register_operand" "=d,d,d") | ||
24 | + (zero_extend:DI (match_operand:HI 1 "nonimmediate_operand" "d,R,m")))] | ||
25 | + "TARGET_MB_64" | ||
26 | + "@ | ||
27 | + andli\t%0,%1,0xffff | ||
28 | + lhu%i1\t%0,%1 | ||
29 | + lhu%i1\t%0,%1" | ||
30 | + [(set_attr "type" "no_delay_arith,load,no_delay_load") | ||
31 | + (set_attr "mode" "DI,DI,DI") | ||
32 | + (set_attr "length" "8,4,8")]) | ||
33 | + | ||
34 | +(define_insn "zero_extendqidi2" | ||
35 | + [(set (match_operand:DI 0 "register_operand" "=d,d,d") | ||
36 | + (zero_extend:DI (match_operand:QI 1 "nonimmediate_operand" "d,R,m")))] | ||
37 | + "TARGET_MB_64" | ||
38 | + "@ | ||
39 | + andli\t%0,%1,0x00ff | ||
40 | + lbu%i1\t%0,%1 | ||
41 | + lbu%i1\t%0,%1" | ||
42 | + [(set_attr "type" "arith,load,no_delay_load") | ||
43 | + (set_attr "mode" "DI,DI,DI") | ||
44 | + (set_attr "length" "4,4,8")]) | ||
45 | + | ||
46 | ;;---------------------------------------------------------------- | ||
47 | ;; Sign extension | ||
48 | ;;---------------------------------------------------------------- | ||
49 | -- | ||
50 | 2.17.1 | ||
51 | |||
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-source_11.%.bbappend b/meta-microblaze/recipes-devtools/gcc/gcc-source_11.%.bbappend index 16c845cd..d80469da 100644 --- a/meta-microblaze/recipes-devtools/gcc/gcc-source_11.%.bbappend +++ b/meta-microblaze/recipes-devtools/gcc/gcc-source_11.%.bbappend | |||
@@ -57,5 +57,6 @@ SRC_URI_append_microblaze = " \ | |||
57 | file://0053-Patch-microblaze-Reducing-Stack-space-for-arguments.patch \ | 57 | file://0053-Patch-microblaze-Reducing-Stack-space-for-arguments.patch \ |
58 | file://0054-Patch-MicroBlaze-Typo-in-the-previous-commits.bsefi-.patch \ | 58 | file://0054-Patch-MicroBlaze-Typo-in-the-previous-commits.bsefi-.patch \ |
59 | file://0055-Patch-MicroBlaze.patch \ | 59 | file://0055-Patch-MicroBlaze.patch \ |
60 | file://0056-Patch-MicroBlaze-Added-zero_extendqidi2-and-zero_ext.patch \ | ||
60 | file://microblaze-mulitlib-hack.patch \ | 61 | file://microblaze-mulitlib-hack.patch \ |
61 | " | 62 | " |