MNRS-BM-BSP/benchmarks/dhrystone/dhrystone.dis

3947 lines
149 KiB
Plaintext
Raw Normal View History

2023-08-20 15:00:51 +02:00
dhrystone: file format elf32-littleriscv
Disassembly of section .init:
00000020 <_start>:
.type _start,@function
_start:
.option push
.option norelax
la gp, __global_pointer$
20: 10000197 auipc gp,0x10000
24: 7f018193 addi gp,gp,2032 # 10000810 <__global_pointer$>
.option pop
la sp, _sp
28: 10004117 auipc sp,0x10004
2c: fd810113 addi sp,sp,-40 # 10004000 <_sp>
/* Load data section */
la a0, _data_lma
30: 00003517 auipc a0,0x3
34: e7450513 addi a0,a0,-396 # 2ea4 <_data_lma>
la a1, _data
38: 10000597 auipc a1,0x10000
3c: fc858593 addi a1,a1,-56 # 10000000 <__DATA_BEGIN__>
la a2, _edata
40: 10000617 auipc a2,0x10000
44: fd460613 addi a2,a2,-44 # 10000014 <Dhrystones_Per_Second>
bgeu a1, a2, 2f
48: 00c5fc63 bgeu a1,a2,60 <_start+0x40>
1:
lw t0, (a0)
4c: 00052283 lw t0,0(a0)
sw t0, (a1)
50: 0055a023 sw t0,0(a1)
addi a0, a0, 4
54: 00450513 addi a0,a0,4
addi a1, a1, 4
58: 00458593 addi a1,a1,4
bltu a1, a2, 1b
5c: fec5e8e3 bltu a1,a2,4c <_start+0x2c>
2:
/* Clear bss section */
la a0, __bss_start
60: 10000517 auipc a0,0x10000
64: fb450513 addi a0,a0,-76 # 10000014 <Dhrystones_Per_Second>
la a1, _end
68: 10002597 auipc a1,0x10002
6c: 7b058593 addi a1,a1,1968 # 10002818 <__BSS_END__>
bgeu a0, a1, 2f
70: 00b57863 bgeu a0,a1,80 <_start+0x60>
1:
sw zero, (a0)
74: 00052023 sw zero,0(a0)
addi a0, a0, 4
78: 00450513 addi a0,a0,4
bltu a0, a1, 1b
7c: feb56ce3 bltu a0,a1,74 <_start+0x54>
fssr x0
1:
#endif
/* argc = argv = 0 */
li a0, 0
80: 00000513 li a0,0
li a1, 0
84: 00000593 li a1,0
call main
88: 008000ef jal ra,90 <main>
tail _exit
8c: 5640106f j 15f0 <__wrap__exit>
Disassembly of section .text:
00000090 <main>:
main ()
/*****/
/* main program, corresponds to procedures */
/* Main and Proc_0 in the Ada version */
{
90: 7135 addi sp,sp,-160
REG int Run_Index;
REG int Number_Of_Runs;
/* Initializations */
Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
92: 03000513 li a0,48
{
96: cf06 sw ra,156(sp)
98: cd22 sw s0,152(sp)
9a: c94a sw s2,144(sp)
9c: c74e sw s3,140(sp)
9e: c552 sw s4,136(sp)
a0: c356 sw s5,132(sp)
a2: c15a sw s6,128(sp)
a4: dede sw s7,124(sp)
a6: dce2 sw s8,120(sp)
a8: dae6 sw s9,116(sp)
aa: d8ea sw s10,112(sp)
ac: d6ee sw s11,108(sp)
ae: cb26 sw s1,148(sp)
Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
b0: 440010ef jal ra,14f0 <__wrap_malloc>
b4: 842a mv s0,a0
b6: 82818793 addi a5,gp,-2008 # 10000038 <Next_Ptr_Glob>
Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
ba: 03000513 li a0,48
Next_Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
be: c380 sw s0,0(a5)
Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
c0: 430010ef jal ra,14f0 <__wrap_malloc>
Ptr_Glob->Ptr_Comp = Next_Ptr_Glob;
Ptr_Glob->Discr = Ident_1;
Ptr_Glob->variant.var_1.Enum_Comp = Ident_3;
Ptr_Glob->variant.var_1.Int_Comp = 40;
strcpy (Ptr_Glob->variant.var_1.Str_Comp,
c4: 00002717 auipc a4,0x2
c8: 50470713 addi a4,a4,1284 # 25c8 <__modsi3+0x30>
"DHRYSTONE PROGRAM, SOME STRING");
strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
cc: 00003917 auipc s2,0x3
d0: a9890913 addi s2,s2,-1384 # 2b64 <__modsi3+0x5cc>
strcpy (Ptr_Glob->variant.var_1.Str_Comp,
d4: 00072283 lw t0,0(a4)
d8: 00472e83 lw t4,4(a4)
dc: 00872e03 lw t3,8(a4)
e0: 00c72303 lw t1,12(a4)
e4: 01072883 lw a7,16(a4)
e8: 01472803 lw a6,20(a4)
ec: 4f0c lw a1,24(a4)
ee: 01c75603 lhu a2,28(a4)
f2: 01e74683 lbu a3,30(a4)
strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
f6: 00092f83 lw t6,0(s2)
fa: 00492f03 lw t5,4(s2)
fe: 00892983 lw s3,8(s2)
Ptr_Glob->variant.var_1.Enum_Comp = Ident_3;
102: 4389 li t2,2
Ptr_Glob->variant.var_1.Int_Comp = 40;
104: 02800a13 li s4,40
Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
108: 82c18a93 addi s5,gp,-2004 # 1000003c <Ptr_Glob>
Ptr_Glob->variant.var_1.Enum_Comp = Ident_3;
10c: 00752423 sw t2,8(a0)
strcpy (Ptr_Glob->variant.var_1.Str_Comp,
110: 00552823 sw t0,16(a0)
114: 01d52a23 sw t4,20(a0)
118: 01c52c23 sw t3,24(a0)
11c: 00652e23 sw t1,28(a0)
120: 03152023 sw a7,32(a0)
124: 03052223 sw a6,36(a0)
128: d50c sw a1,40(a0)
12a: 02c51623 sh a2,44(a0)
12e: 02d50723 sb a3,46(a0)
strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
132: d07e sw t6,32(sp)
134: d27a sw t5,36(sp)
Ptr_Glob->Ptr_Comp = Next_Ptr_Glob;
136: c100 sw s0,0(a0)
Ptr_Glob->Discr = Ident_1;
138: 00052223 sw zero,4(a0)
Ptr_Glob->variant.var_1.Int_Comp = 40;
13c: 01452623 sw s4,12(a0)
Ptr_Glob = (Rec_Pointer) malloc (sizeof (Rec_Type));
140: 00aaa023 sw a0,0(s5)
strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
144: 00c92b03 lw s6,12(s2)
148: 01092b83 lw s7,16(s2)
14c: 01492c03 lw s8,20(s2)
150: 01892c83 lw s9,24(s2)
154: d44e sw s3,40(sp)
156: 01c95d03 lhu s10,28(s2)
15a: 01e94d83 lbu s11,30(s2)
Arr_2_Glob [8][7] = 10;
15e: 10000797 auipc a5,0x10000
162: faa78793 addi a5,a5,-86 # 10000108 <Arr_2_Glob>
166: 4429 li s0,10
168: 6487ae23 sw s0,1628(a5)
/* Was missing in published program. Without this statement, */
/* Arr_2_Glob [8][7] would have an undefined value. */
/* Warning: With 16-Bit processors and Number_Of_Runs > 32000, */
/* overflow may occur for this array element. */
printf ("\n");
16c: 00002517 auipc a0,0x2
170: 6c450513 addi a0,a0,1732 # 2830 <__modsi3+0x298>
strcpy (Str_1_Loc, "DHRYSTONE PROGRAM, 1'ST STRING");
174: d65a sw s6,44(sp)
176: d85e sw s7,48(sp)
178: da62 sw s8,52(sp)
17a: dc66 sw s9,56(sp)
17c: 03a11e23 sh s10,60(sp)
180: 03b10f23 sb s11,62(sp)
printf ("\n");
184: 425010ef jal ra,1da8 <__wrap_printf>
printf ("Dhrystone Benchmark, Version 2.1 (Language: C)\n");
188: 00002517 auipc a0,0x2
18c: 46050513 addi a0,a0,1120 # 25e8 <__modsi3+0x50>
190: 419010ef jal ra,1da8 <__wrap_printf>
printf ("\n");
194: 00002517 auipc a0,0x2
198: 69c50513 addi a0,a0,1692 # 2830 <__modsi3+0x298>
19c: 40d010ef jal ra,1da8 <__wrap_printf>
if (Reg)
1a0: 8181a503 lw a0,-2024(gp) # 10000028 <Reg>
1a4: 5a050963 beqz a0,756 <main+0x6c6>
{
printf ("Program compiled with 'register' attribute\n");
1a8: 00002517 auipc a0,0x2
1ac: 47050513 addi a0,a0,1136 # 2618 <__modsi3+0x80>
1b0: 3f9010ef jal ra,1da8 <__wrap_printf>
printf ("\n");
1b4: 00002517 auipc a0,0x2
1b8: 67c50513 addi a0,a0,1660 # 2830 <__modsi3+0x298>
1bc: 3ed010ef jal ra,1da8 <__wrap_printf>
else
{
printf ("Program compiled without 'register' attribute\n");
printf ("\n");
}
printf ("Please give the number of runs through the benchmark: ");
1c0: 00002517 auipc a0,0x2
1c4: 4b450513 addi a0,a0,1204 # 2674 <__modsi3+0xdc>
1c8: 3e1010ef jal ra,1da8 <__wrap_printf>
{
int n;
scanf ("%d", &n);
1cc: 008c addi a1,sp,64
1ce: 00002517 auipc a0,0x2
1d2: 4de50513 addi a0,a0,1246 # 26ac <__modsi3+0x114>
1d6: 70a000ef jal ra,8e0 <__wrap_scanf>
Number_Of_Runs = n;
1da: 4406 lw s0,64(sp)
}
printf ("\n");
1dc: 00002517 auipc a0,0x2
1e0: 65450513 addi a0,a0,1620 # 2830 <__modsi3+0x298>
Number_Of_Runs = n;
1e4: c622 sw s0,12(sp)
printf ("\n");
1e6: 3c3010ef jal ra,1da8 <__wrap_printf>
printf ("Execution starts, %d runs through Dhrystone\n", Number_Of_Runs);
1ea: 85a2 mv a1,s0
1ec: 00002517 auipc a0,0x2
1f0: 4c450513 addi a0,a0,1220 # 26b0 <__modsi3+0x118>
1f4: 3b5010ef jal ra,1da8 <__wrap_printf>
#ifdef TIMES
times (&time_info);
Begin_Time = (long) time_info.tms_utime;
#endif
#ifdef TIME
Begin_Time = time ( (long *) 0);
1f8: 4501 li a0,0
1fa: 6da000ef jal ra,8d4 <time>
1fe: 81418713 addi a4,gp,-2028 # 10000024 <Begin_Time>
202: c308 sw a0,0(a4)
#endif
for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
204: 58805963 blez s0,796 <main+0x706>
208: 82018e93 addi t4,gp,-2016 # 10000030 <Bool_Glob>
20c: 4905 li s2,1
20e: 00003497 auipc s1,0x3
212: 97648493 addi s1,s1,-1674 # 2b84 <__modsi3+0x5ec>
216: 02010b93 addi s7,sp,32
21a: c476 sw t4,8(sp)
21c: 81c18413 addi s0,gp,-2020 # 1000002c <Ch_2_Glob>
220: 82418a13 addi s4,gp,-2012 # 10000034 <Int_Glob>
Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
/* Int_3_Loc == 7 */
Int_1_Loc += 1;
} /* while */
/* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
Proc_8 (Arr_1_Glob, Arr_2_Glob, Int_1_Loc, Int_3_Loc);
224: 10000d17 auipc s10,0x10000
228: ee4d0d13 addi s10,s10,-284 # 10000108 <Arr_2_Glob>
22c: 83018c93 addi s9,gp,-2000 # 10000040 <Arr_1_Glob>
{
if (Enum_Loc == Func_1 (Ch_Index, 'C'))
/* then, not executed */
{
Proc_6 (Ident_1, &Enum_Loc);
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
230: 00003b17 auipc s6,0x3
234: 974b0b13 addi s6,s6,-1676 # 2ba4 <__modsi3+0x60c>
Proc_5();
238: 029000ef jal ra,a60 <Proc_5>
Proc_4();
23c: 001000ef jal ra,a3c <Proc_4>
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
240: 0004a803 lw a6,0(s1)
244: 0044af83 lw t6,4(s1)
248: 0084ae03 lw t3,8(s1)
24c: 00c4a303 lw t1,12(s1)
250: 0104a883 lw a7,16(s1)
254: 01c4df03 lhu t5,28(s1)
258: 4c94 lw a3,24(s1)
25a: 48d0 lw a2,20(s1)
25c: 01e4c983 lbu s3,30(s1)
Enum_Loc = Ident_2;
260: 4385 li t2,1
Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
262: 008c addi a1,sp,64
264: 855e mv a0,s7
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
266: c0c2 sw a6,64(sp)
268: c2fe sw t6,68(sp)
26a: c4f2 sw t3,72(sp)
26c: c69a sw t1,76(sp)
26e: c8c6 sw a7,80(sp)
270: 05e11e23 sh t5,92(sp)
Enum_Loc = Ident_2;
274: ce1e sw t2,28(sp)
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 2'ND STRING");
276: ccb6 sw a3,88(sp)
278: cab2 sw a2,84(sp)
27a: 05310f23 sb s3,94(sp)
Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
27e: 063000ef jal ra,ae0 <Func_2>
282: 4da2 lw s11,8(sp)
Int_3_Loc = 5 * Int_1_Loc - Int_2_Loc;
284: 479d li a5,7
Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
286: 00153c13 seqz s8,a0
Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
28a: 0830 addi a2,sp,24
28c: 458d li a1,3
28e: 4509 li a0,2
Int_3_Loc = 5 * Int_1_Loc - Int_2_Loc;
290: cc3e sw a5,24(sp)
Bool_Glob = ! Func_2 (Str_1_Loc, Str_2_Loc);
292: 018da023 sw s8,0(s11)
Proc_7 (Int_1_Loc, Int_2_Loc, &Int_3_Loc);
296: 7d8000ef jal ra,a6e <Proc_7>
Proc_8 (Arr_1_Glob, Arr_2_Glob, Int_1_Loc, Int_3_Loc);
29a: 46e2 lw a3,24(sp)
29c: 85ea mv a1,s10
Int_1_Loc += 1;
29e: 470d li a4,3
Proc_8 (Arr_1_Glob, Arr_2_Glob, Int_1_Loc, Int_3_Loc);
2a0: 460d li a2,3
2a2: 8566 mv a0,s9
Int_1_Loc += 1;
2a4: ca3a sw a4,20(sp)
Proc_8 (Arr_1_Glob, Arr_2_Glob, Int_1_Loc, Int_3_Loc);
2a6: 7d0000ef jal ra,a76 <Proc_8>
Proc_1 (Ptr_Glob);
2aa: 000aa503 lw a0,0(s5)
2ae: 686000ef jal ra,934 <Proc_1>
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
2b2: 00044583 lbu a1,0(s0)
2b6: 04000513 li a0,64
2ba: 48b57c63 bgeu a0,a1,752 <main+0x6c2>
2be: 04100c13 li s8,65
Int_2_Loc = 3;
2c2: 498d li s3,3
if (Enum_Loc == Func_1 (Ch_Index, 'C'))
2c4: 8562 mv a0,s8
2c6: 04300593 li a1,67
2ca: 7fe000ef jal ra,ac8 <Func_1>
2ce: 42f2 lw t0,28(sp)
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
2d0: 001c0e93 addi t4,s8,1
if (Enum_Loc == Func_1 (Ch_Index, 'C'))
2d4: 42550363 beq a0,t0,6fa <main+0x66a>
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
2d8: 00044083 lbu ra,0(s0)
2dc: 0ffefc13 zext.b s8,t4
2e0: ff80f2e3 bgeu ra,s8,2c4 <main+0x234>
Int_2_Loc = Run_Index;
Int_Glob = Run_Index;
}
}
/* Int_1_Loc == 3, Int_2_Loc == 3, Int_3_Loc == 7 */
Int_2_Loc = Int_2_Loc * Int_1_Loc;
2e4: 00199713 slli a4,s3,0x1
2e8: 99ba add s3,s3,a4
Int_1_Loc = Int_2_Loc / Int_3_Loc;
2ea: 4de2 lw s11,24(sp)
Int_2_Loc = 7 * (Int_2_Loc - Int_3_Loc) - Int_1_Loc;
/* Int_1_Loc == 1, Int_2_Loc == 13, Int_3_Loc == 7 */
Proc_2 (&Int_1_Loc);
2ec: 0848 addi a0,sp,20
for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
2ee: 0905 addi s2,s2,1
Int_1_Loc = Int_2_Loc / Int_3_Loc;
2f0: 03b9cc33 div s8,s3,s11
2f4: ca62 sw s8,20(sp)
Proc_2 (&Int_1_Loc);
2f6: 2511 jal 8fa <Proc_2>
for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
2f8: 45b2 lw a1,12(sp)
2fa: f325dfe3 bge a1,s2,238 <main+0x1a8>
Int_2_Loc = 7 * (Int_2_Loc - Int_3_Loc) - Int_1_Loc;
2fe: 41b98d33 sub s10,s3,s11
302: 003d1493 slli s1,s10,0x3
306: 41a48cb3 sub s9,s1,s10
30a: 418c84b3 sub s1,s9,s8
#ifdef TIMES
times (&time_info);
End_Time = (long) time_info.tms_utime;
#endif
#ifdef TIME
End_Time = time ( (long *) 0);
30e: 4501 li a0,0
310: 23d1 jal 8d4 <time>
312: 8b2a mv s6,a0
314: 81018993 addi s3,gp,-2032 # 10000020 <End_Time>
#endif
printf ("Execution ends\n");
318: 00002517 auipc a0,0x2
31c: 3c850513 addi a0,a0,968 # 26e0 <__modsi3+0x148>
End_Time = time ( (long *) 0);
320: 0169a023 sw s6,0(s3)
printf ("Execution ends\n");
324: 285010ef jal ra,1da8 <__wrap_printf>
printf ("\n");
328: 00002517 auipc a0,0x2
32c: 50850513 addi a0,a0,1288 # 2830 <__modsi3+0x298>
330: 279010ef jal ra,1da8 <__wrap_printf>
printf ("Final values of the variables used in the benchmark:\n");
334: 00002517 auipc a0,0x2
338: 3bc50513 addi a0,a0,956 # 26f0 <__modsi3+0x158>
33c: 26d010ef jal ra,1da8 <__wrap_printf>
printf ("\n");
340: 00002517 auipc a0,0x2
344: 4f050513 addi a0,a0,1264 # 2830 <__modsi3+0x298>
348: 261010ef jal ra,1da8 <__wrap_printf>
printf ("Int_Glob: %d\n", Int_Glob);
34c: 000a2583 lw a1,0(s4)
350: 00002517 auipc a0,0x2
354: 3d850513 addi a0,a0,984 # 2728 <__modsi3+0x190>
printf (" Int_Comp: %d\n", Ptr_Glob->variant.var_1.Int_Comp);
printf (" should be: %d\n", 17);
printf (" Str_Comp: %s\n", Ptr_Glob->variant.var_1.Str_Comp);
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
printf ("Next_Ptr_Glob->\n");
printf (" Ptr_Comp: %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
358: 82818d93 addi s11,gp,-2008 # 10000038 <Next_Ptr_Glob>
printf ("Int_Glob: %d\n", Int_Glob);
35c: 24d010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 5);
360: 4595 li a1,5
362: 00002517 auipc a0,0x2
366: 3e250513 addi a0,a0,994 # 2744 <__modsi3+0x1ac>
36a: 23f010ef jal ra,1da8 <__wrap_printf>
printf ("Bool_Glob: %d\n", Bool_Glob);
36e: 4a22 lw s4,8(sp)
370: 00002517 auipc a0,0x2
374: 3f050513 addi a0,a0,1008 # 2760 <__modsi3+0x1c8>
378: 000a2583 lw a1,0(s4)
37c: 22d010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 1);
380: 4585 li a1,1
382: 00002517 auipc a0,0x2
386: 3c250513 addi a0,a0,962 # 2744 <__modsi3+0x1ac>
38a: 21f010ef jal ra,1da8 <__wrap_printf>
printf ("Ch_1_Glob: %c\n", Ch_1_Glob);
38e: 81d1c583 lbu a1,-2019(gp) # 1000002d <Ch_1_Glob>
392: 00002517 auipc a0,0x2
396: 3ea50513 addi a0,a0,1002 # 277c <__modsi3+0x1e4>
39a: 20f010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %c\n", 'A');
39e: 04100593 li a1,65
3a2: 00002517 auipc a0,0x2
3a6: 3f650513 addi a0,a0,1014 # 2798 <__modsi3+0x200>
3aa: 1ff010ef jal ra,1da8 <__wrap_printf>
printf ("Ch_2_Glob: %c\n", Ch_2_Glob);
3ae: 00044583 lbu a1,0(s0)
3b2: 00002517 auipc a0,0x2
3b6: 40250513 addi a0,a0,1026 # 27b4 <__modsi3+0x21c>
printf ("Arr_2_Glob[8][7]: %d\n", Arr_2_Glob[8][7]);
3ba: 10000417 auipc s0,0x10000
3be: d4e40413 addi s0,s0,-690 # 10000108 <Arr_2_Glob>
printf ("Ch_2_Glob: %c\n", Ch_2_Glob);
3c2: 1e7010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %c\n", 'B');
3c6: 04200593 li a1,66
3ca: 00002517 auipc a0,0x2
3ce: 3ce50513 addi a0,a0,974 # 2798 <__modsi3+0x200>
3d2: 1d7010ef jal ra,1da8 <__wrap_printf>
printf ("Arr_1_Glob[8]: %d\n", Arr_1_Glob[8]);
3d6: 8501a583 lw a1,-1968(gp) # 10000060 <Arr_1_Glob+0x20>
3da: 00002517 auipc a0,0x2
3de: 3f650513 addi a0,a0,1014 # 27d0 <__modsi3+0x238>
3e2: 1c7010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 7);
3e6: 459d li a1,7
3e8: 00002517 auipc a0,0x2
3ec: 35c50513 addi a0,a0,860 # 2744 <__modsi3+0x1ac>
3f0: 1b9010ef jal ra,1da8 <__wrap_printf>
printf ("Arr_2_Glob[8][7]: %d\n", Arr_2_Glob[8][7]);
3f4: 65c42583 lw a1,1628(s0)
3f8: 00002517 auipc a0,0x2
3fc: 3f450513 addi a0,a0,1012 # 27ec <__modsi3+0x254>
400: 1a9010ef jal ra,1da8 <__wrap_printf>
printf (" should be: Number_Of_Runs + 10\n");
404: 00002517 auipc a0,0x2
408: 40450513 addi a0,a0,1028 # 2808 <__modsi3+0x270>
40c: 19d010ef jal ra,1da8 <__wrap_printf>
printf ("Ptr_Glob->\n");
410: 00002517 auipc a0,0x2
414: 42450513 addi a0,a0,1060 # 2834 <__modsi3+0x29c>
418: 191010ef jal ra,1da8 <__wrap_printf>
printf (" Ptr_Comp: %d\n", (int) Ptr_Glob->Ptr_Comp);
41c: 000aa283 lw t0,0(s5)
420: 00002517 auipc a0,0x2
424: 42050513 addi a0,a0,1056 # 2840 <__modsi3+0x2a8>
428: 0002a583 lw a1,0(t0)
42c: 17d010ef jal ra,1da8 <__wrap_printf>
printf (" should be: (implementation-dependent)\n");
430: 00002517 auipc a0,0x2
434: 42c50513 addi a0,a0,1068 # 285c <__modsi3+0x2c4>
438: 171010ef jal ra,1da8 <__wrap_printf>
printf (" Discr: %d\n", Ptr_Glob->Discr);
43c: 000aae83 lw t4,0(s5)
440: 00002517 auipc a0,0x2
444: 45050513 addi a0,a0,1104 # 2890 <__modsi3+0x2f8>
448: 004ea583 lw a1,4(t4)
44c: 15d010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 0);
450: 4581 li a1,0
452: 00002517 auipc a0,0x2
456: 2f250513 addi a0,a0,754 # 2744 <__modsi3+0x1ac>
45a: 14f010ef jal ra,1da8 <__wrap_printf>
printf (" Enum_Comp: %d\n", Ptr_Glob->variant.var_1.Enum_Comp);
45e: 000aa803 lw a6,0(s5)
462: 00002517 auipc a0,0x2
466: 44a50513 addi a0,a0,1098 # 28ac <__modsi3+0x314>
46a: 00882583 lw a1,8(a6)
46e: 13b010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 2);
472: 4589 li a1,2
474: 00002517 auipc a0,0x2
478: 2d050513 addi a0,a0,720 # 2744 <__modsi3+0x1ac>
47c: 12d010ef jal ra,1da8 <__wrap_printf>
printf (" Int_Comp: %d\n", Ptr_Glob->variant.var_1.Int_Comp);
480: 000aaf83 lw t6,0(s5)
484: 00002517 auipc a0,0x2
488: 44450513 addi a0,a0,1092 # 28c8 <__modsi3+0x330>
48c: 00cfa583 lw a1,12(t6)
490: 119010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 17);
494: 45c5 li a1,17
496: 00002517 auipc a0,0x2
49a: 2ae50513 addi a0,a0,686 # 2744 <__modsi3+0x1ac>
49e: 10b010ef jal ra,1da8 <__wrap_printf>
printf (" Str_Comp: %s\n", Ptr_Glob->variant.var_1.Str_Comp);
4a2: 000aaa83 lw s5,0(s5)
4a6: 00002517 auipc a0,0x2
4aa: 43e50513 addi a0,a0,1086 # 28e4 <__modsi3+0x34c>
4ae: 010a8593 addi a1,s5,16
4b2: 0f7010ef jal ra,1da8 <__wrap_printf>
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
4b6: 00002517 auipc a0,0x2
4ba: 44a50513 addi a0,a0,1098 # 2900 <__modsi3+0x368>
4be: 0eb010ef jal ra,1da8 <__wrap_printf>
printf ("Next_Ptr_Glob->\n");
4c2: 00002517 auipc a0,0x2
4c6: 47650513 addi a0,a0,1142 # 2938 <__modsi3+0x3a0>
4ca: 0df010ef jal ra,1da8 <__wrap_printf>
printf (" Ptr_Comp: %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
4ce: 000dae03 lw t3,0(s11)
4d2: 00002517 auipc a0,0x2
4d6: 36e50513 addi a0,a0,878 # 2840 <__modsi3+0x2a8>
4da: 000e2583 lw a1,0(t3)
4de: 0cb010ef jal ra,1da8 <__wrap_printf>
printf (" should be: (implementation-dependent), same as above\n");
4e2: 00002517 auipc a0,0x2
4e6: 46a50513 addi a0,a0,1130 # 294c <__modsi3+0x3b4>
4ea: 0bf010ef jal ra,1da8 <__wrap_printf>
printf (" Discr: %d\n", Next_Ptr_Glob->Discr);
4ee: 000da303 lw t1,0(s11)
4f2: 00002517 auipc a0,0x2
4f6: 39e50513 addi a0,a0,926 # 2890 <__modsi3+0x2f8>
4fa: 00432583 lw a1,4(t1)
4fe: 0ab010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 0);
502: 4581 li a1,0
504: 00002517 auipc a0,0x2
508: 24050513 addi a0,a0,576 # 2744 <__modsi3+0x1ac>
50c: 09d010ef jal ra,1da8 <__wrap_printf>
printf (" Enum_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Enum_Comp);
510: 000da883 lw a7,0(s11)
514: 00002517 auipc a0,0x2
518: 39850513 addi a0,a0,920 # 28ac <__modsi3+0x314>
51c: 0088a583 lw a1,8(a7)
520: 089010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 1);
524: 4585 li a1,1
526: 00002517 auipc a0,0x2
52a: 21e50513 addi a0,a0,542 # 2744 <__modsi3+0x1ac>
52e: 07b010ef jal ra,1da8 <__wrap_printf>
printf (" Int_Comp: %d\n", Next_Ptr_Glob->variant.var_1.Int_Comp);
532: 000daf03 lw t5,0(s11)
536: 00002517 auipc a0,0x2
53a: 39250513 addi a0,a0,914 # 28c8 <__modsi3+0x330>
53e: 00cf2583 lw a1,12(t5)
542: 067010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 18);
546: 45c9 li a1,18
548: 00002517 auipc a0,0x2
54c: 1fc50513 addi a0,a0,508 # 2744 <__modsi3+0x1ac>
550: 059010ef jal ra,1da8 <__wrap_printf>
printf (" Str_Comp: %s\n",
Next_Ptr_Glob->variant.var_1.Str_Comp);
554: 000da383 lw t2,0(s11)
printf (" Str_Comp: %s\n",
558: 00002517 auipc a0,0x2
55c: 38c50513 addi a0,a0,908 # 28e4 <__modsi3+0x34c>
560: 01038593 addi a1,t2,16
564: 045010ef jal ra,1da8 <__wrap_printf>
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
568: 00002517 auipc a0,0x2
56c: 39850513 addi a0,a0,920 # 2900 <__modsi3+0x368>
570: 039010ef jal ra,1da8 <__wrap_printf>
printf ("Int_1_Loc: %d\n", Int_1_Loc);
574: 45d2 lw a1,20(sp)
576: 00002517 auipc a0,0x2
57a: 41650513 addi a0,a0,1046 # 298c <__modsi3+0x3f4>
57e: 02b010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 5);
582: 4595 li a1,5
584: 00002517 auipc a0,0x2
588: 1c050513 addi a0,a0,448 # 2744 <__modsi3+0x1ac>
58c: 01d010ef jal ra,1da8 <__wrap_printf>
printf ("Int_2_Loc: %d\n", Int_2_Loc);
590: 85a6 mv a1,s1
592: 00002517 auipc a0,0x2
596: 41650513 addi a0,a0,1046 # 29a8 <__modsi3+0x410>
59a: 00f010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 13);
59e: 45b5 li a1,13
5a0: 00002517 auipc a0,0x2
5a4: 1a450513 addi a0,a0,420 # 2744 <__modsi3+0x1ac>
5a8: 001010ef jal ra,1da8 <__wrap_printf>
printf ("Int_3_Loc: %d\n", Int_3_Loc);
5ac: 45e2 lw a1,24(sp)
5ae: 00002517 auipc a0,0x2
5b2: 41650513 addi a0,a0,1046 # 29c4 <__modsi3+0x42c>
5b6: 7f2010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 7);
5ba: 459d li a1,7
5bc: 00002517 auipc a0,0x2
5c0: 18850513 addi a0,a0,392 # 2744 <__modsi3+0x1ac>
5c4: 7e4010ef jal ra,1da8 <__wrap_printf>
printf ("Enum_Loc: %d\n", Enum_Loc);
5c8: 45f2 lw a1,28(sp)
5ca: 00002517 auipc a0,0x2
5ce: 41650513 addi a0,a0,1046 # 29e0 <__modsi3+0x448>
5d2: 7d6010ef jal ra,1da8 <__wrap_printf>
printf (" should be: %d\n", 1);
5d6: 4585 li a1,1
5d8: 00002517 auipc a0,0x2
5dc: 16c50513 addi a0,a0,364 # 2744 <__modsi3+0x1ac>
5e0: 7c8010ef jal ra,1da8 <__wrap_printf>
printf ("Str_1_Loc: %s\n", Str_1_Loc);
5e4: 85de mv a1,s7
5e6: 00002517 auipc a0,0x2
5ea: 41650513 addi a0,a0,1046 # 29fc <__modsi3+0x464>
5ee: 7ba010ef jal ra,1da8 <__wrap_printf>
printf (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
5f2: 00002517 auipc a0,0x2
5f6: 42650513 addi a0,a0,1062 # 2a18 <__modsi3+0x480>
5fa: 7ae010ef jal ra,1da8 <__wrap_printf>
printf ("Str_2_Loc: %s\n", Str_2_Loc);
5fe: 008c addi a1,sp,64
600: 00002517 auipc a0,0x2
604: 45050513 addi a0,a0,1104 # 2a50 <__modsi3+0x4b8>
608: 7a0010ef jal ra,1da8 <__wrap_printf>
printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
60c: 00002517 auipc a0,0x2
610: 46050513 addi a0,a0,1120 # 2a6c <__modsi3+0x4d4>
614: 794010ef jal ra,1da8 <__wrap_printf>
printf ("\n");
618: 00002517 auipc a0,0x2
61c: 21850513 addi a0,a0,536 # 2830 <__modsi3+0x298>
620: 788010ef jal ra,1da8 <__wrap_printf>
User_Time = End_Time - Begin_Time;
624: 81418513 addi a0,gp,-2028 # 10000024 <Begin_Time>
628: 0009ab83 lw s7,0(s3)
62c: 4114 lw a3,0(a0)
if (User_Time < Too_Small_Time)
62e: 4605 li a2,1
User_Time = End_Time - Begin_Time;
630: 40db8533 sub a0,s7,a3
634: 80a1a623 sw a0,-2036(gp) # 1000001c <User_Time>
if (User_Time < Too_Small_Time)
638: 12a65c63 bge a2,a0,770 <main+0x6e0>
printf ("\n");
}
else
{
#ifdef TIME
Microseconds = ((float) User_Time/(float)HZ) * Mic_secs_Per_Second
63c: 479000ef jal ra,12b4 <__floatsisf>
640: 10000597 auipc a1,0x10000
644: 9c85a583 lw a1,-1592(a1) # 10000008 <__DATA_BEGIN__+0x8>
648: 125000ef jal ra,f6c <__mulsf3>
64c: 892a mv s2,a0
/ (float) Number_Of_Runs;
64e: 4532 lw a0,12(sp)
Microseconds = ((float) User_Time/(float)HZ) * Mic_secs_Per_Second
650: 10000d17 auipc s10,0x10000
654: 9c8d0d13 addi s10,s10,-1592 # 10000018 <Microseconds>
Dhrystones_Per_Second = (float) Number_Of_Runs / ((float) User_Time/(float)HZ);
658: 10000497 auipc s1,0x10000
65c: 9bc48493 addi s1,s1,-1604 # 10000014 <Dhrystones_Per_Second>
/ (float) Number_Of_Runs;
660: 455000ef jal ra,12b4 <__floatsisf>
664: 8c2a mv s8,a0
Microseconds = ((float) User_Time/(float)HZ) * Mic_secs_Per_Second
666: 10000597 auipc a1,0x10000
66a: 9a65a583 lw a1,-1626(a1) # 1000000c <__DATA_BEGIN__+0xc>
66e: 854a mv a0,s2
670: 0fd000ef jal ra,f6c <__mulsf3>
/ (float) Number_Of_Runs;
674: 85e2 mv a1,s8
676: 23c9 jal c38 <__divsf3>
678: 87aa mv a5,a0
Microseconds = ((float) User_Time/(float)HZ) * Mic_secs_Per_Second
67a: 00fd2023 sw a5,0(s10)
Dhrystones_Per_Second = (float) Number_Of_Runs / ((float) User_Time/(float)HZ);
67e: 85ca mv a1,s2
680: 8562 mv a0,s8
682: 2b5d jal c38 <__divsf3>
684: 872a mv a4,a0
Microseconds = (float) User_Time * Mic_secs_Per_Second
/ ((float) HZ * ((float) Number_Of_Runs));
Dhrystones_Per_Second = ((float) HZ * (float) Number_Of_Runs)
/ (float) User_Time;
#endif
printf ("Microseconds for one run through Dhrystone: ");
686: 00002517 auipc a0,0x2
68a: 47650513 addi a0,a0,1142 # 2afc <__modsi3+0x564>
Dhrystones_Per_Second = (float) Number_Of_Runs / ((float) User_Time/(float)HZ);
68e: c098 sw a4,0(s1)
printf ("Microseconds for one run through Dhrystone: ");
690: 718010ef jal ra,1da8 <__wrap_printf>
printf ("%6.1f \n", Microseconds);
694: 000d2503 lw a0,0(s10)
698: 531000ef jal ra,13c8 <__extendsfdf2>
69c: 862a mv a2,a0
69e: 86ae mv a3,a1
6a0: 00002517 auipc a0,0x2
6a4: 48c50513 addi a0,a0,1164 # 2b2c <__modsi3+0x594>
6a8: 700010ef jal ra,1da8 <__wrap_printf>
printf ("Dhrystones per Second: ");
6ac: 00002517 auipc a0,0x2
6b0: 48850513 addi a0,a0,1160 # 2b34 <__modsi3+0x59c>
6b4: 6f4010ef jal ra,1da8 <__wrap_printf>
printf ("%6.1f \n", Dhrystones_Per_Second);
6b8: 4088 lw a0,0(s1)
6ba: 50f000ef jal ra,13c8 <__extendsfdf2>
6be: 862a mv a2,a0
6c0: 86ae mv a3,a1
6c2: 00002517 auipc a0,0x2
6c6: 46a50513 addi a0,a0,1130 # 2b2c <__modsi3+0x594>
6ca: 6de010ef jal ra,1da8 <__wrap_printf>
printf ("\n");
6ce: 00002517 auipc a0,0x2
6d2: 16250513 addi a0,a0,354 # 2830 <__modsi3+0x298>
6d6: 6d2010ef jal ra,1da8 <__wrap_printf>
}
}
6da: 40fa lw ra,156(sp)
6dc: 446a lw s0,152(sp)
6de: 44da lw s1,148(sp)
6e0: 494a lw s2,144(sp)
6e2: 49ba lw s3,140(sp)
6e4: 4a2a lw s4,136(sp)
6e6: 4a9a lw s5,132(sp)
6e8: 4b0a lw s6,128(sp)
6ea: 5bf6 lw s7,124(sp)
6ec: 5c66 lw s8,120(sp)
6ee: 5cd6 lw s9,116(sp)
6f0: 5d46 lw s10,112(sp)
6f2: 5db6 lw s11,108(sp)
6f4: 4501 li a0,0
6f6: 610d addi sp,sp,160
6f8: 8082 ret
Proc_6 (Ident_1, &Enum_Loc);
6fa: 086c addi a1,sp,28
6fc: 4501 li a0,0
6fe: 2115 jal b22 <Proc_6>
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
700: 000b2803 lw a6,0(s6)
704: 004b2f83 lw t6,4(s6)
708: 008b2e03 lw t3,8(s6)
70c: 00cb2303 lw t1,12(s6)
710: 010b2883 lw a7,16(s6)
714: 014b2f03 lw t5,20(s6)
718: 018b2383 lw t2,24(s6)
71c: 01cb5683 lhu a3,28(s6)
720: 01eb4d83 lbu s11,30(s6)
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
724: 00044603 lbu a2,0(s0)
728: 001c0793 addi a5,s8,1
strcpy (Str_2_Loc, "DHRYSTONE PROGRAM, 3'RD STRING");
72c: c0c2 sw a6,64(sp)
72e: c2fe sw t6,68(sp)
730: c4f2 sw t3,72(sp)
732: c69a sw t1,76(sp)
734: c8c6 sw a7,80(sp)
736: cafa sw t5,84(sp)
738: cc9e sw t2,88(sp)
73a: 04d11e23 sh a3,92(sp)
73e: 05b10f23 sb s11,94(sp)
Int_Glob = Run_Index;
742: 012a2023 sw s2,0(s4)
for (Ch_Index = 'A'; Ch_Index <= Ch_2_Glob; ++Ch_Index)
746: 0ff7fc13 zext.b s8,a5
74a: 89ca mv s3,s2
74c: b7867ce3 bgeu a2,s8,2c4 <main+0x234>
750: be51 j 2e4 <main+0x254>
752: 49a5 li s3,9
754: be59 j 2ea <main+0x25a>
printf ("Program compiled without 'register' attribute\n");
756: 00002517 auipc a0,0x2
75a: eee50513 addi a0,a0,-274 # 2644 <__modsi3+0xac>
75e: 64a010ef jal ra,1da8 <__wrap_printf>
printf ("\n");
762: 00002517 auipc a0,0x2
766: 0ce50513 addi a0,a0,206 # 2830 <__modsi3+0x298>
76a: 63e010ef jal ra,1da8 <__wrap_printf>
76e: bc89 j 1c0 <main+0x130>
printf ("Measured time too small to obtain meaningful results\n");
770: 00002517 auipc a0,0x2
774: 33450513 addi a0,a0,820 # 2aa4 <__modsi3+0x50c>
778: 630010ef jal ra,1da8 <__wrap_printf>
printf ("Please increase number of runs\n");
77c: 00002517 auipc a0,0x2
780: 36050513 addi a0,a0,864 # 2adc <__modsi3+0x544>
784: 624010ef jal ra,1da8 <__wrap_printf>
printf ("\n");
788: 00002517 auipc a0,0x2
78c: 0a850513 addi a0,a0,168 # 2830 <__modsi3+0x298>
790: 618010ef jal ra,1da8 <__wrap_printf>
794: b799 j 6da <main+0x64a>
796: 82018093 addi ra,gp,-2016 # 10000030 <Bool_Glob>
79a: 02010b93 addi s7,sp,32
79e: c406 sw ra,8(sp)
7a0: 81c18413 addi s0,gp,-2020 # 1000002c <Ch_2_Glob>
7a4: 82418a13 addi s4,gp,-2012 # 10000034 <Int_Glob>
7a8: b69d j 30e <main+0x27e>
...
000007ac <trap_entry>:
.section .text.entry
.align 2
.global trap_entry
trap_entry:
addi sp, sp, -32*REGBYTES
7ac: f8010113 addi sp,sp,-128
STORE x1, 1*REGBYTES(sp)
7b0: 00112223 sw ra,4(sp)
STORE x2, 2*REGBYTES(sp)
7b4: 00212423 sw sp,8(sp)
STORE x3, 3*REGBYTES(sp)
7b8: 00312623 sw gp,12(sp)
STORE x4, 4*REGBYTES(sp)
7bc: 00412823 sw tp,16(sp)
STORE x5, 5*REGBYTES(sp)
7c0: 00512a23 sw t0,20(sp)
STORE x6, 6*REGBYTES(sp)
7c4: 00612c23 sw t1,24(sp)
STORE x7, 7*REGBYTES(sp)
7c8: 00712e23 sw t2,28(sp)
STORE x8, 8*REGBYTES(sp)
7cc: 02812023 sw s0,32(sp)
STORE x9, 9*REGBYTES(sp)
7d0: 02912223 sw s1,36(sp)
STORE x10, 10*REGBYTES(sp)
7d4: 02a12423 sw a0,40(sp)
STORE x11, 11*REGBYTES(sp)
7d8: 02b12623 sw a1,44(sp)
STORE x12, 12*REGBYTES(sp)
7dc: 02c12823 sw a2,48(sp)
STORE x13, 13*REGBYTES(sp)
7e0: 02d12a23 sw a3,52(sp)
STORE x14, 14*REGBYTES(sp)
7e4: 02e12c23 sw a4,56(sp)
STORE x15, 15*REGBYTES(sp)
7e8: 02f12e23 sw a5,60(sp)
#ifndef __riscv_abi_rve
STORE x16, 16*REGBYTES(sp)
7ec: 05012023 sw a6,64(sp)
STORE x17, 17*REGBYTES(sp)
7f0: 05112223 sw a7,68(sp)
STORE x18, 18*REGBYTES(sp)
7f4: 05212423 sw s2,72(sp)
STORE x19, 19*REGBYTES(sp)
7f8: 05312623 sw s3,76(sp)
STORE x20, 20*REGBYTES(sp)
7fc: 05412823 sw s4,80(sp)
STORE x21, 21*REGBYTES(sp)
800: 05512a23 sw s5,84(sp)
STORE x22, 22*REGBYTES(sp)
804: 05612c23 sw s6,88(sp)
STORE x23, 23*REGBYTES(sp)
808: 05712e23 sw s7,92(sp)
STORE x24, 24*REGBYTES(sp)
80c: 07812023 sw s8,96(sp)
STORE x25, 25*REGBYTES(sp)
810: 07912223 sw s9,100(sp)
STORE x26, 26*REGBYTES(sp)
814: 07a12423 sw s10,104(sp)
STORE x27, 27*REGBYTES(sp)
818: 07b12623 sw s11,108(sp)
STORE x28, 28*REGBYTES(sp)
81c: 07c12823 sw t3,112(sp)
STORE x29, 29*REGBYTES(sp)
820: 07d12a23 sw t4,116(sp)
STORE x30, 30*REGBYTES(sp)
824: 07e12c23 sw t5,120(sp)
STORE x31, 31*REGBYTES(sp)
828: 07f12e23 sw t6,124(sp)
#endif
csrr a0, mcause
82c: 34202573 csrr a0,mcause
csrr a1, mepc
830: 341025f3 csrr a1,mepc
mv a2, sp
834: 00010613 mv a2,sp
call handle_trap
838: 384000ef jal ra,bbc <handle_trap>
csrw mepc, a0
83c: 34151073 csrw mepc,a0
# Remain in M-mode after mret
li t0, MSTATUS_MPP
840: 000022b7 lui t0,0x2
844: 80028293 addi t0,t0,-2048 # 1800 <vprintfmt+0x44>
csrs mstatus, t0
848: 3002a073 csrs mstatus,t0
LOAD x1, 1*REGBYTES(sp)
84c: 00412083 lw ra,4(sp)
LOAD x2, 2*REGBYTES(sp)
850: 00812103 lw sp,8(sp)
LOAD x3, 3*REGBYTES(sp)
854: 00c12183 lw gp,12(sp)
LOAD x4, 4*REGBYTES(sp)
858: 01012203 lw tp,16(sp)
LOAD x5, 5*REGBYTES(sp)
85c: 01412283 lw t0,20(sp)
LOAD x6, 6*REGBYTES(sp)
860: 01812303 lw t1,24(sp)
LOAD x7, 7*REGBYTES(sp)
864: 01c12383 lw t2,28(sp)
LOAD x8, 8*REGBYTES(sp)
868: 02012403 lw s0,32(sp)
LOAD x9, 9*REGBYTES(sp)
86c: 02412483 lw s1,36(sp)
LOAD x10, 10*REGBYTES(sp)
870: 02812503 lw a0,40(sp)
LOAD x11, 11*REGBYTES(sp)
874: 02c12583 lw a1,44(sp)
LOAD x12, 12*REGBYTES(sp)
878: 03012603 lw a2,48(sp)
LOAD x13, 13*REGBYTES(sp)
87c: 03412683 lw a3,52(sp)
LOAD x14, 14*REGBYTES(sp)
880: 03812703 lw a4,56(sp)
LOAD x15, 15*REGBYTES(sp)
884: 03c12783 lw a5,60(sp)
#ifndef __riscv_abi_rve
LOAD x16, 16*REGBYTES(sp)
888: 04012803 lw a6,64(sp)
LOAD x17, 17*REGBYTES(sp)
88c: 04412883 lw a7,68(sp)
LOAD x18, 18*REGBYTES(sp)
890: 04812903 lw s2,72(sp)
LOAD x19, 19*REGBYTES(sp)
894: 04c12983 lw s3,76(sp)
LOAD x20, 20*REGBYTES(sp)
898: 05012a03 lw s4,80(sp)
LOAD x21, 21*REGBYTES(sp)
89c: 05412a83 lw s5,84(sp)
LOAD x22, 22*REGBYTES(sp)
8a0: 05812b03 lw s6,88(sp)
LOAD x23, 23*REGBYTES(sp)
8a4: 05c12b83 lw s7,92(sp)
LOAD x24, 24*REGBYTES(sp)
8a8: 06012c03 lw s8,96(sp)
LOAD x25, 25*REGBYTES(sp)
8ac: 06412c83 lw s9,100(sp)
LOAD x26, 26*REGBYTES(sp)
8b0: 06812d03 lw s10,104(sp)
LOAD x27, 27*REGBYTES(sp)
8b4: 06c12d83 lw s11,108(sp)
LOAD x28, 28*REGBYTES(sp)
8b8: 07012e03 lw t3,112(sp)
LOAD x29, 29*REGBYTES(sp)
8bc: 07412e83 lw t4,116(sp)
LOAD x30, 30*REGBYTES(sp)
8c0: 07812f03 lw t5,120(sp)
LOAD x31, 31*REGBYTES(sp)
8c4: 07c12f83 lw t6,124(sp)
#endif
addi sp, sp, 32*REGBYTES
8c8: 08010113 addi sp,sp,128
mret
8cc: 30200073 mret
.weak handle_trap
handle_trap:
1:
j 1b
8d0: 0000006f j 8d0 <__stack_size+0xd0>
000008d4 <time>:
/* The functions in this file are only meant to support Dhrystone on an
* embedded RV32 system and are obviously incorrect in general. */
long time(void)
{
8d4: 1141 addi sp,sp,-16
8d6: c606 sw ra,12(sp)
return get_timer_value();
8d8: 2c65 jal b90 <get_timer_value>
}
8da: 40b2 lw ra,12(sp)
8dc: 0141 addi sp,sp,16
8de: 8082 ret
000008e0 <__wrap_scanf>:
// set the number of dhrystone iterations
void __wrap_scanf(const char* fmt, int* n)
{
*n = 200000;
8e0: 000317b7 lui a5,0x31
8e4: d4078293 addi t0,a5,-704 # 30d40 <_data_lma+0x2de9c>
8e8: 0055a023 sw t0,0(a1)
}
8ec: 8082 ret
000008ee <__wrap_exit>:
extern volatile uint32_t tohost;
void __wrap_exit(int n){
tohost = 0x1;
8ee: 4785 li a5,1
8f0: fffff717 auipc a4,0xfffff
8f4: 70f72023 sw a5,1792(a4) # fffffff0 <tohost+0x0>
for (;;);
8f8: a001 j 8f8 <__wrap_exit+0xa>
000008fa <Proc_2>:
One_Fifty Int_Loc;
Enumeration Enum_Loc;
Int_Loc = *Int_Par_Ref + 10;
do /* executed once */
if (Ch_1_Glob == 'A')
8fa: 81d1c703 lbu a4,-2019(gp) # 1000002d <Ch_1_Glob>
8fe: 04100793 li a5,65
902: 00f70363 beq a4,a5,908 <Proc_2+0xe>
Int_Loc -= 1;
*Int_Par_Ref = Int_Loc - Int_Glob;
Enum_Loc = Ident_1;
} /* if */
while (Enum_Loc != Ident_1); /* true */
} /* Proc_2 */
906: 8082 ret
Int_Loc -= 1;
908: 00052283 lw t0,0(a0)
*Int_Par_Ref = Int_Loc - Int_Glob;
90c: 8241a383 lw t2,-2012(gp) # 10000034 <Int_Glob>
Int_Loc -= 1;
910: 00928313 addi t1,t0,9
*Int_Par_Ref = Int_Loc - Int_Glob;
914: 407305b3 sub a1,t1,t2
918: c10c sw a1,0(a0)
} /* Proc_2 */
91a: 8082 ret
0000091c <Proc_3>:
/* Ptr_Ref_Par becomes Ptr_Glob */
Rec_Pointer *Ptr_Ref_Par;
{
if (Ptr_Glob != Null)
91c: 82c18793 addi a5,gp,-2004 # 1000003c <Ptr_Glob>
920: 4390 lw a2,0(a5)
922: c601 beqz a2,92a <Proc_3+0xe>
/* then, executed */
*Ptr_Ref_Par = Ptr_Glob->Ptr_Comp;
924: 4218 lw a4,0(a2)
926: c118 sw a4,0(a0)
Proc_7 (10, Int_Glob, &Ptr_Glob->variant.var_1.Int_Comp);
928: 4390 lw a2,0(a5)
92a: 0631 addi a2,a2,12
92c: 8241a583 lw a1,-2012(gp) # 10000034 <Int_Glob>
930: 4529 li a0,10
932: aa35 j a6e <Proc_7>
00000934 <Proc_1>:
{
934: 1141 addi sp,sp,-16
936: c04a sw s2,0(sp)
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
938: 82c18913 addi s2,gp,-2004 # 1000003c <Ptr_Glob>
93c: 00092783 lw a5,0(s2)
{
940: c422 sw s0,8(sp)
REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
942: 4100 lw s0,0(a0)
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
944: 4398 lw a4,0(a5)
{
946: c606 sw ra,12(sp)
948: c226 sw s1,4(sp)
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
94a: 0047ae83 lw t4,4(a5)
94e: 0087ae03 lw t3,8(a5)
952: 0107a303 lw t1,16(a5)
956: 0147a883 lw a7,20(a5)
95a: 0187a803 lw a6,24(a5)
95e: 538c lw a1,32(a5)
960: 53d0 lw a2,36(a5)
962: 5794 lw a3,40(a5)
964: 02c7a083 lw ra,44(a5)
{
968: 84aa mv s1,a0
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
96a: 4fc8 lw a0,28(a5)
96c: c018 sw a4,0(s0)
Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
96e: 0004a283 lw t0,0(s1)
Ptr_Val_Par->variant.var_1.Int_Comp = 5;
972: 4395 li t2,5
structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
974: cc48 sw a0,28(s0)
976: 01d42223 sw t4,4(s0)
97a: 01c42423 sw t3,8(s0)
97e: 00642823 sw t1,16(s0)
982: 01142a23 sw a7,20(s0)
986: 01042c23 sw a6,24(s0)
98a: d00c sw a1,32(s0)
98c: d050 sw a2,36(s0)
98e: d414 sw a3,40(s0)
990: 02142623 sw ra,44(s0)
Ptr_Val_Par->variant.var_1.Int_Comp = 5;
994: 0074a623 sw t2,12(s1)
= Ptr_Val_Par->variant.var_1.Int_Comp;
998: 00742623 sw t2,12(s0)
Next_Record->Ptr_Comp = Ptr_Val_Par->Ptr_Comp;
99c: 00542023 sw t0,0(s0)
Proc_3 (&Next_Record->Ptr_Comp);
9a0: 8522 mv a0,s0
9a2: 3fad jal 91c <Proc_3>
if (Next_Record->Discr == Ident_1)
9a4: 00442f03 lw t5,4(s0)
9a8: 060f0463 beqz t5,a10 <Proc_1+0xdc>
structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
9ac: 0004a903 lw s2,0(s1)
} /* Proc_1 */
9b0: 40b2 lw ra,12(sp)
structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
9b2: 00492403 lw s0,4(s2)
9b6: 00092f83 lw t6,0(s2)
9ba: 00892e83 lw t4,8(s2)
9be: 00c92e03 lw t3,12(s2)
9c2: 01092303 lw t1,16(s2)
9c6: 01492883 lw a7,20(s2)
9ca: 01892803 lw a6,24(s2)
9ce: 01c92583 lw a1,28(s2)
9d2: 02092603 lw a2,32(s2)
9d6: 02492683 lw a3,36(s2)
9da: 02892703 lw a4,40(s2)
9de: 02c92783 lw a5,44(s2)
9e2: c0c0 sw s0,4(s1)
} /* Proc_1 */
9e4: 4422 lw s0,8(sp)
structassign (*Ptr_Val_Par, *Ptr_Val_Par->Ptr_Comp);
9e6: 01f4a023 sw t6,0(s1)
9ea: 01d4a423 sw t4,8(s1)
9ee: 01c4a623 sw t3,12(s1)
9f2: 0064a823 sw t1,16(s1)
9f6: 0114aa23 sw a7,20(s1)
9fa: 0104ac23 sw a6,24(s1)
9fe: cccc sw a1,28(s1)
a00: d090 sw a2,32(s1)
a02: d0d4 sw a3,36(s1)
a04: d498 sw a4,40(s1)
a06: d4dc sw a5,44(s1)
} /* Proc_1 */
a08: 4902 lw s2,0(sp)
a0a: 4492 lw s1,4(sp)
a0c: 0141 addi sp,sp,16
a0e: 8082 ret
Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
a10: 4488 lw a0,8(s1)
Next_Record->variant.var_1.Int_Comp = 6;
a12: 4499 li s1,6
Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
a14: 00840593 addi a1,s0,8
Next_Record->variant.var_1.Int_Comp = 6;
a18: c444 sw s1,12(s0)
Proc_6 (Ptr_Val_Par->variant.var_1.Enum_Comp,
a1a: 2221 jal b22 <Proc_6>
Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
a1c: 00092283 lw t0,0(s2)
Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
a20: 4448 lw a0,12(s0)
a22: 00c40613 addi a2,s0,12
Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
a26: 0002a383 lw t2,0(t0)
} /* Proc_1 */
a2a: 40b2 lw ra,12(sp)
a2c: 4492 lw s1,4(sp)
Next_Record->Ptr_Comp = Ptr_Glob->Ptr_Comp;
a2e: 00742023 sw t2,0(s0)
} /* Proc_1 */
a32: 4422 lw s0,8(sp)
a34: 4902 lw s2,0(sp)
Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
a36: 45a9 li a1,10
} /* Proc_1 */
a38: 0141 addi sp,sp,16
Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
a3a: a815 j a6e <Proc_7>
00000a3c <Proc_4>:
/* executed once */
{
Boolean Bool_Loc;
Bool_Loc = Ch_1_Glob == 'A';
Bool_Glob = Bool_Loc | Bool_Glob;
a3c: 82018713 addi a4,gp,-2016 # 10000030 <Bool_Glob>
a40: 4314 lw a3,0(a4)
Bool_Loc = Ch_1_Glob == 'A';
a42: 81d1c783 lbu a5,-2019(gp) # 1000002d <Ch_1_Glob>
a46: fbf78293 addi t0,a5,-65
a4a: 0012b313 seqz t1,t0
Bool_Glob = Bool_Loc | Bool_Glob;
a4e: 00d363b3 or t2,t1,a3
Ch_2_Glob = 'B';
a52: 04200593 li a1,66
Bool_Glob = Bool_Loc | Bool_Glob;
a56: 00772023 sw t2,0(a4)
Ch_2_Glob = 'B';
a5a: 80b18e23 sb a1,-2020(gp) # 1000002c <Ch_2_Glob>
} /* Proc_4 */
a5e: 8082 ret
00000a60 <Proc_5>:
Proc_5 () /* without parameters */
/*******/
/* executed once */
{
Ch_1_Glob = 'A';
a60: 04100793 li a5,65
a64: 80f18ea3 sb a5,-2019(gp) # 1000002d <Ch_1_Glob>
Bool_Glob = false;
a68: 8201a023 sw zero,-2016(gp) # 10000030 <Bool_Glob>
} /* Proc_5 */
a6c: 8082 ret
00000a6e <Proc_7>:
One_Fifty Int_2_Par_Val;
One_Fifty *Int_Par_Ref;
{
One_Fifty Int_Loc;
Int_Loc = Int_1_Par_Val + 2;
a6e: 0509 addi a0,a0,2
*Int_Par_Ref = Int_2_Par_Val + Int_Loc;
a70: 95aa add a1,a1,a0
a72: c20c sw a1,0(a2)
} /* Proc_7 */
a74: 8082 ret
00000a76 <Proc_8>:
int Int_2_Par_Val;
{
REG One_Fifty Int_Index;
REG One_Fifty Int_Loc;
Int_Loc = Int_1_Par_Val + 5;
a76: 00560713 addi a4,a2,5
Arr_1_Par_Ref [Int_Loc] = Int_2_Par_Val;
Arr_1_Par_Ref [Int_Loc+1] = Arr_1_Par_Ref [Int_Loc];
Arr_1_Par_Ref [Int_Loc+30] = Int_Loc;
for (Int_Index = Int_Loc; Int_Index <= Int_Loc+1; ++Int_Index)
Arr_2_Par_Ref [Int_Loc] [Int_Index] = Int_Loc;
a7a: 0c800813 li a6,200
a7e: 030702b3 mul t0,a4,a6
a82: 060a slli a2,a2,0x2
Arr_1_Par_Ref [Int_Loc] = Int_2_Par_Val;
a84: 00271793 slli a5,a4,0x2
a88: 953e add a0,a0,a5
a8a: c114 sw a3,0(a0)
Arr_1_Par_Ref [Int_Loc+1] = Arr_1_Par_Ref [Int_Loc];
a8c: c154 sw a3,4(a0)
Arr_1_Par_Ref [Int_Loc+30] = Int_Loc;
a8e: dd38 sw a4,120(a0)
Arr_2_Par_Ref [Int_Loc] [Int_Loc-1] += 1;
Arr_2_Par_Ref [Int_Loc+20] [Int_Loc] = Arr_1_Par_Ref [Int_Loc];
a90: 6f05 lui t5,0x1
Int_Glob = 5;
a92: 4815 li a6,5
a94: 00c28333 add t1,t0,a2
a98: 006583b3 add t2,a1,t1
Arr_2_Par_Ref [Int_Loc] [Int_Loc-1] += 1;
a9c: 0103a683 lw a3,16(t2)
Arr_2_Par_Ref [Int_Loc] [Int_Index] = Int_Loc;
aa0: 00e3aa23 sw a4,20(t2)
aa4: 00e3ac23 sw a4,24(t2)
Arr_2_Par_Ref [Int_Loc] [Int_Loc-1] += 1;
aa8: 00168893 addi a7,a3,1
aac: 0113a823 sw a7,16(t2)
Arr_2_Par_Ref [Int_Loc+20] [Int_Loc] = Arr_1_Par_Ref [Int_Loc];
ab0: 00052e03 lw t3,0(a0)
ab4: 9596 add a1,a1,t0
ab6: 00c58eb3 add t4,a1,a2
aba: 01df0fb3 add t6,t5,t4
abe: fbcfaa23 sw t3,-76(t6)
Int_Glob = 5;
ac2: 8301a223 sw a6,-2012(gp) # 10000034 <Int_Glob>
} /* Proc_8 */
ac6: 8082 ret
00000ac8 <Func_1>:
/* second call: Ch_1_Par_Val == 'A', Ch_2_Par_Val == 'C' */
/* third call: Ch_1_Par_Val == 'B', Ch_2_Par_Val == 'C' */
Capital_Letter Ch_1_Par_Val;
Capital_Letter Ch_2_Par_Val;
{
ac8: 0ff57513 zext.b a0,a0
acc: 0ff5f593 zext.b a1,a1
Capital_Letter Ch_1_Loc;
Capital_Letter Ch_2_Loc;
Ch_1_Loc = Ch_1_Par_Val;
Ch_2_Loc = Ch_1_Loc;
if (Ch_2_Loc != Ch_2_Par_Val)
ad0: 00b50463 beq a0,a1,ad8 <Func_1+0x10>
/* then, executed */
return (Ident_1);
ad4: 4501 li a0,0
else /* not executed */
{
Ch_1_Glob = Ch_1_Loc;
return (Ident_2);
}
} /* Func_1 */
ad6: 8082 ret
Ch_1_Glob = Ch_1_Loc;
ad8: 80a18ea3 sb a0,-2019(gp) # 1000002d <Ch_1_Glob>
return (Ident_2);
adc: 4505 li a0,1
ade: 8082 ret
00000ae0 <Func_2>:
/* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
/* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
Str_30 Str_1_Par_Ref;
Str_30 Str_2_Par_Ref;
{
ae0: 1141 addi sp,sp,-16
ae2: c422 sw s0,8(sp)
ae4: c226 sw s1,4(sp)
ae6: c606 sw ra,12(sp)
ae8: 842a mv s0,a0
aea: 84ae mv s1,a1
REG One_Thirty Int_Loc;
Capital_Letter Ch_Loc;
Int_Loc = 2;
while (Int_Loc <= 2) /* loop body executed once */
if (Func_1 (Str_1_Par_Ref[Int_Loc],
aec: 0034c583 lbu a1,3(s1)
af0: 00244503 lbu a0,2(s0)
af4: 3fd1 jal ac8 <Func_1>
af6: f97d bnez a0,aec <Func_2+0xc>
if (Ch_Loc == 'R')
/* then, not executed */
return (true);
else /* executed */
{
if (strcmp (Str_1_Par_Ref, Str_2_Par_Ref) > 0)
af8: 85a6 mv a1,s1
afa: 8522 mv a0,s0
afc: 370010ef jal ra,1e6c <strcmp>
Int_Loc += 7;
Int_Glob = Int_Loc;
return (true);
}
else /* executed */
return (false);
b00: 4281 li t0,0
if (strcmp (Str_1_Par_Ref, Str_2_Par_Ref) > 0)
b02: 00a05663 blez a0,b0e <Func_2+0x2e>
Int_Glob = Int_Loc;
b06: 47a9 li a5,10
b08: 82f1a223 sw a5,-2012(gp) # 10000034 <Int_Glob>
return (true);
b0c: 4285 li t0,1
} /* if Ch_Loc */
} /* Func_2 */
b0e: 40b2 lw ra,12(sp)
b10: 4422 lw s0,8(sp)
b12: 4492 lw s1,4(sp)
b14: 8516 mv a0,t0
b16: 0141 addi sp,sp,16
b18: 8082 ret
00000b1a <Func_3>:
Enumeration Enum_Par_Val;
{
Enumeration Enum_Loc;
Enum_Loc = Enum_Par_Val;
if (Enum_Loc == Ident_3)
b1a: 1579 addi a0,a0,-2
/* then, executed */
return (true);
else /* not executed */
return (false);
} /* Func_3 */
b1c: 00153513 seqz a0,a0
b20: 8082 ret
00000b22 <Proc_6>:
{
b22: 1141 addi sp,sp,-16
b24: c422 sw s0,8(sp)
b26: c226 sw s1,4(sp)
b28: 842a mv s0,a0
b2a: c606 sw ra,12(sp)
b2c: 84ae mv s1,a1
if (! Func_3 (Enum_Val_Par))
b2e: 37f5 jal b1a <Func_3>
b30: 87a2 mv a5,s0
b32: e111 bnez a0,b36 <Proc_6+0x14>
b34: 478d li a5,3
b36: c09c sw a5,0(s1)
switch (Enum_Val_Par)
b38: 4089 li ra,2
b3a: 02140c63 beq s0,ra,b72 <Proc_6+0x50>
b3e: 0280e063 bltu ra,s0,b5e <Proc_6+0x3c>
b42: c419 beqz s0,b50 <Proc_6+0x2e>
if (Int_Glob > 100)
b44: 8241a303 lw t1,-2012(gp) # 10000034 <Int_Glob>
b48: 06400393 li t2,100
b4c: 0263db63 bge t2,t1,b82 <Proc_6+0x60>
*Enum_Ref_Par = Ident_1;
b50: 0004a023 sw zero,0(s1)
} /* Proc_6 */
b54: 40b2 lw ra,12(sp)
b56: 4422 lw s0,8(sp)
b58: 4492 lw s1,4(sp)
b5a: 0141 addi sp,sp,16
b5c: 8082 ret
switch (Enum_Val_Par)
b5e: 4711 li a4,4
b60: fee41ae3 bne s0,a4,b54 <Proc_6+0x32>
*Enum_Ref_Par = Ident_3;
b64: 0014a023 sw ra,0(s1)
} /* Proc_6 */
b68: 4422 lw s0,8(sp)
b6a: 40b2 lw ra,12(sp)
b6c: 4492 lw s1,4(sp)
b6e: 0141 addi sp,sp,16
b70: 8082 ret
b72: 40b2 lw ra,12(sp)
b74: 4422 lw s0,8(sp)
*Enum_Ref_Par = Ident_2;
b76: 4285 li t0,1
b78: 0054a023 sw t0,0(s1)
} /* Proc_6 */
b7c: 4492 lw s1,4(sp)
b7e: 0141 addi sp,sp,16
b80: 8082 ret
b82: 40b2 lw ra,12(sp)
b84: 4422 lw s0,8(sp)
else *Enum_Ref_Par = Ident_4;
b86: 450d li a0,3
b88: c088 sw a0,0(s1)
} /* Proc_6 */
b8a: 4492 lw s1,4(sp)
b8c: 0141 addi sp,sp,16
b8e: 8082 ret
00000b90 <get_timer_value>:
#if __riscv_xlen==32
static uint32_t mtime_hi(void)
{
unsigned long ret;
__asm volatile("rdtimeh %0":"=r"(ret));
b90: c81027f3 rdtimeh a5
__asm volatile("rdtime %0":"=r"(ret));
b94: c0102573 rdtime a0
__asm volatile("rdtimeh %0":"=r"(ret));
b98: c81025f3 rdtimeh a1
uint64_t get_timer_value()
{
while (1) {
uint32_t hi = mtime_hi();
uint32_t lo = mtime_lo();
if (hi == mtime_hi())
b9c: fef59ae3 bne a1,a5,b90 <get_timer_value>
return ((uint64_t)hi << 32) | lo;
}
}
ba0: 00008067 ret
00000ba4 <get_timer_freq>:
#endif
unsigned long get_timer_freq()
{
return 32768;
}
ba4: 00008537 lui a0,0x8
ba8: 00008067 ret
00000bac <get_cpu_freq>:
unsigned long get_cpu_freq()
{
return 10000000;
bac: 00989537 lui a0,0x989
}
bb0: 68050513 addi a0,a0,1664 # 989680 <_data_lma+0x9867dc>
bb4: 00008067 ret
00000bb8 <init_pll>:
void init_pll(void){
}
bb8: 00008067 ret
00000bbc <handle_trap>:
#ifdef USE_M_TIME
extern void handle_m_time_interrupt();
#endif
uintptr_t handle_trap(uintptr_t mcause, uintptr_t epc)
{
bbc: ff010113 addi sp,sp,-16
bc0: 00812423 sw s0,8(sp)
} else if ((mcause & MCAUSE_INT) && ((mcause & MCAUSE_CAUSE) == IRQ_M_TIMER)){
handle_m_time_interrupt();
#endif
}
else {
write(1, "trap\n", 5);
bc4: 00500613 li a2,5
{
bc8: 00050413 mv s0,a0
write(1, "trap\n", 5);
bcc: 00002597 auipc a1,0x2
bd0: ff858593 addi a1,a1,-8 # 2bc4 <__modsi3+0x62c>
bd4: 00100513 li a0,1
{
bd8: 00112623 sw ra,12(sp)
write(1, "trap\n", 5);
bdc: 141000ef jal ra,151c <__wrap_write>
_exit(1 + mcause);
be0: 00140513 addi a0,s0,1
be4: 20d000ef jal ra,15f0 <__wrap__exit>
00000be8 <_init>:
void _init()
{
#ifndef NO_INIT
init_pll();
printf("core freq at %d Hz\n", get_cpu_freq());
be8: 009895b7 lui a1,0x989
{
bec: ff010113 addi sp,sp,-16
printf("core freq at %d Hz\n", get_cpu_freq());
bf0: 68058593 addi a1,a1,1664 # 989680 <_data_lma+0x9867dc>
bf4: 00002517 auipc a0,0x2
bf8: fd850513 addi a0,a0,-40 # 2bcc <__modsi3+0x634>
{
bfc: 00112623 sw ra,12(sp)
printf("core freq at %d Hz\n", get_cpu_freq());
c00: 1a8010ef jal ra,1da8 <__wrap_printf>
write_csr(mtvec, &trap_entry);
c04: 00000797 auipc a5,0x0
c08: ba878793 addi a5,a5,-1112 # 7ac <trap_entry>
c0c: 30579073 csrw mtvec,a5
if (read_csr(misa) & (1 << ('F' - 'A'))) { // if F extension is present
c10: 301027f3 csrr a5,misa
c14: 0207f793 andi a5,a5,32
c18: 00078863 beqz a5,c28 <_init+0x40>
write_csr(mstatus, MSTATUS_FS); // allow FPU instructions without trapping
c1c: 000067b7 lui a5,0x6
c20: 30079073 csrw mstatus,a5
write_csr(fcsr, 0); // initialize rounding mode, undefined at reset
c24: 00305073 csrwi fcsr,0
}
#endif
}
c28: 00c12083 lw ra,12(sp)
c2c: 01010113 addi sp,sp,16
c30: 00008067 ret
00000c34 <_fini>:
void _fini()
{
}
c34: 00008067 ret
00000c38 <__divsf3>:
#include "soft-fp.h"
#include "single.h"
SFtype
__divsf3 (SFtype a, SFtype b)
{
c38: fe010113 addi sp,sp,-32
c3c: 00912a23 sw s1,20(sp)
c40: 01755493 srli s1,a0,0x17
c44: 01212823 sw s2,16(sp)
c48: 01312623 sw s3,12(sp)
c4c: 01412423 sw s4,8(sp)
FP_DECL_S (B);
FP_DECL_S (R);
SFtype r;
FP_INIT_ROUNDMODE;
FP_UNPACK_S (A, a);
c50: 00951993 slli s3,a0,0x9
{
c54: 00112e23 sw ra,28(sp)
c58: 00812c23 sw s0,24(sp)
c5c: 01512223 sw s5,4(sp)
c60: 0ff4f493 zext.b s1,s1
c64: 00058a13 mv s4,a1
FP_UNPACK_S (A, a);
c68: 0099d993 srli s3,s3,0x9
c6c: 01f55913 srli s2,a0,0x1f
c70: 08048463 beqz s1,cf8 <__divsf3+0xc0>
c74: 0ff00793 li a5,255
c78: 0af48063 beq s1,a5,d18 <__divsf3+0xe0>
c7c: 00399993 slli s3,s3,0x3
c80: 040007b7 lui a5,0x4000
c84: 00f9e9b3 or s3,s3,a5
c88: f8148493 addi s1,s1,-127
c8c: 00000a93 li s5,0
FP_UNPACK_S (B, b);
c90: 017a5793 srli a5,s4,0x17
c94: 009a1413 slli s0,s4,0x9
c98: 0ff7f793 zext.b a5,a5
c9c: 00945413 srli s0,s0,0x9
ca0: 01fa5a13 srli s4,s4,0x1f
ca4: 08078a63 beqz a5,d38 <__divsf3+0x100>
ca8: 0ff00713 li a4,255
cac: 0ae78663 beq a5,a4,d58 <__divsf3+0x120>
cb0: 00341413 slli s0,s0,0x3
cb4: 04000737 lui a4,0x4000
cb8: 00e46433 or s0,s0,a4
cbc: f8178793 addi a5,a5,-127 # 3ffff81 <_data_lma+0x3ffd0dd>
cc0: 00000713 li a4,0
FP_DIV_S (R, A, B);
cc4: 40f484b3 sub s1,s1,a5
cc8: 002a9793 slli a5,s5,0x2
ccc: 00e7e7b3 or a5,a5,a4
cd0: fff78793 addi a5,a5,-1
cd4: 00e00613 li a2,14
cd8: 014946b3 xor a3,s2,s4
cdc: 08f66e63 bltu a2,a5,d78 <__divsf3+0x140>
ce0: 00003637 lui a2,0x3
ce4: 00279793 slli a5,a5,0x2
ce8: be060613 addi a2,a2,-1056 # 2be0 <__modsi3+0x648>
cec: 00c787b3 add a5,a5,a2
cf0: 0007a783 lw a5,0(a5)
cf4: 00078067 jr a5
FP_UNPACK_S (A, a);
cf8: 02098a63 beqz s3,d2c <__divsf3+0xf4>
cfc: 00098513 mv a0,s3
d00: 7a4000ef jal ra,14a4 <__clzsi2>
d04: ffb50793 addi a5,a0,-5
d08: f8a00493 li s1,-118
d0c: 00f999b3 sll s3,s3,a5
d10: 40a484b3 sub s1,s1,a0
d14: f79ff06f j c8c <__divsf3+0x54>
d18: 0ff00493 li s1,255
d1c: 00200a93 li s5,2
d20: f60988e3 beqz s3,c90 <__divsf3+0x58>
d24: 00300a93 li s5,3
d28: f69ff06f j c90 <__divsf3+0x58>
d2c: 00000493 li s1,0
d30: 00100a93 li s5,1
d34: f5dff06f j c90 <__divsf3+0x58>
FP_UNPACK_S (B, b);
d38: 02040a63 beqz s0,d6c <__divsf3+0x134>
d3c: 00040513 mv a0,s0
d40: 764000ef jal ra,14a4 <__clzsi2>
d44: ffb50793 addi a5,a0,-5
d48: 00f41433 sll s0,s0,a5
d4c: f8a00793 li a5,-118
d50: 40a787b3 sub a5,a5,a0
d54: f6dff06f j cc0 <__divsf3+0x88>
d58: 0ff00793 li a5,255
d5c: 00200713 li a4,2
d60: f60402e3 beqz s0,cc4 <__divsf3+0x8c>
d64: 00300713 li a4,3
d68: f5dff06f j cc4 <__divsf3+0x8c>
d6c: 00000793 li a5,0
d70: 00100713 li a4,1
d74: f51ff06f j cc4 <__divsf3+0x8c>
FP_DIV_S (R, A, B);
d78: 00541613 slli a2,s0,0x5
d7c: 1289f463 bgeu s3,s0,ea4 <__divsf3+0x26c>
d80: fff48493 addi s1,s1,-1
d84: 00000793 li a5,0
d88: 01065593 srli a1,a2,0x10
d8c: 02b9d833 divu a6,s3,a1
d90: 00010737 lui a4,0x10
d94: fff70713 addi a4,a4,-1 # ffff <_data_lma+0xd15b>
d98: 00e67733 and a4,a2,a4
d9c: 0107d793 srli a5,a5,0x10
da0: 02b9f9b3 remu s3,s3,a1
da4: 00080413 mv s0,a6
da8: 03070533 mul a0,a4,a6
dac: 01099993 slli s3,s3,0x10
db0: 0137e7b3 or a5,a5,s3
db4: 00a7fe63 bgeu a5,a0,dd0 <__divsf3+0x198>
db8: 00c787b3 add a5,a5,a2
dbc: fff80413 addi s0,a6,-1
dc0: 00c7e863 bltu a5,a2,dd0 <__divsf3+0x198>
dc4: 00a7f663 bgeu a5,a0,dd0 <__divsf3+0x198>
dc8: ffe80413 addi s0,a6,-2
dcc: 00c787b3 add a5,a5,a2
dd0: 40a787b3 sub a5,a5,a0
dd4: 02b7d533 divu a0,a5,a1
dd8: 02b7f7b3 remu a5,a5,a1
ddc: 00050593 mv a1,a0
de0: 02a70733 mul a4,a4,a0
de4: 01079793 slli a5,a5,0x10
de8: 00e7fe63 bgeu a5,a4,e04 <__divsf3+0x1cc>
dec: 00c787b3 add a5,a5,a2
df0: fff50593 addi a1,a0,-1
df4: 00c7e863 bltu a5,a2,e04 <__divsf3+0x1cc>
df8: 00e7f663 bgeu a5,a4,e04 <__divsf3+0x1cc>
dfc: ffe50593 addi a1,a0,-2
e00: 00c787b3 add a5,a5,a2
e04: 01041413 slli s0,s0,0x10
e08: 40e787b3 sub a5,a5,a4
e0c: 00b46433 or s0,s0,a1
e10: 00f037b3 snez a5,a5
e14: 00f46433 or s0,s0,a5
FP_PACK_S (r, R);
e18: 07f48713 addi a4,s1,127
e1c: 0ce05e63 blez a4,ef8 <__divsf3+0x2c0>
e20: 00747793 andi a5,s0,7
e24: 00078a63 beqz a5,e38 <__divsf3+0x200>
e28: 00f47793 andi a5,s0,15
e2c: 00400613 li a2,4
e30: 00c78463 beq a5,a2,e38 <__divsf3+0x200>
e34: 00440413 addi s0,s0,4
e38: 080007b7 lui a5,0x8000
e3c: 00f477b3 and a5,s0,a5
e40: 00078a63 beqz a5,e54 <__divsf3+0x21c>
e44: f80007b7 lui a5,0xf8000
e48: fff78793 addi a5,a5,-1 # f7ffffff <tohost+0xf800000f>
e4c: 00f47433 and s0,s0,a5
e50: 08048713 addi a4,s1,128
e54: 0fe00793 li a5,254
e58: 06e7ce63 blt a5,a4,ed4 <__divsf3+0x29c>
e5c: 00345793 srli a5,s0,0x3
FP_HANDLE_EXCEPTIONS;
return r;
}
e60: 01c12083 lw ra,28(sp)
e64: 01812403 lw s0,24(sp)
FP_PACK_S (r, R);
e68: 01771713 slli a4,a4,0x17
e6c: 7f800637 lui a2,0x7f800
e70: 00979793 slli a5,a5,0x9
e74: 00c77733 and a4,a4,a2
e78: 0097d793 srli a5,a5,0x9
e7c: 00f76733 or a4,a4,a5
e80: 01f69513 slli a0,a3,0x1f
}
e84: 01412483 lw s1,20(sp)
e88: 01012903 lw s2,16(sp)
e8c: 00c12983 lw s3,12(sp)
e90: 00812a03 lw s4,8(sp)
e94: 00412a83 lw s5,4(sp)
e98: 00a76533 or a0,a4,a0
e9c: 02010113 addi sp,sp,32
ea0: 00008067 ret
FP_DIV_S (R, A, B);
ea4: 01f99793 slli a5,s3,0x1f
ea8: 0019d993 srli s3,s3,0x1
eac: eddff06f j d88 <__divsf3+0x150>
FP_UNPACK_S (A, a);
eb0: 00090693 mv a3,s2
FP_DIV_S (R, A, B);
eb4: 00098413 mv s0,s3
eb8: 000a8713 mv a4,s5
FP_PACK_S (r, R);
ebc: 00300793 li a5,3
ec0: 08f70863 beq a4,a5,f50 <__divsf3+0x318>
ec4: 00100793 li a5,1
ec8: 08f70c63 beq a4,a5,f60 <__divsf3+0x328>
ecc: 00200793 li a5,2
ed0: f4f714e3 bne a4,a5,e18 <__divsf3+0x1e0>
ed4: 00000793 li a5,0
ed8: 0ff00713 li a4,255
edc: f85ff06f j e60 <__divsf3+0x228>
FP_UNPACK_S (B, b);
ee0: 000a0693 mv a3,s4
FP_DIV_S (R, A, B);
ee4: fd9ff06f j ebc <__divsf3+0x284>
ee8: 00400437 lui s0,0x400
eec: 00000693 li a3,0
ef0: 00300713 li a4,3
ef4: fc9ff06f j ebc <__divsf3+0x284>
FP_PACK_S (r, R);
ef8: 00100793 li a5,1
efc: 40e787b3 sub a5,a5,a4
f00: 01b00713 li a4,27
f04: 04f74e63 blt a4,a5,f60 <__divsf3+0x328>
f08: 09e48493 addi s1,s1,158
f0c: 00f457b3 srl a5,s0,a5
f10: 00941433 sll s0,s0,s1
f14: 00803433 snez s0,s0
f18: 0087e7b3 or a5,a5,s0
f1c: 0077f713 andi a4,a5,7
f20: 00070a63 beqz a4,f34 <__divsf3+0x2fc>
f24: 00f7f713 andi a4,a5,15
f28: 00400613 li a2,4
f2c: 00c70463 beq a4,a2,f34 <__divsf3+0x2fc>
f30: 00478793 addi a5,a5,4
f34: 04000737 lui a4,0x4000
f38: 00e7f733 and a4,a5,a4
f3c: 0037d793 srli a5,a5,0x3
f40: f20700e3 beqz a4,e60 <__divsf3+0x228>
f44: 00000793 li a5,0
f48: 00100713 li a4,1
f4c: f15ff06f j e60 <__divsf3+0x228>
f50: 004007b7 lui a5,0x400
f54: 0ff00713 li a4,255
f58: 00000693 li a3,0
f5c: f05ff06f j e60 <__divsf3+0x228>
f60: 00000793 li a5,0
f64: 00000713 li a4,0
f68: ef9ff06f j e60 <__divsf3+0x228>
00000f6c <__mulsf3>:
#include "soft-fp.h"
#include "single.h"
SFtype
__mulsf3 (SFtype a, SFtype b)
{
f6c: fe010113 addi sp,sp,-32
f70: 01212823 sw s2,16(sp)
f74: 01755913 srli s2,a0,0x17
f78: 00912a23 sw s1,20(sp)
f7c: 01312623 sw s3,12(sp)
f80: 01512223 sw s5,4(sp)
FP_DECL_S (B);
FP_DECL_S (R);
SFtype r;
FP_INIT_ROUNDMODE;
FP_UNPACK_S (A, a);
f84: 00951493 slli s1,a0,0x9
{
f88: 00112e23 sw ra,28(sp)
f8c: 00812c23 sw s0,24(sp)
f90: 01412423 sw s4,8(sp)
f94: 0ff97913 zext.b s2,s2
f98: 00058a93 mv s5,a1
FP_UNPACK_S (A, a);
f9c: 0094d493 srli s1,s1,0x9
fa0: 01f55993 srli s3,a0,0x1f
fa4: 18090a63 beqz s2,1138 <__mulsf3+0x1cc>
fa8: 0ff00793 li a5,255
fac: 1af90663 beq s2,a5,1158 <__mulsf3+0x1ec>
fb0: 00349493 slli s1,s1,0x3
fb4: 040007b7 lui a5,0x4000
fb8: 00f4e4b3 or s1,s1,a5
fbc: f8190913 addi s2,s2,-127
fc0: 00000a13 li s4,0
FP_UNPACK_S (B, b);
fc4: 017ad793 srli a5,s5,0x17
fc8: 009a9413 slli s0,s5,0x9
fcc: 0ff7f793 zext.b a5,a5
fd0: 00945413 srli s0,s0,0x9
fd4: 01fada93 srli s5,s5,0x1f
fd8: 1a078063 beqz a5,1178 <__mulsf3+0x20c>
fdc: 0ff00713 li a4,255
fe0: 1ae78c63 beq a5,a4,1198 <__mulsf3+0x22c>
fe4: 00341413 slli s0,s0,0x3
fe8: 04000737 lui a4,0x4000
fec: 00e46433 or s0,s0,a4
ff0: f8178793 addi a5,a5,-127 # 3ffff81 <_data_lma+0x3ffd0dd>
ff4: 00000693 li a3,0
FP_MUL_S (R, A, B);
ff8: 00f90933 add s2,s2,a5
ffc: 002a1793 slli a5,s4,0x2
1000: 00d7e7b3 or a5,a5,a3
1004: 00a00713 li a4,10
1008: 0159c533 xor a0,s3,s5
100c: 00190613 addi a2,s2,1
1010: 1ef74c63 blt a4,a5,1208 <__mulsf3+0x29c>
1014: 00200713 li a4,2
1018: 1af74063 blt a4,a5,11b8 <__mulsf3+0x24c>
101c: fff78793 addi a5,a5,-1
1020: 00100713 li a4,1
1024: 1af77c63 bgeu a4,a5,11dc <__mulsf3+0x270>
1028: 000108b7 lui a7,0x10
102c: fff88813 addi a6,a7,-1 # ffff <_data_lma+0xd15b>
1030: 0104d713 srli a4,s1,0x10
1034: 01045793 srli a5,s0,0x10
1038: 010476b3 and a3,s0,a6
103c: 0104f4b3 and s1,s1,a6
1040: 029685b3 mul a1,a3,s1
1044: 02d706b3 mul a3,a4,a3
1048: 0105d413 srli s0,a1,0x10
104c: 02f70733 mul a4,a4,a5
1050: 029787b3 mul a5,a5,s1
1054: 00d787b3 add a5,a5,a3
1058: 00f40433 add s0,s0,a5
105c: 00d47463 bgeu s0,a3,1064 <__mulsf3+0xf8>
1060: 01170733 add a4,a4,a7
1064: 010477b3 and a5,s0,a6
1068: 01079793 slli a5,a5,0x10
106c: 0105f5b3 and a1,a1,a6
1070: 00b787b3 add a5,a5,a1
1074: 00679693 slli a3,a5,0x6
1078: 01045413 srli s0,s0,0x10
107c: 00d036b3 snez a3,a3
1080: 01a7d793 srli a5,a5,0x1a
1084: 00e40433 add s0,s0,a4
1088: 00f6e7b3 or a5,a3,a5
108c: 00641413 slli s0,s0,0x6
1090: 00f46433 or s0,s0,a5
1094: 080007b7 lui a5,0x8000
1098: 00f477b3 and a5,s0,a5
109c: 18078e63 beqz a5,1238 <__mulsf3+0x2cc>
10a0: 00145793 srli a5,s0,0x1
10a4: 00147413 andi s0,s0,1
10a8: 0087e433 or s0,a5,s0
FP_PACK_S (r, R);
10ac: 07f60713 addi a4,a2,127 # 7f80007f <_sp+0x6f7fc07f>
10b0: 18e05863 blez a4,1240 <__mulsf3+0x2d4>
10b4: 00747793 andi a5,s0,7
10b8: 00078a63 beqz a5,10cc <__mulsf3+0x160>
10bc: 00f47793 andi a5,s0,15
10c0: 00400693 li a3,4
10c4: 00d78463 beq a5,a3,10cc <__mulsf3+0x160>
10c8: 00440413 addi s0,s0,4 # 400004 <_data_lma+0x3fd160>
10cc: 080007b7 lui a5,0x8000
10d0: 00f477b3 and a5,s0,a5
10d4: 00078a63 beqz a5,10e8 <__mulsf3+0x17c>
10d8: f80007b7 lui a5,0xf8000
10dc: fff78793 addi a5,a5,-1 # f7ffffff <tohost+0xf800000f>
10e0: 00f47433 and s0,s0,a5
10e4: 08060713 addi a4,a2,128
10e8: 0fe00793 li a5,254
10ec: 1ae7ce63 blt a5,a4,12a8 <__mulsf3+0x33c>
10f0: 00345793 srli a5,s0,0x3
FP_HANDLE_EXCEPTIONS;
return r;
}
10f4: 01c12083 lw ra,28(sp)
10f8: 01812403 lw s0,24(sp)
FP_PACK_S (r, R);
10fc: 01771713 slli a4,a4,0x17
1100: 7f8006b7 lui a3,0x7f800
1104: 00979793 slli a5,a5,0x9
1108: 00d77733 and a4,a4,a3
110c: 0097d793 srli a5,a5,0x9
1110: 00f76733 or a4,a4,a5
1114: 01f51513 slli a0,a0,0x1f
}
1118: 01412483 lw s1,20(sp)
111c: 01012903 lw s2,16(sp)
1120: 00c12983 lw s3,12(sp)
1124: 00812a03 lw s4,8(sp)
1128: 00412a83 lw s5,4(sp)
112c: 00a76533 or a0,a4,a0
1130: 02010113 addi sp,sp,32
1134: 00008067 ret
FP_UNPACK_S (A, a);
1138: 02048a63 beqz s1,116c <__mulsf3+0x200>
113c: 00048513 mv a0,s1
1140: 364000ef jal ra,14a4 <__clzsi2>
1144: ffb50793 addi a5,a0,-5
1148: f8a00913 li s2,-118
114c: 00f494b3 sll s1,s1,a5
1150: 40a90933 sub s2,s2,a0
1154: e6dff06f j fc0 <__mulsf3+0x54>
1158: 0ff00913 li s2,255
115c: 00200a13 li s4,2
1160: e60482e3 beqz s1,fc4 <__mulsf3+0x58>
1164: 00300a13 li s4,3
1168: e5dff06f j fc4 <__mulsf3+0x58>
116c: 00000913 li s2,0
1170: 00100a13 li s4,1
1174: e51ff06f j fc4 <__mulsf3+0x58>
FP_UNPACK_S (B, b);
1178: 02040a63 beqz s0,11ac <__mulsf3+0x240>
117c: 00040513 mv a0,s0
1180: 324000ef jal ra,14a4 <__clzsi2>
1184: ffb50793 addi a5,a0,-5
1188: 00f41433 sll s0,s0,a5
118c: f8a00793 li a5,-118
1190: 40a787b3 sub a5,a5,a0
1194: e61ff06f j ff4 <__mulsf3+0x88>
1198: 0ff00793 li a5,255
119c: 00200693 li a3,2
11a0: e4040ce3 beqz s0,ff8 <__mulsf3+0x8c>
11a4: 00300693 li a3,3
11a8: e51ff06f j ff8 <__mulsf3+0x8c>
11ac: 00000793 li a5,0
11b0: 00100693 li a3,1
11b4: e45ff06f j ff8 <__mulsf3+0x8c>
11b8: 00100713 li a4,1
11bc: 00f717b3 sll a5,a4,a5
11c0: 5307f713 andi a4,a5,1328
11c4: 04071c63 bnez a4,121c <__mulsf3+0x2b0>
11c8: 2407f713 andi a4,a5,576
11cc: 0c071663 bnez a4,1298 <__mulsf3+0x32c>
11d0: 0887f793 andi a5,a5,136
11d4: e4078ae3 beqz a5,1028 <__mulsf3+0xbc>
11d8: 000a8513 mv a0,s5
FP_PACK_S (r, R);
11dc: 00200593 li a1,2
11e0: 00000793 li a5,0
11e4: 0ff00713 li a4,255
11e8: f0b686e3 beq a3,a1,10f4 <__mulsf3+0x188>
11ec: 00300793 li a5,3
11f0: 0af68463 beq a3,a5,1298 <__mulsf3+0x32c>
11f4: 00100793 li a5,1
11f8: eaf69ae3 bne a3,a5,10ac <__mulsf3+0x140>
11fc: 00000793 li a5,0
1200: 00000713 li a4,0
1204: ef1ff06f j 10f4 <__mulsf3+0x188>
FP_MUL_S (R, A, B);
1208: 00f00713 li a4,15
120c: 00e78e63 beq a5,a4,1228 <__mulsf3+0x2bc>
1210: 00b00713 li a4,11
1214: fce782e3 beq a5,a4,11d8 <__mulsf3+0x26c>
FP_UNPACK_S (A, a);
1218: 00098513 mv a0,s3
FP_MUL_S (R, A, B);
121c: 00048413 mv s0,s1
1220: 000a0693 mv a3,s4
1224: fb9ff06f j 11dc <__mulsf3+0x270>
1228: 00400437 lui s0,0x400
122c: 00000513 li a0,0
1230: 00300693 li a3,3
1234: fb9ff06f j 11ec <__mulsf3+0x280>
1238: 00090613 mv a2,s2
123c: e71ff06f j 10ac <__mulsf3+0x140>
FP_PACK_S (r, R);
1240: 00100793 li a5,1
1244: 40e787b3 sub a5,a5,a4
1248: 01b00713 li a4,27
124c: faf748e3 blt a4,a5,11fc <__mulsf3+0x290>
1250: 09e60613 addi a2,a2,158
1254: 00f457b3 srl a5,s0,a5
1258: 00c41433 sll s0,s0,a2
125c: 00803433 snez s0,s0
1260: 0087e7b3 or a5,a5,s0
1264: 0077f713 andi a4,a5,7
1268: 00070a63 beqz a4,127c <__mulsf3+0x310>
126c: 00f7f713 andi a4,a5,15
1270: 00400693 li a3,4
1274: 00d70463 beq a4,a3,127c <__mulsf3+0x310>
1278: 00478793 addi a5,a5,4
127c: 04000737 lui a4,0x4000
1280: 00e7f733 and a4,a5,a4
1284: 0037d793 srli a5,a5,0x3
1288: e60706e3 beqz a4,10f4 <__mulsf3+0x188>
128c: 00000793 li a5,0
1290: 00100713 li a4,1
1294: e61ff06f j 10f4 <__mulsf3+0x188>
1298: 004007b7 lui a5,0x400
129c: 0ff00713 li a4,255
12a0: 00000513 li a0,0
12a4: e51ff06f j 10f4 <__mulsf3+0x188>
12a8: 00000793 li a5,0
12ac: 0ff00713 li a4,255
12b0: e45ff06f j 10f4 <__mulsf3+0x188>
000012b4 <__floatsisf>:
FP_DECL_EX;
FP_DECL_S (A);
SFtype a;
FP_INIT_ROUNDMODE;
FP_FROM_INT_S (A, i, SI_BITS, USItype);
12b4: 0e050863 beqz a0,13a4 <__floatsisf+0xf0>
12b8: 41f55793 srai a5,a0,0x1f
{
12bc: ff010113 addi sp,sp,-16
12c0: 00812423 sw s0,8(sp)
FP_FROM_INT_S (A, i, SI_BITS, USItype);
12c4: 00a7c433 xor s0,a5,a0
12c8: 40f40433 sub s0,s0,a5
{
12cc: 00912223 sw s1,4(sp)
FP_FROM_INT_S (A, i, SI_BITS, USItype);
12d0: 01f55493 srli s1,a0,0x1f
12d4: 00040513 mv a0,s0
{
12d8: 00112623 sw ra,12(sp)
FP_FROM_INT_S (A, i, SI_BITS, USItype);
12dc: 1c8000ef jal ra,14a4 <__clzsi2>
12e0: 09e00713 li a4,158
12e4: 40a70733 sub a4,a4,a0
12e8: 09600793 li a5,150
12ec: 02e7cc63 blt a5,a4,1324 <__floatsisf+0x70>
12f0: ff850513 addi a0,a0,-8
12f4: 00a417b3 sll a5,s0,a0
FP_PACK_RAW_S (a, A);
FP_HANDLE_EXCEPTIONS;
return a;
}
12f8: 00c12083 lw ra,12(sp)
12fc: 00812403 lw s0,8(sp)
FP_PACK_RAW_S (a, A);
1300: 00979793 slli a5,a5,0x9
1304: 01771713 slli a4,a4,0x17
1308: 0097d793 srli a5,a5,0x9
130c: 01f49513 slli a0,s1,0x1f
1310: 00f76733 or a4,a4,a5
}
1314: 00412483 lw s1,4(sp)
1318: 00a76533 or a0,a4,a0
131c: 01010113 addi sp,sp,16
1320: 00008067 ret
FP_FROM_INT_S (A, i, SI_BITS, USItype);
1324: 09900793 li a5,153
1328: 02e7d063 bge a5,a4,1348 <__floatsisf+0x94>
132c: 00500793 li a5,5
1330: 40a787b3 sub a5,a5,a0
1334: 01b50693 addi a3,a0,27
1338: 00f457b3 srl a5,s0,a5
133c: 00d41433 sll s0,s0,a3
1340: 00803433 snez s0,s0
1344: 0087e433 or s0,a5,s0
1348: 00500793 li a5,5
134c: 00a7d663 bge a5,a0,1358 <__floatsisf+0xa4>
1350: ffb50793 addi a5,a0,-5
1354: 00f41433 sll s0,s0,a5
1358: fc0007b7 lui a5,0xfc000
135c: fff78793 addi a5,a5,-1 # fbffffff <tohost+0xfc00000f>
1360: 00747693 andi a3,s0,7
1364: 00f477b3 and a5,s0,a5
1368: 00068a63 beqz a3,137c <__floatsisf+0xc8>
136c: 00f47413 andi s0,s0,15
1370: 00400693 li a3,4
1374: 00d40463 beq s0,a3,137c <__floatsisf+0xc8>
1378: 00478793 addi a5,a5,4
137c: 040006b7 lui a3,0x4000
1380: 00d7f6b3 and a3,a5,a3
1384: 00068c63 beqz a3,139c <__floatsisf+0xe8>
1388: fc000737 lui a4,0xfc000
138c: fff70713 addi a4,a4,-1 # fbffffff <tohost+0xfc00000f>
1390: 00e7f7b3 and a5,a5,a4
1394: 09f00713 li a4,159
1398: 40a70733 sub a4,a4,a0
139c: 0037d793 srli a5,a5,0x3
13a0: f59ff06f j 12f8 <__floatsisf+0x44>
13a4: 00000793 li a5,0
13a8: 00000713 li a4,0
FP_PACK_RAW_S (a, A);
13ac: 00979793 slli a5,a5,0x9
13b0: 0097d793 srli a5,a5,0x9
13b4: 01771713 slli a4,a4,0x17
13b8: 00f76733 or a4,a4,a5
13bc: 01f51513 slli a0,a0,0x1f
}
13c0: 00a76533 or a0,a4,a0
13c4: 00008067 ret
000013c8 <__extendsfdf2>:
FP_DECL_S (A);
FP_DECL_D (R);
DFtype r;
FP_INIT_EXCEPTIONS;
FP_UNPACK_RAW_S (A, a);
13c8: 01755713 srli a4,a0,0x17
13cc: 0ff77713 zext.b a4,a4
{
13d0: ff010113 addi sp,sp,-16
#if _FP_W_TYPE_SIZE < _FP_FRACBITS_D
FP_EXTEND (D, S, 2, 1, R, A);
13d4: 00170793 addi a5,a4,1
{
13d8: 00812423 sw s0,8(sp)
13dc: 00912223 sw s1,4(sp)
FP_UNPACK_RAW_S (A, a);
13e0: 00951413 slli s0,a0,0x9
{
13e4: 00112623 sw ra,12(sp)
FP_EXTEND (D, S, 2, 1, R, A);
13e8: 0fe7f793 andi a5,a5,254
FP_UNPACK_RAW_S (A, a);
13ec: 00945413 srli s0,s0,0x9
13f0: 01f55493 srli s1,a0,0x1f
FP_EXTEND (D, S, 2, 1, R, A);
13f4: 04078263 beqz a5,1438 <__extendsfdf2+0x70>
13f8: 00345793 srli a5,s0,0x3
13fc: 38070713 addi a4,a4,896
1400: 01d41413 slli s0,s0,0x1d
#else
FP_EXTEND (D, S, 1, 1, R, A);
#endif
FP_PACK_RAW_D (r, R);
1404: 00c79793 slli a5,a5,0xc
1408: 00c7d793 srli a5,a5,0xc
140c: 01471713 slli a4,a4,0x14
1410: 01f49513 slli a0,s1,0x1f
1414: 00f76733 or a4,a4,a5
FP_HANDLE_EXCEPTIONS;
return r;
}
1418: 00c12083 lw ra,12(sp)
FP_PACK_RAW_D (r, R);
141c: 00a767b3 or a5,a4,a0
}
1420: 00040513 mv a0,s0
1424: 00812403 lw s0,8(sp)
1428: 00412483 lw s1,4(sp)
142c: 00078593 mv a1,a5
1430: 01010113 addi sp,sp,16
1434: 00008067 ret
FP_EXTEND (D, S, 2, 1, R, A);
1438: 04071663 bnez a4,1484 <__extendsfdf2+0xbc>
143c: 00000793 li a5,0
1440: fc0402e3 beqz s0,1404 <__extendsfdf2+0x3c>
1444: 00040513 mv a0,s0
1448: 05c000ef jal ra,14a4 <__clzsi2>
144c: 00a00793 li a5,10
1450: 02a7c263 blt a5,a0,1474 <__extendsfdf2+0xac>
1454: 00b00793 li a5,11
1458: 40a787b3 sub a5,a5,a0
145c: 01550713 addi a4,a0,21
1460: 00f457b3 srl a5,s0,a5
1464: 00e41433 sll s0,s0,a4
1468: 38900713 li a4,905
146c: 40a70733 sub a4,a4,a0
1470: f95ff06f j 1404 <__extendsfdf2+0x3c>
1474: ff550793 addi a5,a0,-11
1478: 00f417b3 sll a5,s0,a5
147c: 00000413 li s0,0
1480: fe9ff06f j 1468 <__extendsfdf2+0xa0>
1484: 00000793 li a5,0
1488: 00040a63 beqz s0,149c <__extendsfdf2+0xd4>
148c: 00345793 srli a5,s0,0x3
1490: 00080737 lui a4,0x80
1494: 01d41413 slli s0,s0,0x1d
1498: 00e7e7b3 or a5,a5,a4
149c: 7ff00713 li a4,2047
14a0: f65ff06f j 1404 <__extendsfdf2+0x3c>
000014a4 <__clzsi2>:
int
__clzSI2 (UWtype x)
{
Wtype ret;
count_leading_zeros (ret, x);
14a4: 000107b7 lui a5,0x10
14a8: 02f57a63 bgeu a0,a5,14dc <__clzsi2+0x38>
14ac: 10053793 sltiu a5,a0,256
14b0: 0017c793 xori a5,a5,1
14b4: 00379793 slli a5,a5,0x3
14b8: 00003737 lui a4,0x3
14bc: 02000693 li a3,32
14c0: 40f686b3 sub a3,a3,a5
14c4: 00f55533 srl a0,a0,a5
14c8: c1c70793 addi a5,a4,-996 # 2c1c <__clz_tab>
14cc: 00a787b3 add a5,a5,a0
14d0: 0007c503 lbu a0,0(a5) # 10000 <_data_lma+0xd15c>
return ret;
}
14d4: 40a68533 sub a0,a3,a0
14d8: 00008067 ret
count_leading_zeros (ret, x);
14dc: 01000737 lui a4,0x1000
14e0: 01000793 li a5,16
14e4: fce56ae3 bltu a0,a4,14b8 <__clzsi2+0x14>
14e8: 01800793 li a5,24
14ec: fcdff06f j 14b8 <__clzsi2+0x14>
000014f0 <__wrap_malloc>:
/* These functions are intended for embedded RV32 systems and are
obviously incorrect in general. */
void* __wrap_malloc(unsigned long sz)
{
14f0: ff010113 addi sp,sp,-16
14f4: 00112623 sw ra,12(sp)
extern void* sbrk(long);
void* res = sbrk(sz);
14f8: 0b8000ef jal ra,15b0 <__wrap_sbrk>
if ((long)res == -1)
return 0;
return res;
}
14fc: 00c12083 lw ra,12(sp)
return 0;
1500: 00150793 addi a5,a0,1
1504: 00f037b3 snez a5,a5
1508: 40f007b3 neg a5,a5
}
150c: 00f57533 and a0,a0,a5
1510: 01010113 addi sp,sp,16
1514: 00008067 ret
00001518 <__wrap_free>:
void __wrap_free(void* ptr)
{
}
1518: 00008067 ret
0000151c <__wrap_write>:
#include "platform.h"
#include "stub.h"
ssize_t __wrap_write(int fd, const void* ptr, size_t len)
{
151c: ff010113 addi sp,sp,-16
1520: 00812423 sw s0,8(sp)
1524: 00912223 sw s1,4(sp)
1528: 00112623 sw ra,12(sp)
152c: 00058413 mv s0,a1
1530: 00060493 mv s1,a2
const uint8_t * current = (const char *)ptr;
if (isatty(fd)) {
1534: 070000ef jal ra,15a4 <__wrap_isatty>
1538: 06050263 beqz a0,159c <__wrap_write+0x80>
for (size_t jj = 0; jj < len; jj++) {
153c: 02048c63 beqz s1,1574 <__wrap_write+0x58>
1540: 00040593 mv a1,s0
1544: 00940833 add a6,s0,s1
while (UART0_REG(UART_REG_TXFIFO) & 0x80000000) ;
1548: ffff0737 lui a4,0xffff0
UART0_REG(UART_REG_TXFIFO) = current[jj];
if (current[jj] == '\n') {
154c: 00a00693 li a3,10
while (UART0_REG(UART_REG_TXFIFO) & 0x80000000) ;
UART0_REG(UART_REG_TXFIFO) = '\r';
1550: 00d00613 li a2,13
while (UART0_REG(UART_REG_TXFIFO) & 0x80000000) ;
1554: 00072783 lw a5,0(a4) # ffff0000 <tohost+0xffff0010>
1558: fe07cee3 bltz a5,1554 <__wrap_write+0x38>
UART0_REG(UART_REG_TXFIFO) = current[jj];
155c: 0005c783 lbu a5,0(a1)
1560: 00f72023 sw a5,0(a4)
if (current[jj] == '\n') {
1564: 0005c783 lbu a5,0(a1)
1568: 02d78263 beq a5,a3,158c <__wrap_write+0x70>
for (size_t jj = 0; jj < len; jj++) {
156c: 00158593 addi a1,a1,1
1570: ff0592e3 bne a1,a6,1554 <__wrap_write+0x38>
}
}
return len;
1574: 00048513 mv a0,s1
}
return _stub(EBADF);
}
1578: 00c12083 lw ra,12(sp)
157c: 00812403 lw s0,8(sp)
1580: 00412483 lw s1,4(sp)
1584: 01010113 addi sp,sp,16
1588: 00008067 ret
while (UART0_REG(UART_REG_TXFIFO) & 0x80000000) ;
158c: 00072783 lw a5,0(a4)
1590: fe07cee3 bltz a5,158c <__wrap_write+0x70>
UART0_REG(UART_REG_TXFIFO) = '\r';
1594: 00c72023 sw a2,0(a4)
1598: fd5ff06f j 156c <__wrap_write+0x50>
return _stub(EBADF);
159c: fff00513 li a0,-1
15a0: fd9ff06f j 1578 <__wrap_write+0x5c>
000015a4 <__wrap_isatty>:
#include <unistd.h>
int __wrap_isatty(int fd)
{
if (fd == STDOUT_FILENO || fd == STDERR_FILENO)
15a4: fff50513 addi a0,a0,-1
return 1;
return 0;
}
15a8: 00253513 sltiu a0,a0,2
15ac: 00008067 ret
000015b0 <__wrap_sbrk>:
{
extern char _end[];
extern char _heap_end[];
static char *curbrk = _end;
if ((curbrk + incr < _end) || (curbrk + incr > _heap_end))
15b0: 0ffff717 auipc a4,0xffff
15b4: a6070713 addi a4,a4,-1440 # 10000010 <curbrk.0>
15b8: 00072783 lw a5,0(a4)
15bc: 10001697 auipc a3,0x10001
15c0: 25c68693 addi a3,a3,604 # 10002818 <__BSS_END__>
15c4: 00a78533 add a0,a5,a0
15c8: 00d56e63 bltu a0,a3,15e4 <__wrap_sbrk+0x34>
15cc: 10002697 auipc a3,0x10002
15d0: 23468693 addi a3,a3,564 # 10003800 <_heap_end>
15d4: 00a6e863 bltu a3,a0,15e4 <__wrap_sbrk+0x34>
return NULL - 1;
curbrk += incr;
15d8: 00a72023 sw a0,0(a4)
return curbrk - incr;
}
15dc: 00078513 mv a0,a5
15e0: 00008067 ret
return NULL - 1;
15e4: fff00793 li a5,-1
}
15e8: 00078513 mv a0,a5
15ec: 00008067 ret
000015f0 <__wrap__exit>:
extern volatile uint32_t fromhost;
void __wrap__exit(int code)
{
//volatile uint32_t* leds = (uint32_t*) (GPIO_BASE_ADDR + GPIO_OUT_OFFSET);
const char message[] = "\nProgam has exited with code:";
15f0: 00001797 auipc a5,0x1
15f4: 73078793 addi a5,a5,1840 # 2d20 <__clz_tab+0x104>
15f8: 0007ae83 lw t4,0(a5)
15fc: 0047ae03 lw t3,4(a5)
1600: 0087a303 lw t1,8(a5)
1604: 00c7a883 lw a7,12(a5)
1608: 0107a803 lw a6,16(a5)
160c: 0147a683 lw a3,20(a5)
1610: 0187a703 lw a4,24(a5)
1614: 01c7d783 lhu a5,28(a5)
{
1618: fd010113 addi sp,sp,-48
//*leds = (~(code));
write(STDERR_FILENO, message, sizeof(message) - 1);
161c: 01d00613 li a2,29
{
1620: 02812423 sw s0,40(sp)
write(STDERR_FILENO, message, sizeof(message) - 1);
1624: 00010593 mv a1,sp
{
1628: 00050413 mv s0,a0
write(STDERR_FILENO, message, sizeof(message) - 1);
162c: 00200513 li a0,2
const char message[] = "\nProgam has exited with code:";
1630: 00f11e23 sh a5,28(sp)
{
1634: 02112623 sw ra,44(sp)
const char message[] = "\nProgam has exited with code:";
1638: 01d12023 sw t4,0(sp)
163c: 01c12223 sw t3,4(sp)
1640: 00612423 sw t1,8(sp)
1644: 01112623 sw a7,12(sp)
1648: 01012823 sw a6,16(sp)
164c: 00d12a23 sw a3,20(sp)
1650: 00e12c23 sw a4,24(sp)
write(STDERR_FILENO, message, sizeof(message) - 1);
1654: ec9ff0ef jal ra,151c <__wrap_write>
write_hex(STDERR_FILENO, code);
1658: 00040593 mv a1,s0
165c: 00200513 li a0,2
1660: 03c000ef jal ra,169c <write_hex>
write(STDERR_FILENO, "\n", 1);
1664: 00100613 li a2,1
1668: 00001597 auipc a1,0x1
166c: 1c858593 addi a1,a1,456 # 2830 <__modsi3+0x298>
1670: 00200513 li a0,2
1674: ea9ff0ef jal ra,151c <__wrap_write>
tohost = code+1;
1678: 00140413 addi s0,s0,1 # 400001 <_data_lma+0x3fd15d>
write(STDERR_FILENO, "\x04", 1);
167c: 00100613 li a2,1
1680: 00001597 auipc a1,0x1
1684: 69c58593 addi a1,a1,1692 # 2d1c <__clz_tab+0x100>
1688: 00200513 li a0,2
tohost = code+1;
168c: fffff797 auipc a5,0xfffff
1690: 9687a223 sw s0,-1692(a5) # fffffff0 <tohost+0x0>
write(STDERR_FILENO, "\x04", 1);
1694: e89ff0ef jal ra,151c <__wrap_write>
for (;;);
1698: 0000006f j 1698 <__wrap__exit+0xa8>
0000169c <write_hex>:
#include <stdint.h>
#include <unistd.h>
#include "platform.h"
void write_hex(int fd, uint32_t hex)
{
169c: fd010113 addi sp,sp,-48
16a0: 02912223 sw s1,36(sp)
uint8_t ii;
uint8_t jj;
char towrite;
write(fd , "0x", 2);
16a4: 00200613 li a2,2
{
16a8: 00058493 mv s1,a1
write(fd , "0x", 2);
16ac: 00001597 auipc a1,0x1
16b0: 69458593 addi a1,a1,1684 # 2d40 <__clz_tab+0x124>
{
16b4: 02812423 sw s0,40(sp)
16b8: 03212023 sw s2,32(sp)
16bc: 01312e23 sw s3,28(sp)
16c0: 01412c23 sw s4,24(sp)
16c4: 01512a23 sw s5,20(sp)
16c8: 02112623 sw ra,44(sp)
16cc: 00050913 mv s2,a0
write(fd , "0x", 2);
16d0: 01c00413 li s0,28
16d4: e49ff0ef jal ra,151c <__wrap_write>
for (ii = 8 ; ii > 0; ii--) {
jj = ii - 1;
uint8_t digit = ((hex & (0xF << (jj*4))) >> (jj*4));
16d8: 00f00a93 li s5,15
towrite = digit < 0xA ? ('0' + digit) : ('A' + (digit - 0xA));
16dc: 00900a13 li s4,9
for (ii = 8 ; ii > 0; ii--) {
16e0: ffc00993 li s3,-4
16e4: 0240006f j 1708 <write_hex+0x6c>
towrite = digit < 0xA ? ('0' + digit) : ('A' + (digit - 0xA));
16e8: 0ff6f793 zext.b a5,a3
for (ii = 8 ; ii > 0; ii--) {
16ec: ffc40413 addi s0,s0,-4
write(fd, &towrite, 1);
16f0: 00100613 li a2,1
16f4: 00f10593 addi a1,sp,15
16f8: 00090513 mv a0,s2
towrite = digit < 0xA ? ('0' + digit) : ('A' + (digit - 0xA));
16fc: 00f107a3 sb a5,15(sp)
write(fd, &towrite, 1);
1700: e1dff0ef jal ra,151c <__wrap_write>
for (ii = 8 ; ii > 0; ii--) {
1704: 05340063 beq s0,s3,1744 <write_hex+0xa8>
uint8_t digit = ((hex & (0xF << (jj*4))) >> (jj*4));
1708: 008a97b3 sll a5,s5,s0
170c: 0097f7b3 and a5,a5,s1
1710: 0087d7b3 srl a5,a5,s0
1714: 0ff7f793 zext.b a5,a5
towrite = digit < 0xA ? ('0' + digit) : ('A' + (digit - 0xA));
1718: 03078693 addi a3,a5,48
171c: 03778713 addi a4,a5,55
1720: fcfa74e3 bgeu s4,a5,16e8 <write_hex+0x4c>
1724: 0ff77793 zext.b a5,a4
for (ii = 8 ; ii > 0; ii--) {
1728: ffc40413 addi s0,s0,-4
write(fd, &towrite, 1);
172c: 00100613 li a2,1
1730: 00f10593 addi a1,sp,15
1734: 00090513 mv a0,s2
towrite = digit < 0xA ? ('0' + digit) : ('A' + (digit - 0xA));
1738: 00f107a3 sb a5,15(sp)
write(fd, &towrite, 1);
173c: de1ff0ef jal ra,151c <__wrap_write>
for (ii = 8 ; ii > 0; ii--) {
1740: fd3414e3 bne s0,s3,1708 <write_hex+0x6c>
}
}
1744: 02c12083 lw ra,44(sp)
1748: 02812403 lw s0,40(sp)
174c: 02412483 lw s1,36(sp)
1750: 02012903 lw s2,32(sp)
1754: 01c12983 lw s3,28(sp)
1758: 01812a03 lw s4,24(sp)
175c: 01412a83 lw s5,20(sp)
1760: 03010113 addi sp,sp,48
1764: 00008067 ret
00001768 <sprintf_putch>:
}
static void sprintf_putch(int ch, void** data)
{
char** pstr = (char**)data;
**pstr = ch;
1768: 0005a783 lw a5,0(a1)
176c: 00a78023 sb a0,0(a5)
(*pstr)++;
1770: 0005a783 lw a5,0(a1)
1774: 00178793 addi a5,a5,1
1778: 00f5a023 sw a5,0(a1)
}
177c: 00008067 ret
00001780 <putchar>:
{
1780: fe010113 addi sp,sp,-32
1784: 00a12623 sw a0,12(sp)
return write(STDOUT_FILENO, &ch, 1) == 1 ? ch : -1;
1788: 00100613 li a2,1
178c: 00c10593 addi a1,sp,12
1790: 00100513 li a0,1
{
1794: 00112e23 sw ra,28(sp)
return write(STDOUT_FILENO, &ch, 1) == 1 ? ch : -1;
1798: d85ff0ef jal ra,151c <__wrap_write>
179c: 00100793 li a5,1
17a0: 00f51a63 bne a0,a5,17b4 <putchar+0x34>
17a4: 00c12503 lw a0,12(sp)
}
17a8: 01c12083 lw ra,28(sp)
17ac: 02010113 addi sp,sp,32
17b0: 00008067 ret
return write(STDOUT_FILENO, &ch, 1) == 1 ? ch : -1;
17b4: fff00513 li a0,-1
17b8: ff1ff06f j 17a8 <putchar+0x28>
000017bc <vprintfmt>:
for (char* p = buf; p < pbuf; p++)
putch(*p, putdat);
}
static void vprintfmt(void (*putch)(int, void**), void **putdat, const char *fmt, va_list ap)
{
17bc: f1010113 addi sp,sp,-240
17c0: 0d512a23 sw s5,212(sp)
17c4: 40000ab7 lui s5,0x40000
17c8: fffa8793 addi a5,s5,-1 # 3fffffff <_sp+0x2fffbfff>
17cc: 0d912223 sw s9,196(sp)
u.u &= ~(1ULL << 63);
17d0: 80000cb7 lui s9,0x80000
17d4: 00f12223 sw a5,4(sp)
17d8: fffcc793 not a5,s9
{
17dc: 0e812423 sw s0,232(sp)
17e0: 0e912223 sw s1,228(sp)
17e4: 0f212023 sw s2,224(sp)
17e8: 0d312e23 sw s3,220(sp)
17ec: 0e112623 sw ra,236(sp)
17f0: 0d412c23 sw s4,216(sp)
17f4: 0d612823 sw s6,208(sp)
17f8: 0d712623 sw s7,204(sp)
17fc: 0d812423 sw s8,200(sp)
1800: 0da12023 sw s10,192(sp)
1804: 0bb12e23 sw s11,188(sp)
1808: 00050913 mv s2,a0
180c: 00058493 mv s1,a1
1810: 00060413 mv s0,a2
1814: 00d12023 sw a3,0(sp)
unsigned long num;
int base, lflag, width, precision, altflag;
char padc;
while (1) {
while ((ch = *(unsigned char *) fmt) != '%') {
1818: 02500993 li s3,37
u.u &= ~(1ULL << 63);
181c: 00f12423 sw a5,8(sp)
while ((ch = *(unsigned char *) fmt) != '%') {
1820: 0140006f j 1834 <vprintfmt+0x78>
if (ch == '\0')
1824: 06050263 beqz a0,1888 <vprintfmt+0xcc>
return;
fmt++;
putch(ch, putdat);
1828: 00048593 mv a1,s1
fmt++;
182c: 00140413 addi s0,s0,1
putch(ch, putdat);
1830: 000900e7 jalr s2
while ((ch = *(unsigned char *) fmt) != '%') {
1834: 00044503 lbu a0,0(s0)
1838: ff3516e3 bne a0,s3,1824 <vprintfmt+0x68>
width = -1;
precision = -1;
lflag = 0;
altflag = 0;
reswitch:
switch (ch = *(unsigned char *) fmt++) {
183c: 00144683 lbu a3,1(s0)
fmt++;
1840: 00140d93 addi s11,s0,1
1844: 000d8713 mv a4,s11
padc = ' ';
1848: 02000b93 li s7,32
precision = -1;
184c: fff00d13 li s10,-1
width = -1;
1850: fff00b13 li s6,-1
switch (ch = *(unsigned char *) fmt++) {
1854: 05500593 li a1,85
case '8':
case '9':
for (precision = 0; ; ++fmt) {
precision = precision * 10 + ch - '0';
ch = *fmt;
if (ch < '0' || ch > '9')
1858: 00900513 li a0,9
switch (ch = *(unsigned char *) fmt++) {
185c: fdd68793 addi a5,a3,-35
1860: 0ff7f793 zext.b a5,a5
1864: 00170413 addi s0,a4,1
1868: 06f5ec63 bltu a1,a5,18e0 <vprintfmt+0x124>
186c: 00001617 auipc a2,0x1
1870: 4e060613 addi a2,a2,1248 # 2d4c <__clz_tab+0x130>
1874: 00279793 slli a5,a5,0x2
1878: 00c787b3 add a5,a5,a2
187c: 0007a783 lw a5,0(a5)
1880: 00c787b3 add a5,a5,a2
1884: 00078067 jr a5
putch('%', putdat);
fmt = last_fmt;
break;
}
}
}
1888: 0ec12083 lw ra,236(sp)
188c: 0e812403 lw s0,232(sp)
1890: 0e412483 lw s1,228(sp)
1894: 0e012903 lw s2,224(sp)
1898: 0dc12983 lw s3,220(sp)
189c: 0d812a03 lw s4,216(sp)
18a0: 0d412a83 lw s5,212(sp)
18a4: 0d012b03 lw s6,208(sp)
18a8: 0cc12b83 lw s7,204(sp)
18ac: 0c812c03 lw s8,200(sp)
18b0: 0c412c83 lw s9,196(sp)
18b4: 0c012d03 lw s10,192(sp)
18b8: 0bc12d83 lw s11,188(sp)
18bc: 0f010113 addi sp,sp,240
18c0: 00008067 ret
padc = '0';
18c4: 00068b93 mv s7,a3
goto reswitch;
18c8: 00174683 lbu a3,1(a4)
switch (ch = *(unsigned char *) fmt++) {
18cc: 00040713 mv a4,s0
18d0: 00170413 addi s0,a4,1
18d4: fdd68793 addi a5,a3,-35
18d8: 0ff7f793 zext.b a5,a5
18dc: f8f5f8e3 bgeu a1,a5,186c <vprintfmt+0xb0>
putch('%', putdat);
18e0: 00048593 mv a1,s1
18e4: 02500513 li a0,37
18e8: 000900e7 jalr s2
fmt = last_fmt;
18ec: 000d8413 mv s0,s11
break;
18f0: f45ff06f j 1834 <vprintfmt+0x78>
ch = *fmt;
18f4: 00174683 lbu a3,1(a4)
switch (ch = *(unsigned char *) fmt++) {
18f8: 00040713 mv a4,s0
goto reswitch;
18fc: f61ff06f j 185c <vprintfmt+0xa0>
ch = *fmt;
1900: 00174603 lbu a2,1(a4)
precision = precision * 10 + ch - '0';
1904: fd068d13 addi s10,a3,-48
switch (ch = *(unsigned char *) fmt++) {
1908: 00040713 mv a4,s0
if (ch < '0' || ch > '9')
190c: fd060793 addi a5,a2,-48
ch = *fmt;
1910: 00060693 mv a3,a2
if (ch < '0' || ch > '9')
1914: 02f56663 bltu a0,a5,1940 <vprintfmt+0x184>
precision = precision * 10 + ch - '0';
1918: 002d1793 slli a5,s10,0x2
191c: 01a787b3 add a5,a5,s10
for (precision = 0; ; ++fmt) {
1920: 00170713 addi a4,a4,1
precision = precision * 10 + ch - '0';
1924: 00179793 slli a5,a5,0x1
1928: 00c787b3 add a5,a5,a2
ch = *fmt;
192c: 00074603 lbu a2,0(a4)
precision = precision * 10 + ch - '0';
1930: fd078d13 addi s10,a5,-48
if (ch < '0' || ch > '9')
1934: fd060793 addi a5,a2,-48
ch = *fmt;
1938: 00060693 mv a3,a2
if (ch < '0' || ch > '9')
193c: fcf57ee3 bgeu a0,a5,1918 <vprintfmt+0x15c>
if (width < 0)
1940: f00b5ee3 bgez s6,185c <vprintfmt+0xa0>
width = precision, precision = -1;
1944: 000d0b13 mv s6,s10
1948: fff00d13 li s10,-1
194c: f11ff06f j 185c <vprintfmt+0xa0>
putch(ch, putdat);
1950: 00048593 mv a1,s1
1954: 02500513 li a0,37
1958: 000900e7 jalr s2
break;
195c: ed9ff06f j 1834 <vprintfmt+0x78>
precision = va_arg(ap, int);
1960: 00012783 lw a5,0(sp)
ch = *fmt;
1964: 00174683 lbu a3,1(a4)
switch (ch = *(unsigned char *) fmt++) {
1968: 00040713 mv a4,s0
precision = va_arg(ap, int);
196c: 0007ad03 lw s10,0(a5)
1970: 00478793 addi a5,a5,4
1974: 00f12023 sw a5,0(sp)
goto process_precision;
1978: fc9ff06f j 1940 <vprintfmt+0x184>
switch (ch = *(unsigned char *) fmt++) {
197c: 01000a93 li s5,16
return va_arg(*ap, unsigned int);
1980: 00012783 lw a5,0(sp)
1984: 0007ac03 lw s8,0(a5)
1988: 00478793 addi a5,a5,4
198c: 00f12023 sw a5,0(sp)
digs[pos++] = num % base;
1990: 000a8593 mv a1,s5
1994: 000c0513 mv a0,s8
1998: 3cd000ef jal ra,2564 <__umodsi3>
199c: 02a12823 sw a0,48(sp)
19a0: 00050d13 mv s10,a0
19a4: 03410a13 addi s4,sp,52
19a8: 00100c93 li s9,1
if (num < base)
19ac: 355c6e63 bltu s8,s5,1d08 <vprintfmt+0x54c>
num /= base;
19b0: 000a8593 mv a1,s5
19b4: 000c0513 mv a0,s8
19b8: 365000ef jal ra,251c <__udivsi3>
digs[pos++] = num % base;
19bc: 000a8593 mv a1,s5
num /= base;
19c0: 00050c13 mv s8,a0
digs[pos++] = num % base;
19c4: 3a1000ef jal ra,2564 <__umodsi3>
19c8: 00aa2023 sw a0,0(s4)
19cc: 000c8d93 mv s11,s9
19d0: 00050d13 mv s10,a0
if (num < base)
19d4: 004a0a13 addi s4,s4,4
digs[pos++] = num % base;
19d8: 001c8c93 addi s9,s9,1 # 80000001 <tohost+0x80000011>
if (num < base)
19dc: fd5c7ae3 bgeu s8,s5,19b0 <vprintfmt+0x1f4>
while (width-- > pos)
19e0: 016cdc63 bge s9,s6,19f8 <vprintfmt+0x23c>
19e4: fffb0b13 addi s6,s6,-1
putch(padc, putdat);
19e8: 00048593 mv a1,s1
19ec: 000b8513 mv a0,s7
19f0: 000900e7 jalr s2
while (width-- > pos)
19f4: ff6cc8e3 blt s9,s6,19e4 <vprintfmt+0x228>
19f8: 00412783 lw a5,4(sp)
19fc: 02c10b93 addi s7,sp,44
putch(digs[pos] + (digs[pos] >= 10 ? 'a' - 10 : '0'), putdat);
1a00: 00900b13 li s6,9
1a04: 00fd8db3 add s11,s11,a5
1a08: 002d9d93 slli s11,s11,0x2
1a0c: 03010793 addi a5,sp,48
1a10: 01b78db3 add s11,a5,s11
1a14: 00c0006f j 1a20 <vprintfmt+0x264>
1a18: 000dad03 lw s10,0(s11)
1a1c: ffcd8d93 addi s11,s11,-4
1a20: 01ab37b3 sltu a5,s6,s10
1a24: 40f007b3 neg a5,a5
1a28: 0277f793 andi a5,a5,39
1a2c: 03078793 addi a5,a5,48
1a30: 00048593 mv a1,s1
1a34: 01a78533 add a0,a5,s10
1a38: 000900e7 jalr s2
while (pos-- > 0)
1a3c: fdbb9ee3 bne s7,s11,1a18 <vprintfmt+0x25c>
1a40: df5ff06f j 1834 <vprintfmt+0x78>
if ((p = va_arg(ap, char *)) == NULL)
1a44: 00012783 lw a5,0(sp)
1a48: 0007ad83 lw s11,0(a5)
1a4c: 00478a13 addi s4,a5,4
1a50: 2e0d8c63 beqz s11,1d48 <vprintfmt+0x58c>
if (width > 0 && padc != '-')
1a54: 0b605263 blez s6,1af8 <vprintfmt+0x33c>
1a58: 02d00793 li a5,45
1a5c: 04fb9e63 bne s7,a5,1ab8 <vprintfmt+0x2fc>
for (; (ch = *p) != '\0' && (precision < 0 || --precision >= 0); width--) {
1a60: 000dc503 lbu a0,0(s11)
1a64: 02050863 beqz a0,1a94 <vprintfmt+0x2d8>
1a68: fff00b93 li s7,-1
1a6c: 000d4663 bltz s10,1a78 <vprintfmt+0x2bc>
1a70: fffd0d13 addi s10,s10,-1
1a74: 017d0e63 beq s10,s7,1a90 <vprintfmt+0x2d4>
putch(ch, putdat);
1a78: 00048593 mv a1,s1
p++;
1a7c: 001d8d93 addi s11,s11,1
putch(ch, putdat);
1a80: 000900e7 jalr s2
for (; (ch = *p) != '\0' && (precision < 0 || --precision >= 0); width--) {
1a84: 000dc503 lbu a0,0(s11)
1a88: fffb0b13 addi s6,s6,-1
1a8c: fe0510e3 bnez a0,1a6c <vprintfmt+0x2b0>
for (; width > 0; width--)
1a90: 01605c63 blez s6,1aa8 <vprintfmt+0x2ec>
1a94: fffb0b13 addi s6,s6,-1
putch(' ', putdat);
1a98: 00048593 mv a1,s1
1a9c: 02000513 li a0,32
1aa0: 000900e7 jalr s2
for (; width > 0; width--)
1aa4: fe0b18e3 bnez s6,1a94 <vprintfmt+0x2d8>
if ((p = va_arg(ap, char *)) == NULL)
1aa8: 01412023 sw s4,0(sp)
1aac: d89ff06f j 1834 <vprintfmt+0x78>
p = "(null)";
1ab0: 00001d97 auipc s11,0x1
1ab4: 294d8d93 addi s11,s11,660 # 2d44 <__clz_tab+0x128>
while (n-- > 0 && *str) str++;
1ab8: 000d8793 mv a5,s11
1abc: 01ad86b3 add a3,s11,s10
1ac0: 000d1863 bnez s10,1ad0 <vprintfmt+0x314>
1ac4: 0200006f j 1ae4 <vprintfmt+0x328>
1ac8: 00178793 addi a5,a5,1
1acc: 00d78663 beq a5,a3,1ad8 <vprintfmt+0x31c>
1ad0: 0007c703 lbu a4,0(a5)
1ad4: fe071ae3 bnez a4,1ac8 <vprintfmt+0x30c>
return str - start;
1ad8: 41b787b3 sub a5,a5,s11
for (width -= strnlen(p, precision); width > 0; width--)
1adc: 40fb0b33 sub s6,s6,a5
1ae0: 01605c63 blez s6,1af8 <vprintfmt+0x33c>
1ae4: fffb0b13 addi s6,s6,-1
putch(padc, putdat);
1ae8: 00048593 mv a1,s1
1aec: 000b8513 mv a0,s7
1af0: 000900e7 jalr s2
for (width -= strnlen(p, precision); width > 0; width--)
1af4: fe0b18e3 bnez s6,1ae4 <vprintfmt+0x328>
for (; (ch = *p) != '\0' && (precision < 0 || --precision >= 0); width--) {
1af8: 000dc503 lbu a0,0(s11)
1afc: fa0506e3 beqz a0,1aa8 <vprintfmt+0x2ec>
1b00: fff00b93 li s7,-1
1b04: f69ff06f j 1a6c <vprintfmt+0x2b0>
putch(va_arg(ap, int), putdat);
1b08: 00012783 lw a5,0(sp)
1b0c: 00048593 mv a1,s1
1b10: 0007a503 lw a0,0(a5)
1b14: 00478a13 addi s4,a5,4
1b18: 000900e7 jalr s2
1b1c: 01412023 sw s4,0(sp)
break;
1b20: d15ff06f j 1834 <vprintfmt+0x78>
return va_arg(*ap, int);
1b24: 00012783 lw a5,0(sp)
1b28: 0007ac03 lw s8,0(a5)
1b2c: 00478a13 addi s4,a5,4
if ((long) num < 0) {
1b30: 000c5a63 bgez s8,1b44 <vprintfmt+0x388>
putch('-', putdat);
1b34: 00048593 mv a1,s1
1b38: 02d00513 li a0,45
1b3c: 000900e7 jalr s2
num = -(long) num;
1b40: 41800c33 neg s8,s8
return va_arg(*ap, int);
1b44: 01412023 sw s4,0(sp)
num = -(long) num;
1b48: 00a00a93 li s5,10
1b4c: e45ff06f j 1990 <vprintfmt+0x1d4>
print_double(putch, putdat, va_arg(ap, double), width, precision);
1b50: 00012783 lw a5,0(sp)
1b54: 00778a13 addi s4,a5,7
1b58: ff8a7a13 andi s4,s4,-8
1b5c: 004a2d83 lw s11,4(s4)
1b60: 000a2a83 lw s5,0(s4)
1b64: 008a0793 addi a5,s4,8
1b68: 00f12023 sw a5,0(sp)
u.d = num;
1b6c: 000d8713 mv a4,s11
1b70: 000a8693 mv a3,s5
if (u.u & (1ULL << 63)) {
1b74: 1a0dc063 bltz s11,1d14 <vprintfmt+0x558>
for (int i = 0; i < prec; i++)
1b78: 05a05263 blez s10,1bbc <vprintfmt+0x400>
1b7c: 0fffe797 auipc a5,0xfffe
1b80: 48478793 addi a5,a5,1156 # 10000000 <__DATA_BEGIN__>
u.d *= 10;
1b84: 0007ab03 lw s6,0(a5)
1b88: 0047ab83 lw s7,4(a5)
for (int i = 0; i < prec; i++)
1b8c: 00000a13 li s4,0
u.d *= 10;
1b90: 00068513 mv a0,a3
1b94: 00070593 mv a1,a4
1b98: 000b8693 mv a3,s7
1b9c: 000b0613 mv a2,s6
1ba0: 2ec000ef jal ra,1e8c <__muldf3>
for (int i = 0; i < prec; i++)
1ba4: 001a0a13 addi s4,s4,1
u.d *= 10;
1ba8: 00050a93 mv s5,a0
1bac: 00058d93 mv s11,a1
1bb0: 00050693 mv a3,a0
1bb4: 00058713 mv a4,a1
for (int i = 0; i < prec; i++)
1bb8: fd4d1ce3 bne s10,s4,1b90 <vprintfmt+0x3d4>
printnum(sprintf_putch, (void**)&pbuf, (unsigned long)u.d, 10, 0, 0);
1bbc: 000d8593 mv a1,s11
1bc0: 000a8513 mv a0,s5
1bc4: 0d5000ef jal ra,2498 <__fixunsdfsi>
digs[pos++] = num % base;
1bc8: 00a00593 li a1,10
printnum(sprintf_putch, (void**)&pbuf, (unsigned long)u.d, 10, 0, 0);
1bcc: 00050b13 mv s6,a0
digs[pos++] = num % base;
1bd0: 195000ef jal ra,2564 <__umodsi3>
1bd4: 02a12823 sw a0,48(sp)
if (num < base)
1bd8: 00900793 li a5,9
1bdc: 1967f663 bgeu a5,s6,1d68 <vprintfmt+0x5ac>
1be0: 03410a13 addi s4,sp,52
digs[pos++] = num % base;
1be4: 00100d93 li s11,1
if (num < base)
1be8: 06300b93 li s7,99
num /= base;
1bec: 00a00593 li a1,10
1bf0: 000b0513 mv a0,s6
1bf4: 129000ef jal ra,251c <__udivsi3>
digs[pos++] = num % base;
1bf8: 00a00593 li a1,10
1bfc: 000b0a93 mv s5,s6
num /= base;
1c00: 00050b13 mv s6,a0
digs[pos++] = num % base;
1c04: 161000ef jal ra,2564 <__umodsi3>
1c08: 00aa2023 sw a0,0(s4)
1c0c: 000d8613 mv a2,s11
if (num < base)
1c10: 004a0a13 addi s4,s4,4
digs[pos++] = num % base;
1c14: 001d8d93 addi s11,s11,1
if (num < base)
1c18: fd5beae3 bltu s7,s5,1bec <vprintfmt+0x430>
1c1c: 03010813 addi a6,sp,48
1c20: 00261713 slli a4,a2,0x2
1c24: 00e80733 add a4,a6,a4
putch(digs[pos] + (digs[pos] >= 10 ? 'a' - 10 : '0'), putdat);
1c28: 01010693 addi a3,sp,16
1c2c: 00900893 li a7,9
1c30: 00c0006f j 1c3c <vprintfmt+0x480>
1c34: ffc72503 lw a0,-4(a4)
1c38: 00058713 mv a4,a1
1c3c: 00a8b7b3 sltu a5,a7,a0
1c40: 40f007b3 neg a5,a5
1c44: 0277f793 andi a5,a5,39
1c48: 03078793 addi a5,a5,48
1c4c: 00a787b3 add a5,a5,a0
**pstr = ch;
1c50: 0ff7f793 zext.b a5,a5
1c54: 00f68023 sb a5,0(a3)
while (pos-- > 0)
1c58: ffc70593 addi a1,a4,-4
(*pstr)++;
1c5c: 00168693 addi a3,a3,1
while (pos-- > 0)
1c60: fce81ae3 bne a6,a4,1c34 <vprintfmt+0x478>
(*pstr)++;
1c64: 01160713 addi a4,a2,17
1c68: 00270bb3 add s7,a4,sp
if (prec > 0) {
1c6c: 03a05a63 blez s10,1ca0 <vprintfmt+0x4e4>
1c70: 000b8713 mv a4,s7
1c74: 41ab86b3 sub a3,s7,s10
1c78: 0080006f j 1c80 <vprintfmt+0x4c4>
pbuf[-i] = pbuf[-i-1];
1c7c: fff74783 lbu a5,-1(a4)
1c80: 00f70023 sb a5,0(a4)
for (int i = 0; i < prec; i++) {
1c84: fff70713 addi a4,a4,-1
1c88: fed71ae3 bne a4,a3,1c7c <vprintfmt+0x4c0>
pbuf[-prec] = '.';
1c8c: 41ab8bb3 sub s7,s7,s10
1c90: 02e00793 li a5,46
1c94: 00fb8023 sb a5,0(s7)
pbuf++;
1c98: 01260793 addi a5,a2,18
1c9c: 00278bb3 add s7,a5,sp
for (char* p = buf; p < pbuf; p++)
1ca0: 01010b13 addi s6,sp,16
1ca4: b97b78e3 bgeu s6,s7,1834 <vprintfmt+0x78>
putch(*p, putdat);
1ca8: 000b4503 lbu a0,0(s6)
1cac: 00048593 mv a1,s1
for (char* p = buf; p < pbuf; p++)
1cb0: 001b0b13 addi s6,s6,1
putch(*p, putdat);
1cb4: 000900e7 jalr s2
for (char* p = buf; p < pbuf; p++)
1cb8: ff7b18e3 bne s6,s7,1ca8 <vprintfmt+0x4ec>
1cbc: b79ff06f j 1834 <vprintfmt+0x78>
putch('0', putdat);
1cc0: 03000513 li a0,48
1cc4: 00048593 mv a1,s1
1cc8: 000900e7 jalr s2
putch('x', putdat);
1ccc: 00048593 mv a1,s1
1cd0: 07800513 li a0,120
1cd4: 000900e7 jalr s2
return va_arg(*ap, unsigned long);
1cd8: 00012783 lw a5,0(sp)
1cdc: 01000a93 li s5,16
1ce0: 00478793 addi a5,a5,4
1ce4: 00f12023 sw a5,0(sp)
1ce8: ffc7ac03 lw s8,-4(a5)
1cec: ca5ff06f j 1990 <vprintfmt+0x1d4>
if (width < 0)
1cf0: fffb4793 not a5,s6
1cf4: 41f7d793 srai a5,a5,0x1f
ch = *fmt;
1cf8: 00174683 lbu a3,1(a4)
1cfc: 00fb7b33 and s6,s6,a5
switch (ch = *(unsigned char *) fmt++) {
1d00: 00040713 mv a4,s0
goto reswitch;
1d04: b59ff06f j 185c <vprintfmt+0xa0>
while (width-- > pos)
1d08: 00000d93 li s11,0
1d0c: cd6ccce3 blt s9,s6,19e4 <vprintfmt+0x228>
1d10: ce9ff06f j 19f8 <vprintfmt+0x23c>
putch('-', putdat);
1d14: 00048593 mv a1,s1
1d18: 02d00513 li a0,45
1d1c: 01512623 sw s5,12(sp)
1d20: 000900e7 jalr s2
u.u &= ~(1ULL << 63);
1d24: 00812783 lw a5,8(sp)
printnum(sprintf_putch, (void**)&pbuf, (unsigned long)u.d, 10, 0, 0);
1d28: 00c12683 lw a3,12(sp)
u.u &= ~(1ULL << 63);
1d2c: 01b7f733 and a4,a5,s11
printnum(sprintf_putch, (void**)&pbuf, (unsigned long)u.d, 10, 0, 0);
1d30: 00070d93 mv s11,a4
1d34: e45ff06f j 1b78 <vprintfmt+0x3bc>
switch (ch = *(unsigned char *) fmt++) {
1d38: 00800a93 li s5,8
1d3c: c45ff06f j 1980 <vprintfmt+0x1c4>
1d40: 00a00a93 li s5,10
1d44: c3dff06f j 1980 <vprintfmt+0x1c4>
if (width > 0 && padc != '-')
1d48: 01605663 blez s6,1d54 <vprintfmt+0x598>
1d4c: 02d00793 li a5,45
1d50: d6fb90e3 bne s7,a5,1ab0 <vprintfmt+0x2f4>
1d54: 00001d97 auipc s11,0x1
1d58: ff0d8d93 addi s11,s11,-16 # 2d44 <__clz_tab+0x128>
for (; (ch = *p) != '\0' && (precision < 0 || --precision >= 0); width--) {
1d5c: 02800513 li a0,40
1d60: fff00b93 li s7,-1
1d64: d09ff06f j 1a6c <vprintfmt+0x2b0>
while (pos-- > 0)
1d68: 00000613 li a2,0
1d6c: eb1ff06f j 1c1c <vprintfmt+0x460>
00001d70 <strnlen>:
while (n-- > 0 && *str) str++;
1d70: 00b506b3 add a3,a0,a1
1d74: 00050793 mv a5,a0
1d78: 00059863 bnez a1,1d88 <strnlen+0x18>
1d7c: 0240006f j 1da0 <strnlen+0x30>
1d80: 00178793 addi a5,a5,1
1d84: 00f68a63 beq a3,a5,1d98 <strnlen+0x28>
1d88: 0007c703 lbu a4,0(a5)
1d8c: fe071ae3 bnez a4,1d80 <strnlen+0x10>
return str - start;
1d90: 40a78533 sub a0,a5,a0
}
1d94: 00008067 ret
return str - start;
1d98: 40a68533 sub a0,a3,a0
1d9c: 00008067 ret
while (n-- > 0 && *str) str++;
1da0: 00000513 li a0,0
1da4: 00008067 ret
00001da8 <__wrap_printf>:
int __wrap_printf(const char* fmt, ...)
{
1da8: fc010113 addi sp,sp,-64
va_list ap;
va_start(ap, fmt);
1dac: 02410313 addi t1,sp,36
{
1db0: 00050e13 mv t3,a0
1db4: 02b12223 sw a1,36(sp)
1db8: 02c12423 sw a2,40(sp)
1dbc: 02d12623 sw a3,44(sp)
vprintfmt((void*)putchar, 0, fmt, ap);
1dc0: 00000517 auipc a0,0x0
1dc4: 9c050513 addi a0,a0,-1600 # 1780 <putchar>
1dc8: 00030693 mv a3,t1
1dcc: 000e0613 mv a2,t3
1dd0: 00000593 li a1,0
{
1dd4: 00112e23 sw ra,28(sp)
1dd8: 02e12823 sw a4,48(sp)
1ddc: 02f12a23 sw a5,52(sp)
1de0: 03012c23 sw a6,56(sp)
1de4: 03112e23 sw a7,60(sp)
va_start(ap, fmt);
1de8: 00612623 sw t1,12(sp)
vprintfmt((void*)putchar, 0, fmt, ap);
1dec: 9d1ff0ef jal ra,17bc <vprintfmt>
va_end(ap);
return 0; // incorrect return value, but who cares, anyway?
}
1df0: 01c12083 lw ra,28(sp)
1df4: 00000513 li a0,0
1df8: 04010113 addi sp,sp,64
1dfc: 00008067 ret
00001e00 <__wrap_sprintf>:
int __wrap_sprintf(char* str, const char* fmt, ...)
{
1e00: fb010113 addi sp,sp,-80
va_list ap;
char* str0 = str;
va_start(ap, fmt);
1e04: 03810313 addi t1,sp,56
{
1e08: 02812423 sw s0,40(sp)
1e0c: 00a12623 sw a0,12(sp)
1e10: 02c12c23 sw a2,56(sp)
1e14: 02d12e23 sw a3,60(sp)
char* str0 = str;
1e18: 00050413 mv s0,a0
vprintfmt(sprintf_putch, (void**)&str, fmt, ap);
1e1c: 00058613 mv a2,a1
1e20: 00000517 auipc a0,0x0
1e24: 94850513 addi a0,a0,-1720 # 1768 <sprintf_putch>
1e28: 00c10593 addi a1,sp,12
1e2c: 00030693 mv a3,t1
{
1e30: 02112623 sw ra,44(sp)
1e34: 04f12223 sw a5,68(sp)
1e38: 04e12023 sw a4,64(sp)
1e3c: 05012423 sw a6,72(sp)
1e40: 05112623 sw a7,76(sp)
va_start(ap, fmt);
1e44: 00612e23 sw t1,28(sp)
vprintfmt(sprintf_putch, (void**)&str, fmt, ap);
1e48: 975ff0ef jal ra,17bc <vprintfmt>
*str = 0;
1e4c: 00c12783 lw a5,12(sp)
1e50: 00078023 sb zero,0(a5)
va_end(ap);
return str - str0;
1e54: 00c12503 lw a0,12(sp)
}
1e58: 02c12083 lw ra,44(sp)
1e5c: 40850533 sub a0,a0,s0
1e60: 02812403 lw s0,40(sp)
1e64: 05010113 addi sp,sp,80
1e68: 00008067 ret
00001e6c <strcmp>:
.globl strcmp
.type strcmp, @function
strcmp:
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
1:
lbu a2, 0(a0)
1e6c: 00054603 lbu a2,0(a0)
lbu a3, 0(a1)
1e70: 0005c683 lbu a3,0(a1)
add a0, a0, 1
1e74: 00150513 addi a0,a0,1
add a1, a1, 1
1e78: 00158593 addi a1,a1,1
bne a2, a3, 2f
1e7c: 00d61463 bne a2,a3,1e84 <strcmp+0x18>
bnez a2, 1b
1e80: fe0616e3 bnez a2,1e6c <strcmp>
2:
sub a0, a2, a3
1e84: 40d60533 sub a0,a2,a3
ret
1e88: 00008067 ret
00001e8c <__muldf3>:
#include "soft-fp.h"
#include "double.h"
DFtype
__muldf3 (DFtype a, DFtype b)
{
1e8c: fd010113 addi sp,sp,-48
1e90: 01312e23 sw s3,28(sp)
FP_DECL_D (B);
FP_DECL_D (R);
DFtype r;
FP_INIT_ROUNDMODE;
FP_UNPACK_D (A, a);
1e94: 0145d993 srli s3,a1,0x14
{
1e98: 02812423 sw s0,40(sp)
1e9c: 02912223 sw s1,36(sp)
1ea0: 01412c23 sw s4,24(sp)
1ea4: 01512a23 sw s5,20(sp)
1ea8: 01712623 sw s7,12(sp)
FP_UNPACK_D (A, a);
1eac: 00c59493 slli s1,a1,0xc
{
1eb0: 02112623 sw ra,44(sp)
1eb4: 03212023 sw s2,32(sp)
1eb8: 01612823 sw s6,16(sp)
FP_UNPACK_D (A, a);
1ebc: 7ff9f993 andi s3,s3,2047
{
1ec0: 00050413 mv s0,a0
1ec4: 00060b93 mv s7,a2
1ec8: 00068a93 mv s5,a3
FP_UNPACK_D (A, a);
1ecc: 00c4d493 srli s1,s1,0xc
1ed0: 01f5da13 srli s4,a1,0x1f
1ed4: 30098863 beqz s3,21e4 <__muldf3+0x358>
1ed8: 7ff00793 li a5,2047
1edc: 36f98663 beq s3,a5,2248 <__muldf3+0x3bc>
1ee0: 00349493 slli s1,s1,0x3
1ee4: 01d55793 srli a5,a0,0x1d
1ee8: 0097e7b3 or a5,a5,s1
1eec: 008004b7 lui s1,0x800
1ef0: 0097e4b3 or s1,a5,s1
1ef4: 00351913 slli s2,a0,0x3
1ef8: c0198993 addi s3,s3,-1023
1efc: 00000b13 li s6,0
FP_UNPACK_D (B, b);
1f00: 014ad713 srli a4,s5,0x14
1f04: 00ca9413 slli s0,s5,0xc
1f08: 7ff77713 andi a4,a4,2047
1f0c: 00c45413 srli s0,s0,0xc
1f10: 01fada93 srli s5,s5,0x1f
1f14: 36070663 beqz a4,2280 <__muldf3+0x3f4>
1f18: 7ff00793 li a5,2047
1f1c: 3cf70663 beq a4,a5,22e8 <__muldf3+0x45c>
1f20: 00341413 slli s0,s0,0x3
1f24: 01dbd793 srli a5,s7,0x1d
1f28: 0087e7b3 or a5,a5,s0
1f2c: 00800437 lui s0,0x800
1f30: 0087e433 or s0,a5,s0
1f34: c0170713 addi a4,a4,-1023
1f38: 003b9793 slli a5,s7,0x3
1f3c: 00000513 li a0,0
FP_MUL_D (R, A, B);
1f40: 00e989b3 add s3,s3,a4
1f44: 002b1713 slli a4,s6,0x2
1f48: 00a76733 or a4,a4,a0
1f4c: 00a00693 li a3,10
1f50: 015a4633 xor a2,s4,s5
1f54: 00198593 addi a1,s3,1
1f58: 40e6c863 blt a3,a4,2368 <__muldf3+0x4dc>
1f5c: 00200693 li a3,2
1f60: 3ce6c063 blt a3,a4,2320 <__muldf3+0x494>
1f64: fff70713 addi a4,a4,-1
1f68: 00100693 li a3,1
1f6c: 3ce6fc63 bgeu a3,a4,2344 <__muldf3+0x4b8>
1f70: 00010e37 lui t3,0x10
1f74: fffe0313 addi t1,t3,-1 # ffff <_data_lma+0xd15b>
1f78: 01095813 srli a6,s2,0x10
1f7c: 0107d513 srli a0,a5,0x10
1f80: 00697933 and s2,s2,t1
1f84: 0067feb3 and t4,a5,t1
1f88: 03d907b3 mul a5,s2,t4
1f8c: 03d80f33 mul t5,a6,t4
1f90: 0107d713 srli a4,a5,0x10
1f94: 032506b3 mul a3,a0,s2
1f98: 01e686b3 add a3,a3,t5
1f9c: 00d70733 add a4,a4,a3
1fa0: 02a808b3 mul a7,a6,a0
1fa4: 01e77463 bgeu a4,t5,1fac <__muldf3+0x120>
1fa8: 01c888b3 add a7,a7,t3
1fac: 006776b3 and a3,a4,t1
1fb0: 0067f7b3 and a5,a5,t1
1fb4: 01069693 slli a3,a3,0x10
1fb8: 00647e33 and t3,s0,t1
1fbc: 00f686b3 add a3,a3,a5
1fc0: 01045793 srli a5,s0,0x10
1fc4: 01075293 srli t0,a4,0x10
1fc8: 03c90f33 mul t5,s2,t3
1fcc: 03c80333 mul t1,a6,t3
1fd0: 010f5713 srli a4,t5,0x10
1fd4: 03278933 mul s2,a5,s2
1fd8: 00690933 add s2,s2,t1
1fdc: 01270733 add a4,a4,s2
1fe0: 02f80833 mul a6,a6,a5
1fe4: 00677663 bgeu a4,t1,1ff0 <__muldf3+0x164>
1fe8: 00010337 lui t1,0x10
1fec: 00680833 add a6,a6,t1
1ff0: 00010937 lui s2,0x10
1ff4: fff90f93 addi t6,s2,-1 # ffff <_data_lma+0xd15b>
1ff8: 01075313 srli t1,a4,0x10
1ffc: 01ff7f33 and t5,t5,t6
2000: 01f77733 and a4,a4,t6
2004: 0104d413 srli s0,s1,0x10
2008: 01f4ffb3 and t6,s1,t6
200c: 03fe83b3 mul t2,t4,t6
2010: 01030333 add t1,t1,a6
2014: 01071713 slli a4,a4,0x10
2018: 01e70f33 add t5,a4,t5
201c: 01e282b3 add t0,t0,t5
2020: 03d40833 mul a6,s0,t4
2024: 0103d713 srli a4,t2,0x10
2028: 028504b3 mul s1,a0,s0
202c: 03f50533 mul a0,a0,t6
2030: 01050533 add a0,a0,a6
2034: 00a70733 add a4,a4,a0
2038: 01077463 bgeu a4,a6,2040 <__muldf3+0x1b4>
203c: 012484b3 add s1,s1,s2
2040: 01075e93 srli t4,a4,0x10
2044: 009e8eb3 add t4,t4,s1
2048: 000104b7 lui s1,0x10
204c: fff48513 addi a0,s1,-1 # ffff <_data_lma+0xd15b>
2050: 00a77733 and a4,a4,a0
2054: 00a3f3b3 and t2,t2,a0
2058: 01071713 slli a4,a4,0x10
205c: 03c40533 mul a0,s0,t3
2060: 00770733 add a4,a4,t2
2064: 02878833 mul a6,a5,s0
2068: 03fe03b3 mul t2,t3,t6
206c: 03f787b3 mul a5,a5,t6
2070: 0103df93 srli t6,t2,0x10
2074: 00a787b3 add a5,a5,a0
2078: 00ff8fb3 add t6,t6,a5
207c: 00aff463 bgeu t6,a0,2084 <__muldf3+0x1f8>
2080: 00980833 add a6,a6,s1
2084: 00010537 lui a0,0x10
2088: fff50513 addi a0,a0,-1 # ffff <_data_lma+0xd15b>
208c: 00aff7b3 and a5,t6,a0
2090: 00a3f3b3 and t2,t2,a0
2094: 01079793 slli a5,a5,0x10
2098: 005888b3 add a7,a7,t0
209c: 007787b3 add a5,a5,t2
20a0: 01e8bf33 sltu t5,a7,t5
20a4: 006787b3 add a5,a5,t1
20a8: 01e782b3 add t0,a5,t5
20ac: 00e888b3 add a7,a7,a4
20b0: 00e8b733 sltu a4,a7,a4
20b4: 01d28533 add a0,t0,t4
20b8: 00e50e33 add t3,a0,a4
20bc: 0067b433 sltu s0,a5,t1
20c0: 01e2b2b3 sltu t0,t0,t5
20c4: 010fd793 srli a5,t6,0x10
20c8: 00ee3733 sltu a4,t3,a4
20cc: 00546433 or s0,s0,t0
20d0: 01d53533 sltu a0,a0,t4
20d4: 00f40433 add s0,s0,a5
20d8: 00e56533 or a0,a0,a4
20dc: 00a40433 add s0,s0,a0
20e0: 01040433 add s0,s0,a6
20e4: 017e5793 srli a5,t3,0x17
20e8: 00941413 slli s0,s0,0x9
20ec: 00f46433 or s0,s0,a5
20f0: 00989793 slli a5,a7,0x9
20f4: 00d7e7b3 or a5,a5,a3
20f8: 00f037b3 snez a5,a5
20fc: 0178d893 srli a7,a7,0x17
2100: 009e1713 slli a4,t3,0x9
2104: 0117e7b3 or a5,a5,a7
2108: 00e7e7b3 or a5,a5,a4
210c: 01000737 lui a4,0x1000
2110: 00e47733 and a4,s0,a4
2114: 28070663 beqz a4,23a0 <__muldf3+0x514>
2118: 0017d713 srli a4,a5,0x1
211c: 0017f793 andi a5,a5,1
2120: 00f76733 or a4,a4,a5
2124: 01f41793 slli a5,s0,0x1f
2128: 00f767b3 or a5,a4,a5
212c: 00145413 srli s0,s0,0x1
FP_PACK_D (r, R);
2130: 3ff58693 addi a3,a1,1023
2134: 26d05a63 blez a3,23a8 <__muldf3+0x51c>
2138: 0077f713 andi a4,a5,7
213c: 02070063 beqz a4,215c <__muldf3+0x2d0>
2140: 00f7f713 andi a4,a5,15
2144: 00400513 li a0,4
2148: 00a70a63 beq a4,a0,215c <__muldf3+0x2d0>
214c: 00478713 addi a4,a5,4
2150: 00f737b3 sltu a5,a4,a5
2154: 00f40433 add s0,s0,a5
2158: 00070793 mv a5,a4
215c: 01000737 lui a4,0x1000
2160: 00e47733 and a4,s0,a4
2164: 00070a63 beqz a4,2178 <__muldf3+0x2ec>
2168: ff000737 lui a4,0xff000
216c: fff70713 addi a4,a4,-1 # feffffff <tohost+0xff00000f>
2170: 00e47433 and s0,s0,a4
2174: 40058693 addi a3,a1,1024
2178: 7fe00713 li a4,2046
217c: 2ed74e63 blt a4,a3,2478 <__muldf3+0x5ec>
2180: 01d41713 slli a4,s0,0x1d
2184: 0037d793 srli a5,a5,0x3
2188: 00f76733 or a4,a4,a5
218c: 00345413 srli s0,s0,0x3
2190: 7ff007b7 lui a5,0x7ff00
2194: 01469693 slli a3,a3,0x14
2198: 00c41413 slli s0,s0,0xc
219c: 00f6f6b3 and a3,a3,a5
21a0: 00c45413 srli s0,s0,0xc
FP_HANDLE_EXCEPTIONS;
return r;
}
21a4: 02c12083 lw ra,44(sp)
FP_PACK_D (r, R);
21a8: 0086e6b3 or a3,a3,s0
}
21ac: 02812403 lw s0,40(sp)
FP_PACK_D (r, R);
21b0: 01f61613 slli a2,a2,0x1f
21b4: 00c6e7b3 or a5,a3,a2
}
21b8: 02412483 lw s1,36(sp)
21bc: 02012903 lw s2,32(sp)
21c0: 01c12983 lw s3,28(sp)
21c4: 01812a03 lw s4,24(sp)
21c8: 01412a83 lw s5,20(sp)
21cc: 01012b03 lw s6,16(sp)
21d0: 00c12b83 lw s7,12(sp)
21d4: 00070513 mv a0,a4
21d8: 00078593 mv a1,a5
21dc: 03010113 addi sp,sp,48
21e0: 00008067 ret
FP_UNPACK_D (A, a);
21e4: 00a4e933 or s2,s1,a0
21e8: 06090c63 beqz s2,2260 <__muldf3+0x3d4>
21ec: 04048063 beqz s1,222c <__muldf3+0x3a0>
21f0: 00048513 mv a0,s1
21f4: ab0ff0ef jal ra,14a4 <__clzsi2>
21f8: ff550713 addi a4,a0,-11
21fc: 01c00793 li a5,28
2200: 02e7cc63 blt a5,a4,2238 <__muldf3+0x3ac>
2204: 01d00793 li a5,29
2208: ff850913 addi s2,a0,-8
220c: 40e787b3 sub a5,a5,a4
2210: 012494b3 sll s1,s1,s2
2214: 00f457b3 srl a5,s0,a5
2218: 0097e4b3 or s1,a5,s1
221c: 01241933 sll s2,s0,s2
2220: c0d00993 li s3,-1011
2224: 40a989b3 sub s3,s3,a0
2228: cd5ff06f j 1efc <__muldf3+0x70>
222c: a78ff0ef jal ra,14a4 <__clzsi2>
2230: 02050513 addi a0,a0,32
2234: fc5ff06f j 21f8 <__muldf3+0x36c>
2238: fd850493 addi s1,a0,-40
223c: 009414b3 sll s1,s0,s1
2240: 00000913 li s2,0
2244: fddff06f j 2220 <__muldf3+0x394>
2248: 00a4e933 or s2,s1,a0
224c: 02090263 beqz s2,2270 <__muldf3+0x3e4>
2250: 00050913 mv s2,a0
2254: 7ff00993 li s3,2047
2258: 00300b13 li s6,3
225c: ca5ff06f j 1f00 <__muldf3+0x74>
2260: 00000493 li s1,0
2264: 00000993 li s3,0
2268: 00100b13 li s6,1
226c: c95ff06f j 1f00 <__muldf3+0x74>
2270: 00000493 li s1,0
2274: 7ff00993 li s3,2047
2278: 00200b13 li s6,2
227c: c85ff06f j 1f00 <__muldf3+0x74>
FP_UNPACK_D (B, b);
2280: 017467b3 or a5,s0,s7
2284: 06078e63 beqz a5,2300 <__muldf3+0x474>
2288: 04040063 beqz s0,22c8 <__muldf3+0x43c>
228c: 00040513 mv a0,s0
2290: a14ff0ef jal ra,14a4 <__clzsi2>
2294: ff550693 addi a3,a0,-11
2298: 01c00793 li a5,28
229c: 02d7ce63 blt a5,a3,22d8 <__muldf3+0x44c>
22a0: 01d00713 li a4,29
22a4: ff850793 addi a5,a0,-8
22a8: 40d70733 sub a4,a4,a3
22ac: 00f41433 sll s0,s0,a5
22b0: 00ebd733 srl a4,s7,a4
22b4: 00876433 or s0,a4,s0
22b8: 00fb97b3 sll a5,s7,a5
22bc: c0d00713 li a4,-1011
22c0: 40a70733 sub a4,a4,a0
22c4: c79ff06f j 1f3c <__muldf3+0xb0>
22c8: 000b8513 mv a0,s7
22cc: 9d8ff0ef jal ra,14a4 <__clzsi2>
22d0: 02050513 addi a0,a0,32
22d4: fc1ff06f j 2294 <__muldf3+0x408>
22d8: fd850413 addi s0,a0,-40
22dc: 008b9433 sll s0,s7,s0
22e0: 00000793 li a5,0
22e4: fd9ff06f j 22bc <__muldf3+0x430>
22e8: 017467b3 or a5,s0,s7
22ec: 02078263 beqz a5,2310 <__muldf3+0x484>
22f0: 000b8793 mv a5,s7
22f4: 7ff00713 li a4,2047
22f8: 00300513 li a0,3
22fc: c45ff06f j 1f40 <__muldf3+0xb4>
2300: 00000413 li s0,0
2304: 00000713 li a4,0
2308: 00100513 li a0,1
230c: c35ff06f j 1f40 <__muldf3+0xb4>
2310: 00000413 li s0,0
2314: 7ff00713 li a4,2047
2318: 00200513 li a0,2
231c: c25ff06f j 1f40 <__muldf3+0xb4>
2320: 00100693 li a3,1
2324: 00e696b3 sll a3,a3,a4
2328: 5306f713 andi a4,a3,1328
232c: 04071863 bnez a4,237c <__muldf3+0x4f0>
2330: 2406f813 andi a6,a3,576
2334: 12081463 bnez a6,245c <__muldf3+0x5d0>
2338: 0886f693 andi a3,a3,136
233c: c2068ae3 beqz a3,1f70 <__muldf3+0xe4>
2340: 000a8613 mv a2,s5
FP_PACK_D (r, R);
2344: 00200713 li a4,2
2348: 12e50863 beq a0,a4,2478 <__muldf3+0x5ec>
234c: 00300713 li a4,3
2350: 10e50e63 beq a0,a4,246c <__muldf3+0x5e0>
2354: 00100713 li a4,1
2358: dce51ce3 bne a0,a4,2130 <__muldf3+0x2a4>
235c: 00000413 li s0,0
2360: 00000713 li a4,0
2364: 0bc0006f j 2420 <__muldf3+0x594>
FP_MUL_D (R, A, B);
2368: 00f00693 li a3,15
236c: 02d70063 beq a4,a3,238c <__muldf3+0x500>
2370: 00b00693 li a3,11
2374: fcd706e3 beq a4,a3,2340 <__muldf3+0x4b4>
FP_UNPACK_D (A, a);
2378: 000a0613 mv a2,s4
FP_MUL_D (R, A, B);
237c: 00048413 mv s0,s1
2380: 00090793 mv a5,s2
2384: 000b0513 mv a0,s6
2388: fbdff06f j 2344 <__muldf3+0x4b8>
238c: 00080437 lui s0,0x80
2390: 00000793 li a5,0
2394: 00000613 li a2,0
2398: 00300513 li a0,3
239c: fb1ff06f j 234c <__muldf3+0x4c0>
23a0: 00098593 mv a1,s3
23a4: d8dff06f j 2130 <__muldf3+0x2a4>
FP_PACK_D (r, R);
23a8: 00100513 li a0,1
23ac: 40d50533 sub a0,a0,a3
23b0: 03800713 li a4,56
23b4: faa744e3 blt a4,a0,235c <__muldf3+0x4d0>
23b8: 01f00713 li a4,31
23bc: 06a74663 blt a4,a0,2428 <__muldf3+0x59c>
23c0: 41e58593 addi a1,a1,1054
23c4: 00b41733 sll a4,s0,a1
23c8: 00a7d6b3 srl a3,a5,a0
23cc: 00b795b3 sll a1,a5,a1
23d0: 00d76733 or a4,a4,a3
23d4: 00b035b3 snez a1,a1
23d8: 00b767b3 or a5,a4,a1
23dc: 00a45433 srl s0,s0,a0
23e0: 0077f713 andi a4,a5,7
23e4: 02070063 beqz a4,2404 <__muldf3+0x578>
23e8: 00f7f713 andi a4,a5,15
23ec: 00400693 li a3,4
23f0: 00d70a63 beq a4,a3,2404 <__muldf3+0x578>
23f4: 00478713 addi a4,a5,4 # 7ff00004 <_sp+0x6fefc004>
23f8: 00f737b3 sltu a5,a4,a5
23fc: 00f40433 add s0,s0,a5
2400: 00070793 mv a5,a4
2404: 00800737 lui a4,0x800
2408: 00e47733 and a4,s0,a4
240c: 06071e63 bnez a4,2488 <__muldf3+0x5fc>
2410: 01d41713 slli a4,s0,0x1d
2414: 0037d793 srli a5,a5,0x3
2418: 00f76733 or a4,a4,a5
241c: 00345413 srli s0,s0,0x3
2420: 00000693 li a3,0
2424: d6dff06f j 2190 <__muldf3+0x304>
2428: fe100713 li a4,-31
242c: 40d70733 sub a4,a4,a3
2430: 02000813 li a6,32
2434: 00e45733 srl a4,s0,a4
2438: 00000693 li a3,0
243c: 01050663 beq a0,a6,2448 <__muldf3+0x5bc>
2440: 43e58593 addi a1,a1,1086
2444: 00b416b3 sll a3,s0,a1
2448: 00f6e6b3 or a3,a3,a5
244c: 00d036b3 snez a3,a3
2450: 00d767b3 or a5,a4,a3
2454: 00000413 li s0,0
2458: f89ff06f j 23e0 <__muldf3+0x554>
FP_MUL_D (R, A, B);
245c: 00080437 lui s0,0x80
FP_PACK_D (r, R);
2460: 7ff00693 li a3,2047
2464: 00000613 li a2,0
2468: d29ff06f j 2190 <__muldf3+0x304>
246c: 00080437 lui s0,0x80
2470: 00000713 li a4,0
2474: fedff06f j 2460 <__muldf3+0x5d4>
2478: 00000413 li s0,0
247c: 00000713 li a4,0
2480: 7ff00693 li a3,2047
2484: d0dff06f j 2190 <__muldf3+0x304>
2488: 00000413 li s0,0
248c: 00000713 li a4,0
2490: 00100693 li a3,1
2494: cfdff06f j 2190 <__muldf3+0x304>
00002498 <__fixunsdfsi>:
FP_DECL_EX;
FP_DECL_D (A);
USItype r;
FP_INIT_EXCEPTIONS;
FP_UNPACK_RAW_D (A, a);
2498: 0145d713 srli a4,a1,0x14
249c: 00100637 lui a2,0x100
{
24a0: 00050693 mv a3,a0
FP_UNPACK_RAW_D (A, a);
24a4: fff60793 addi a5,a2,-1 # fffff <_data_lma+0xfd15b>
24a8: 7ff77713 andi a4,a4,2047
FP_TO_INT_D (r, A, SI_BITS, 0);
24ac: 3fe00513 li a0,1022
FP_UNPACK_RAW_D (A, a);
24b0: 00b7f7b3 and a5,a5,a1
24b4: 01f5d593 srli a1,a1,0x1f
FP_TO_INT_D (r, A, SI_BITS, 0);
24b8: 04e55a63 bge a0,a4,250c <__fixunsdfsi+0x74>
24bc: 00000513 li a0,0
24c0: 00059863 bnez a1,24d0 <__fixunsdfsi+0x38>
24c4: 41e00593 li a1,1054
24c8: fff00513 li a0,-1
24cc: 00e5d463 bge a1,a4,24d4 <__fixunsdfsi+0x3c>
FP_HANDLE_EXCEPTIONS;
return r;
}
24d0: 00008067 ret
FP_TO_INT_D (r, A, SI_BITS, 0);
24d4: 00c7e7b3 or a5,a5,a2
24d8: 43300613 li a2,1075
24dc: 40e60633 sub a2,a2,a4
24e0: 01f00593 li a1,31
24e4: 00c5cc63 blt a1,a2,24fc <__fixunsdfsi+0x64>
24e8: bed70713 addi a4,a4,-1043 # 7ffbed <_data_lma+0x7fcd49>
24ec: 00e797b3 sll a5,a5,a4
24f0: 00c6d533 srl a0,a3,a2
24f4: 00a7e533 or a0,a5,a0
24f8: 00008067 ret
24fc: 41300693 li a3,1043
2500: 40e68733 sub a4,a3,a4
2504: 00e7d533 srl a0,a5,a4
2508: 00008067 ret
250c: 00000513 li a0,0
2510: 00008067 ret
00002514 <__divsi3>:
li t0, -1
beq a1, t0, .L20
#endif
FUNC_BEGIN (__divdi3)
bltz a0, .L10
2514: 06054063 bltz a0,2574 <__umodsi3+0x10>
bltz a1, .L11
2518: 0605c663 bltz a1,2584 <__umodsi3+0x20>
0000251c <__udivsi3>:
/* Since the quotient is positive, fall into __udivdi3. */
FUNC_BEGIN (__udivdi3)
mv a2, a1
251c: 00058613 mv a2,a1
mv a1, a0
2520: 00050593 mv a1,a0
li a0, -1
2524: fff00513 li a0,-1
beqz a2, .L5
2528: 02060c63 beqz a2,2560 <__udivsi3+0x44>
li a3, 1
252c: 00100693 li a3,1
bgeu a2, a1, .L2
2530: 00b67a63 bgeu a2,a1,2544 <__udivsi3+0x28>
.L1:
blez a2, .L2
2534: 00c05863 blez a2,2544 <__udivsi3+0x28>
slli a2, a2, 1
2538: 00161613 slli a2,a2,0x1
slli a3, a3, 1
253c: 00169693 slli a3,a3,0x1
bgtu a1, a2, .L1
2540: feb66ae3 bltu a2,a1,2534 <__udivsi3+0x18>
.L2:
li a0, 0
2544: 00000513 li a0,0
.L3:
bltu a1, a2, .L4
2548: 00c5e663 bltu a1,a2,2554 <__udivsi3+0x38>
sub a1, a1, a2
254c: 40c585b3 sub a1,a1,a2
or a0, a0, a3
2550: 00d56533 or a0,a0,a3
.L4:
srli a3, a3, 1
2554: 0016d693 srli a3,a3,0x1
srli a2, a2, 1
2558: 00165613 srli a2,a2,0x1
bnez a3, .L3
255c: fe0696e3 bnez a3,2548 <__udivsi3+0x2c>
.L5:
ret
2560: 00008067 ret
00002564 <__umodsi3>:
FUNC_END (__udivdi3)
FUNC_BEGIN (__umoddi3)
/* Call __udivdi3(a0, a1), then return the remainder, which is in a1. */
move t0, ra
2564: 00008293 mv t0,ra
jal __udivdi3
2568: fb5ff0ef jal ra,251c <__udivsi3>
move a0, a1
256c: 00058513 mv a0,a1
jr t0
2570: 00028067 jr t0
FUNC_END (__umoddi3)
/* Handle negative arguments to __divdi3. */
.L10:
neg a0, a0
2574: 40a00533 neg a0,a0
/* Zero is handled as a negative so that the result will not be inverted. */
bgtz a1, .L12 /* Compute __udivdi3(-a0, a1), then negate the result. */
2578: 00b04863 bgtz a1,2588 <__umodsi3+0x24>
neg a1, a1
257c: 40b005b3 neg a1,a1
j __udivdi3 /* Compute __udivdi3(-a0, -a1). */
2580: f9dff06f j 251c <__udivsi3>
.L11: /* Compute __udivdi3(a0, -a1), then negate the result. */
neg a1, a1
2584: 40b005b3 neg a1,a1
.L12:
move t0, ra
2588: 00008293 mv t0,ra
jal __udivdi3
258c: f91ff0ef jal ra,251c <__udivsi3>
neg a0, a0
2590: 40a00533 neg a0,a0
jr t0
2594: 00028067 jr t0
00002598 <__modsi3>:
FUNC_END (__divdi3)
FUNC_BEGIN (__moddi3)
move t0, ra
2598: 00008293 mv t0,ra
bltz a1, .L31
259c: 0005ca63 bltz a1,25b0 <__modsi3+0x18>
bltz a0, .L32
25a0: 00054c63 bltz a0,25b8 <__modsi3+0x20>
.L30:
jal __udivdi3 /* The dividend is not negative. */
25a4: f79ff0ef jal ra,251c <__udivsi3>
move a0, a1
25a8: 00058513 mv a0,a1
jr t0
25ac: 00028067 jr t0
.L31:
neg a1, a1
25b0: 40b005b3 neg a1,a1
bgez a0, .L30
25b4: fe0558e3 bgez a0,25a4 <__modsi3+0xc>
.L32:
neg a0, a0
25b8: 40a00533 neg a0,a0
jal __udivdi3 /* The dividend is hella negative. */
25bc: f61ff0ef jal ra,251c <__udivsi3>
neg a0, a1
25c0: 40b00533 neg a0,a1
jr t0
25c4: 00028067 jr t0