summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/gcc/gcc-10/0056-patch-microblaze64-Add-Zero_extended-instructions.patch
blob: 949e6346db3ec23a9766a259e29bf62b75ffcfc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From 4096da3ea3765ec9484af719a16074789b8946ee Mon Sep 17 00:00:00 2001
From: Nagaraju Mekala <nmekala@xilinx.com>
Date: Mon, 30 Aug 2021 12:13:45 +0530
Subject: [PATCH] [patch, microblaze64]: Add Zero_extended instructions

Due to latest changes in GCC-10.2 MB64 perforamance has reduced
We have added zero_extended instructions to get rid of left shift
and right shift loops

[CR/TSR]: TSR-974519

Signed-off-by: Nagaraju Mekala<nmekala@xilinx.com>
---
 gcc/config/microblaze/microblaze.md | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
index 71ac46dfb6c..51c2751e6be 100644
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
@@ -1191,6 +1191,33 @@
   (set_attr "mode"	"SI,SI,SI")
   (set_attr "length"	"4,4,8")])
 
+(define_insn "zero_extendhidi2"
+  [(set (match_operand:DI 0 "register_operand" "=d")
+	(zero_extend:DI (match_operand:HI 1 "register_operand" "d")))]
+  "TARGET_MB_64"
+  "andli\t%0,%1,0xffff"
+  [(set_attr "type"	"no_delay_arith")
+  (set_attr "mode"	"DI")
+  (set_attr "length"	"8")])
+
+(define_insn "zero_extendsidi2"
+  [(set (match_operand:DI 0 "register_operand" "=d")
+	(zero_extend:DI (match_operand:SI 1 "register_operand" "d")))]
+  "TARGET_MB_64"
+  "andli\t%0,%1,0xffffffff"
+  [(set_attr "type"	"no_delay_arith")
+  (set_attr "mode"	"DI")
+  (set_attr "length"	"8")])
+  
+(define_insn "zero_extendqidi2"
+  [(set (match_operand:DI 0 "register_operand" "=d")
+	(zero_extend:DI (match_operand:QI 1 "register_operand" "d")))]
+  "TARGET_MB_64"
+  "andli\t%0,%1,0x00ff"
+  [(set_attr "type"	"no_delay_arith")
+  (set_attr "mode"	"DI")
+  (set_attr "length"	"8")])
+
 ;;----------------------------------------------------------------
 ;; Sign extension
 ;;----------------------------------------------------------------
-- 
2.17.1