OSDN Git Service

2008-09-03 Hari Sandanagobalane <hariharan@picochip.com>
[pf3gnuchains/gcc-fork.git] / config / picochip / libgccExtras / lshrsi3.asm
1 // picoChip ASM file
2 //
3 //   Support for 32-bit logical shift right.
4 //
5 //   Copyright (C) 2003, 2004, 2005  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 .section .text
33
34 .global ___lshrsi3
35 ___lshrsi3:
36 _picoMark_FUNCTION_BEGIN=
37
38 // picoChip Function Prologue : &___lshrsi3 = 4 bytes
39
40         // if (R2 > 15) goto _L2
41         SUB.0 15,R2,r15
42         JMPLT _L2
43 =->     SUB.0 16,R2,R5 // R5 := R5 - R2 (HI)
44
45         LSR.0 R0,R2,R0 // R4 := R0 >> R2
46         LSR.0 R1,R2,R3 // R3 := R1 >> R2
47         // if (R2 == 0) goto _L4
48         LSL.0 R1,R5,R5 // R5 := R1 << R5
49         OR.0 R5,R0,R4 // R2 := R5 IOR R2 (HI)
50         SUB.0 R2,0,r15
51         COPYNE R4,R0            // R0 := R2
52         JR (R12)        // Return to caller 
53 =->     COPY.0 R3,R1            // R1 := R3
54
55 _L2:
56         LSR.0 R1,R2,R0  // R2 := R1 >> R2
57         JR (R12)        // Return to caller 
58 =->     COPY.0 0,R1     // R3 := 0 (short constant)
59
60 _picoMark_FUNCTION_END=
61 // picoChip Function Epilogue : __lshrsi3
62
63 //============================================================================
64 // All DWARF information between this marker, and the END OF DWARF
65 // marker should be included in the source file. Search for
66 // FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and
67 // provide the relevent information. Add markers called
68 // _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the
69 // function in question.
70 //============================================================================
71
72 //============================================================================
73 // Frame information. 
74 //============================================================================
75
76 .section .debug_frame
77 _picoMark_DebugFrame=
78
79 // Common CIE header.
80 .unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin
81 _picoMark_CieBegin=
82 .unalignedInitLong 0xffffffff
83 .initByte 0x1   // CIE Version
84 .ascii 16#0#    // CIE Augmentation
85 .uleb128 0x1    // CIE Code Alignment Factor
86 .sleb128 2      // CIE Data Alignment Factor
87 .initByte 0xc   // CIE RA Column
88 .initByte 0xc   // DW_CFA_def_cfa
89 .uleb128 0xd
90 .uleb128 0x0
91 .align 2
92 _picoMark_CieEnd=
93
94 // FDE 
95 _picoMark_LSFDE0I900821033007563=
96 .unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin
97 _picoMark_FdeBegin=
98 .unalignedInitLong _picoMark_DebugFrame // FDE CIE offset
99 .unalignedInitWord _picoMark_FUNCTION_BEGIN     // FDE initial location
100 .unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
101 .initByte 0xe   // DW_CFA_def_cfa_offset
102 .uleb128 0x4    // <-- FUNCTION_STACK_SIZE_GOES_HERE
103 .initByte 0x4   // DW_CFA_advance_loc4
104 .unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN
105 .initByte 0xe   // DW_CFA_def_cfa_offset
106 .uleb128 0x0
107 .align 2
108 _picoMark_FdeEnd=
109
110 //============================================================================
111 // Abbrevation information.
112 //============================================================================
113
114 .section .debug_abbrev
115 _picoMark_ABBREVIATIONS=
116
117 .section .debug_abbrev
118         .uleb128 0x1    // (abbrev code)
119         .uleb128 0x11   // (TAG: DW_TAG_compile_unit)
120         .initByte 0x1   // DW_children_yes
121         .uleb128 0x10   // (DW_AT_stmt_list)
122         .uleb128 0x6    // (DW_FORM_data4)
123         .uleb128 0x12   // (DW_AT_high_pc)
124         .uleb128 0x1    // (DW_FORM_addr)
125         .uleb128 0x11   // (DW_AT_low_pc)
126         .uleb128 0x1    // (DW_FORM_addr)
127         .uleb128 0x25   // (DW_AT_producer)
128         .uleb128 0x8    // (DW_FORM_string)
129         .uleb128 0x13   // (DW_AT_language)
130         .uleb128 0x5    // (DW_FORM_data2)
131         .uleb128 0x3    // (DW_AT_name)
132         .uleb128 0x8    // (DW_FORM_string)
133 .initByte 0x0
134 .initByte 0x0
135
136         .uleb128 0x2    ;# (abbrev code)
137         .uleb128 0x2e   ;# (TAG: DW_TAG_subprogram)
138 .initByte 0x0   ;# DW_children_no
139         .uleb128 0x3    ;# (DW_AT_name)
140         .uleb128 0x8    ;# (DW_FORM_string)
141         .uleb128 0x11   ;# (DW_AT_low_pc)
142         .uleb128 0x1    ;# (DW_FORM_addr)
143         .uleb128 0x12   ;# (DW_AT_high_pc)
144         .uleb128 0x1    ;# (DW_FORM_addr)
145 .initByte 0x0
146 .initByte 0x0
147
148 .initByte 0x0
149
150 //============================================================================
151 // Line information. DwarfLib requires this to be present, but it can
152 // be empty.
153 //============================================================================
154
155 .section .debug_line
156 _picoMark_LINES=
157
158 //============================================================================
159 // Debug Information
160 //============================================================================
161 .section .debug_info
162
163 //Fixed header.
164 .unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN
165 _picoMark_DEBUG_INFO_BEGIN=
166 .unalignedInitWord 0x2
167 .unalignedInitLong _picoMark_ABBREVIATIONS
168 .initByte 0x2
169
170 // Compile unit information.
171 .uleb128 0x1    // (DIE 0xb) DW_TAG_compile_unit)
172 .unalignedInitLong _picoMark_LINES
173 .unalignedInitWord _picoMark_FUNCTION_END
174 .unalignedInitWord _picoMark_FUNCTION_BEGIN
175 // Producer is `picoChip'
176 .ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00#
177 .unalignedInitWord 0xcafe // ASM language
178 .ascii 16#0# // Name. DwarfLib expects this to be present.
179
180 .uleb128 0x2    ;# (DIE DW_TAG_subprogram)
181
182 // FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex
183 // digit is specified using the format 16#XX#
184 .ascii 16#5f# 16#5f# 16#6c# 16#73# 16#68# 16#72# 16#72# 16#73# 16#69# 16#33# 16#0# // Function name `__lshrsi3'
185 .unalignedInitWord _picoMark_FUNCTION_BEGIN     // DW_AT_low_pc
186 .unalignedInitWord _picoMark_FUNCTION_END       // DW_AT_high_pc
187
188 .initByte 0x0   // end of compile unit children.
189
190 _picoMark_DEBUG_INFO_END=
191
192 //============================================================================
193 // END OF DWARF
194 //============================================================================
195 .section .endFile