summaryrefslogtreecommitdiff
path: root/meta-xilinx/meta-microblaze/recipes-devtools/gcc/gcc-10/0041-Fix-various.patch
blob: 75ee48fa631a5917f077241059a5f7ed88177f81 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
From 90edf612331af9b7e99105112c2067a3f085daef Mon Sep 17 00:00:00 2001
From: Nagaraju Mekala <nmekala@xilix.com>
Date: Tue, 9 Oct 2018 10:07:08 +0530
Subject: [PATCH 41/58] Fix various

-Added double arith instructions
-Fixed prologue stack pointer decrement issue
---
 gcc/config/microblaze/microblaze.md | 78 +++++++++++++++++++++++++----
 gcc/config/microblaze/t-microblaze  |  7 +++
 2 files changed, 76 insertions(+), 9 deletions(-)

diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
index 013c77651c3..645f48f2847 100644
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
@@ -527,6 +527,66 @@
   (set_attr "mode"      "SF")
   (set_attr "length"    "4")])
 
+(define_insn "fix_truncsfsi2"
+  [(set (match_operand:SI 0 "register_operand" "=d")
+        (fix:SI (match_operand:SF 1 "register_operand" "d")))]
+  "TARGET_HARD_FLOAT && TARGET_FLOAT_CONVERT"
+  "fint\t%0,%1"
+  [(set_attr "type"     "fint")
+  (set_attr "mode"      "SF")
+  (set_attr "length"    "4")])
+
+
+(define_insn "adddf3"
+  [(set (match_operand:DF 0 "register_operand" "=d")
+        (plus:DF (match_operand:DF 1 "register_operand" "d")
+                 (match_operand:DF 2 "register_operand" "d")))]
+  "TARGET_MB_64"
+  "dadd\t%0,%1,%2"
+  [(set_attr "type"     "fadd")
+  (set_attr "mode"      "DF")
+  (set_attr "length"    "4")])
+
+(define_insn "subdf3"
+  [(set (match_operand:DF 0 "register_operand" "=d")
+        (minus:DF (match_operand:DF 1 "register_operand" "d")
+                  (match_operand:DF 2 "register_operand" "d")))]
+  "TARGET_MB_64"
+  "drsub\t%0,%2,%1"
+  [(set_attr "type"     "frsub")
+  (set_attr "mode"      "DF")
+  (set_attr "length"    "4")])
+
+(define_insn "muldf3"
+  [(set (match_operand:DF 0 "register_operand" "=d")
+        (mult:DF (match_operand:DF 1 "register_operand" "d")
+                 (match_operand:DF 2 "register_operand" "d")))]
+  "TARGET_MB_64"
+  "dmul\t%0,%1,%2"
+  [(set_attr "type"     "fmul")
+  (set_attr "mode"      "DF")
+  (set_attr "length"    "4")])
+
+(define_insn "divdf3"
+  [(set (match_operand:DF 0 "register_operand" "=d")
+        (div:DF (match_operand:DF 1 "register_operand" "d")
+                (match_operand:DF 2 "register_operand" "d")))]
+  "TARGET_MB_64"
+  "ddiv\t%0,%2,%1"
+  [(set_attr "type"     "fdiv")
+  (set_attr "mode"      "DF")
+  (set_attr "length"    "4")])
+
+
+(define_insn "sqrtdf2"
+  [(set (match_operand:DF 0 "register_operand" "=d")
+        (sqrt:DF (match_operand:DF 1 "register_operand" "d")))]
+  "TARGET_MB_64"
+  "dsqrt\t%0,%1"
+  [(set_attr "type"     "fsqrt")
+  (set_attr "mode"      "DF")
+  (set_attr "length"    "4")])
+
 (define_insn "floatdidf2"
   [(set (match_operand:DF 0 "register_operand" "=d")
         (float:DF (match_operand:DI 1 "register_operand" "d")))]
@@ -536,13 +596,13 @@
   (set_attr "mode"      "DF")
   (set_attr "length"    "4")])
 
-(define_insn "fix_truncsfsi2"
-  [(set (match_operand:SI 0 "register_operand" "=d")
-        (fix:SI (match_operand:SF 1 "register_operand" "d")))]
-  "TARGET_HARD_FLOAT && TARGET_FLOAT_CONVERT"
-  "fint\t%0,%1"
-  [(set_attr "type"     "fint")
-  (set_attr "mode"      "SF")
+(define_insn "floatdfdi2"
+  [(set (match_operand:DI 0 "register_operand" "=d")
+        (float:DI (match_operand:DF 1 "register_operand" "d")))]
+  "TARGET_MB_64"
+  "dlong\t%0,%1"
+  [(set_attr "type"     "fcvt")
+  (set_attr "mode"      "DI")
   (set_attr "length"    "4")])
 
 ;;----------------------------------------------------------------
@@ -660,8 +720,8 @@
   "TARGET_MB_64"
   "@
    rsubl\t%0,%2,%1
-   addik\t%0,%z1,-%2
-   addik\t%0,%z1,-%2"
+   addlik\t%0,%z1,-%2
+   addlik\t%0,%z1,-%2"
   [(set_attr "type"	"arith,no_delay_arith,no_delay_arith")
   (set_attr "mode"	"DI")
   (set_attr "length"	"4,4,4")])
diff --git a/gcc/config/microblaze/t-microblaze b/gcc/config/microblaze/t-microblaze
index 35ab9654052..dfef45c268e 100644
--- a/gcc/config/microblaze/t-microblaze
+++ b/gcc/config/microblaze/t-microblaze
@@ -1,6 +1,13 @@
 MULTILIB_OPTIONS = m64 mxl-barrel-shift mlittle-endian mno-xl-soft-mul mxl-multiply-high
 MULTILIB_DIRNAMES = m64 bs le m mh
 MULTILIB_EXCEPTIONS = *m64/mxl-multiply-high mxl-multiply-high
+MULTILIB_EXCEPTIONS += *m64
+MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift
+MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul
+MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mno-xl-soft-mul
+MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul
+MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mno-xl-soft-mul/mxl-multiply-high
+MULTILIB_EXCEPTIONS += *m64/mno-xl-soft-mul/mxl-multiply-high
 MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high
 MULTILIB_EXCEPTIONS += *mlittle-endian/mxl-multiply-high mxl-multiply-high
 MULTILIB_EXCEPTIONS += *m64/mxl-barrel-shift/mlittle-endian/mxl-multiply-high
-- 
2.17.1