diff options
author | Alejandro Enedino Hernandez Samaniego <alejandr@xilinx.com> | 2018-12-12 09:57:10 -0800 |
---|---|---|
committer | Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> | 2019-06-28 16:32:42 -0700 |
commit | eca44e3e9f65a242c384735946307c663b87804b (patch) | |
tree | 80f27ab934c9b2923d39edd359f3a12d05d2b001 /meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0016-Patch-microblaze-Removed-moddi3-routinue.patch | |
parent | 3b825c1d9667fcfa3d16f513361236b87886033d (diff) | |
download | meta-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>
Diffstat (limited to 'meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0016-Patch-microblaze-Removed-moddi3-routinue.patch')
-rw-r--r-- | meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0016-Patch-microblaze-Removed-moddi3-routinue.patch | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0016-Patch-microblaze-Removed-moddi3-routinue.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0016-Patch-microblaze-Removed-moddi3-routinue.patch new file mode 100644 index 00000000..dbd7b2e2 --- /dev/null +++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-8/0016-Patch-microblaze-Removed-moddi3-routinue.patch | |||
@@ -0,0 +1,157 @@ | |||
1 | From 640628680ff6f028ad6d5fef2e41da29664f036f Mon Sep 17 00:00:00 2001 | ||
2 | From: Mahesh Bodapati <mbodapat@xilinx.com> | ||
3 | Date: Thu, 12 Jan 2017 17:36:16 +0530 | ||
4 | Subject: [PATCH 16/54] [Patch, microblaze]: Removed moddi3 routinue Using the | ||
5 | default moddi3 function as the existing implementation has many bugs | ||
6 | |||
7 | Signed-off-by:Nagaraju <nmekala@xilix.com> | ||
8 | --- | ||
9 | libgcc/config/microblaze/moddi3.S | 121 ---------------------------------- | ||
10 | libgcc/config/microblaze/t-microblaze | 3 +- | ||
11 | 2 files changed, 1 insertion(+), 123 deletions(-) | ||
12 | delete mode 100644 libgcc/config/microblaze/moddi3.S | ||
13 | |||
14 | diff --git a/libgcc/config/microblaze/moddi3.S b/libgcc/config/microblaze/moddi3.S | ||
15 | deleted file mode 100644 | ||
16 | index a8f17d7..0000000 | ||
17 | --- a/libgcc/config/microblaze/moddi3.S | ||
18 | +++ /dev/null | ||
19 | @@ -1,121 +0,0 @@ | ||
20 | -################################### | ||
21 | -# | ||
22 | -# Copyright (C) 2009-2018 Free Software Foundation, Inc. | ||
23 | -# | ||
24 | -# Contributed by Michael Eager <eager@eagercon.com>. | ||
25 | -# | ||
26 | -# This file is free software; you can redistribute it and/or modify it | ||
27 | -# under the terms of the GNU General Public License as published by the | ||
28 | -# Free Software Foundation; either version 3, or (at your option) any | ||
29 | -# later version. | ||
30 | -# | ||
31 | -# GCC is distributed in the hope that it will be useful, but WITHOUT | ||
32 | -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
33 | -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public | ||
34 | -# License for more details. | ||
35 | -# | ||
36 | -# Under Section 7 of GPL version 3, you are granted additional | ||
37 | -# permissions described in the GCC Runtime Library Exception, version | ||
38 | -# 3.1, as published by the Free Software Foundation. | ||
39 | -# | ||
40 | -# You should have received a copy of the GNU General Public License and | ||
41 | -# a copy of the GCC Runtime Library Exception along with this program; | ||
42 | -# see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | ||
43 | -# <http://www.gnu.org/licenses/>. | ||
44 | -# | ||
45 | -# modsi3.S | ||
46 | -# | ||
47 | -# modulo operation for 64 bit integers. | ||
48 | -# | ||
49 | -####################################### | ||
50 | - | ||
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 | - | ||
58 | - .globl __moddi3 | ||
59 | - .ent __moddi3 | ||
60 | -__moddi3: | ||
61 | - .frame r1,0,r15 | ||
62 | - | ||
63 | -#Change the stack pointer value and Save callee saved regs | ||
64 | - addik r1,r1,-24 | ||
65 | - swi r25,r1,0 | ||
66 | - swi r26,r1,4 | ||
67 | - swi r27,r1,8 # used for sign | ||
68 | - swi r28,r1,12 # used for loop count | ||
69 | - swi r29,r1,16 # Used for div value High | ||
70 | - swi r30,r1,20 # Used for div value Low | ||
71 | - | ||
72 | -#Check for Zero Value in the divisor/dividend | ||
73 | - OR r9,r5,r6 # Check for the op1 being zero | ||
74 | - BEQID r9,$LaResult_Is_Zero # Result is zero | ||
75 | - OR r9,r7,r8 # Check for the dividend being zero | ||
76 | - BEQI r9,$LaDiv_By_Zero # Div_by_Zero # Division Error | ||
77 | - BGEId r5,$La1_Pos | ||
78 | - XOR r27,r5,r7 # Get the sign of the result | ||
79 | - RSUBI r6,r6,0 # Make dividend positive | ||
80 | - RSUBIC r5,r5,0 # Make dividend positive | ||
81 | -$La1_Pos: | ||
82 | - BGEI r7,$La2_Pos | ||
83 | - RSUBI r8,r8,0 # Make Divisor Positive | ||
84 | - RSUBIC r9,r9,0 # Make Divisor Positive | ||
85 | -$La2_Pos: | ||
86 | - ADDIK r4,r0,0 # Clear mod low | ||
87 | - ADDIK r3,r0,0 # Clear mod high | ||
88 | - ADDIK r29,r0,0 # clear div high | ||
89 | - ADDIK r30,r0,0 # clear div low | ||
90 | - ADDIK r28,r0,64 # Initialize the loop count | ||
91 | - # First part try to find the first '1' in the r5/r6 | ||
92 | -$LaDIV1: | ||
93 | - ADD r6,r6,r6 | ||
94 | - ADDC r5,r5,r5 # left shift logical r5 | ||
95 | - BGEID r5,$LaDIV1 | ||
96 | - ADDIK r28,r28,-1 | ||
97 | -$LaDIV2: | ||
98 | - ADD r6,r6,r6 | ||
99 | - ADDC r5,r5,r5 # left shift logical r5/r6 get the '1' into the Carry | ||
100 | - ADDC r4,r4,r4 # Move that bit into the Mod register | ||
101 | - ADDC r3,r3,r3 # Move carry into high mod register | ||
102 | - rsub r18,r7,r3 # Compare the High Parts of Mod and Divisor | ||
103 | - bnei r18,$L_High_EQ | ||
104 | - rsub r18,r6,r4 # Compare Low Parts only if Mod[h] == Divisor[h] | ||
105 | -$L_High_EQ: | ||
106 | - rSUB r26,r8,r4 # Subtract divisor[L] from Mod[L] | ||
107 | - rsubc r25,r7,r3 # Subtract divisor[H] from Mod[H] | ||
108 | - BLTi r25,$LaMOD_TOO_SMALL | ||
109 | - OR r3,r0,r25 # move r25 to mod [h] | ||
110 | - OR r4,r0,r26 # move r26 to mod [l] | ||
111 | - ADDI r30,r30,1 | ||
112 | - ADDC r29,r29,r0 | ||
113 | -$LaMOD_TOO_SMALL: | ||
114 | - ADDIK r28,r28,-1 | ||
115 | - BEQi r28,$LaLOOP_END | ||
116 | - ADD r30,r30,r30 # Shift in the '1' into div [low] | ||
117 | - ADDC r29,r29,r29 # Move the carry generated into high | ||
118 | - BRI $LaDIV2 # Div2 | ||
119 | -$LaLOOP_END: | ||
120 | - BGEI r27,$LaRETURN_HERE | ||
121 | - rsubi r30,r30,0 | ||
122 | - rsubc r29,r29,r0 | ||
123 | - BRI $LaRETURN_HERE | ||
124 | -$LaDiv_By_Zero: | ||
125 | -$LaResult_Is_Zero: | ||
126 | - or r29,r0,r0 # set result to 0 [High] | ||
127 | - or r30,r0,r0 # set result to 0 [Low] | ||
128 | -$LaRETURN_HERE: | ||
129 | -# Restore values of CSRs and that of r29 and the divisor and the dividend | ||
130 | - | ||
131 | - lwi r25,r1,0 | ||
132 | - lwi r26,r1,4 | ||
133 | - lwi r27,r1,8 | ||
134 | - lwi r28,r1,12 | ||
135 | - lwi r29,r1,16 | ||
136 | - lwi r30,r1,20 | ||
137 | - rtsd r15,8 | ||
138 | - addik r1,r1,24 | ||
139 | - .end __moddi3 | ||
140 | - | ||
141 | diff --git a/libgcc/config/microblaze/t-microblaze b/libgcc/config/microblaze/t-microblaze | ||
142 | index 96959f0..8d954a4 100644 | ||
143 | --- a/libgcc/config/microblaze/t-microblaze | ||
144 | +++ b/libgcc/config/microblaze/t-microblaze | ||
145 | @@ -1,8 +1,7 @@ | ||
146 | -LIB2FUNCS_EXCLUDE += _divsi3 _modsi3 _moddi3 _mulsi3 _udivsi3 _umodsi3 | ||
147 | +LIB2FUNCS_EXCLUDE += _divsi3 _modsi3 _mulsi3 _udivsi3 _umodsi3 | ||
148 | |||
149 | LIB2ADD += \ | ||
150 | $(srcdir)/config/microblaze/divsi3.S \ | ||
151 | - $(srcdir)/config/microblaze/moddi3.S \ | ||
152 | $(srcdir)/config/microblaze/modsi3.S \ | ||
153 | $(srcdir)/config/microblaze/muldi3_hard.S \ | ||
154 | $(srcdir)/config/microblaze/mulsi3.S \ | ||
155 | -- | ||
156 | 2.7.4 | ||
157 | |||