Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/picochip/libgccExtras/cmpsi2.asm @ 0:a06113de4d67
first commit
author | kent <kent@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 17 Jul 2009 14:47:48 +0900 |
parents | |
children | f6334be47118 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a06113de4d67 |
---|---|
1 // picoChip ASM file | |
2 //.file "ucmpsi2.c" | |
3 // | |
4 // Support for 32-bit signed compare. | |
5 // | |
6 // Copyright (C) 2003, 2004, 2005, 2008, 2009 Free Software Foundation, Inc. | |
7 // Contributed by picoChip Designs Ltd. | |
8 // Maintained by Daniel Towner (daniel.towner@picochip.com) | |
9 // | |
10 // This file is free software; you can redistribute it and/or modify it | |
11 // under the terms of the GNU General Public License as published by the | |
12 // Free Software Foundation; either version 3, or (at your option) any | |
13 // later version. | |
14 // | |
15 // This file is distributed in the hope that it will be useful, but | |
16 // WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
18 // General Public License for more details. | |
19 // | |
20 // Under Section 7 of GPL version 3, you are granted additional | |
21 // permissions described in the GCC Runtime Library Exception, version | |
22 // 3.1, as published by the Free Software Foundation. | |
23 // | |
24 // You should have received a copy of the GNU General Public License and | |
25 // a copy of the GCC Runtime Library Exception along with this program; | |
26 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
27 // <http://www.gnu.org/licenses/>. | |
28 | |
29 // Compiled from the following, and then hand optimised. | |
30 // | |
31 // int __cmpsi2 (USItype x, USItype y) | |
32 // { | |
33 // | |
34 // SIunion lx; lx.l = x; | |
35 // SIunion ly; ly.l = y; | |
36 // | |
37 // if (lx.s.high < ly.s.high) | |
38 // return 0; | |
39 // else if (lx.s.high > ly.s.high) | |
40 // return 2; | |
41 // if (lx.s.low < ly.s.low) | |
42 // return 0; | |
43 // else if (lx.s.low > ly.s.low) | |
44 // return 2; | |
45 // return 1; | |
46 // } | |
47 | |
48 .section .text | |
49 | |
50 .align 8 | |
51 .global ___cmpsi2 | |
52 ___cmpsi2: | |
53 _picoMark_FUNCTION_BEGIN= | |
54 | |
55 // picoChip Function Prologue : &___cmpsi2 = 0 bytes | |
56 | |
57 SUB.0 R1,R3,r15 | |
58 | |
59 BLT _L1 | |
60 =-> SUB.0 R3,R1,r15 \ COPY.1 0,R5 | |
61 | |
62 BLT _L1 | |
63 =-> SUB.0 R0,R2,r15 \ COPY.1 2,R5 | |
64 | |
65 BLO _L1 | |
66 =-> SUB.0 R2,R0,r15 \ COPY.1 0,R5 | |
67 | |
68 BLO _L1 | |
69 =-> COPY.0 2,R5 | |
70 | |
71 COPY.0 1,R5 | |
72 _L1: | |
73 JR (R12) | |
74 =-> COPY.0 R5,R0 | |
75 | |
76 _picoMark_FUNCTION_END= | |
77 // picoChip Function Epilogue : __cmpsi2 | |
78 //============================================================================ | |
79 // All DWARF information between this marker, and the END OF DWARF | |
80 // marker should be included in the source file. Search for | |
81 // FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and | |
82 // provide the relevent information. Add markers called | |
83 // _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the | |
84 // function in question. | |
85 //============================================================================ | |
86 | |
87 //============================================================================ | |
88 // Frame information. | |
89 //============================================================================ | |
90 | |
91 .section .debug_frame | |
92 _picoMark_DebugFrame= | |
93 | |
94 // Common CIE header. | |
95 .unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin | |
96 _picoMark_CieBegin= | |
97 .unalignedInitLong 0xffffffff | |
98 .initByte 0x1 // CIE Version | |
99 .ascii 16#0# // CIE Augmentation | |
100 .uleb128 0x1 // CIE Code Alignment Factor | |
101 .sleb128 2 // CIE Data Alignment Factor | |
102 .initByte 0xc // CIE RA Column | |
103 .initByte 0xc // DW_CFA_def_cfa | |
104 .uleb128 0xd | |
105 .uleb128 0x0 | |
106 .align 2 | |
107 _picoMark_CieEnd= | |
108 | |
109 // FDE | |
110 _picoMark_LSFDE0I900821033007563= | |
111 .unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin | |
112 _picoMark_FdeBegin= | |
113 .unalignedInitLong _picoMark_DebugFrame // FDE CIE offset | |
114 .unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location | |
115 .unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN | |
116 .initByte 0xe // DW_CFA_def_cfa_offset | |
117 .uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE | |
118 .initByte 0x4 // DW_CFA_advance_loc4 | |
119 .unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN | |
120 .initByte 0xe // DW_CFA_def_cfa_offset | |
121 .uleb128 0x0 | |
122 .align 2 | |
123 _picoMark_FdeEnd= | |
124 | |
125 //============================================================================ | |
126 // Abbrevation information. | |
127 //============================================================================ | |
128 | |
129 .section .debug_abbrev | |
130 _picoMark_ABBREVIATIONS= | |
131 | |
132 .section .debug_abbrev | |
133 .uleb128 0x1 // (abbrev code) | |
134 .uleb128 0x11 // (TAG: DW_TAG_compile_unit) | |
135 .initByte 0x1 // DW_children_yes | |
136 .uleb128 0x10 // (DW_AT_stmt_list) | |
137 .uleb128 0x6 // (DW_FORM_data4) | |
138 .uleb128 0x12 // (DW_AT_high_pc) | |
139 .uleb128 0x1 // (DW_FORM_addr) | |
140 .uleb128 0x11 // (DW_AT_low_pc) | |
141 .uleb128 0x1 // (DW_FORM_addr) | |
142 .uleb128 0x25 // (DW_AT_producer) | |
143 .uleb128 0x8 // (DW_FORM_string) | |
144 .uleb128 0x13 // (DW_AT_language) | |
145 .uleb128 0x5 // (DW_FORM_data2) | |
146 .uleb128 0x3 // (DW_AT_name) | |
147 .uleb128 0x8 // (DW_FORM_string) | |
148 .initByte 0x0 | |
149 .initByte 0x0 | |
150 | |
151 .uleb128 0x2 ;# (abbrev code) | |
152 .uleb128 0x2e ;# (TAG: DW_TAG_subprogram) | |
153 .initByte 0x0 ;# DW_children_no | |
154 .uleb128 0x3 ;# (DW_AT_name) | |
155 .uleb128 0x8 ;# (DW_FORM_string) | |
156 .uleb128 0x11 ;# (DW_AT_low_pc) | |
157 .uleb128 0x1 ;# (DW_FORM_addr) | |
158 .uleb128 0x12 ;# (DW_AT_high_pc) | |
159 .uleb128 0x1 ;# (DW_FORM_addr) | |
160 .initByte 0x0 | |
161 .initByte 0x0 | |
162 | |
163 .initByte 0x0 | |
164 | |
165 //============================================================================ | |
166 // Line information. DwarfLib requires this to be present, but it can | |
167 // be empty. | |
168 //============================================================================ | |
169 | |
170 .section .debug_line | |
171 _picoMark_LINES= | |
172 | |
173 //============================================================================ | |
174 // Debug Information | |
175 //============================================================================ | |
176 .section .debug_info | |
177 | |
178 //Fixed header. | |
179 .unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN | |
180 _picoMark_DEBUG_INFO_BEGIN= | |
181 .unalignedInitWord 0x2 | |
182 .unalignedInitLong _picoMark_ABBREVIATIONS | |
183 .initByte 0x2 | |
184 | |
185 // Compile unit information. | |
186 .uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit) | |
187 .unalignedInitLong _picoMark_LINES | |
188 .unalignedInitWord _picoMark_FUNCTION_END | |
189 .unalignedInitWord _picoMark_FUNCTION_BEGIN | |
190 // Producer is `picoChip' | |
191 .ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00# | |
192 .unalignedInitWord 0xcafe // ASM language | |
193 .ascii 16#0# // Name. DwarfLib expects this to be present. | |
194 | |
195 .uleb128 0x2 ;# (DIE DW_TAG_subprogram) | |
196 | |
197 // FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex | |
198 // digit is specified using the format 16#XX# | |
199 .ascii 16#5f# 16#5f# 16#63# 16#6d# 16#70# 16#73# 16#69# 16#32# 16#0# // Function name `__cmpsi2' | |
200 .unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc | |
201 .unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc | |
202 | |
203 .initByte 0x0 // end of compile unit children. | |
204 | |
205 _picoMark_DEBUG_INFO_END= | |
206 | |
207 //============================================================================ | |
208 // END OF DWARF | |
209 //============================================================================ | |
210 | |
211 .section .endFile | |
212 // End of picoChip ASM file |