Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/picochip/libgccExtras/clzsi2.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 | 77e2b8dfacca |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a06113de4d67 |
---|---|
1 // picoChip ASM file | |
2 //.file "clzsi2.asm" | |
3 | |
4 .section .text | |
5 | |
6 .global __clzsi2 | |
7 __clzsi2: | |
8 _picoMark_FUNCTION_BEGIN= | |
9 | |
10 // picoChip Function Prologue : &__clzsi2 = 0 bytes | |
11 | |
12 // What value should be operated on? If the top word is empty | |
13 // then count the bits in the bottom word, and add 16. If the | |
14 // top word is not empty, then count the bits in the top word. | |
15 | |
16 // R4 stores the constant 0 | |
17 | |
18 sub.0 R1,0,r15 \ copy.1 16,r2 | |
19 copyeq r0,r1 | |
20 copyne 0,r2 | |
21 | |
22 // R1 now stores value to count, and R2 stores current bit offset. | |
23 sbc r1,r0 | |
24 asr.0 r1,15,r15 \ add.1 r0,1,r0 | |
25 jr (lr) \ copyne 0,r0 | |
26 =-> add.0 r0,r2,r0 | |
27 | |
28 _picoMark_FUNCTION_END= | |
29 | |
30 // picoChip Function Epilogue : __clzsi2 | |
31 | |
32 //============================================================================ | |
33 // All DWARF information between this marker, and the END OF DWARF | |
34 // marker should be included in the source file. Search for | |
35 // FUNCTION_STACK_SIZE_GOES_HERE and FUNCTION NAME GOES HERE, and | |
36 // provide the relevent information. Add markers called | |
37 // _picoMark_FUNCTION_BEGIN and _picoMark_FUNCTION_END around the | |
38 // function in question. | |
39 //============================================================================ | |
40 | |
41 //============================================================================ | |
42 // Frame information. | |
43 //============================================================================ | |
44 | |
45 .section .debug_frame | |
46 _picoMark_DebugFrame= | |
47 | |
48 // Common CIE header. | |
49 .unalignedInitLong _picoMark_CieEnd-_picoMark_CieBegin | |
50 _picoMark_CieBegin= | |
51 .unalignedInitLong 0xffffffff | |
52 .initByte 0x1 // CIE Version | |
53 .ascii 16#0# // CIE Augmentation | |
54 .uleb128 0x1 // CIE Code Alignment Factor | |
55 .sleb128 2 // CIE Data Alignment Factor | |
56 .initByte 0xc // CIE RA Column | |
57 .initByte 0xc // DW_CFA_def_cfa | |
58 .uleb128 0xd | |
59 .uleb128 0x0 | |
60 .align 2 | |
61 _picoMark_CieEnd= | |
62 | |
63 // FDE | |
64 _picoMark_LSFDE0I900821033007563= | |
65 .unalignedInitLong _picoMark_FdeEnd-_picoMark_FdeBegin | |
66 _picoMark_FdeBegin= | |
67 .unalignedInitLong _picoMark_DebugFrame // FDE CIE offset | |
68 .unalignedInitWord _picoMark_FUNCTION_BEGIN // FDE initial location | |
69 .unalignedInitWord _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN | |
70 .initByte 0xe // DW_CFA_def_cfa_offset | |
71 .uleb128 0x0 // <-- FUNCTION_STACK_SIZE_GOES_HERE | |
72 .initByte 0x4 // DW_CFA_advance_loc4 | |
73 .unalignedInitLong _picoMark_FUNCTION_END-_picoMark_FUNCTION_BEGIN | |
74 .initByte 0xe // DW_CFA_def_cfa_offset | |
75 .uleb128 0x0 | |
76 .align 2 | |
77 _picoMark_FdeEnd= | |
78 | |
79 //============================================================================ | |
80 // Abbrevation information. | |
81 //============================================================================ | |
82 | |
83 .section .debug_abbrev | |
84 _picoMark_ABBREVIATIONS= | |
85 | |
86 .section .debug_abbrev | |
87 .uleb128 0x1 // (abbrev code) | |
88 .uleb128 0x11 // (TAG: DW_TAG_compile_unit) | |
89 .initByte 0x1 // DW_children_yes | |
90 .uleb128 0x10 // (DW_AT_stmt_list) | |
91 .uleb128 0x6 // (DW_FORM_data4) | |
92 .uleb128 0x12 // (DW_AT_high_pc) | |
93 .uleb128 0x1 // (DW_FORM_addr) | |
94 .uleb128 0x11 // (DW_AT_low_pc) | |
95 .uleb128 0x1 // (DW_FORM_addr) | |
96 .uleb128 0x25 // (DW_AT_producer) | |
97 .uleb128 0x8 // (DW_FORM_string) | |
98 .uleb128 0x13 // (DW_AT_language) | |
99 .uleb128 0x5 // (DW_FORM_data2) | |
100 .uleb128 0x3 // (DW_AT_name) | |
101 .uleb128 0x8 // (DW_FORM_string) | |
102 .initByte 0x0 | |
103 .initByte 0x0 | |
104 | |
105 .uleb128 0x2 ;# (abbrev code) | |
106 .uleb128 0x2e ;# (TAG: DW_TAG_subprogram) | |
107 .initByte 0x0 ;# DW_children_no | |
108 .uleb128 0x3 ;# (DW_AT_name) | |
109 .uleb128 0x8 ;# (DW_FORM_string) | |
110 .uleb128 0x11 ;# (DW_AT_low_pc) | |
111 .uleb128 0x1 ;# (DW_FORM_addr) | |
112 .uleb128 0x12 ;# (DW_AT_high_pc) | |
113 .uleb128 0x1 ;# (DW_FORM_addr) | |
114 .initByte 0x0 | |
115 .initByte 0x0 | |
116 | |
117 .initByte 0x0 | |
118 | |
119 //============================================================================ | |
120 // Line information. DwarfLib requires this to be present, but it can | |
121 // be empty. | |
122 //============================================================================ | |
123 | |
124 .section .debug_line | |
125 _picoMark_LINES= | |
126 | |
127 //============================================================================ | |
128 // Debug Information | |
129 //============================================================================ | |
130 .section .debug_info | |
131 | |
132 //Fixed header. | |
133 .unalignedInitLong _picoMark_DEBUG_INFO_END-_picoMark_DEBUG_INFO_BEGIN | |
134 _picoMark_DEBUG_INFO_BEGIN= | |
135 .unalignedInitWord 0x2 | |
136 .unalignedInitLong _picoMark_ABBREVIATIONS | |
137 .initByte 0x2 | |
138 | |
139 // Compile unit information. | |
140 .uleb128 0x1 // (DIE 0xb) DW_TAG_compile_unit) | |
141 .unalignedInitLong _picoMark_LINES | |
142 .unalignedInitWord _picoMark_FUNCTION_END | |
143 .unalignedInitWord _picoMark_FUNCTION_BEGIN | |
144 // Producer is `picoChip' | |
145 .ascii 16#70# 16#69# 16#63# 16#6f# 16#43# 16#68# 16#69# 16#70# 16#00# | |
146 .unalignedInitWord 0xcafe // ASM language | |
147 .ascii 16#0# // Name. DwarfLib expects this to be present. | |
148 | |
149 .uleb128 0x2 ;# (DIE DW_TAG_subprogram) | |
150 | |
151 // FUNCTION NAME GOES HERE. Use `echo name | od -t x1' to get the hex. Each hex | |
152 // digit is specified using the format 16#XX# | |
153 .ascii 16#5F# 16#63# 16#6C# 16#7A# 16#73# 16#69# 16#32# 16#0# // Function name `_clzsi2' | |
154 .unalignedInitWord _picoMark_FUNCTION_BEGIN // DW_AT_low_pc | |
155 .unalignedInitWord _picoMark_FUNCTION_END // DW_AT_high_pc | |
156 | |
157 .initByte 0x0 // end of compile unit children. | |
158 | |
159 _picoMark_DEBUG_INFO_END= | |
160 | |
161 //============================================================================ | |
162 // END OF DWARF | |
163 //============================================================================ | |
164 | |
165 .section .endFile | |
166 // End of picoChip ASM file |