OSDN Git Service

Update Copyright years for files modified in 2008 and/or 2009.
[pf3gnuchains/gcc-fork.git] / gcc / config / picochip / libgccExtras / ashrsi3.asm
1 // picoChip ASM file
2 //
3 //   Support for 32-bit arithmetic shift right.
4 //
5 //   Copyright (C) 2003, 2004, 2005, 2008  Free Software Foundation, Inc.
6 //   Contributed by picoChip Designs Ltd.
7 //   Maintained by Hariharan Sandanagobalane (hariharan@picochip.com)
8 //
9 //   This file is free software; you can redistribute it and/or modify it
10 //   under the terms of the GNU General Public License as published by the
11 //   Free Software Foundation; either version 2, or (at your option) any
12 //   later version.
13 //
14 //   In addition to the permissions in the GNU General Public License, the
15 //   Free Software Foundation gives you unlimited permission to link the
16 //   compiled version of this file into combinations with other programs,
17 //   and to distribute those combinations without any restriction coming
18 //   from the use of this file.  (The General Public License restrictions
19 //   do apply in other respects; for example, they cover modification of
20 //   the file, and distribution when not linked into a combine
21 //   executable.)
22 //
23 //   This file is distributed in the hope that it will be useful, but
24 //   WITHOUT ANY WARRANTY; without even the implied warranty of
25 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26 //   General Public License for more details.
27 //
28 //   You should have received a copy of the GNU General Public License
29 //   along with this program; see the file COPYING.  If not, write to
30 //   the Free Software Foundation, 51 Franklin Street, Fifth Floor,
31 //   Boston, MA 02110-1301, USA.
32
33 .section .text
34
35 .global ___ashrsi3
36 ___ashrsi3:
37 _picoMark_FUNCTION_BEGIN=
38
39 // picoChip Function Prologue : &___ashrsi3 = 0 bytes
40
41         // if (R2 > 15) goto _L2
42         SUB.0 15,R2,r15
43         JMPLT _L2
44 =->     COPY.0 R1,R3
45
46         LSR.0 R1,R2,R1 // R1 := R1 >> R2
47         // if (R2 == 0) goto _L4
48         SUB.0 R2,0,r15
49         JMPEQ _L4
50 =->     LSR.0 R0,R2,R0 // R2 := R0 >> R2
51
52         SUB.0 16,R2,R4 // R4 := R4 - R2 (HI)
53         ASR.0 R3,15,R5  // R5 = R1 >>{arith} 15
54         LSL.0 R5,R4,R5 // R5 := R5 << R4
55         LSL.0 R3,R4,R4 // R4 := R1 << R4
56         OR.0 R5,R1,R1 // R3 := R5 IOR R3 (HI)
57         BRA _L4
58         =->     OR.0 R4,R0,R0 // R2 := R4 IOR R0 (HI)
59 _L2:
60         ASR.0 R1,15,R1  // R4 = R1 >>{arith} 15
61         SUB.0 16,R2,R5  // R5 := R5 - R2 (HI)
62         LSR.0 R3,R2,R0 // R2 := R1 >> R2
63         LSL.0 R1,R5,R5 // R5 := R4 << R5
64         OR.0 R5,R0,R5 // R2 := R5 IOR R2 (HI)
65         SUB.0 R2,16,r15  // R5 := R5 - R2 (HI)
66         COPYNE R5,R0
67 _L4:
68         JR (R12)        // Return to caller 
69
70 _picoMark_FUNCTION_END=
71
72 // picoChip Function Epilogue : __ashrsi3
73 //============================================================================
74 // All DWARF information between this marker, and the END OF DWARF
75 // marker should be included in the source file. Search for
76 // FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
77 // provide the relevent information. Add markers called
78 // _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
79 // function in question.
80 //============================================================================
81
82 //============================================================================
83 // Frame information. 
84 //============================================================================
85
86 .section .debug_frame
87 _picoMark_DebugFrame=
88
89 // Common CIE header.
90 .unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
91 _picoMark_CieBegin=
92 .unalignedInitLong 0xffffffff
93 .initByte 0x1   // CIE Version
94 .ascii 16#0#    // CIE Augmentation
95 .uleb128 0x1    // CIE Code Alignment Factor
96 .sleb128 2      // CIE Data Alignment Factor
97 .initByte 0xc   // CIE RA Column
98 .initByte 0xc   // DW_CFA_def_cfa
99 .uleb128 0xd
100 .uleb128 0x0
101 .align 2
102 _picoMark_CieEnd=
103
104 // FDE 
105 _picoMark_LSFDE0I900821033007563=
106 .unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
107 _picoMark_FdeBegin=
108 .unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
109 .unalignedInitWord _picoMark_FUNCTION_BEGIN     // FDE initial location
110 .unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
111 .initByte 0xe   // DW_CFA_def_cfa_offset
112 .uleb128 0x0    // <-- FUNCTION_STACK_SIZE_GOES_HERE
113 .initByte 0x4   // DW_CFA_advance_loc4
114 .unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
115 .initByte 0xe   // DW_CFA_def_cfa_offset
116 .uleb128 0x0
117 .align 2
118 _picoMark_FdeEnd=
119
120 //============================================================================
121 // Abbrevation information.
122 //============================================================================
123
124 .section .debug_abbrev
125 _picoMark_ABBREVIATIONS=
126
127 .section .debug_abbrev
128         .uleb128 0x1    // (abbrev code)
129         .uleb128 0x11   // (TAG: DW_TAG_compile_unit)
130         .initByte 0x1   // DW_children_yes
131         .uleb128 0x10   // (DW_AT_stmt_list)
132         .uleb128 0x6    // (DW_FORM_data4)
133         .uleb128 0x12   // (DW_AT_high_pc)
134         .uleb128 0x1    // (DW_FORM_addr)
135         .uleb128 0x11   // (DW_AT_low_pc)
136         .uleb128 0x1    // (DW_FORM_addr)
137         .uleb128 0x25   // (DW_AT_producer)
138         .uleb128 0x8    // (DW_FORM_string)
139         .uleb128 0x13   // (DW_AT_language)
140         .uleb128 0x5    // (DW_FORM_data2)
141         .uleb128 0x3    // (DW_AT_name)
142         .uleb128 0x8    // (DW_FORM_string)
143 .initByte 0x0
144 .initByte 0x0
145
146         .uleb128 0x2    ;# (abbrev code)
147         .uleb128 0x2e   ;# (TAG: DW_TAG_subprogram)
148 .initByte 0x0   ;# DW_children_no
149         .uleb128 0x3    ;# (DW_AT_name)
150         .uleb128 0x8    ;# (DW_FORM_string)
151         .uleb128 0x11   ;# (DW_AT_low_pc)
152         .uleb128 0x1    ;# (DW_FORM_addr)
153         .uleb128 0x12   ;# (DW_AT_high_pc)
154         .uleb128 0x1    ;# (DW_FORM_addr)
155 .initByte 0x0
156 .initByte 0x0
157
158 .initByte 0x0
159
160 //============================================================================
161 // Line information. DwarfLib requires this to be present, but it can
162 // be empty.
163 //============================================================================
164
165 .section .debug_line
166 _picoMark_LINES=
167
168 //============================================================================
169 // Debug Information
170 //============================================================================
171 .section .debug_info
172
173 //Fixed header.
174 .unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
175 _picoMark_DEBUG_INFO_BEGIN=
176 .unalignedInitWord 0x2
177 .unalignedInitLong _picoMark_ABBREVIATIONS
178 .initByte 0x2
179
180 // Compile unit information.
181 .uleb128 0x1    // (DIE 0xb) DW_TAG_compile_unit)
182 .unalignedInitLong _picoMark_LINES
183 .unalignedInitWord _picoMark_FUNCTION_END
184 .unalignedInitWord _picoMark_FUNCTION_BEGIN
185 // Producer is `picoChip'
186 .ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
187 .unalignedInitWord 0xcafe // ASM language
188 .ascii 16#0# // Name. DwarfLib expects this to be present.
189
190 .uleb128 0x2    ;# (DIE DW_TAG_subprogram)
191
192 // FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
193 // digit is specified using the format 16#XX#
194 .ascii 16#5f# 16#61# 16#73# 16#68# 16#72# 16#73# 16#69# 16#33# 16#0# // Function name `_ashrsi3'
195 .unalignedInitWord _picoMark_FUNCTION_BEGIN     // DW_AT_low_pc
196 .unalignedInitWord _picoMark_FUNCTION_END       // DW_AT_high_pc
197
198 .initByte 0x0   // end of compile unit children.
199
200 _picoMark_DEBUG_INFO_END=
201
202 //============================================================================
203 // END OF DWARF
204 //============================================================================
205
206 .section .endFile
207 // End of picoChip ASM file