From 447074a5b3cc173c64dcabb3c9b2062b4269d75a Mon Sep 17 00:00:00 2001 From: HidetaroTanaka Date: Thu, 9 Nov 2023 15:01:26 +0900 Subject: [PATCH 1/8] add `vmul.v{v,x}` --- .../resources/applications_vector/build.sh | 19 + .../resources/applications_vector/vmul.dump | 1158 +++++++++++++++++ .../resources/applications_vector/vmul/vmul.c | 61 + .../applications_vector/vmul_data.hex | 214 +++ .../applications_vector/vmul_inst.hex | 658 ++++++++++ .../scala/hajime/common/Instructions.scala | 40 +- .../scala/hajime/publicmodules/Decoder.scala | 2 + .../hajime/vectormodules/VectorDecoder.scala | 21 +- .../hajime/vectormodules/VectorExecUnit.scala | 17 +- .../vectormodules/VectorOpConstants.scala | 6 +- .../hajime/vectormodules/VectorCpuSpec.scala | 1 + 11 files changed, 2168 insertions(+), 29 deletions(-) create mode 100644 src/main/resources/applications_vector/vmul.dump create mode 100644 src/main/resources/applications_vector/vmul/vmul.c create mode 100644 src/main/resources/applications_vector/vmul_data.hex create mode 100644 src/main/resources/applications_vector/vmul_inst.hex diff --git a/src/main/resources/applications_vector/build.sh b/src/main/resources/applications_vector/build.sh index ea6e251d..d6840300 100644 --- a/src/main/resources/applications_vector/build.sh +++ b/src/main/resources/applications_vector/build.sh @@ -381,4 +381,23 @@ hexdump -v -e '1/4 "%08x" "\n"' vector_median_text_startup.bin > vector_median_t cat vector_median_data.temp vector_median_rodata.temp vector_median_rodata_str1_8.temp vector_median_sdata.temp > vector_median_data.hex cat vector_median_text_init.temp vector_median_text.temp vector_median_text_startup.temp > vector_median_inst.hex +riscv64-unknown-elf-gcc -I ../application_headers -DPREALLOCATE=1 -mcmodel=medany -static -std=gnu99 -O2 -fno-common -fno-builtin-printf -fno-tree-loop-distribute-patterns -march=rv64im_zicsr_zve64x -mabi=lp64 -o vmul.riscv ./vmul/vmul.c ../application_headers/syscalls.c ../application_headers/crt.S -static -nostdlib -nostartfiles -T ../application_headers/test.ld +riscv64-unknown-elf-objdump --disassemble-all vmul.riscv > vmul.dump +riscv64-unknown-elf-objdump --disassemble-all vmul.riscv > vmul.dump +riscv64-unknown-elf-objcopy --dump-section .rodata=vmul_rodata.bin vmul.riscv +riscv64-unknown-elf-objcopy --dump-section .rodata.str1.8=vmul_rodata_str1_8.bin vmul.riscv +riscv64-unknown-elf-objcopy --dump-section .sdata=vmul_sdata.bin vmul.riscv +riscv64-unknown-elf-objcopy --dump-section .text.init=vmul_text_init.bin vmul.riscv +riscv64-unknown-elf-objcopy --dump-section .text=vmul_text.bin vmul.riscv +riscv64-unknown-elf-objcopy --dump-section .text.startup=vmul_text_startup.bin vmul.riscv +hexdump -v -e '1/4 "%08x" "\n"' vmul_rodata.bin > vmul_rodata.temp +hexdump -v -e '1/4 "%08x" "\n"' vmul_rodata_str1_8.bin > vmul_rodata_str1_8.temp +hexdump -v -e '1/4 "%08x" "\n"' vmul_sdata.bin > vmul_sdata.temp +hexdump -v -e '1/4 "%08x" "\n"' vmul_text_init.bin > vmul_text_init.temp +hexdump -v -e '1/4 "%08x" "\n"' vmul_text.bin > vmul_text.temp +hexdump -v -e '1/4 "%08x" "\n"' vmul_text_startup.bin > vmul_text_startup.temp +cat vmul_rodata.temp vmul_rodata_str1_8.temp vmul_sdata.temp > vmul_data.hex +cat vmul_text_init.temp vmul_text.temp vmul_text_startup.temp > vmul_inst.hex + + rm *.riscv *.bin *.temp \ No newline at end of file diff --git a/src/main/resources/applications_vector/vmul.dump b/src/main/resources/applications_vector/vmul.dump new file mode 100644 index 00000000..ac861700 --- /dev/null +++ b/src/main/resources/applications_vector/vmul.dump @@ -0,0 +1,1158 @@ + +vmul.riscv: file format elf64-littleriscv + + +Disassembly of section .text.init: + +0000000000000000 <_start>: + 0: 00000093 li ra,0 + 4: 00000113 li sp,0 + 8: 00000193 li gp,0 + c: 00000213 li tp,0 + 10: 00000293 li t0,0 + 14: 00000313 li t1,0 + 18: 00000393 li t2,0 + 1c: 00000413 li s0,0 + 20: 00000493 li s1,0 + 24: 00000513 li a0,0 + 28: 00000593 li a1,0 + 2c: 00000613 li a2,0 + 30: 00000693 li a3,0 + 34: 00000713 li a4,0 + 38: 00000793 li a5,0 + 3c: 00000813 li a6,0 + 40: 00000893 li a7,0 + 44: 00000913 li s2,0 + 48: 00000993 li s3,0 + 4c: 00000a13 li s4,0 + 50: 00000a93 li s5,0 + 54: 00000b13 li s6,0 + 58: 00000b93 li s7,0 + 5c: 00000c13 li s8,0 + 60: 00000c93 li s9,0 + 64: 00000d13 li s10,0 + 68: 00000d93 li s11,0 + 6c: 00000e13 li t3,0 + 70: 00000e93 li t4,0 + 74: 00000f13 li t5,0 + 78: 00000f93 li t6,0 + 7c: 00000297 auipc t0,0x0 + 80: 03828293 add t0,t0,56 # b4 + 84: 30529073 csrw mtvec,t0 + 88: 00005197 auipc gp,0x5 + 8c: ac818193 add gp,gp,-1336 # 4b50 <__global_pointer$> + 90: 10000217 auipc tp,0x10000 + 94: ff720213 add tp,tp,-9 # 10000087 <_end+0x3f> + 98: fc027213 and tp,tp,-64 + 9c: f1402573 csrr a0,mhartid + a0: 00100593 li a1,1 + a4: 00b57063 bgeu a0,a1,a4 <_start+0xa4> + a8: 00006137 lui sp,0x6 + ac: ff01011b addw sp,sp,-16 # 5ff0 <__global_pointer$+0x14a0> + b0: 6580006f j 708 <_init> + +00000000000000b4 : + b4: ef010113 add sp,sp,-272 + b8: 00113423 sd ra,8(sp) + bc: 00213823 sd sp,16(sp) + c0: 00313c23 sd gp,24(sp) + c4: 02413023 sd tp,32(sp) + c8: 02513423 sd t0,40(sp) + cc: 02613823 sd t1,48(sp) + d0: 02713c23 sd t2,56(sp) + d4: 04813023 sd s0,64(sp) + d8: 04913423 sd s1,72(sp) + dc: 04a13823 sd a0,80(sp) + e0: 04b13c23 sd a1,88(sp) + e4: 06c13023 sd a2,96(sp) + e8: 06d13423 sd a3,104(sp) + ec: 06e13823 sd a4,112(sp) + f0: 06f13c23 sd a5,120(sp) + f4: 09013023 sd a6,128(sp) + f8: 09113423 sd a7,136(sp) + fc: 09213823 sd s2,144(sp) + 100: 09313c23 sd s3,152(sp) + 104: 0b413023 sd s4,160(sp) + 108: 0b513423 sd s5,168(sp) + 10c: 0b613823 sd s6,176(sp) + 110: 0b713c23 sd s7,184(sp) + 114: 0d813023 sd s8,192(sp) + 118: 0d913423 sd s9,200(sp) + 11c: 0da13823 sd s10,208(sp) + 120: 0db13c23 sd s11,216(sp) + 124: 0fc13023 sd t3,224(sp) + 128: 0fd13423 sd t4,232(sp) + 12c: 0fe13823 sd t5,240(sp) + 130: 0ff13c23 sd t6,248(sp) + 134: 34202573 csrr a0,mcause + 138: 341025f3 csrr a1,mepc + 13c: 00010613 mv a2,sp + 140: 2d0000ef jal 410 + 144: 34151073 csrw mepc,a0 + 148: 000022b7 lui t0,0x2 + 14c: 8002829b addw t0,t0,-2048 # 1800 + 150: 3002a073 csrs mstatus,t0 + 154: 00813083 ld ra,8(sp) + 158: 01013103 ld sp,16(sp) + 15c: 01813183 ld gp,24(sp) + 160: 02013203 ld tp,32(sp) + 164: 02813283 ld t0,40(sp) + 168: 03013303 ld t1,48(sp) + 16c: 03813383 ld t2,56(sp) + 170: 04013403 ld s0,64(sp) + 174: 04813483 ld s1,72(sp) + 178: 05013503 ld a0,80(sp) + 17c: 05813583 ld a1,88(sp) + 180: 06013603 ld a2,96(sp) + 184: 06813683 ld a3,104(sp) + 188: 07013703 ld a4,112(sp) + 18c: 07813783 ld a5,120(sp) + 190: 08013803 ld a6,128(sp) + 194: 08813883 ld a7,136(sp) + 198: 09013903 ld s2,144(sp) + 19c: 09813983 ld s3,152(sp) + 1a0: 0a013a03 ld s4,160(sp) + 1a4: 0a813a83 ld s5,168(sp) + 1a8: 0b013b03 ld s6,176(sp) + 1ac: 0b813b83 ld s7,184(sp) + 1b0: 0c013c03 ld s8,192(sp) + 1b4: 0c813c83 ld s9,200(sp) + 1b8: 0d013d03 ld s10,208(sp) + 1bc: 0d813d83 ld s11,216(sp) + 1c0: 0e013e03 ld t3,224(sp) + 1c4: 0e813e83 ld t4,232(sp) + 1c8: 0f013f03 ld t5,240(sp) + 1cc: 0f813f83 ld t6,248(sp) + 1d0: 11010113 add sp,sp,272 + 1d4: 30200073 mret + +Disassembly of section .text: + +00000000000001d8 : + 1d8: b0201073 csrw minstret,zero + 1dc: b0001073 csrw mcycle,zero + 1e0: 00008067 ret + +00000000000001e4 : + 1e4: 03000793 li a5,48 + 1e8: 00f58023 sb a5,0(a1) + 1ec: 07800793 li a5,120 + 1f0: 00f580a3 sb a5,1(a1) + 1f4: 00158813 add a6,a1,1 + 1f8: 00958793 add a5,a1,9 + 1fc: 00900613 li a2,9 + 200: 00f57713 and a4,a0,15 + 204: 03770693 add a3,a4,55 + 208: 00e66463 bltu a2,a4,210 + 20c: 03070693 add a3,a4,48 + 210: 00d78023 sb a3,0(a5) + 214: fff78793 add a5,a5,-1 + 218: 40455513 sra a0,a0,0x4 + 21c: fef812e3 bne a6,a5,200 + 220: 00058523 sb zero,10(a1) + 224: 00008067 ret + +0000000000000228 : + 228: 03000793 li a5,48 + 22c: 00f58023 sb a5,0(a1) + 230: 07800793 li a5,120 + 234: 00f580a3 sb a5,1(a1) + 238: 00158813 add a6,a1,1 + 23c: 01158793 add a5,a1,17 + 240: 00900613 li a2,9 + 244: 00f57713 and a4,a0,15 + 248: 03770693 add a3,a4,55 + 24c: 00e66463 bltu a2,a4,254 + 250: 03070693 add a3,a4,48 + 254: 00d78023 sb a3,0(a5) + 258: fff78793 add a5,a5,-1 + 25c: 40455513 sra a0,a0,0x4 + 260: fef812e3 bne a6,a5,244 + 264: 00058923 sb zero,18(a1) + 268: 00008067 ret + +000000000000026c : + 26c: 00054783 lbu a5,0(a0) + 270: 00078c63 beqz a5,288 + 274: 10000737 lui a4,0x10000 + 278: 00f70023 sb a5,0(a4) # 10000000 + 27c: 00154783 lbu a5,1(a0) + 280: 00150513 add a0,a0,1 + 284: fe079ae3 bnez a5,278 + 288: 00008067 ret + +000000000000028c : + 28c: fe010113 add sp,sp,-32 + 290: c0202673 rdinstret a2 + 294: c00025f3 rdcycle a1 + 298: 00004717 auipc a4,0x4 + 29c: f4070713 add a4,a4,-192 # 41d8 + 2a0: 06300793 li a5,99 + 2a4: 100006b7 lui a3,0x10000 + 2a8: 00f68023 sb a5,0(a3) # 10000000 + 2ac: 00174783 lbu a5,1(a4) + 2b0: 00170713 add a4,a4,1 + 2b4: fe079ae3 bnez a5,2a8 + 2b8: ffff8737 lui a4,0xffff8 + 2bc: 83074713 xor a4,a4,-2000 + 2c0: 01910793 add a5,sp,25 + 2c4: 00e11423 sh a4,8(sp) + 2c8: 00910813 add a6,sp,9 + 2cc: 00078713 mv a4,a5 + 2d0: 00900893 li a7,9 + 2d4: 00f5f693 and a3,a1,15 + 2d8: 03768513 add a0,a3,55 + 2dc: 00d8e463 bltu a7,a3,2e4 + 2e0: 03068513 add a0,a3,48 + 2e4: 00a70023 sb a0,0(a4) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 2e8: fff70713 add a4,a4,-1 + 2ec: 4045d593 sra a1,a1,0x4 + 2f0: fee812e3 bne a6,a4,2d4 + 2f4: 00814703 lbu a4,8(sp) + 2f8: 00010d23 sb zero,26(sp) + 2fc: 00810693 add a3,sp,8 + 300: 100005b7 lui a1,0x10000 + 304: 00070a63 beqz a4,318 + 308: 00e58023 sb a4,0(a1) # 10000000 + 30c: 0016c703 lbu a4,1(a3) + 310: 00168693 add a3,a3,1 + 314: fe071ae3 bnez a4,308 + 318: 00004697 auipc a3,0x4 + 31c: ec868693 add a3,a3,-312 # 41e0 + 320: 00a00713 li a4,10 + 324: 100005b7 lui a1,0x10000 + 328: 00e58023 sb a4,0(a1) # 10000000 + 32c: 0016c703 lbu a4,1(a3) + 330: 00168693 add a3,a3,1 + 334: fe071ae3 bnez a4,328 + 338: ffff8737 lui a4,0xffff8 + 33c: 83074713 xor a4,a4,-2000 + 340: 00060693 mv a3,a2 + 344: 00e11423 sh a4,8(sp) + 348: 00900593 li a1,9 + 34c: 00f6f713 and a4,a3,15 + 350: 03770613 add a2,a4,55 # ffffffffffff8037 <_end+0xffffffffefff7fef> + 354: 00e5e463 bltu a1,a4,35c + 358: 03070613 add a2,a4,48 + 35c: 00c78023 sb a2,0(a5) + 360: fff78793 add a5,a5,-1 + 364: 4046d693 sra a3,a3,0x4 + 368: fef812e3 bne a6,a5,34c + 36c: 00814783 lbu a5,8(sp) + 370: 00010d23 sb zero,26(sp) + 374: 00810713 add a4,sp,8 + 378: 100006b7 lui a3,0x10000 + 37c: 00078a63 beqz a5,390 + 380: 00f68023 sb a5,0(a3) # 10000000 + 384: 00174783 lbu a5,1(a4) + 388: 00170713 add a4,a4,1 + 38c: fe079ae3 bnez a5,380 + 390: 100007b7 lui a5,0x10000 + 394: 00a00713 li a4,10 + 398: 00e78023 sb a4,0(a5) # 10000000 + 39c: 02010113 add sp,sp,32 + 3a0: 00008067 ret + +00000000000003a4 : + 3a4: fe010113 add sp,sp,-32 + 3a8: 00813823 sd s0,16(sp) + 3ac: 00113c23 sd ra,24(sp) + 3b0: 00050413 mv s0,a0 + 3b4: 00004717 auipc a4,0x4 + 3b8: e3c70713 add a4,a4,-452 # 41f0 + 3bc: 04500793 li a5,69 + 3c0: 100006b7 lui a3,0x10000 + 3c4: 00f68023 sb a5,0(a3) # 10000000 + 3c8: 00174783 lbu a5,1(a4) + 3cc: 00170713 add a4,a4,1 + 3d0: fe079ae3 bnez a5,3c4 + 3d4: 00010593 mv a1,sp + 3d8: 00040513 mv a0,s0 + 3dc: e09ff0ef jal 1e4 + 3e0: 00014703 lbu a4,0(sp) + 3e4: 00070e63 beqz a4,400 + 3e8: 00010793 mv a5,sp + 3ec: 100006b7 lui a3,0x10000 + 3f0: 00e68023 sb a4,0(a3) # 10000000 + 3f4: 0017c703 lbu a4,1(a5) + 3f8: 00178793 add a5,a5,1 + 3fc: fe071ae3 bnez a4,3f0 + 400: 00040513 mv a0,s0 + 404: 100007b7 lui a5,0x10000 + 408: 00078023 sb zero,0(a5) # 10000000 + 40c: 0000006f j 40c + +0000000000000410 : + 410: ffff87b7 lui a5,0xffff8 + 414: fd010113 add sp,sp,-48 + 418: 8307c793 xor a5,a5,-2000 + 41c: 00f11423 sh a5,8(sp) + 420: 02113423 sd ra,40(sp) + 424: 01910793 add a5,sp,25 + 428: 00910813 add a6,sp,9 + 42c: 00900613 li a2,9 + 430: 00f5f713 and a4,a1,15 + 434: 03770693 add a3,a4,55 + 438: 00e66463 bltu a2,a4,440 + 43c: 03070693 add a3,a4,48 + 440: 00d78023 sb a3,0(a5) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 444: fff78793 add a5,a5,-1 + 448: 4045d593 sra a1,a1,0x4 + 44c: ff0792e3 bne a5,a6,430 + 450: 00010d23 sb zero,26(sp) + 454: 00b00793 li a5,11 + 458: 02a7e063 bltu a5,a0,478 + 45c: 00004717 auipc a4,0x4 + 460: d2470713 add a4,a4,-732 # 4180 + 464: 00251513 sll a0,a0,0x2 + 468: 00e50533 add a0,a0,a4 + 46c: 00052783 lw a5,0(a0) + 470: 00e787b3 add a5,a5,a4 + 474: 00078067 jr a5 + 478: 00004717 auipc a4,0x4 + 47c: ea070713 add a4,a4,-352 # 4318 + 480: 05500793 li a5,85 + 484: 100006b7 lui a3,0x10000 + 488: 00f68023 sb a5,0(a3) # 10000000 + 48c: 00174783 lbu a5,1(a4) + 490: 00170713 add a4,a4,1 + 494: fe079ae3 bnez a5,488 + 498: 00814783 lbu a5,8(sp) + 49c: 00810713 add a4,sp,8 + 4a0: 100006b7 lui a3,0x10000 + 4a4: 00078a63 beqz a5,4b8 + 4a8: 00f68023 sb a5,0(a3) # 10000000 + 4ac: 00174783 lbu a5,1(a4) + 4b0: 00170713 add a4,a4,1 + 4b4: fe079ae3 bnez a5,4a8 + 4b8: 00004717 auipc a4,0x4 + 4bc: e8070713 add a4,a4,-384 # 4338 + 4c0: 00a00793 li a5,10 + 4c4: 100006b7 lui a3,0x10000 + 4c8: 00f68023 sb a5,0(a3) # 10000000 + 4cc: 00174783 lbu a5,1(a4) + 4d0: 00170713 add a4,a4,1 + 4d4: fe079ae3 bnez a5,4c8 + 4d8: fff00513 li a0,-1 + 4dc: ec9ff0ef jal 3a4 + 4e0: 00004717 auipc a4,0x4 + 4e4: d2070713 add a4,a4,-736 # 4200 + 4e8: 04900793 li a5,73 + 4ec: 100006b7 lui a3,0x10000 + 4f0: 00f68023 sb a5,0(a3) # 10000000 + 4f4: 00174783 lbu a5,1(a4) + 4f8: 00170713 add a4,a4,1 + 4fc: fe079ae3 bnez a5,4f0 + 500: 00814783 lbu a5,8(sp) + 504: 00810713 add a4,sp,8 + 508: 100006b7 lui a3,0x10000 + 50c: fc0786e3 beqz a5,4d8 + 510: 00f68023 sb a5,0(a3) # 10000000 + 514: 00174783 lbu a5,1(a4) + 518: 00170713 add a4,a4,1 + 51c: fe079ae3 bnez a5,510 + 520: fb9ff06f j 4d8 + 524: 00004717 auipc a4,0x4 + 528: d0470713 add a4,a4,-764 # 4228 + 52c: 04900793 li a5,73 + 530: 100006b7 lui a3,0x10000 + 534: 00f68023 sb a5,0(a3) # 10000000 + 538: 00174783 lbu a5,1(a4) + 53c: 00170713 add a4,a4,1 + 540: fe079ae3 bnez a5,534 + 544: 00814783 lbu a5,8(sp) + 548: f80788e3 beqz a5,4d8 + 54c: 00810713 add a4,sp,8 + 550: 100006b7 lui a3,0x10000 + 554: 00f68023 sb a5,0(a3) # 10000000 + 558: 00174783 lbu a5,1(a4) + 55c: 00170713 add a4,a4,1 + 560: fe079ae3 bnez a5,554 + 564: f75ff06f j 4d8 + 568: 00004717 auipc a4,0x4 + 56c: ce870713 add a4,a4,-792 # 4250 + 570: 04900793 li a5,73 + 574: 100006b7 lui a3,0x10000 + 578: 00f68023 sb a5,0(a3) # 10000000 + 57c: 00174783 lbu a5,1(a4) + 580: 00170713 add a4,a4,1 + 584: fe079ae3 bnez a5,578 + 588: 00814783 lbu a5,8(sp) + 58c: f40786e3 beqz a5,4d8 + 590: 00810713 add a4,sp,8 + 594: 100006b7 lui a3,0x10000 + 598: 00f68023 sb a5,0(a3) # 10000000 + 59c: 00174783 lbu a5,1(a4) + 5a0: 00170713 add a4,a4,1 + 5a4: fe079ae3 bnez a5,598 + 5a8: f31ff06f j 4d8 + 5ac: 00004717 auipc a4,0x4 + 5b0: cc470713 add a4,a4,-828 # 4270 + 5b4: 04c00793 li a5,76 + 5b8: 100006b7 lui a3,0x10000 + 5bc: 00f68023 sb a5,0(a3) # 10000000 + 5c0: 00174783 lbu a5,1(a4) + 5c4: 00170713 add a4,a4,1 + 5c8: fe079ae3 bnez a5,5bc + 5cc: 00814783 lbu a5,8(sp) + 5d0: f00784e3 beqz a5,4d8 + 5d4: 00810713 add a4,sp,8 + 5d8: 100006b7 lui a3,0x10000 + 5dc: 00f68023 sb a5,0(a3) # 10000000 + 5e0: 00174783 lbu a5,1(a4) + 5e4: 00170713 add a4,a4,1 + 5e8: fe079ae3 bnez a5,5dc + 5ec: eedff06f j 4d8 + 5f0: 00004717 auipc a4,0x4 + 5f4: ca070713 add a4,a4,-864 # 4290 + 5f8: 04c00793 li a5,76 + 5fc: 100006b7 lui a3,0x10000 + 600: 00f68023 sb a5,0(a3) # 10000000 + 604: 00174783 lbu a5,1(a4) + 608: 00170713 add a4,a4,1 + 60c: fe079ae3 bnez a5,600 + 610: 00814783 lbu a5,8(sp) + 614: ec0782e3 beqz a5,4d8 + 618: 00810713 add a4,sp,8 + 61c: 100006b7 lui a3,0x10000 + 620: 00f68023 sb a5,0(a3) # 10000000 + 624: 00174783 lbu a5,1(a4) + 628: 00170713 add a4,a4,1 + 62c: fe079ae3 bnez a5,620 + 630: ea9ff06f j 4d8 + 634: 00004717 auipc a4,0x4 + 638: c7c70713 add a4,a4,-900 # 42b0 + 63c: 05300793 li a5,83 + 640: 100006b7 lui a3,0x10000 + 644: 00f68023 sb a5,0(a3) # 10000000 + 648: 00174783 lbu a5,1(a4) + 64c: 00170713 add a4,a4,1 + 650: fe079ae3 bnez a5,644 + 654: 00814783 lbu a5,8(sp) + 658: e80780e3 beqz a5,4d8 + 65c: 00810713 add a4,sp,8 + 660: 100006b7 lui a3,0x10000 + 664: 00f68023 sb a5,0(a3) # 10000000 + 668: 00174783 lbu a5,1(a4) + 66c: 00170713 add a4,a4,1 + 670: fe079ae3 bnez a5,664 + 674: e65ff06f j 4d8 + 678: 00004717 auipc a4,0x4 + 67c: c6070713 add a4,a4,-928 # 42d8 + 680: 05300793 li a5,83 + 684: 100006b7 lui a3,0x10000 + 688: 00f68023 sb a5,0(a3) # 10000000 + 68c: 00174783 lbu a5,1(a4) + 690: 00170713 add a4,a4,1 + 694: fe079ae3 bnez a5,688 + 698: 00814783 lbu a5,8(sp) + 69c: e2078ee3 beqz a5,4d8 + 6a0: 00810713 add a4,sp,8 + 6a4: 100006b7 lui a3,0x10000 + 6a8: 00f68023 sb a5,0(a3) # 10000000 + 6ac: 00174783 lbu a5,1(a4) + 6b0: 00170713 add a4,a4,1 + 6b4: fe079ae3 bnez a5,6a8 + 6b8: e21ff06f j 4d8 + 6bc: 00004717 auipc a4,0x4 + 6c0: c3c70713 add a4,a4,-964 # 42f8 + 6c4: 04500793 li a5,69 + 6c8: 100006b7 lui a3,0x10000 + 6cc: 00f68023 sb a5,0(a3) # 10000000 + 6d0: 00174783 lbu a5,1(a4) + 6d4: 00170713 add a4,a4,1 + 6d8: fe079ae3 bnez a5,6cc + 6dc: 00814783 lbu a5,8(sp) + 6e0: de078ce3 beqz a5,4d8 + 6e4: 00810713 add a4,sp,8 + 6e8: 100006b7 lui a3,0x10000 + 6ec: 00f68023 sb a5,0(a3) # 10000000 + 6f0: 00174783 lbu a5,1(a4) + 6f4: 00170713 add a4,a4,1 + 6f8: fe079ae3 bnez a5,6ec + 6fc: dddff06f j 4d8 + +0000000000000700 : + 700: 00051063 bnez a0,700 + 704: 00008067 ret + +0000000000000708 <_init>: + 708: ff010113 add sp,sp,-16 + 70c: 00000593 li a1,0 + 710: 00000513 li a0,0 + 714: 00113423 sd ra,8(sp) + 718: 1d8000ef jal 8f0
+ 71c: c89ff0ef jal 3a4 + +0000000000000720 : + 720: 00b567b3 or a5,a0,a1 + 724: 00c7e7b3 or a5,a5,a2 + 728: 0077f793 and a5,a5,7 + 72c: 00c50833 add a6,a0,a2 + 730: 02078463 beqz a5,758 + 734: 00c58633 add a2,a1,a2 + 738: 00050793 mv a5,a0 + 73c: 0b057663 bgeu a0,a6,7e8 + 740: 0005c703 lbu a4,0(a1) + 744: 00158593 add a1,a1,1 + 748: 00178793 add a5,a5,1 + 74c: fee78fa3 sb a4,-1(a5) + 750: fec598e3 bne a1,a2,740 + 754: 00008067 ret + 758: 04050693 add a3,a0,64 + 75c: 0906f863 bgeu a3,a6,7ec + 760: 00058713 mv a4,a1 + 764: 00068793 mv a5,a3 + 768: 00073383 ld t2,0(a4) + 76c: 00873283 ld t0,8(a4) + 770: 01073f83 ld t6,16(a4) + 774: 01873f03 ld t5,24(a4) + 778: 02073e83 ld t4,32(a4) + 77c: 02873e03 ld t3,40(a4) + 780: 03073303 ld t1,48(a4) + 784: 03873883 ld a7,56(a4) + 788: 04078793 add a5,a5,64 + 78c: f877b023 sd t2,-128(a5) + 790: f857b423 sd t0,-120(a5) + 794: f9f7b823 sd t6,-112(a5) + 798: f9e7bc23 sd t5,-104(a5) + 79c: fbd7b023 sd t4,-96(a5) + 7a0: fbc7b423 sd t3,-88(a5) + 7a4: fa67b823 sd t1,-80(a5) + 7a8: fb17bc23 sd a7,-72(a5) + 7ac: 04070713 add a4,a4,64 + 7b0: fb07ece3 bltu a5,a6,768 + 7b4: fbf60613 add a2,a2,-65 + 7b8: fc067793 and a5,a2,-64 + 7bc: 04078793 add a5,a5,64 + 7c0: fc067613 and a2,a2,-64 + 7c4: 00f585b3 add a1,a1,a5 + 7c8: 00c687b3 add a5,a3,a2 + 7cc: f907f4e3 bgeu a5,a6,754 + 7d0: 0005b703 ld a4,0(a1) + 7d4: 00878793 add a5,a5,8 + 7d8: 00858593 add a1,a1,8 + 7dc: fee7bc23 sd a4,-8(a5) + 7e0: ff07e8e3 bltu a5,a6,7d0 + 7e4: 00008067 ret + 7e8: 00008067 ret + 7ec: 00050793 mv a5,a0 + 7f0: fddff06f j 7cc + +00000000000007f4 : + 7f4: 00c567b3 or a5,a0,a2 + 7f8: 0077f793 and a5,a5,7 + 7fc: 00c50633 add a2,a0,a2 + 800: 0ff5f713 zext.b a4,a1 + 804: 00078e63 beqz a5,820 + 808: 00050793 mv a5,a0 + 80c: 02c57c63 bgeu a0,a2,844 + 810: 00178793 add a5,a5,1 + 814: fee78fa3 sb a4,-1(a5) + 818: fef61ce3 bne a2,a5,810 + 81c: 00008067 ret + 820: 00004797 auipc a5,0x4 + 824: b307b783 ld a5,-1232(a5) # 4350 + 828: 02f70733 mul a4,a4,a5 + 82c: fec578e3 bgeu a0,a2,81c + 830: 00050793 mv a5,a0 + 834: 00878793 add a5,a5,8 + 838: fee7bc23 sd a4,-8(a5) + 83c: fec7ece3 bltu a5,a2,834 + 840: 00008067 ret + 844: 00008067 ret + +0000000000000848 : + 848: 00054783 lbu a5,0(a0) + 84c: 00078e63 beqz a5,868 + 850: 00050793 mv a5,a0 + 854: 0017c703 lbu a4,1(a5) + 858: 00178793 add a5,a5,1 + 85c: fe071ce3 bnez a4,854 + 860: 40a78533 sub a0,a5,a0 + 864: 00008067 ret + 868: 00000513 li a0,0 + 86c: 00008067 ret + +0000000000000870 : + 870: 00b506b3 add a3,a0,a1 + 874: 00050793 mv a5,a0 + 878: 00059863 bnez a1,888 + 87c: 0240006f j 8a0 + 880: 00178793 add a5,a5,1 + 884: 00f68a63 beq a3,a5,898 + 888: 0007c703 lbu a4,0(a5) + 88c: fe071ae3 bnez a4,880 + 890: 40a78533 sub a0,a5,a0 + 894: 00008067 ret + 898: 40a68533 sub a0,a3,a0 + 89c: 00008067 ret + 8a0: 00000513 li a0,0 + 8a4: 00008067 ret + +00000000000008a8 : + 8a8: 00054783 lbu a5,0(a0) + 8ac: 00158593 add a1,a1,1 + 8b0: 00150513 add a0,a0,1 + 8b4: fff5c703 lbu a4,-1(a1) + 8b8: 00078a63 beqz a5,8cc + 8bc: fee786e3 beq a5,a4,8a8 + 8c0: 0007851b sext.w a0,a5 + 8c4: 40e5053b subw a0,a0,a4 + 8c8: 00008067 ret + 8cc: 00000513 li a0,0 + 8d0: ff5ff06f j 8c4 + +00000000000008d4 : + 8d4: 00050793 mv a5,a0 + 8d8: 0005c703 lbu a4,0(a1) + 8dc: 00178793 add a5,a5,1 + 8e0: 00158593 add a1,a1,1 + 8e4: fee78fa3 sb a4,-1(a5) + 8e8: fe0718e3 bnez a4,8d8 + 8ec: 00008067 ret + +Disassembly of section .text.startup: + +00000000000008f0
: + 8f0: fa010113 add sp,sp,-96 + 8f4: 04813823 sd s0,80(sp) + 8f8: 04113c23 sd ra,88(sp) + 8fc: 04913423 sd s1,72(sp) + 900: 05213023 sd s2,64(sp) + 904: 03313c23 sd s3,56(sp) + 908: 03413823 sd s4,48(sp) + 90c: 03513423 sd s5,40(sp) + 910: 00004617 auipc a2,0x4 + 914: a4860613 add a2,a2,-1464 # 4358 + 918: 00003697 auipc a3,0x3 + 91c: 6e868693 add a3,a3,1768 # 4000 + 920: 00003717 auipc a4,0x3 + 924: 7a070713 add a4,a4,1952 # 40c0 + 928: 02900413 li s0,41 + 92c: 0d0475d7 vsetvli a1,s0,e32,m1,ta,ma + 930: 0005879b sext.w a5,a1 + 934: 000012b7 lui t0,0x1 + 938: 8102829b addw t0,t0,-2032 # 810 + 93c: 02076507 vle32.v v10,(a4) + 940: 0206e587 vle32.v v11,(a3) + 944: 96a5a657 vmul.vv v12,v10,v11 + 948: 96c2e657 vmul.vx v12,v12,t0 + 94c: 02066627 vse32.v v12,(a2) + 950: 00279793 sll a5,a5,0x2 + 954: 40b4043b subw s0,s0,a1 + 958: 00f70733 add a4,a4,a5 + 95c: 00f686b3 add a3,a3,a5 + 960: 00f60633 add a2,a2,a5 + 964: fc0414e3 bnez s0,92c + 968: 8c818493 add s1,gp,-1848 # 4418 + 96c: 00003697 auipc a3,0x3 + 970: 75468693 add a3,a3,1876 # 40c0 + 974: 00003597 auipc a1,0x3 + 978: 68c58593 add a1,a1,1676 # 4000 + 97c: 00003517 auipc a0,0x3 + 980: 7e850513 add a0,a0,2024 # 4164 + 984: 00048613 mv a2,s1 + 988: 0006a783 lw a5,0(a3) + 98c: 0005a703 lw a4,0(a1) + 990: 00460613 add a2,a2,4 + 994: 00468693 add a3,a3,4 + 998: 02f7073b mulw a4,a4,a5 + 99c: 00458593 add a1,a1,4 + 9a0: 0077179b sllw a5,a4,0x7 + 9a4: 00e787bb addw a5,a5,a4 + 9a8: 0047979b sllw a5,a5,0x4 + 9ac: fef62e23 sw a5,-4(a2) + 9b0: fca69ce3 bne a3,a0,988 + 9b4: 00004917 auipc s2,0x4 + 9b8: 9a490913 add s2,s2,-1628 # 4358 + 9bc: 00100693 li a3,1 + 9c0: 00003a17 auipc s4,0x3 + 9c4: 7f0a0a13 add s4,s4,2032 # 41b0 + 9c8: 00004a97 auipc s5,0x4 + 9cc: 808a8a93 add s5,s5,-2040 # 41d0 + 9d0: 02900993 li s3,41 + 9d4: 00092703 lw a4,0(s2) + 9d8: 0004a783 lw a5,0(s1) + 9dc: 000a0513 mv a0,s4 + 9e0: 00490913 add s2,s2,4 + 9e4: 00448493 add s1,s1,4 + 9e8: 02f70463 beq a4,a5,a10 + 9ec: 881ff0ef jal 26c + 9f0: 00810593 add a1,sp,8 + 9f4: 00040513 mv a0,s0 + 9f8: fecff0ef jal 1e4 + 9fc: 00810513 add a0,sp,8 + a00: 86dff0ef jal 26c + a04: 000a8513 mv a0,s5 + a08: 865ff0ef jal 26c + a0c: 00000693 li a3,0 + a10: 0014041b addw s0,s0,1 + a14: fd3410e3 bne s0,s3,9d4 + a18: 05813083 ld ra,88(sp) + a1c: 05013403 ld s0,80(sp) + a20: 04813483 ld s1,72(sp) + a24: 04013903 ld s2,64(sp) + a28: 03813983 ld s3,56(sp) + a2c: 03013a03 ld s4,48(sp) + a30: 02813a83 ld s5,40(sp) + a34: 0016c513 xor a0,a3,1 + a38: 06010113 add sp,sp,96 + a3c: 00008067 ret + a40: fff00513 li a0,-1 + a44: 00008067 ret + +Disassembly of section .rodata: + +0000000000004000 : + 4000: 0009 .2byte 0x9 + 4002: 0000 vmsge.vx v0,v0,zero,v0.t + 4004: fffffff3 csrrc t6,0xfff,31 + 4008: fff0 .2byte 0xfff0 + 400a: ffff .2byte 0xffff + 400c: ffffffeb .4byte 0xffffffeb + 4010: fffd .2byte 0xfffd + 4012: ffff .2byte 0xffff + 4014: ffe9 .2byte 0xffe9 + 4016: ffff .2byte 0xffff + 4018: 000c .2byte 0xc + 401a: 0000 vmsge.vx v0,v0,zero,v0.t + 401c: ffffffef jal t6,401a + 4020: fff1 .2byte 0xfff1 + 4022: ffff .2byte 0xffff + 4024: 0016 .2byte 0x16 + 4026: 0000 vmsge.vx v0,v0,zero,v0.t + 4028: 0000000f fence unknown,unknown + 402c: ffed .2byte 0xffed + 402e: ffff .2byte 0xffff + 4030: 0010 .2byte 0x10 + 4032: 0000 vmsge.vx v0,v0,zero,v0.t + 4034: 000a .2byte 0xa + 4036: 0000 vmsge.vx v0,v0,zero,v0.t + 4038: fffe .2byte 0xfffe + 403a: ffff .2byte 0xffff + 403c: 0006 .2byte 0x6 + 403e: 0000 vmsge.vx v0,v0,zero,v0.t + 4040: fff4 .2byte 0xfff4 + 4042: ffff .2byte 0xffff + 4044: 0004 .2byte 0x4 + 4046: 0000 vmsge.vx v0,v0,zero,v0.t + 4048: 0014 .2byte 0x14 + 404a: 0000 vmsge.vx v0,v0,zero,v0.t + 404c: 0012 .2byte 0x12 + 404e: 0000 vmsge.vx v0,v0,zero,v0.t + 4050: fffffff7 .4byte 0xfffffff7 + 4054: fff9 .2byte 0xfff9 + 4056: ffff .2byte 0xffff + 4058: 0011 .2byte 0x11 + 405a: 0000 vmsge.vx v0,v0,zero,v0.t + 405c: fff2 .2byte 0xfff2 + 405e: ffff .2byte 0xffff + 4060: 000e .2byte 0xe + 4062: 0000 vmsge.vx v0,v0,zero,v0.t + 4064: 0008 .2byte 0x8 + 4066: 0000 vmsge.vx v0,v0,zero,v0.t + 4068: ffec .2byte 0xffec + 406a: ffff .2byte 0xffff + 406c: ffe8 .2byte 0xffe8 + 406e: ffff .2byte 0xffff + 4070: fff5 .2byte 0xfff5 + 4072: ffff .2byte 0xffff + 4074: fff6 .2byte 0xfff6 + 4076: ffff .2byte 0xffff + 4078: 00000007 vle8.v v0,(zero),v0.t + 407c: 0002 vmsge.vx v0,v0,zero,v0.t + 407e: 0000 vmsge.vx v0,v0,zero,v0.t + 4080: 0015 .2byte 0x15 + 4082: 0000 vmsge.vx v0,v0,zero,v0.t + 4084: fffc .2byte 0xfffc + 4086: ffff .2byte 0xffff + 4088: 00000003 lb zero,0(zero) # 0 <_start> + 408c: ffea .2byte 0xffea + 408e: ffff .2byte 0xffff + 4090: 0000 vmsge.vx v0,v0,zero,v0.t + 4092: 0000 vmsge.vx v0,v0,zero,v0.t + 4094: fff8 .2byte 0xfff8 + 4096: ffff .2byte 0xffff + 4098: 0005 .2byte 0x5 + 409a: 0000 vmsge.vx v0,v0,zero,v0.t + 409c: ffee .2byte 0xffee + 409e: ffff .2byte 0xffff + 40a0: ffff .2byte 0xffff + 40a2: ffff .2byte 0xffff + 40a4: 000d .2byte 0xd + 40a6: 0000 vmsge.vx v0,v0,zero,v0.t + 40a8: fffffffb .4byte 0xfffffffb + 40ac: 00000013 nop + 40b0: 0001 vmsge.vx v0,v0,zero,v0.t + 40b2: 0000 vmsge.vx v0,v0,zero,v0.t + 40b4: fffa .2byte 0xfffa + 40b6: ffff .2byte 0xffff + 40b8: 0000000b .4byte 0xb + 40bc: 0000 vmsge.vx v0,v0,zero,v0.t + ... + +00000000000040c0 : + 40c0: 0006 .2byte 0x6 + 40c2: 0000 vmsge.vx v0,v0,zero,v0.t + 40c4: fff4 .2byte 0xfff4 + 40c6: ffff .2byte 0xffff + 40c8: 000c .2byte 0xc + 40ca: 0000 vmsge.vx v0,v0,zero,v0.t + 40cc: fffffffb .4byte 0xfffffffb + 40d0: 0014 .2byte 0x14 + 40d2: 0000 vmsge.vx v0,v0,zero,v0.t + 40d4: 0000000f fence unknown,unknown + 40d8: fff2 .2byte 0xfff2 + 40da: ffff .2byte 0xffff + 40dc: 0008 .2byte 0x8 + 40de: 0000 vmsge.vx v0,v0,zero,v0.t + 40e0: 0009 .2byte 0x9 + 40e2: 0000 vmsge.vx v0,v0,zero,v0.t + 40e4: ffed .2byte 0xffed + 40e6: ffff .2byte 0xffff + 40e8: 0012 .2byte 0x12 + 40ea: 0000 vmsge.vx v0,v0,zero,v0.t + 40ec: 0000000b .4byte 0xb + 40f0: 00000007 vle8.v v0,(zero),v0.t + 40f4: fff6 .2byte 0xfff6 + 40f6: ffff .2byte 0xffff + 40f8: fff0 .2byte 0xfff0 + 40fa: ffff .2byte 0xffff + 40fc: fffd .2byte 0xfffd + 40fe: ffff .2byte 0xffff + 4100: 0010 .2byte 0x10 + 4102: 0000 vmsge.vx v0,v0,zero,v0.t + 4104: ffe9 .2byte 0xffe9 + 4106: ffff .2byte 0xffff + 4108: fffffff7 .4byte 0xfffffff7 + 410c: 00000013 nop + 4110: 0004 .2byte 0x4 + 4112: 0000 vmsge.vx v0,v0,zero,v0.t + 4114: 0001 vmsge.vx v0,v0,zero,v0.t + 4116: 0000 vmsge.vx v0,v0,zero,v0.t + 4118: ffffffef jal t6,4116 + 411c: ffec .2byte 0xffec + 411e: ffff .2byte 0xffff + 4120: 00000003 lb zero,0(zero) # 0 <_start> + 4124: 0000 vmsge.vx v0,v0,zero,v0.t + 4126: 0000 vmsge.vx v0,v0,zero,v0.t + 4128: ffffffeb .4byte 0xffffffeb + 412c: fff8 .2byte 0xfff8 + 412e: ffff .2byte 0xffff + 4130: fffa .2byte 0xfffa + 4132: ffff .2byte 0xffff + 4134: ffea .2byte 0xffea + 4136: ffff .2byte 0xffff + 4138: 0002 vmsge.vx v0,v0,zero,v0.t + 413a: 0000 vmsge.vx v0,v0,zero,v0.t + 413c: fffffff3 csrrc t6,0xfff,31 + 4140: fffe .2byte 0xfffe + 4142: ffff .2byte 0xffff + 4144: 0016 .2byte 0x16 + 4146: 0000 vmsge.vx v0,v0,zero,v0.t + 4148: 0005 .2byte 0x5 + 414a: 0000 vmsge.vx v0,v0,zero,v0.t + 414c: ffe8 .2byte 0xffe8 + 414e: ffff .2byte 0xffff + 4150: fff5 .2byte 0xfff5 + 4152: ffff .2byte 0xffff + 4154: 000e .2byte 0xe + 4156: 0000 vmsge.vx v0,v0,zero,v0.t + 4158: ffff .2byte 0xffff + 415a: ffff .2byte 0xffff + 415c: 000a .2byte 0xa + 415e: 0000 vmsge.vx v0,v0,zero,v0.t + 4160: fffc .2byte 0xfffc + 4162: ffff .2byte 0xffff + 4164: 000d .2byte 0xd + 4166: 0000 vmsge.vx v0,v0,zero,v0.t + 4168: 0011 .2byte 0x11 + 416a: 0000 vmsge.vx v0,v0,zero,v0.t + 416c: 0015 .2byte 0x15 + 416e: 0000 vmsge.vx v0,v0,zero,v0.t + 4170: fff1 .2byte 0xfff1 + 4172: ffff .2byte 0xffff + 4174: fff9 .2byte 0xfff9 + 4176: ffff .2byte 0xffff + 4178: ffee .2byte 0xffee + 417a: ffff .2byte 0xffff + 417c: 0000 vmsge.vx v0,v0,zero,v0.t + 417e: 0000 vmsge.vx v0,v0,zero,v0.t + 4180: c360 vmsge.vx v6,v0,ra,v0.t + 4182: ffff .2byte 0xffff + 4184: c3a4 .2byte 0xc3a4 + 4186: ffff .2byte 0xffff + 4188: c3e8 .2byte 0xc3e8 + 418a: ffff .2byte 0xffff + 418c: c2f8 .2byte 0xc2f8 + 418e: ffff .2byte 0xffff + 4190: c42c .2byte 0xc42c + 4192: ffff .2byte 0xffff + 4194: c470 .2byte 0xc470 + 4196: ffff .2byte 0xffff + 4198: c4b4 .2byte 0xc4b4 + 419a: ffff .2byte 0xffff + 419c: c4f8 .2byte 0xc4f8 + 419e: ffff .2byte 0xffff + 41a0: c2f8 .2byte 0xc2f8 + 41a2: ffff .2byte 0xffff + 41a4: c2f8 .2byte 0xc2f8 + 41a6: ffff .2byte 0xffff + 41a8: c2f8 .2byte 0xc2f8 + 41aa: ffff .2byte 0xffff + 41ac: c53c .2byte 0xc53c + 41ae: ffff .2byte 0xffff + +Disassembly of section .rodata.str1.8: + +00000000000041b0 <.rodata.str1.8>: + 41b0: 5241 vmsge.vx v4,v0,zero,v0.t + 41b2: 4152 .2byte 0x4152 + 41b4: 2059 .2byte 0x2059 + 41b6: 4f4e .2byte 0x4f4e + 41b8: 2054 .2byte 0x2054 + 41ba: 52524f43 vmsge.vx v30,v5,tp + 41be: 4345 .2byte 0x4345 + 41c0: 2054 .2byte 0x2054 + 41c2: 4e49 .2byte 0x4e49 + 41c4: 4920 vmsge.vx v18,v0,zero,v0.t + 41c6: 444e .2byte 0x444e + 41c8: 5845 .2byte 0x5845 + 41ca: 203a .2byte 0x203a + 41cc: 0000 vmsge.vx v0,v0,zero,v0.t + 41ce: 0000 vmsge.vx v0,v0,zero,v0.t + 41d0: 000a .2byte 0xa + 41d2: 0000 vmsge.vx v0,v0,zero,v0.t + 41d4: 0000 vmsge.vx v0,v0,zero,v0.t + 41d6: 0000 vmsge.vx v0,v0,zero,v0.t + 41d8: 6c637963 bgeu t1,t1,48aa <_tbss_end+0x3d2> + 41dc: 3a65 .2byte 0x3a65 + 41de: 0020 vmsge.vx v0,v0,zero,v0.t + 41e0: 690a .2byte 0x690a + 41e2: 736e .2byte 0x736e + 41e4: 7274 .2byte 0x7274 + 41e6: 7465 .2byte 0x7465 + 41e8: 203a .2byte 0x203a + 41ea: 0000 vmsge.vx v0,v0,zero,v0.t + 41ec: 0000 vmsge.vx v0,v0,zero,v0.t + 41ee: 0000 vmsge.vx v0,v0,zero,v0.t + 41f0: 7845 .2byte 0x7845 + 41f2: 7469 .2byte 0x7469 + 41f4: 6320 vmsge.vx v6,v0,zero,v0.t + 41f6: 3a65646f jal s0,5a59c <__global_pointer$+0x55a4c> + 41fa: 0020 vmsge.vx v0,v0,zero,v0.t + 41fc: 0000 vmsge.vx v0,v0,zero,v0.t + 41fe: 0000 vmsge.vx v0,v0,zero,v0.t + 4200: 4e49 .2byte 0x4e49 + 4202: 55525453 .4byte 0x55525453 + 4206: 4f495443 vmsge.vx v8,v20,s2 + 420a: 204e .2byte 0x204e + 420c: 4441 vmsge.vx v8,v0,zero,v0.t + 420e: 5244 .2byte 0x5244 + 4210: 5345 .2byte 0x5345 + 4212: 494d2053 .4byte 0x494d2053 + 4216: 494c4153 .4byte 0x494c4153 + 421a: 44454e47 .4byte 0x44454e47 + 421e: 6120 vmsge.vx v2,v0,zero,v0.t + 4220: 2074 .2byte 0x2074 + 4222: 4350 .2byte 0x4350 + 4224: 203a .2byte 0x203a + 4226: 0000 vmsge.vx v0,v0,zero,v0.t + 4228: 4e49 .2byte 0x4e49 + 422a: 55525453 .4byte 0x55525453 + 422e: 4f495443 vmsge.vx v8,v20,s2 + 4232: 204e .2byte 0x204e + 4234: 4341 vmsge.vx v6,v0,zero,v0.t + 4236: 53534543 vmsge.vx v10,v21,t1 + 423a: 4620 vmsge.vx v12,v0,zero,v0.t + 423c: 5541 vmsge.vx v10,v0,zero,v0.t + 423e: 544c .2byte 0x544c + 4240: 6120 vmsge.vx v2,v0,zero,v0.t + 4242: 2074 .2byte 0x2074 + 4244: 4350 .2byte 0x4350 + 4246: 203a .2byte 0x203a + ... + 4250: 4c49 .2byte 0x4c49 + 4252: 454c .2byte 0x454c + 4254: 204c4147 .4byte 0x204c4147 + 4258: 4e49 .2byte 0x4e49 + 425a: 55525453 .4byte 0x55525453 + 425e: 4f495443 vmsge.vx v8,v20,s2 + 4262: 204e .2byte 0x204e + 4264: 7461 vmsge.vx v8,v0,zero,v0.t + 4266: 5020 vmsge.vx v0,v0,zero,v0.t + 4268: 00203a43 vmsge.vx v20,v2,zero,v0.t + 426c: 0000 vmsge.vx v0,v0,zero,v0.t + 426e: 0000 vmsge.vx v0,v0,zero,v0.t + 4270: 4f4c .2byte 0x4f4c + 4272: 4441 vmsge.vx v8,v0,zero,v0.t + 4274: 4120 vmsge.vx v2,v0,zero,v0.t + 4276: 4444 .2byte 0x4444 + 4278: 4552 .2byte 0x4552 + 427a: 4d205353 .4byte 0x4d205353 + 427e: 5349 .2byte 0x5349 + 4280: 4c41 vmsge.vx v24,v0,zero,v0.t + 4282: 4749 .2byte 0x4749 + 4284: 454e .2byte 0x454e + 4286: 2044 .2byte 0x2044 + 4288: 7461 vmsge.vx v8,v0,zero,v0.t + 428a: 5020 vmsge.vx v0,v0,zero,v0.t + 428c: 00203a43 vmsge.vx v20,v2,zero,v0.t + 4290: 4f4c .2byte 0x4f4c + 4292: 4441 vmsge.vx v8,v0,zero,v0.t + 4294: 4120 vmsge.vx v2,v0,zero,v0.t + 4296: 53454343 vmsge.vx v6,v20,a0 + 429a: 41462053 .4byte 0x41462053 + 429e: 4c55 .2byte 0x4c55 + 42a0: 2054 .2byte 0x2054 + 42a2: 7461 vmsge.vx v8,v0,zero,v0.t + 42a4: 5020 vmsge.vx v0,v0,zero,v0.t + 42a6: 00203a43 vmsge.vx v20,v2,zero,v0.t + 42aa: 0000 vmsge.vx v0,v0,zero,v0.t + 42ac: 0000 vmsge.vx v0,v0,zero,v0.t + 42ae: 0000 vmsge.vx v0,v0,zero,v0.t + 42b0: 524f5453 .4byte 0x524f5453 + 42b4: 2045 .2byte 0x2045 + 42b6: 4441 vmsge.vx v8,v0,zero,v0.t + 42b8: 5244 .2byte 0x5244 + 42ba: 5345 .2byte 0x5345 + 42bc: 494d2053 .4byte 0x494d2053 + 42c0: 494c4153 .4byte 0x494c4153 + 42c4: 44454e47 .4byte 0x44454e47 + 42c8: 6120 vmsge.vx v2,v0,zero,v0.t + 42ca: 2074 .2byte 0x2074 + 42cc: 4350 .2byte 0x4350 + 42ce: 203a .2byte 0x203a + ... + 42d8: 524f5453 .4byte 0x524f5453 + 42dc: 2045 .2byte 0x2045 + 42de: 4341 vmsge.vx v6,v0,zero,v0.t + 42e0: 53534543 vmsge.vx v10,v21,t1 + 42e4: 4620 vmsge.vx v12,v0,zero,v0.t + 42e6: 5541 vmsge.vx v10,v0,zero,v0.t + 42e8: 544c .2byte 0x544c + 42ea: 6120 vmsge.vx v2,v0,zero,v0.t + 42ec: 2074 .2byte 0x2074 + 42ee: 4350 .2byte 0x4350 + 42f0: 203a .2byte 0x203a + 42f2: 0000 vmsge.vx v0,v0,zero,v0.t + 42f4: 0000 vmsge.vx v0,v0,zero,v0.t + 42f6: 0000 vmsge.vx v0,v0,zero,v0.t + 42f8: 4345 .2byte 0x4345 + 42fa: 4c41 vmsge.vx v24,v0,zero,v0.t + 42fc: 204c .2byte 0x204c + 42fe: 5246 .2byte 0x5246 + 4300: 4d204d4f .4byte 0x4d204d4f + 4304: 4d2d .2byte 0x4d2d + 4306: 2045444f .4byte 0x2045444f + 430a: 7461 vmsge.vx v8,v0,zero,v0.t + 430c: 5020 vmsge.vx v0,v0,zero,v0.t + 430e: 00203a43 vmsge.vx v20,v2,zero,v0.t + 4312: 0000 vmsge.vx v0,v0,zero,v0.t + 4314: 0000 vmsge.vx v0,v0,zero,v0.t + 4316: 0000 vmsge.vx v0,v0,zero,v0.t + 4318: 4e55 .2byte 0x4e55 + 431a: 574f4e4b .4byte 0x574f4e4b + 431e: 204e .2byte 0x204e + 4320: 5845 .2byte 0x5845 + 4322: 54504543 vmsge.vx v10,v5,zero,v0.t + 4326: 4f49 .2byte 0x4f49 + 4328: 204e .2byte 0x204e + 432a: 7461 vmsge.vx v8,v0,zero,v0.t + 432c: 5020 vmsge.vx v0,v0,zero,v0.t + 432e: 00203a43 vmsge.vx v20,v2,zero,v0.t + 4332: 0000 vmsge.vx v0,v0,zero,v0.t + 4334: 0000 vmsge.vx v0,v0,zero,v0.t + 4336: 0000 vmsge.vx v0,v0,zero,v0.t + 4338: 430a .2byte 0x430a + 433a: 4548 .2byte 0x4548 + 433c: 4d204b43 vmsge.vx v22,v18,zero,v0.t + 4340: 53554143 vmsge.vx v2,v21,a0 + 4344: 2045 .2byte 0x2045 + 4346: 6e69 .2byte 0x6e69 + 4348: 5220 vmsge.vx v4,v0,zero,v0.t + 434a: 4c54 .2byte 0x4c54 + ... + +Disassembly of section .sdata: + +0000000000004350 <__global_pointer$-0x800>: + 4350: 0101 vmsge.vx v2,v0,zero,v0.t + 4352: 0101 vmsge.vx v2,v0,zero,v0.t + 4354: 0101 vmsge.vx v2,v0,zero,v0.t + 4356: 0101 vmsge.vx v2,v0,zero,v0.t + +Disassembly of section .bss: + +0000000000004358 : + ... + +0000000000004418 : + ... + +Disassembly of section .tohost: + +0000000010000000 : + ... + +0000000010000040 : + ... + +Disassembly of section .comment: + +0000000000000000 <.comment>: + 0: 3a434347 .4byte 0x3a434347 + 4: 2820 vmsge.vx v16,v0,zero,v0.t + 6: 65653267 .4byte 0x65653267 + a: 6535 .2byte 0x6535 + c: 3334 .2byte 0x3334 + e: 3030 .2byte 0x3030 + 10: 3831 .2byte 0x3831 + 12: 2029 .2byte 0x2029 + 14: 3231 .2byte 0x3231 + 16: 322e .2byte 0x322e + 18: 302e .2byte 0x302e + ... + +Disassembly of section .riscv.attributes: + +0000000000000000 <.riscv.attributes>: + 0: 5e41 vmsge.vx v28,v0,zero,v0.t + 2: 0000 vmsge.vx v0,v0,zero,v0.t + 4: 7200 vmsge.vx v4,v0,zero,v0.t + 6: 7369 .2byte 0x7369 + 8: 01007663 bgeu zero,a6,14 <_start+0x14> + c: 0054 .2byte 0x54 + e: 0000 vmsge.vx v0,v0,zero,v0.t + 10: 1004 .2byte 0x1004 + 12: 7205 .2byte 0x7205 + 14: 3676 .2byte 0x3676 + 16: 6934 .2byte 0x6934 + 18: 7032 .2byte 0x7032 + 1a: 5f31 .2byte 0x5f31 + 1c: 326d .2byte 0x326d + 1e: 3070 .2byte 0x3070 + 20: 7a5f 6369 7273 .byte 0x5f, 0x7a, 0x69, 0x63, 0x73, 0x72 + 26: 7032 .2byte 0x7032 + 28: 5f30 .2byte 0x5f30 + 2a: 6d7a .2byte 0x6d7a + 2c: 756d .2byte 0x756d + 2e: 316c .2byte 0x316c + 30: 3070 .2byte 0x3070 + 32: 7a5f 6576 3233 .byte 0x5f, 0x7a, 0x76, 0x65, 0x33, 0x32 + 38: 3178 .2byte 0x3178 + 3a: 3070 .2byte 0x3070 + 3c: 7a5f 6576 3436 .byte 0x5f, 0x7a, 0x76, 0x65, 0x36, 0x34 + 42: 3178 .2byte 0x3178 + 44: 3070 .2byte 0x3070 + 46: 7a5f 6c76 3233 .byte 0x5f, 0x7a, 0x76, 0x6c, 0x33, 0x32 + 4c: 3162 vmsge.vx v2,v0,zero,v0.t + 4e: 3070 .2byte 0x3070 + 50: 7a5f 6c76 3436 .byte 0x5f, 0x7a, 0x76, 0x6c, 0x36, 0x34 + 56: 3162 vmsge.vx v2,v0,zero,v0.t + 58: 3070 .2byte 0x3070 + 5a: 0800 vmsge.vx v16,v0,zero,v0.t + 5c: 0a01 vmsge.vx v20,v0,zero,v0.t + 5e: 0b Address 0x5e is out of bounds. + diff --git a/src/main/resources/applications_vector/vmul/vmul.c b/src/main/resources/applications_vector/vmul/vmul.c new file mode 100644 index 00000000..962bf933 --- /dev/null +++ b/src/main/resources/applications_vector/vmul/vmul.c @@ -0,0 +1,61 @@ +#include "util.h" + +#define size_t long +#define N 48 + +const int dataArray0[N] = {6, -12, 12, -5, 20, 15, -14, 8, 9, -19, 18, 11, 7, -10, -16, -3, 16, -23, -9, 19, 4, 1, -17, -20, 3, 0, -21, -8, -6, -22, 2, -13, -2, 22, 5, -24, -11, 14, -1, 10, -4, 13, 17, 21, -15, -7, -18}; +const int dataArray1[N] = {9, -13, -16, -21, -3, -23, 12, -17, -15, 22, 15, -19, 16, 10, -2, 6, -12, 4, 20, 18, -9, -7, 17, -14, 14, 8, -20, -24, -11, -10, 7, 2, 21, -4, 3, -22, 0, -8, 5, -18, -1, 13, -5, 19, 1, -6, 11}; +int resultArray[N] = {0}; +int answerArray[N] = {0}; + +extern void printstr(char* str); +extern void int64ToHex(long num, char* str); +extern void int32ToHex(int num, char* str); +extern void clearCounters(); +extern void printCounters(); + +int main(int argc, char** argv) { + int vl, avl = 41; + const int *ptr0 = dataArray0; + const int *ptr1 = dataArray1; + int *ptr2 = resultArray; + while(avl != 0) { + asm volatile ("vsetvli %0, %1, e32, m1, ta, ma" + : "=r"(vl) + : "r"(avl)); + asm volatile ("li t0, 0x810"); + asm volatile ("vle32.v v10, (%0)" + : + : "r"(ptr0)); + asm volatile ("vle32.v v11, (%0)" + : + : "r"(ptr1)); + asm volatile ("vmul.vv v12, v10, v11"); + asm volatile ("vmul.vx v12, v12, t0"); + asm volatile ("vse32.v v12, (%0)" + : + : "r"(ptr2)); + ptr0 += vl; + ptr1 += vl; + ptr2 += vl; + avl -= vl; + } + int i; + for(i=0; i<41; i++) { + answerArray[i] = dataArray0[i] * dataArray1[i] * 0x810; + } + + _Bool correct = 1; + char string[19]; + for(i=0; i<41; i++) { + if(resultArray[i] != answerArray[i]) { + printstr("ARRAY NOT CORRECT IN INDEX: "); + int32ToHex(i, string); + printstr(string); + printstr("\n"); + correct = 0; + } + } + return !correct; +} + diff --git a/src/main/resources/applications_vector/vmul_data.hex b/src/main/resources/applications_vector/vmul_data.hex new file mode 100644 index 00000000..2784c896 --- /dev/null +++ b/src/main/resources/applications_vector/vmul_data.hex @@ -0,0 +1,214 @@ +00000009 +fffffff3 +fffffff0 +ffffffeb +fffffffd +ffffffe9 +0000000c +ffffffef +fffffff1 +00000016 +0000000f +ffffffed +00000010 +0000000a +fffffffe +00000006 +fffffff4 +00000004 +00000014 +00000012 +fffffff7 +fffffff9 +00000011 +fffffff2 +0000000e +00000008 +ffffffec +ffffffe8 +fffffff5 +fffffff6 +00000007 +00000002 +00000015 +fffffffc +00000003 +ffffffea +00000000 +fffffff8 +00000005 +ffffffee +ffffffff +0000000d +fffffffb +00000013 +00000001 +fffffffa +0000000b +00000000 +00000006 +fffffff4 +0000000c +fffffffb +00000014 +0000000f +fffffff2 +00000008 +00000009 +ffffffed +00000012 +0000000b +00000007 +fffffff6 +fffffff0 +fffffffd +00000010 +ffffffe9 +fffffff7 +00000013 +00000004 +00000001 +ffffffef +ffffffec +00000003 +00000000 +ffffffeb +fffffff8 +fffffffa +ffffffea +00000002 +fffffff3 +fffffffe +00000016 +00000005 +ffffffe8 +fffffff5 +0000000e +ffffffff +0000000a +fffffffc +0000000d +00000011 +00000015 +fffffff1 +fffffff9 +ffffffee +00000000 +ffffc360 +ffffc3a4 +ffffc3e8 +ffffc2f8 +ffffc42c +ffffc470 +ffffc4b4 +ffffc4f8 +ffffc2f8 +ffffc2f8 +ffffc2f8 +ffffc53c +41525241 +4f4e2059 +4f432054 +43455252 +4e492054 +444e4920 +203a5845 +00000000 +0000000a +00000000 +6c637963 +00203a65 +736e690a +74657274 +0000203a +00000000 +74697845 +646f6320 +00203a65 +00000000 +54534e49 +54435552 +204e4f49 +52444441 +20535345 +4153494d +4e47494c +61204445 +43502074 +0000203a +54534e49 +54435552 +204e4f49 +45434341 +46205353 +544c5541 +20746120 +203a4350 +00000000 +00000000 +454c4c49 +204c4147 +54534e49 +54435552 +204e4f49 +50207461 +00203a43 +00000000 +44414f4c +44444120 +53534552 +53494d20 +47494c41 +2044454e +50207461 +00203a43 +44414f4c +43434120 +20535345 +4c554146 +74612054 +3a435020 +00000020 +00000000 +524f5453 +44412045 +53455244 +494d2053 +494c4153 +44454e47 +20746120 +203a4350 +00000000 +00000000 +524f5453 +43412045 +53534543 +55414620 +6120544c +43502074 +0000203a +00000000 +4c414345 +5246204c +4d204d4f +444f4d2d +74612045 +3a435020 +00000020 +00000000 +4e4b4e55 +204e574f +45435845 +4f495450 +7461204e +3a435020 +00000020 +00000000 +4548430a +4d204b43 +53554143 +6e692045 +4c545220 +00000000 +01010101 +01010101 diff --git a/src/main/resources/applications_vector/vmul_inst.hex b/src/main/resources/applications_vector/vmul_inst.hex new file mode 100644 index 00000000..d02c3b32 --- /dev/null +++ b/src/main/resources/applications_vector/vmul_inst.hex @@ -0,0 +1,658 @@ +00000093 +00000113 +00000193 +00000213 +00000293 +00000313 +00000393 +00000413 +00000493 +00000513 +00000593 +00000613 +00000693 +00000713 +00000793 +00000813 +00000893 +00000913 +00000993 +00000a13 +00000a93 +00000b13 +00000b93 +00000c13 +00000c93 +00000d13 +00000d93 +00000e13 +00000e93 +00000f13 +00000f93 +00000297 +03828293 +30529073 +00005197 +ac818193 +10000217 +ff720213 +fc027213 +f1402573 +00100593 +00b57063 +00006137 +ff01011b +6580006f +ef010113 +00113423 +00213823 +00313c23 +02413023 +02513423 +02613823 +02713c23 +04813023 +04913423 +04a13823 +04b13c23 +06c13023 +06d13423 +06e13823 +06f13c23 +09013023 +09113423 +09213823 +09313c23 +0b413023 +0b513423 +0b613823 +0b713c23 +0d813023 +0d913423 +0da13823 +0db13c23 +0fc13023 +0fd13423 +0fe13823 +0ff13c23 +34202573 +341025f3 +00010613 +2d0000ef +34151073 +000022b7 +8002829b +3002a073 +00813083 +01013103 +01813183 +02013203 +02813283 +03013303 +03813383 +04013403 +04813483 +05013503 +05813583 +06013603 +06813683 +07013703 +07813783 +08013803 +08813883 +09013903 +09813983 +0a013a03 +0a813a83 +0b013b03 +0b813b83 +0c013c03 +0c813c83 +0d013d03 +0d813d83 +0e013e03 +0e813e83 +0f013f03 +0f813f83 +11010113 +30200073 +b0201073 +b0001073 +00008067 +03000793 +00f58023 +07800793 +00f580a3 +00158813 +00958793 +00900613 +00f57713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +40455513 +fef812e3 +00058523 +00008067 +03000793 +00f58023 +07800793 +00f580a3 +00158813 +01158793 +00900613 +00f57713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +40455513 +fef812e3 +00058923 +00008067 +00054783 +00078c63 +10000737 +00f70023 +00154783 +00150513 +fe079ae3 +00008067 +fe010113 +c0202673 +c00025f3 +00004717 +f4070713 +06300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +ffff8737 +83074713 +01910793 +00e11423 +00910813 +00078713 +00900893 +00f5f693 +03768513 +00d8e463 +03068513 +00a70023 +fff70713 +4045d593 +fee812e3 +00814703 +00010d23 +00810693 +100005b7 +00070a63 +00e58023 +0016c703 +00168693 +fe071ae3 +00004697 +ec868693 +00a00713 +100005b7 +00e58023 +0016c703 +00168693 +fe071ae3 +ffff8737 +83074713 +00060693 +00e11423 +00900593 +00f6f713 +03770613 +00e5e463 +03070613 +00c78023 +fff78793 +4046d693 +fef812e3 +00814783 +00010d23 +00810713 +100006b7 +00078a63 +00f68023 +00174783 +00170713 +fe079ae3 +100007b7 +00a00713 +00e78023 +02010113 +00008067 +fe010113 +00813823 +00113c23 +00050413 +00004717 +e3c70713 +04500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00010593 +00040513 +e09ff0ef +00014703 +00070e63 +00010793 +100006b7 +00e68023 +0017c703 +00178793 +fe071ae3 +00040513 +100007b7 +00078023 +0000006f +ffff87b7 +fd010113 +8307c793 +00f11423 +02113423 +01910793 +00910813 +00900613 +00f5f713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +4045d593 +ff0792e3 +00010d23 +00b00793 +02a7e063 +00004717 +d2470713 +00251513 +00e50533 +00052783 +00e787b3 +00078067 +00004717 +ea070713 +05500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +00810713 +100006b7 +00078a63 +00f68023 +00174783 +00170713 +fe079ae3 +00004717 +e8070713 +00a00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +fff00513 +ec9ff0ef +00004717 +d2070713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +00810713 +100006b7 +fc0786e3 +00f68023 +00174783 +00170713 +fe079ae3 +fb9ff06f +00004717 +d0470713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f80788e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +f75ff06f +00004717 +ce870713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f40786e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +f31ff06f +00004717 +cc470713 +04c00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f00784e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +eedff06f +00004717 +ca070713 +04c00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +ec0782e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +ea9ff06f +00004717 +c7c70713 +05300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +e80780e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +e65ff06f +00004717 +c6070713 +05300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +e2078ee3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +e21ff06f +00004717 +c3c70713 +04500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +de078ce3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +dddff06f +00051063 +00008067 +ff010113 +00000593 +00000513 +00113423 +1d8000ef +c89ff0ef +00b567b3 +00c7e7b3 +0077f793 +00c50833 +02078463 +00c58633 +00050793 +0b057663 +0005c703 +00158593 +00178793 +fee78fa3 +fec598e3 +00008067 +04050693 +0906f863 +00058713 +00068793 +00073383 +00873283 +01073f83 +01873f03 +02073e83 +02873e03 +03073303 +03873883 +04078793 +f877b023 +f857b423 +f9f7b823 +f9e7bc23 +fbd7b023 +fbc7b423 +fa67b823 +fb17bc23 +04070713 +fb07ece3 +fbf60613 +fc067793 +04078793 +fc067613 +00f585b3 +00c687b3 +f907f4e3 +0005b703 +00878793 +00858593 +fee7bc23 +ff07e8e3 +00008067 +00008067 +00050793 +fddff06f +00c567b3 +0077f793 +00c50633 +0ff5f713 +00078e63 +00050793 +02c57c63 +00178793 +fee78fa3 +fef61ce3 +00008067 +00004797 +b307b783 +02f70733 +fec578e3 +00050793 +00878793 +fee7bc23 +fec7ece3 +00008067 +00008067 +00054783 +00078e63 +00050793 +0017c703 +00178793 +fe071ce3 +40a78533 +00008067 +00000513 +00008067 +00b506b3 +00050793 +00059863 +0240006f +00178793 +00f68a63 +0007c703 +fe071ae3 +40a78533 +00008067 +40a68533 +00008067 +00000513 +00008067 +00054783 +00158593 +00150513 +fff5c703 +00078a63 +fee786e3 +0007851b +40e5053b +00008067 +00000513 +ff5ff06f +00050793 +0005c703 +00178793 +00158593 +fee78fa3 +fe0718e3 +00008067 +fa010113 +04813823 +04113c23 +04913423 +05213023 +03313c23 +03413823 +03513423 +00004617 +a4860613 +00003697 +6e868693 +00003717 +7a070713 +02900413 +0d0475d7 +0005879b +000012b7 +8102829b +02076507 +0206e587 +96a5a657 +96c2e657 +02066627 +00279793 +40b4043b +00f70733 +00f686b3 +00f60633 +fc0414e3 +8c818493 +00003697 +75468693 +00003597 +68c58593 +00003517 +7e850513 +00048613 +0006a783 +0005a703 +00460613 +00468693 +02f7073b +00458593 +0077179b +00e787bb +0047979b +fef62e23 +fca69ce3 +00004917 +9a490913 +00100693 +00003a17 +7f0a0a13 +00004a97 +808a8a93 +02900993 +00092703 +0004a783 +000a0513 +00490913 +00448493 +02f70463 +881ff0ef +00810593 +00040513 +fecff0ef +00810513 +86dff0ef +000a8513 +865ff0ef +00000693 +0014041b +fd3410e3 +05813083 +05013403 +04813483 +04013903 +03813983 +03013a03 +02813a83 +0016c513 +06010113 +00008067 +fff00513 +00008067 diff --git a/src/main/scala/hajime/common/Instructions.scala b/src/main/scala/hajime/common/Instructions.scala index 60c6f7ff..52388c7f 100644 --- a/src/main/scala/hajime/common/Instructions.scala +++ b/src/main/scala/hajime/common/Instructions.scala @@ -156,7 +156,8 @@ object VectorInstructions extends ScalarOpConstants with VectorOpConstants { case VSOURCE.VV => "000" case VSOURCE.VX => "100" case VSOURCE.VI => "011" - case VSOURCE.MM => "010" + case VSOURCE.MVV => "010" + case VSOURCE.MVX => "110" case _ => throw new Exception("amogus") } } @@ -184,8 +185,24 @@ object VectorInstructions extends ScalarOpConstants with VectorOpConstants { case "vmin" => "000101" case "vmaxu" => "000110" case "vmax" => "000111" + case "vmul" => "100101" + case "vmulh" => "100111" + case "vmulhu" => "100100" + case "vmulhsu" => "100110" + case "vmacc" => ??? + case "vnmsac" => ??? + case "vmadd" => ??? + case "vnmsub" => ??? case "vmerge" => "010111" case "vmv" => "010111" + case "vredsum" => ??? + case "vredmaxu" => ??? + case "vredmax" => ??? + case "vredminu" => ??? + case "vredmin" => ??? + case "vredand" => ??? + case "vredor" => ??? + case "vredxor" => ??? case "vmand" => "011001" case "vmnand" => "011101" case "vmandn" => "011000" @@ -194,6 +211,8 @@ object VectorInstructions extends ScalarOpConstants with VectorOpConstants { case "vmnor" => "011110" case "vmorn" => "011100" case "vmxnor" => "011111" + case "vmv_x_s" => ??? + case "vmv_s_x" => ??? case _ => throw new Exception(s"inst $vInst is invalid") } } @@ -265,6 +284,9 @@ object VectorInstructions extends ScalarOpConstants with VectorOpConstants { def VMAXU_VX = vArithGen(vInst = "vmaxu", vsource = VSOURCE.VX) def VMAX_VV = vArithGen(vInst = "vmax", vsource = VSOURCE.VV) def VMAX_VX = vArithGen(vInst = "vmax", vsource = VSOURCE.VX) + + def VMUL_VV = vArithGen(vInst = "vmul", vsource = VSOURCE.MVV) + def VMUL_VX = vArithGen(vInst = "vmul", vsource = VSOURCE.MVX) def VMERGE_VVM = vArithGen(vInst = "vmerge", vsource = VSOURCE.VV, vm = "0") def VMERGE_VXM = vArithGen(vInst = "vmerge", vsource = VSOURCE.VX, vm = "0") def VMERGE_VIM = vArithGen(vInst = "vmerge", vsource = VSOURCE.VI, vm = "0") @@ -272,14 +294,14 @@ object VectorInstructions extends ScalarOpConstants with VectorOpConstants { def VMV_VX = vArithGen(vInst = "vmv", vsource = VSOURCE.VX, vm = "1", vs2Zero = true) def VMV_VI = vArithGen(vInst = "vmv", vsource = VSOURCE.VI, vm = "1", vs2Zero = true) - def VMAND_MM = vArithGen(vInst = "vmand", vsource = VSOURCE.MM, vm = "1") - def VMNAND_MM = vArithGen(vInst = "vmnand", vsource = VSOURCE.MM, vm = "1") - def VMANDN_MM = vArithGen(vInst = "vmandn", vsource = VSOURCE.MM, vm = "1") - def VMXOR_MM = vArithGen(vInst = "vmxor", vsource = VSOURCE.MM, vm = "1") - def VMOR_MM = vArithGen(vInst = "vmor", vsource = VSOURCE.MM, vm = "1") - def VMNOR_MM = vArithGen(vInst = "vmnor", vsource = VSOURCE.MM, vm = "1") - def VMORN_MM = vArithGen(vInst = "vmorn", vsource = VSOURCE.MM, vm = "1") - def VMXNOR_MM = vArithGen(vInst = "vmxnor", vsource = VSOURCE.MM, vm = "1") + def VMAND_MM = vArithGen(vInst = "vmand", vsource = VSOURCE.MVV, vm = "1") + def VMNAND_MM = vArithGen(vInst = "vmnand", vsource = VSOURCE.MVV, vm = "1") + def VMANDN_MM = vArithGen(vInst = "vmandn", vsource = VSOURCE.MVV, vm = "1") + def VMXOR_MM = vArithGen(vInst = "vmxor", vsource = VSOURCE.MVV, vm = "1") + def VMOR_MM = vArithGen(vInst = "vmor", vsource = VSOURCE.MVV, vm = "1") + def VMNOR_MM = vArithGen(vInst = "vmnor", vsource = VSOURCE.MVV, vm = "1") + def VMORN_MM = vArithGen(vInst = "vmorn", vsource = VSOURCE.MVV, vm = "1") + def VMXNOR_MM = vArithGen(vInst = "vmxnor", vsource = VSOURCE.MVV, vm = "1") } object Causes { diff --git a/src/main/scala/hajime/publicmodules/Decoder.scala b/src/main/scala/hajime/publicmodules/Decoder.scala index e3d1ec94..ccbe07db 100644 --- a/src/main/scala/hajime/publicmodules/Decoder.scala +++ b/src/main/scala/hajime/publicmodules/Decoder.scala @@ -255,6 +255,8 @@ object RvvDecode extends DecodeConstants { VMNOR_MM -> List(Y, Branch.NONE, Value1.ZERO, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), VMORN_MM -> List(Y, Branch.NONE, Value1.ZERO, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), VMXNOR_MM -> List(Y, Branch.NONE, Value1.ZERO, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), + VMUL_VV -> List(Y, Branch.NONE, Value1.ZERO, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), + VMUL_VX -> List(Y, Branch.NONE, Value1.RS1, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), ) } diff --git a/src/main/scala/hajime/vectormodules/VectorDecoder.scala b/src/main/scala/hajime/vectormodules/VectorDecoder.scala index e635df04..e6b4eb2b 100644 --- a/src/main/scala/hajime/vectormodules/VectorDecoder.scala +++ b/src/main/scala/hajime/vectormodules/VectorDecoder.scala @@ -43,6 +43,7 @@ object VDecode extends DecodeConstants with VectorOpConstants { case "vmax" => MAX case "vmerge" => MERGE case "vmv" => MV + case "vmul" => MUL case "vmand" => MAND case "vmnand" => MNAND case "vmandn" => MANDN @@ -161,14 +162,16 @@ object VDecode extends DecodeConstants with VectorOpConstants { VMV_VV -> amogus("vmv", VSOURCE.VV), VMV_VX -> amogus("vmv", VSOURCE.VX), VMV_VI -> amogus("vmv", VSOURCE.VI), - VMAND_MM -> amogus("vmand", VSOURCE.MM), - VMNAND_MM -> amogus("vmnand", VSOURCE.MM), - VMANDN_MM -> amogus("vmandn", VSOURCE.MM), - VMXOR_MM -> amogus("vmxor", VSOURCE.MM), - VMOR_MM -> amogus("vmor", VSOURCE.MM), - VMNOR_MM -> amogus("vmnor", VSOURCE.MM), - VMORN_MM -> amogus("vmorn", VSOURCE.MM), - VMXNOR_MM -> amogus("vmxnor", VSOURCE.MM), + VMAND_MM -> amogus("vmand", VSOURCE.MVV), + VMNAND_MM -> amogus("vmnand", VSOURCE.MVV), + VMANDN_MM -> amogus("vmandn", VSOURCE.MVV), + VMXOR_MM -> amogus("vmxor", VSOURCE.MVV), + VMOR_MM -> amogus("vmor", VSOURCE.MVV), + VMNOR_MM -> amogus("vmnor", VSOURCE.MVV), + VMORN_MM -> amogus("vmorn", VSOURCE.MVV), + VMXNOR_MM -> amogus("vmxnor", VSOURCE.MVV), + VMUL_VV -> amogus("vmul", VSOURCE.VV), + VMUL_VX -> amogus("vmul", VSOURCE.VX), ) } @@ -204,8 +207,6 @@ class VectorDecoder(implicit params: HajimeCoreParams) extends Module with Decod val tableForListLookup = table.map { case (inst, ls) => (inst, ls.map(_.asUInt)) } - - import ContentValid._ val csignals = ListLookup(io.inst.bits, default = List(N, AVL_SEL.NONE, VTYPE_SEL.NONE, MOP.NONE, UMOP.NORMAL, N, VEU_FUN.ADD, VSOURCE.VV).map(_.asUInt), mapping = tableForListLookup diff --git a/src/main/scala/hajime/vectormodules/VectorExecUnit.scala b/src/main/scala/hajime/vectormodules/VectorExecUnit.scala index 9b44fcc5..433b939b 100644 --- a/src/main/scala/hajime/vectormodules/VectorExecUnit.scala +++ b/src/main/scala/hajime/vectormodules/VectorExecUnit.scala @@ -71,15 +71,15 @@ abstract class VectorExecUnit(implicit params: HajimeCoreParams) extends Module } import VEU_FUN._ - io.readVrf.req.idx := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MM.asUInt, idx.head(idx.getWidth-3), idx) - io.readVrf.req.sew := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MM.asUInt, 0.U, instInfoReg.bits.vecConf.vtype.vsew) + io.readVrf.req.idx := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MVV.asUInt, idx.head(idx.getWidth-3), idx) + io.readVrf.req.sew := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MVV.asUInt, 0.U, instInfoReg.bits.vecConf.vtype.vsew) io.readVrf.req.vs1 := instInfoReg.bits.vs1 io.readVrf.req.vs2 := instInfoReg.bits.vs2 io.readVrf.req.vd := instInfoReg.bits.vd // ベクトルマスク命令ならばidx自体が対応するため下げる - io.readVrf.req.readVdAsMaskSource := instInfoReg.bits.vectorDecode.veuFun.writeAsMask && (instInfoReg.bits.vectorDecode.vSource =/= VSOURCE.MM.asUInt) + io.readVrf.req.readVdAsMaskSource := instInfoReg.bits.vectorDecode.veuFun.writeAsMask && (instInfoReg.bits.vectorDecode.vSource =/= VSOURCE.MVV.asUInt) - val execValue1 = Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.VV.asUInt || instInfoReg.bits.vectorDecode.vSource === VSOURCE.MM.asUInt, io.readVrf.resp.vs1Out, instInfoReg.bits.scalarVal) + val execValue1 = Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.VV.asUInt || instInfoReg.bits.vectorDecode.vSource === VSOURCE.MVV.asUInt, io.readVrf.resp.vs1Out, instInfoReg.bits.scalarVal) val execValue2 = io.readVrf.resp.vs2Out val execValue3 = io.readVrf.resp.vdOut val execValueVM = io.readVrf.resp.vm @@ -140,16 +140,17 @@ class IntegerAluExecUnit(implicit params: HajimeCoreParams) extends VectorExecUn Mux(vm, vs1Out, vs2Out) :: vs1Out :: (vs2Out & vs1Out) :: (vs2Out | vs1Out) :: (vs2Out ^ vs1Out) :: (vs2Mask && vs1Mask) :: !(vs2Mask && vs1Mask) :: (vs2Mask && !vs1Mask) :: (vs2Mask ^ vs1Mask) :: - (vs2Mask || vs1Mask) :: !(vs2Mask || vs1Mask) :: (vs2Mask || !vs1Mask) :: !(vs2Mask ^ vs1Mask) :: Nil + (vs2Mask || vs1Mask) :: !(vs2Mask || vs1Mask) :: (vs2Mask || !vs1Mask) :: !(vs2Mask ^ vs1Mask) :: + (vs2Out.asSInt * vs1Out.asSInt).asUInt :: Nil } import VEU_FUN._ - valueToExec.vs1Out := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MM.asUInt, execValue1(7,0)(idx(2,0)), execValue1) - valueToExec.vs2Out := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MM.asUInt, execValue2(7,0)(idx(2,0)), execValue2) + valueToExec.vs1Out := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MVV.asUInt, execValue1(7,0)(idx(2,0)), execValue1) + valueToExec.vs2Out := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MVV.asUInt, execValue2(7,0)(idx(2,0)), execValue2) // VMADC, VMSBCでマスクが無効(vm=1)の場合は0 valueToExec.vm := !(instInfoReg.bits.vectorDecode.veuFun.isCarryMask && instInfoReg.bits.vectorDecode.vm) && io.readVrf.resp.vm val rawResult = MuxLookup(instInfoReg.bits.vectorDecode.veuFun, 0.U)( - Seq(ADD, SUB, RSUB, ADC, MADC, SBC, MSBC, SEQ, SNE, SLTU, SLT, SLEU, SLE, SGTU, SGT, MINU, MIN, MAXU, MAX, MERGE, MV, AND, OR, XOR, MAND, MNAND, MANDN, MXOR, MOR, MNOR, MORN, MXNOR).zipWithIndex.map( + Seq(ADD, SUB, RSUB, ADC, MADC, SBC, MSBC, SEQ, SNE, SLTU, SLT, SLEU, SLE, SGTU, SGT, MINU, MIN, MAXU, MAX, MERGE, MV, AND, OR, XOR, MAND, MNAND, MANDN, MXOR, MOR, MNOR, MORN, MXNOR, MUL).zipWithIndex.map( x => x._1.asUInt -> execResult(x._2) ) ) diff --git a/src/main/scala/hajime/vectormodules/VectorOpConstants.scala b/src/main/scala/hajime/vectormodules/VectorOpConstants.scala index 3fecafc7..695b05a4 100644 --- a/src/main/scala/hajime/vectormodules/VectorOpConstants.scala +++ b/src/main/scala/hajime/vectormodules/VectorOpConstants.scala @@ -25,7 +25,9 @@ trait VectorOpConstants { } object VEU_FUN extends ChiselEnum { - val NONE, ADD, SUB, RSUB, ADC, MADC, SBC, MSBC, SEQ, SNE, SLTU, SLT, SLEU, SLE, SGTU, SGT, MINU, MIN, MAXU, MAX, MERGE, MV, AND, OR, XOR, MAND, MNAND, MANDN, MXOR, MOR, MNOR, MORN, MXNOR = Value + val NONE, ADD, SUB, RSUB, ADC, MADC, SBC, MSBC, SEQ, SNE, SLTU, SLT, SLEU, SLE, SGTU, SGT, + MINU, MIN, MAXU, MAX, MERGE, MV, AND, OR, XOR, MAND, MNAND, MANDN, MXOR, MOR, MNOR, MORN, MXNOR, + MUL = Value val compMaskList = SEQ :: SNE :: SLTU :: SLT :: SLEU :: SLE :: SGTU :: SGT :: Nil val carryMaskList = MADC :: MSBC :: Nil val ignoreMaskList = ADC :: MADC :: SBC :: MSBC :: MERGE :: Nil @@ -54,6 +56,6 @@ trait VectorOpConstants { } object VSOURCE extends ChiselEnum { - val VV, VX, VI, MM = Value + val VV, VX, VI, MVV, MVX = Value } } diff --git a/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala b/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala index 8ca99657..00f522c7 100644 --- a/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala +++ b/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala @@ -139,6 +139,7 @@ class Zve64xAppTestForVecCpu extends AnyFlatSpec with ChiselScalatestTester { "vadd", "vsub", "vand", "vmseq", "vmslt", "vmsle", "vmsgt", "vminmax", "vmerge", "vmv", "vmand", "vmor", "vmxor", + "vmul" ) val applicationTest = Seq( "vector_median" From 7049729b2d11f5136c818769d7b4a45726581c44 Mon Sep 17 00:00:00 2001 From: HidetaroTanaka Date: Thu, 9 Nov 2023 18:07:09 +0900 Subject: [PATCH 2/8] add other multiply --- src/main/scala/hajime/common/Functions.scala | 7 ++- .../scala/hajime/common/Instructions.scala | 7 +++ .../scala/hajime/publicmodules/Decoder.scala | 6 +++ .../hajime/vectormodules/VectorDecoder.scala | 9 ++++ .../hajime/vectormodules/VectorExecUnit.scala | 49 ++++++++++++++++--- .../vectormodules/VectorOpConstants.scala | 2 +- 6 files changed, 72 insertions(+), 8 deletions(-) diff --git a/src/main/scala/hajime/common/Functions.scala b/src/main/scala/hajime/common/Functions.scala index fbd59c0d..6e72ab8a 100644 --- a/src/main/scala/hajime/common/Functions.scala +++ b/src/main/scala/hajime/common/Functions.scala @@ -16,7 +16,12 @@ object Functions { } implicit class seqHasElementEquivalentToUInt(ls: List[UInt]) { def has(elem: UInt): Bool = { - ls.map(x => x === elem).reduce(_ || _) + ls.map(_ === elem).reduce(_ || _) + } + } + implicit class lsHasElementEquivalentToUInt[T <: scala.collection.Iterable[UInt]](ls: T) { + def has(elem: UInt): Bool = { + ls.map(_ === elem).reduce(_ || _) } } implicit class booleanToInt(b: Boolean) { diff --git a/src/main/scala/hajime/common/Instructions.scala b/src/main/scala/hajime/common/Instructions.scala index 52388c7f..c4a23b3d 100644 --- a/src/main/scala/hajime/common/Instructions.scala +++ b/src/main/scala/hajime/common/Instructions.scala @@ -287,6 +287,13 @@ object VectorInstructions extends ScalarOpConstants with VectorOpConstants { def VMUL_VV = vArithGen(vInst = "vmul", vsource = VSOURCE.MVV) def VMUL_VX = vArithGen(vInst = "vmul", vsource = VSOURCE.MVX) + def VMULH_VV = vArithGen(vInst = "vmulh", vsource = VSOURCE.MVV) + def VMULH_VX = vArithGen(vInst = "vmulh", vsource = VSOURCE.MVX) + def VMULHU_VV = vArithGen(vInst = "vmulhu", vsource = VSOURCE.MVV) + def VMULHU_VX = vArithGen(vInst = "vmulhu", vsource = VSOURCE.MVX) + def VMULHSU_VV = vArithGen(vInst = "vmulhsu", vsource = VSOURCE.MVV) + def VMULHSU_VX = vArithGen(vInst = "vmulhsu", vsource = VSOURCE.MVX) + def VMERGE_VVM = vArithGen(vInst = "vmerge", vsource = VSOURCE.VV, vm = "0") def VMERGE_VXM = vArithGen(vInst = "vmerge", vsource = VSOURCE.VX, vm = "0") def VMERGE_VIM = vArithGen(vInst = "vmerge", vsource = VSOURCE.VI, vm = "0") diff --git a/src/main/scala/hajime/publicmodules/Decoder.scala b/src/main/scala/hajime/publicmodules/Decoder.scala index ccbe07db..40581a27 100644 --- a/src/main/scala/hajime/publicmodules/Decoder.scala +++ b/src/main/scala/hajime/publicmodules/Decoder.scala @@ -257,6 +257,12 @@ object RvvDecode extends DecodeConstants { VMXNOR_MM -> List(Y, Branch.NONE, Value1.ZERO, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), VMUL_VV -> List(Y, Branch.NONE, Value1.ZERO, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), VMUL_VX -> List(Y, Branch.NONE, Value1.RS1, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), + VMULH_VV -> List(Y, Branch.NONE, Value1.ZERO, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), + VMULH_VX -> List(Y, Branch.NONE, Value1.RS1, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), + VMULHU_VV -> List(Y, Branch.NONE, Value1.ZERO, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), + VMULHU_VX -> List(Y, Branch.NONE, Value1.RS1, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), + VMULHSU_VV -> List(Y, Branch.NONE, Value1.ZERO, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), + VMULHSU_VX -> List(Y, Branch.NONE, Value1.RS1, Value2.ZERO, ARITHMETIC_FCN.NONE, N, N, WB_SEL.NONE, MEM_FCN.M_NONE, MEM_LEN.B, N, CSR_FCN.N, N, Y), ) } diff --git a/src/main/scala/hajime/vectormodules/VectorDecoder.scala b/src/main/scala/hajime/vectormodules/VectorDecoder.scala index e6b4eb2b..1f83bb89 100644 --- a/src/main/scala/hajime/vectormodules/VectorDecoder.scala +++ b/src/main/scala/hajime/vectormodules/VectorDecoder.scala @@ -44,6 +44,9 @@ object VDecode extends DecodeConstants with VectorOpConstants { case "vmerge" => MERGE case "vmv" => MV case "vmul" => MUL + case "vmulh" => MULH + case "vmulhu" => MULHU + case "vmulhsu" => MULHSU case "vmand" => MAND case "vmnand" => MNAND case "vmandn" => MANDN @@ -172,6 +175,12 @@ object VDecode extends DecodeConstants with VectorOpConstants { VMXNOR_MM -> amogus("vmxnor", VSOURCE.MVV), VMUL_VV -> amogus("vmul", VSOURCE.VV), VMUL_VX -> amogus("vmul", VSOURCE.VX), + VMULH_VV -> amogus("vmulh", VSOURCE.VV), + VMULH_VX -> amogus("vmulh", VSOURCE.VX), + VMULHU_VV -> amogus("vmulhu", VSOURCE.VV), + VMULHU_VX -> amogus("vmulhu", VSOURCE.VX), + VMULHSU_VV -> amogus("vmulhsu", VSOURCE.VV), + VMULHSU_VX -> amogus("vmulhsu", VSOURCE.VX) ) } diff --git a/src/main/scala/hajime/vectormodules/VectorExecUnit.scala b/src/main/scala/hajime/vectormodules/VectorExecUnit.scala index 433b939b..51dd3995 100644 --- a/src/main/scala/hajime/vectormodules/VectorExecUnit.scala +++ b/src/main/scala/hajime/vectormodules/VectorExecUnit.scala @@ -4,6 +4,7 @@ import chisel3._ import chisel3.experimental.BundleLiterals._ import circt.stage.ChiselStage import chisel3.util._ +import hajime.common.Functions.{signExtend, lsHasElementEquivalentToUInt} import hajime.common._ import hajime.publicmodules._ import hajime.simple4Stage._ @@ -39,8 +40,7 @@ class VectorExecUnitIO(implicit params: HajimeCoreParams) extends Bundle { */ abstract class VectorExecUnit(implicit params: HajimeCoreParams) extends Module with VectorOpConstants { require(params.useVector, "Insert Funni Amongus Reference here") - // 演算内容をここに書けばop関数はいらない? - def exec(vectorDec: VectorDecoderResp, values: VecRegFileReadResp): Seq[UInt] + def exec(vectorDec: VectorDecoderResp, values: VecRegFileReadResp, vsew: UInt): Seq[UInt] val io = IO(new VectorExecUnitIO()) @@ -71,6 +71,7 @@ abstract class VectorExecUnit(implicit params: HajimeCoreParams) extends Module } import VEU_FUN._ + // TODO: vs1Outの判定はMVVではなくベクトルマスク命令か否かで io.readVrf.req.idx := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MVV.asUInt, idx.head(idx.getWidth-3), idx) io.readVrf.req.sew := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MVV.asUInt, 0.U, instInfoReg.bits.vecConf.vtype.vsew) io.readVrf.req.vs1 := instInfoReg.bits.vs1 @@ -100,7 +101,7 @@ abstract class VectorExecUnit(implicit params: HajimeCoreParams) extends Module io.signalIn.ready := !instInfoReg.valid || io.dataOut.toVRF.bits.last - val execResult = exec(instInfoReg.bits.vectorDecode, valueToExec) + val execResult = exec(instInfoReg.bits.vectorDecode, valueToExec, instInfoReg.bits.vecConf.vtype.vsew) io.toExWbReg.valid := io.dataOut.toVRF.bits.last io.toExWbReg.bits.dataSignals := DontCare @@ -116,12 +117,45 @@ abstract class VectorExecUnit(implicit params: HajimeCoreParams) extends Module } class IntegerAluExecUnit(implicit params: HajimeCoreParams) extends VectorExecUnit { - override def exec(vectorDec: VectorDecoderResp, values: VecRegFileReadResp): Seq[UInt] = { + override def exec(vectorDec: VectorDecoderResp, values: VecRegFileReadResp, vsew: UInt): Seq[UInt] = { import values._ val vadcResult = (vs2Out +& vs1Out) + vm val vsbcResult = (vs2Out -& vs1Out) - vm val vs2Mask = vs2Out(0) val vs1Mask = vs1Out(0) + val vs2ForMult = MuxLookup(vsew, vs2Out)( + (0 until 4).map( + // vs2がunsignedならば零拡張,そうでなければ符号拡張 + i => i.U -> { + val vs2OutMainBits = vs2Out((8 << i) - 1, 0) + Mux(vectorDec.veuFun === VEU_FUN.MULHU.asUInt, Cat(false.B, vs2OutMainBits), vs2OutMainBits.ext(params.xprlen+1)) + } + ) + ).asSInt + val vs1ForMult = MuxLookup(vsew, vs1Out)( + (0 until 4).map( + // vs1がunsignedならば零拡張,そうでなければ符号拡張 + i => i.U -> { + val vs1OutMainBits = vs1Out((8 << i) - 1, 0) + Mux(Seq(VEU_FUN.MULHU, VEU_FUN.MULHSU).map(_.asUInt).has(vectorDec.veuFun), Cat(false.B, vs1OutMainBits), vs1OutMainBits.ext(params.xprlen+1)) + } + ) + ).asSInt + val multiplyRes = (vs2ForMult * vs1ForMult).asUInt + val multiplyResLowBits = MuxLookup(vsew, multiplyRes(7,0))( + (0 until 4).map( + i => i.U -> multiplyRes((8 << i) - 1, 0) + ) + ) + // (15, 7) + // (31, 16) + // (63, 32) + // (127, 64) + val multiplyResHighBits = MuxLookup(vsew, multiplyRes(15, 8))( + (0 until 4).map( + i => i.U -> multiplyRes((16 << i) - 1, 8 << i) + ) + ) // vadd, vsub, vrsub, vadc, vmadc, (vsbc, vmsbc), // seq, sne, // sltu, slt, sleu, sle, @@ -141,16 +175,19 @@ class IntegerAluExecUnit(implicit params: HajimeCoreParams) extends VectorExecUn (vs2Out & vs1Out) :: (vs2Out | vs1Out) :: (vs2Out ^ vs1Out) :: (vs2Mask && vs1Mask) :: !(vs2Mask && vs1Mask) :: (vs2Mask && !vs1Mask) :: (vs2Mask ^ vs1Mask) :: (vs2Mask || vs1Mask) :: !(vs2Mask || vs1Mask) :: (vs2Mask || !vs1Mask) :: !(vs2Mask ^ vs1Mask) :: - (vs2Out.asSInt * vs1Out.asSInt).asUInt :: Nil + multiplyResLowBits :: multiplyResHighBits :: multiplyResHighBits :: multiplyResHighBits :: Nil } import VEU_FUN._ + // TODO: vs1Outの判定はMVVではなくベクトルマスク命令か否かで valueToExec.vs1Out := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MVV.asUInt, execValue1(7,0)(idx(2,0)), execValue1) valueToExec.vs2Out := Mux(instInfoReg.bits.vectorDecode.vSource === VSOURCE.MVV.asUInt, execValue2(7,0)(idx(2,0)), execValue2) // VMADC, VMSBCでマスクが無効(vm=1)の場合は0 valueToExec.vm := !(instInfoReg.bits.vectorDecode.veuFun.isCarryMask && instInfoReg.bits.vectorDecode.vm) && io.readVrf.resp.vm val rawResult = MuxLookup(instInfoReg.bits.vectorDecode.veuFun, 0.U)( - Seq(ADD, SUB, RSUB, ADC, MADC, SBC, MSBC, SEQ, SNE, SLTU, SLT, SLEU, SLE, SGTU, SGT, MINU, MIN, MAXU, MAX, MERGE, MV, AND, OR, XOR, MAND, MNAND, MANDN, MXOR, MOR, MNOR, MORN, MXNOR, MUL).zipWithIndex.map( + Seq(ADD, SUB, RSUB, ADC, MADC, SBC, MSBC, SEQ, SNE, SLTU, SLT, SLEU, SLE, SGTU, SGT, + MINU, MIN, MAXU, MAX, MERGE, MV, AND, OR, XOR, MAND, MNAND, MANDN, MXOR, MOR, MNOR, MORN, MXNOR, + MUL, MULH, MULHU, MULHSU).zipWithIndex.map( x => x._1.asUInt -> execResult(x._2) ) ) diff --git a/src/main/scala/hajime/vectormodules/VectorOpConstants.scala b/src/main/scala/hajime/vectormodules/VectorOpConstants.scala index 695b05a4..8aa15c1f 100644 --- a/src/main/scala/hajime/vectormodules/VectorOpConstants.scala +++ b/src/main/scala/hajime/vectormodules/VectorOpConstants.scala @@ -27,7 +27,7 @@ trait VectorOpConstants { object VEU_FUN extends ChiselEnum { val NONE, ADD, SUB, RSUB, ADC, MADC, SBC, MSBC, SEQ, SNE, SLTU, SLT, SLEU, SLE, SGTU, SGT, MINU, MIN, MAXU, MAX, MERGE, MV, AND, OR, XOR, MAND, MNAND, MANDN, MXOR, MOR, MNOR, MORN, MXNOR, - MUL = Value + MUL, MULH, MULHU, MULHSU = Value val compMaskList = SEQ :: SNE :: SLTU :: SLT :: SLEU :: SLE :: SGTU :: SGT :: Nil val carryMaskList = MADC :: MSBC :: Nil val ignoreMaskList = ADC :: MADC :: SBC :: MSBC :: MERGE :: Nil From 8121cd903ede6970ca8431b36546d5dc1ab03a52 Mon Sep 17 00:00:00 2001 From: HidetaroTanaka Date: Thu, 9 Nov 2023 18:12:24 +0900 Subject: [PATCH 3/8] a --- src/main/scala/hajime/common/Functions.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/scala/hajime/common/Functions.scala b/src/main/scala/hajime/common/Functions.scala index 6e72ab8a..d72230e4 100644 --- a/src/main/scala/hajime/common/Functions.scala +++ b/src/main/scala/hajime/common/Functions.scala @@ -14,14 +14,15 @@ object Functions { } } } - implicit class seqHasElementEquivalentToUInt(ls: List[UInt]) { + implicit class lsHasElementEquivalentToUInt[T <: scala.collection.Iterable[UInt]](ls: T) { def has(elem: UInt): Bool = { ls.map(_ === elem).reduce(_ || _) } } - implicit class lsHasElementEquivalentToUInt[T <: scala.collection.Iterable[UInt]](ls: T) { + @deprecated("this only supports List, so use lsHasElementEquivalentToUInt instead as it supports everything Iterable") + implicit class seqHasElementEquivalentToUInt(ls: List[UInt]) { def has(elem: UInt): Bool = { - ls.map(_ === elem).reduce(_ || _) + Functions.lsHasElementEquivalentToUInt(ls).has(elem) } } implicit class booleanToInt(b: Boolean) { @@ -29,4 +30,4 @@ object Functions { if(b) 1 else 0 } } -} +} \ No newline at end of file From d62d24fb7a0f6765246d4a99da4b9c38acaa0f24 Mon Sep 17 00:00:00 2001 From: HidetaroTanaka Date: Thu, 9 Nov 2023 18:47:39 +0900 Subject: [PATCH 4/8] needs debug --- .../resources/applications_vector/build.sh | 17 + .../resources/applications_vector/vmulh.dump | 1061 +++++++++++++++++ .../applications_vector/vmulh/vmulh.c | 61 + .../applications_vector/vmulh_data.hex | 166 +++ .../applications_vector/vmulh_inst.hex | 659 ++++++++++ .../RandomArrayGen.scala | 6 +- .../hajime/vectormodules/VectorCpuSpec.scala | 2 +- 7 files changed, 1968 insertions(+), 4 deletions(-) create mode 100644 src/main/resources/applications_vector/vmulh.dump create mode 100644 src/main/resources/applications_vector/vmulh/vmulh.c create mode 100644 src/main/resources/applications_vector/vmulh_data.hex create mode 100644 src/main/resources/applications_vector/vmulh_inst.hex diff --git a/src/main/resources/applications_vector/build.sh b/src/main/resources/applications_vector/build.sh index d6840300..ab7ffdcc 100644 --- a/src/main/resources/applications_vector/build.sh +++ b/src/main/resources/applications_vector/build.sh @@ -399,5 +399,22 @@ hexdump -v -e '1/4 "%08x" "\n"' vmul_text_startup.bin > vmul_text_startup.temp cat vmul_rodata.temp vmul_rodata_str1_8.temp vmul_sdata.temp > vmul_data.hex cat vmul_text_init.temp vmul_text.temp vmul_text_startup.temp > vmul_inst.hex +riscv64-unknown-elf-gcc -I ../application_headers -DPREALLOCATE=1 -mcmodel=medany -static -std=gnu99 -O2 -fno-common -fno-builtin-printf -fno-tree-loop-distribute-patterns -march=rv64im_zicsr_zve64x -mabi=lp64 -o vmulh.riscv ./vmulh/vmulh.c ../application_headers/syscalls.c ../application_headers/crt.S -static -nostdlib -nostartfiles -T ../application_headers/test.ld +riscv64-unknown-elf-objdump --disassemble-all vmulh.riscv > vmulh.dump +riscv64-unknown-elf-objdump --disassemble-all vmulh.riscv > vmulh.dump +riscv64-unknown-elf-objcopy --dump-section .rodata=vmulh_rodata.bin vmulh.riscv +riscv64-unknown-elf-objcopy --dump-section .rodata.str1.8=vmulh_rodata_str1_8.bin vmulh.riscv +riscv64-unknown-elf-objcopy --dump-section .sdata=vmulh_sdata.bin vmulh.riscv +riscv64-unknown-elf-objcopy --dump-section .text.init=vmulh_text_init.bin vmulh.riscv +riscv64-unknown-elf-objcopy --dump-section .text=vmulh_text.bin vmulh.riscv +riscv64-unknown-elf-objcopy --dump-section .text.startup=vmulh_text_startup.bin vmulh.riscv +hexdump -v -e '1/4 "%08x" "\n"' vmulh_rodata.bin > vmulh_rodata.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulh_rodata_str1_8.bin > vmulh_rodata_str1_8.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulh_sdata.bin > vmulh_sdata.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulh_text_init.bin > vmulh_text_init.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulh_text.bin > vmulh_text.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulh_text_startup.bin > vmulh_text_startup.temp +cat vmulh_rodata.temp vmulh_rodata_str1_8.temp vmulh_sdata.temp > vmulh_data.hex +cat vmulh_text_init.temp vmulh_text.temp vmulh_text_startup.temp > vmulh_inst.hex rm *.riscv *.bin *.temp \ No newline at end of file diff --git a/src/main/resources/applications_vector/vmulh.dump b/src/main/resources/applications_vector/vmulh.dump new file mode 100644 index 00000000..e90637e4 --- /dev/null +++ b/src/main/resources/applications_vector/vmulh.dump @@ -0,0 +1,1061 @@ + +vmulh.riscv: file format elf64-littleriscv + + +Disassembly of section .text.init: + +0000000000000000 <_start>: + 0: 00000093 li ra,0 + 4: 00000113 li sp,0 + 8: 00000193 li gp,0 + c: 00000213 li tp,0 + 10: 00000293 li t0,0 + 14: 00000313 li t1,0 + 18: 00000393 li t2,0 + 1c: 00000413 li s0,0 + 20: 00000493 li s1,0 + 24: 00000513 li a0,0 + 28: 00000593 li a1,0 + 2c: 00000613 li a2,0 + 30: 00000693 li a3,0 + 34: 00000713 li a4,0 + 38: 00000793 li a5,0 + 3c: 00000813 li a6,0 + 40: 00000893 li a7,0 + 44: 00000913 li s2,0 + 48: 00000993 li s3,0 + 4c: 00000a13 li s4,0 + 50: 00000a93 li s5,0 + 54: 00000b13 li s6,0 + 58: 00000b93 li s7,0 + 5c: 00000c13 li s8,0 + 60: 00000c93 li s9,0 + 64: 00000d13 li s10,0 + 68: 00000d93 li s11,0 + 6c: 00000e13 li t3,0 + 70: 00000e93 li t4,0 + 74: 00000f13 li t5,0 + 78: 00000f93 li t6,0 + 7c: 00000297 auipc t0,0x0 + 80: 03828293 add t0,t0,56 # b4 + 84: 30529073 csrw mtvec,t0 + 88: 00005197 auipc gp,0x5 + 8c: a0818193 add gp,gp,-1528 # 4a90 <__global_pointer$> + 90: 10000217 auipc tp,0x10000 + 94: ff720213 add tp,tp,-9 # 10000087 <_end+0x3f> + 98: fc027213 and tp,tp,-64 + 9c: f1402573 csrr a0,mhartid + a0: 00100593 li a1,1 + a4: 00b57063 bgeu a0,a1,a4 <_start+0xa4> + a8: 00006137 lui sp,0x6 + ac: ff01011b addw sp,sp,-16 # 5ff0 <__global_pointer$+0x1560> + b0: 6580006f j 708 <_init> + +00000000000000b4 : + b4: ef010113 add sp,sp,-272 + b8: 00113423 sd ra,8(sp) + bc: 00213823 sd sp,16(sp) + c0: 00313c23 sd gp,24(sp) + c4: 02413023 sd tp,32(sp) + c8: 02513423 sd t0,40(sp) + cc: 02613823 sd t1,48(sp) + d0: 02713c23 sd t2,56(sp) + d4: 04813023 sd s0,64(sp) + d8: 04913423 sd s1,72(sp) + dc: 04a13823 sd a0,80(sp) + e0: 04b13c23 sd a1,88(sp) + e4: 06c13023 sd a2,96(sp) + e8: 06d13423 sd a3,104(sp) + ec: 06e13823 sd a4,112(sp) + f0: 06f13c23 sd a5,120(sp) + f4: 09013023 sd a6,128(sp) + f8: 09113423 sd a7,136(sp) + fc: 09213823 sd s2,144(sp) + 100: 09313c23 sd s3,152(sp) + 104: 0b413023 sd s4,160(sp) + 108: 0b513423 sd s5,168(sp) + 10c: 0b613823 sd s6,176(sp) + 110: 0b713c23 sd s7,184(sp) + 114: 0d813023 sd s8,192(sp) + 118: 0d913423 sd s9,200(sp) + 11c: 0da13823 sd s10,208(sp) + 120: 0db13c23 sd s11,216(sp) + 124: 0fc13023 sd t3,224(sp) + 128: 0fd13423 sd t4,232(sp) + 12c: 0fe13823 sd t5,240(sp) + 130: 0ff13c23 sd t6,248(sp) + 134: 34202573 csrr a0,mcause + 138: 341025f3 csrr a1,mepc + 13c: 00010613 mv a2,sp + 140: 2d0000ef jal 410 + 144: 34151073 csrw mepc,a0 + 148: 000022b7 lui t0,0x2 + 14c: 8002829b addw t0,t0,-2048 # 1800 + 150: 3002a073 csrs mstatus,t0 + 154: 00813083 ld ra,8(sp) + 158: 01013103 ld sp,16(sp) + 15c: 01813183 ld gp,24(sp) + 160: 02013203 ld tp,32(sp) + 164: 02813283 ld t0,40(sp) + 168: 03013303 ld t1,48(sp) + 16c: 03813383 ld t2,56(sp) + 170: 04013403 ld s0,64(sp) + 174: 04813483 ld s1,72(sp) + 178: 05013503 ld a0,80(sp) + 17c: 05813583 ld a1,88(sp) + 180: 06013603 ld a2,96(sp) + 184: 06813683 ld a3,104(sp) + 188: 07013703 ld a4,112(sp) + 18c: 07813783 ld a5,120(sp) + 190: 08013803 ld a6,128(sp) + 194: 08813883 ld a7,136(sp) + 198: 09013903 ld s2,144(sp) + 19c: 09813983 ld s3,152(sp) + 1a0: 0a013a03 ld s4,160(sp) + 1a4: 0a813a83 ld s5,168(sp) + 1a8: 0b013b03 ld s6,176(sp) + 1ac: 0b813b83 ld s7,184(sp) + 1b0: 0c013c03 ld s8,192(sp) + 1b4: 0c813c83 ld s9,200(sp) + 1b8: 0d013d03 ld s10,208(sp) + 1bc: 0d813d83 ld s11,216(sp) + 1c0: 0e013e03 ld t3,224(sp) + 1c4: 0e813e83 ld t4,232(sp) + 1c8: 0f013f03 ld t5,240(sp) + 1cc: 0f813f83 ld t6,248(sp) + 1d0: 11010113 add sp,sp,272 + 1d4: 30200073 mret + +Disassembly of section .text: + +00000000000001d8 : + 1d8: b0201073 csrw minstret,zero + 1dc: b0001073 csrw mcycle,zero + 1e0: 00008067 ret + +00000000000001e4 : + 1e4: 03000793 li a5,48 + 1e8: 00f58023 sb a5,0(a1) + 1ec: 07800793 li a5,120 + 1f0: 00f580a3 sb a5,1(a1) + 1f4: 00158813 add a6,a1,1 + 1f8: 00958793 add a5,a1,9 + 1fc: 00900613 li a2,9 + 200: 00f57713 and a4,a0,15 + 204: 03770693 add a3,a4,55 + 208: 00e66463 bltu a2,a4,210 + 20c: 03070693 add a3,a4,48 + 210: 00d78023 sb a3,0(a5) + 214: fff78793 add a5,a5,-1 + 218: 40455513 sra a0,a0,0x4 + 21c: fef812e3 bne a6,a5,200 + 220: 00058523 sb zero,10(a1) + 224: 00008067 ret + +0000000000000228 : + 228: 03000793 li a5,48 + 22c: 00f58023 sb a5,0(a1) + 230: 07800793 li a5,120 + 234: 00f580a3 sb a5,1(a1) + 238: 00158813 add a6,a1,1 + 23c: 01158793 add a5,a1,17 + 240: 00900613 li a2,9 + 244: 00f57713 and a4,a0,15 + 248: 03770693 add a3,a4,55 + 24c: 00e66463 bltu a2,a4,254 + 250: 03070693 add a3,a4,48 + 254: 00d78023 sb a3,0(a5) + 258: fff78793 add a5,a5,-1 + 25c: 40455513 sra a0,a0,0x4 + 260: fef812e3 bne a6,a5,244 + 264: 00058923 sb zero,18(a1) + 268: 00008067 ret + +000000000000026c : + 26c: 00054783 lbu a5,0(a0) + 270: 00078c63 beqz a5,288 + 274: 10000737 lui a4,0x10000 + 278: 00f70023 sb a5,0(a4) # 10000000 + 27c: 00154783 lbu a5,1(a0) + 280: 00150513 add a0,a0,1 + 284: fe079ae3 bnez a5,278 + 288: 00008067 ret + +000000000000028c : + 28c: fe010113 add sp,sp,-32 + 290: c0202673 rdinstret a2 + 294: c00025f3 rdcycle a1 + 298: 00004717 auipc a4,0x4 + 29c: e8070713 add a4,a4,-384 # 4118 + 2a0: 06300793 li a5,99 + 2a4: 100006b7 lui a3,0x10000 + 2a8: 00f68023 sb a5,0(a3) # 10000000 + 2ac: 00174783 lbu a5,1(a4) + 2b0: 00170713 add a4,a4,1 + 2b4: fe079ae3 bnez a5,2a8 + 2b8: ffff8737 lui a4,0xffff8 + 2bc: 83074713 xor a4,a4,-2000 + 2c0: 01910793 add a5,sp,25 + 2c4: 00e11423 sh a4,8(sp) + 2c8: 00910813 add a6,sp,9 + 2cc: 00078713 mv a4,a5 + 2d0: 00900893 li a7,9 + 2d4: 00f5f693 and a3,a1,15 + 2d8: 03768513 add a0,a3,55 + 2dc: 00d8e463 bltu a7,a3,2e4 + 2e0: 03068513 add a0,a3,48 + 2e4: 00a70023 sb a0,0(a4) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 2e8: fff70713 add a4,a4,-1 + 2ec: 4045d593 sra a1,a1,0x4 + 2f0: fee812e3 bne a6,a4,2d4 + 2f4: 00814703 lbu a4,8(sp) + 2f8: 00010d23 sb zero,26(sp) + 2fc: 00810693 add a3,sp,8 + 300: 100005b7 lui a1,0x10000 + 304: 00070a63 beqz a4,318 + 308: 00e58023 sb a4,0(a1) # 10000000 + 30c: 0016c703 lbu a4,1(a3) + 310: 00168693 add a3,a3,1 + 314: fe071ae3 bnez a4,308 + 318: 00004697 auipc a3,0x4 + 31c: e0868693 add a3,a3,-504 # 4120 + 320: 00a00713 li a4,10 + 324: 100005b7 lui a1,0x10000 + 328: 00e58023 sb a4,0(a1) # 10000000 + 32c: 0016c703 lbu a4,1(a3) + 330: 00168693 add a3,a3,1 + 334: fe071ae3 bnez a4,328 + 338: ffff8737 lui a4,0xffff8 + 33c: 83074713 xor a4,a4,-2000 + 340: 00060693 mv a3,a2 + 344: 00e11423 sh a4,8(sp) + 348: 00900593 li a1,9 + 34c: 00f6f713 and a4,a3,15 + 350: 03770613 add a2,a4,55 # ffffffffffff8037 <_end+0xffffffffefff7fef> + 354: 00e5e463 bltu a1,a4,35c + 358: 03070613 add a2,a4,48 + 35c: 00c78023 sb a2,0(a5) + 360: fff78793 add a5,a5,-1 + 364: 4046d693 sra a3,a3,0x4 + 368: fef812e3 bne a6,a5,34c + 36c: 00814783 lbu a5,8(sp) + 370: 00010d23 sb zero,26(sp) + 374: 00810713 add a4,sp,8 + 378: 100006b7 lui a3,0x10000 + 37c: 00078a63 beqz a5,390 + 380: 00f68023 sb a5,0(a3) # 10000000 + 384: 00174783 lbu a5,1(a4) + 388: 00170713 add a4,a4,1 + 38c: fe079ae3 bnez a5,380 + 390: 100007b7 lui a5,0x10000 + 394: 00a00713 li a4,10 + 398: 00e78023 sb a4,0(a5) # 10000000 + 39c: 02010113 add sp,sp,32 + 3a0: 00008067 ret + +00000000000003a4 : + 3a4: fe010113 add sp,sp,-32 + 3a8: 00813823 sd s0,16(sp) + 3ac: 00113c23 sd ra,24(sp) + 3b0: 00050413 mv s0,a0 + 3b4: 00004717 auipc a4,0x4 + 3b8: d7c70713 add a4,a4,-644 # 4130 + 3bc: 04500793 li a5,69 + 3c0: 100006b7 lui a3,0x10000 + 3c4: 00f68023 sb a5,0(a3) # 10000000 + 3c8: 00174783 lbu a5,1(a4) + 3cc: 00170713 add a4,a4,1 + 3d0: fe079ae3 bnez a5,3c4 + 3d4: 00010593 mv a1,sp + 3d8: 00040513 mv a0,s0 + 3dc: e09ff0ef jal 1e4 + 3e0: 00014703 lbu a4,0(sp) + 3e4: 00070e63 beqz a4,400 + 3e8: 00010793 mv a5,sp + 3ec: 100006b7 lui a3,0x10000 + 3f0: 00e68023 sb a4,0(a3) # 10000000 + 3f4: 0017c703 lbu a4,1(a5) + 3f8: 00178793 add a5,a5,1 + 3fc: fe071ae3 bnez a4,3f0 + 400: 00040513 mv a0,s0 + 404: 100007b7 lui a5,0x10000 + 408: 00078023 sb zero,0(a5) # 10000000 + 40c: 0000006f j 40c + +0000000000000410 : + 410: ffff87b7 lui a5,0xffff8 + 414: fd010113 add sp,sp,-48 + 418: 8307c793 xor a5,a5,-2000 + 41c: 00f11423 sh a5,8(sp) + 420: 02113423 sd ra,40(sp) + 424: 01910793 add a5,sp,25 + 428: 00910813 add a6,sp,9 + 42c: 00900613 li a2,9 + 430: 00f5f713 and a4,a1,15 + 434: 03770693 add a3,a4,55 + 438: 00e66463 bltu a2,a4,440 + 43c: 03070693 add a3,a4,48 + 440: 00d78023 sb a3,0(a5) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 444: fff78793 add a5,a5,-1 + 448: 4045d593 sra a1,a1,0x4 + 44c: ff0792e3 bne a5,a6,430 + 450: 00010d23 sb zero,26(sp) + 454: 00b00793 li a5,11 + 458: 02a7e063 bltu a5,a0,478 + 45c: 00004717 auipc a4,0x4 + 460: c6470713 add a4,a4,-924 # 40c0 + 464: 00251513 sll a0,a0,0x2 + 468: 00e50533 add a0,a0,a4 + 46c: 00052783 lw a5,0(a0) + 470: 00e787b3 add a5,a5,a4 + 474: 00078067 jr a5 + 478: 00004717 auipc a4,0x4 + 47c: de070713 add a4,a4,-544 # 4258 + 480: 05500793 li a5,85 + 484: 100006b7 lui a3,0x10000 + 488: 00f68023 sb a5,0(a3) # 10000000 + 48c: 00174783 lbu a5,1(a4) + 490: 00170713 add a4,a4,1 + 494: fe079ae3 bnez a5,488 + 498: 00814783 lbu a5,8(sp) + 49c: 00810713 add a4,sp,8 + 4a0: 100006b7 lui a3,0x10000 + 4a4: 00078a63 beqz a5,4b8 + 4a8: 00f68023 sb a5,0(a3) # 10000000 + 4ac: 00174783 lbu a5,1(a4) + 4b0: 00170713 add a4,a4,1 + 4b4: fe079ae3 bnez a5,4a8 + 4b8: 00004717 auipc a4,0x4 + 4bc: dc070713 add a4,a4,-576 # 4278 + 4c0: 00a00793 li a5,10 + 4c4: 100006b7 lui a3,0x10000 + 4c8: 00f68023 sb a5,0(a3) # 10000000 + 4cc: 00174783 lbu a5,1(a4) + 4d0: 00170713 add a4,a4,1 + 4d4: fe079ae3 bnez a5,4c8 + 4d8: fff00513 li a0,-1 + 4dc: ec9ff0ef jal 3a4 + 4e0: 00004717 auipc a4,0x4 + 4e4: c6070713 add a4,a4,-928 # 4140 + 4e8: 04900793 li a5,73 + 4ec: 100006b7 lui a3,0x10000 + 4f0: 00f68023 sb a5,0(a3) # 10000000 + 4f4: 00174783 lbu a5,1(a4) + 4f8: 00170713 add a4,a4,1 + 4fc: fe079ae3 bnez a5,4f0 + 500: 00814783 lbu a5,8(sp) + 504: 00810713 add a4,sp,8 + 508: 100006b7 lui a3,0x10000 + 50c: fc0786e3 beqz a5,4d8 + 510: 00f68023 sb a5,0(a3) # 10000000 + 514: 00174783 lbu a5,1(a4) + 518: 00170713 add a4,a4,1 + 51c: fe079ae3 bnez a5,510 + 520: fb9ff06f j 4d8 + 524: 00004717 auipc a4,0x4 + 528: c4470713 add a4,a4,-956 # 4168 + 52c: 04900793 li a5,73 + 530: 100006b7 lui a3,0x10000 + 534: 00f68023 sb a5,0(a3) # 10000000 + 538: 00174783 lbu a5,1(a4) + 53c: 00170713 add a4,a4,1 + 540: fe079ae3 bnez a5,534 + 544: 00814783 lbu a5,8(sp) + 548: f80788e3 beqz a5,4d8 + 54c: 00810713 add a4,sp,8 + 550: 100006b7 lui a3,0x10000 + 554: 00f68023 sb a5,0(a3) # 10000000 + 558: 00174783 lbu a5,1(a4) + 55c: 00170713 add a4,a4,1 + 560: fe079ae3 bnez a5,554 + 564: f75ff06f j 4d8 + 568: 00004717 auipc a4,0x4 + 56c: c2870713 add a4,a4,-984 # 4190 + 570: 04900793 li a5,73 + 574: 100006b7 lui a3,0x10000 + 578: 00f68023 sb a5,0(a3) # 10000000 + 57c: 00174783 lbu a5,1(a4) + 580: 00170713 add a4,a4,1 + 584: fe079ae3 bnez a5,578 + 588: 00814783 lbu a5,8(sp) + 58c: f40786e3 beqz a5,4d8 + 590: 00810713 add a4,sp,8 + 594: 100006b7 lui a3,0x10000 + 598: 00f68023 sb a5,0(a3) # 10000000 + 59c: 00174783 lbu a5,1(a4) + 5a0: 00170713 add a4,a4,1 + 5a4: fe079ae3 bnez a5,598 + 5a8: f31ff06f j 4d8 + 5ac: 00004717 auipc a4,0x4 + 5b0: c0470713 add a4,a4,-1020 # 41b0 + 5b4: 04c00793 li a5,76 + 5b8: 100006b7 lui a3,0x10000 + 5bc: 00f68023 sb a5,0(a3) # 10000000 + 5c0: 00174783 lbu a5,1(a4) + 5c4: 00170713 add a4,a4,1 + 5c8: fe079ae3 bnez a5,5bc + 5cc: 00814783 lbu a5,8(sp) + 5d0: f00784e3 beqz a5,4d8 + 5d4: 00810713 add a4,sp,8 + 5d8: 100006b7 lui a3,0x10000 + 5dc: 00f68023 sb a5,0(a3) # 10000000 + 5e0: 00174783 lbu a5,1(a4) + 5e4: 00170713 add a4,a4,1 + 5e8: fe079ae3 bnez a5,5dc + 5ec: eedff06f j 4d8 + 5f0: 00004717 auipc a4,0x4 + 5f4: be070713 add a4,a4,-1056 # 41d0 + 5f8: 04c00793 li a5,76 + 5fc: 100006b7 lui a3,0x10000 + 600: 00f68023 sb a5,0(a3) # 10000000 + 604: 00174783 lbu a5,1(a4) + 608: 00170713 add a4,a4,1 + 60c: fe079ae3 bnez a5,600 + 610: 00814783 lbu a5,8(sp) + 614: ec0782e3 beqz a5,4d8 + 618: 00810713 add a4,sp,8 + 61c: 100006b7 lui a3,0x10000 + 620: 00f68023 sb a5,0(a3) # 10000000 + 624: 00174783 lbu a5,1(a4) + 628: 00170713 add a4,a4,1 + 62c: fe079ae3 bnez a5,620 + 630: ea9ff06f j 4d8 + 634: 00004717 auipc a4,0x4 + 638: bbc70713 add a4,a4,-1092 # 41f0 + 63c: 05300793 li a5,83 + 640: 100006b7 lui a3,0x10000 + 644: 00f68023 sb a5,0(a3) # 10000000 + 648: 00174783 lbu a5,1(a4) + 64c: 00170713 add a4,a4,1 + 650: fe079ae3 bnez a5,644 + 654: 00814783 lbu a5,8(sp) + 658: e80780e3 beqz a5,4d8 + 65c: 00810713 add a4,sp,8 + 660: 100006b7 lui a3,0x10000 + 664: 00f68023 sb a5,0(a3) # 10000000 + 668: 00174783 lbu a5,1(a4) + 66c: 00170713 add a4,a4,1 + 670: fe079ae3 bnez a5,664 + 674: e65ff06f j 4d8 + 678: 00004717 auipc a4,0x4 + 67c: ba070713 add a4,a4,-1120 # 4218 + 680: 05300793 li a5,83 + 684: 100006b7 lui a3,0x10000 + 688: 00f68023 sb a5,0(a3) # 10000000 + 68c: 00174783 lbu a5,1(a4) + 690: 00170713 add a4,a4,1 + 694: fe079ae3 bnez a5,688 + 698: 00814783 lbu a5,8(sp) + 69c: e2078ee3 beqz a5,4d8 + 6a0: 00810713 add a4,sp,8 + 6a4: 100006b7 lui a3,0x10000 + 6a8: 00f68023 sb a5,0(a3) # 10000000 + 6ac: 00174783 lbu a5,1(a4) + 6b0: 00170713 add a4,a4,1 + 6b4: fe079ae3 bnez a5,6a8 + 6b8: e21ff06f j 4d8 + 6bc: 00004717 auipc a4,0x4 + 6c0: b7c70713 add a4,a4,-1156 # 4238 + 6c4: 04500793 li a5,69 + 6c8: 100006b7 lui a3,0x10000 + 6cc: 00f68023 sb a5,0(a3) # 10000000 + 6d0: 00174783 lbu a5,1(a4) + 6d4: 00170713 add a4,a4,1 + 6d8: fe079ae3 bnez a5,6cc + 6dc: 00814783 lbu a5,8(sp) + 6e0: de078ce3 beqz a5,4d8 + 6e4: 00810713 add a4,sp,8 + 6e8: 100006b7 lui a3,0x10000 + 6ec: 00f68023 sb a5,0(a3) # 10000000 + 6f0: 00174783 lbu a5,1(a4) + 6f4: 00170713 add a4,a4,1 + 6f8: fe079ae3 bnez a5,6ec + 6fc: dddff06f j 4d8 + +0000000000000700 : + 700: 00051063 bnez a0,700 + 704: 00008067 ret + +0000000000000708 <_init>: + 708: ff010113 add sp,sp,-16 + 70c: 00000593 li a1,0 + 710: 00000513 li a0,0 + 714: 00113423 sd ra,8(sp) + 718: 1d8000ef jal 8f0
+ 71c: c89ff0ef jal 3a4 + +0000000000000720 : + 720: 00b567b3 or a5,a0,a1 + 724: 00c7e7b3 or a5,a5,a2 + 728: 0077f793 and a5,a5,7 + 72c: 00c50833 add a6,a0,a2 + 730: 02078463 beqz a5,758 + 734: 00c58633 add a2,a1,a2 + 738: 00050793 mv a5,a0 + 73c: 0b057663 bgeu a0,a6,7e8 + 740: 0005c703 lbu a4,0(a1) + 744: 00158593 add a1,a1,1 + 748: 00178793 add a5,a5,1 + 74c: fee78fa3 sb a4,-1(a5) + 750: fec598e3 bne a1,a2,740 + 754: 00008067 ret + 758: 04050693 add a3,a0,64 + 75c: 0906f863 bgeu a3,a6,7ec + 760: 00058713 mv a4,a1 + 764: 00068793 mv a5,a3 + 768: 00073383 ld t2,0(a4) + 76c: 00873283 ld t0,8(a4) + 770: 01073f83 ld t6,16(a4) + 774: 01873f03 ld t5,24(a4) + 778: 02073e83 ld t4,32(a4) + 77c: 02873e03 ld t3,40(a4) + 780: 03073303 ld t1,48(a4) + 784: 03873883 ld a7,56(a4) + 788: 04078793 add a5,a5,64 + 78c: f877b023 sd t2,-128(a5) + 790: f857b423 sd t0,-120(a5) + 794: f9f7b823 sd t6,-112(a5) + 798: f9e7bc23 sd t5,-104(a5) + 79c: fbd7b023 sd t4,-96(a5) + 7a0: fbc7b423 sd t3,-88(a5) + 7a4: fa67b823 sd t1,-80(a5) + 7a8: fb17bc23 sd a7,-72(a5) + 7ac: 04070713 add a4,a4,64 + 7b0: fb07ece3 bltu a5,a6,768 + 7b4: fbf60613 add a2,a2,-65 + 7b8: fc067793 and a5,a2,-64 + 7bc: 04078793 add a5,a5,64 + 7c0: fc067613 and a2,a2,-64 + 7c4: 00f585b3 add a1,a1,a5 + 7c8: 00c687b3 add a5,a3,a2 + 7cc: f907f4e3 bgeu a5,a6,754 + 7d0: 0005b703 ld a4,0(a1) + 7d4: 00878793 add a5,a5,8 + 7d8: 00858593 add a1,a1,8 + 7dc: fee7bc23 sd a4,-8(a5) + 7e0: ff07e8e3 bltu a5,a6,7d0 + 7e4: 00008067 ret + 7e8: 00008067 ret + 7ec: 00050793 mv a5,a0 + 7f0: fddff06f j 7cc + +00000000000007f4 : + 7f4: 00c567b3 or a5,a0,a2 + 7f8: 0077f793 and a5,a5,7 + 7fc: 00c50633 add a2,a0,a2 + 800: 0ff5f713 zext.b a4,a1 + 804: 00078e63 beqz a5,820 + 808: 00050793 mv a5,a0 + 80c: 02c57c63 bgeu a0,a2,844 + 810: 00178793 add a5,a5,1 + 814: fee78fa3 sb a4,-1(a5) + 818: fef61ce3 bne a2,a5,810 + 81c: 00008067 ret + 820: 00004797 auipc a5,0x4 + 824: a707b783 ld a5,-1424(a5) # 4290 + 828: 02f70733 mul a4,a4,a5 + 82c: fec578e3 bgeu a0,a2,81c + 830: 00050793 mv a5,a0 + 834: 00878793 add a5,a5,8 + 838: fee7bc23 sd a4,-8(a5) + 83c: fec7ece3 bltu a5,a2,834 + 840: 00008067 ret + 844: 00008067 ret + +0000000000000848 : + 848: 00054783 lbu a5,0(a0) + 84c: 00078e63 beqz a5,868 + 850: 00050793 mv a5,a0 + 854: 0017c703 lbu a4,1(a5) + 858: 00178793 add a5,a5,1 + 85c: fe071ce3 bnez a4,854 + 860: 40a78533 sub a0,a5,a0 + 864: 00008067 ret + 868: 00000513 li a0,0 + 86c: 00008067 ret + +0000000000000870 : + 870: 00b506b3 add a3,a0,a1 + 874: 00050793 mv a5,a0 + 878: 00059863 bnez a1,888 + 87c: 0240006f j 8a0 + 880: 00178793 add a5,a5,1 + 884: 00f68a63 beq a3,a5,898 + 888: 0007c703 lbu a4,0(a5) + 88c: fe071ae3 bnez a4,880 + 890: 40a78533 sub a0,a5,a0 + 894: 00008067 ret + 898: 40a68533 sub a0,a3,a0 + 89c: 00008067 ret + 8a0: 00000513 li a0,0 + 8a4: 00008067 ret + +00000000000008a8 : + 8a8: 00054783 lbu a5,0(a0) + 8ac: 00158593 add a1,a1,1 + 8b0: 00150513 add a0,a0,1 + 8b4: fff5c703 lbu a4,-1(a1) + 8b8: 00078a63 beqz a5,8cc + 8bc: fee786e3 beq a5,a4,8a8 + 8c0: 0007851b sext.w a0,a5 + 8c4: 40e5053b subw a0,a0,a4 + 8c8: 00008067 ret + 8cc: 00000513 li a0,0 + 8d0: ff5ff06f j 8c4 + +00000000000008d4 : + 8d4: 00050793 mv a5,a0 + 8d8: 0005c703 lbu a4,0(a1) + 8dc: 00178793 add a5,a5,1 + 8e0: 00158593 add a1,a1,1 + 8e4: fee78fa3 sb a4,-1(a5) + 8e8: fe0718e3 bnez a4,8d8 + 8ec: 00008067 ret + +Disassembly of section .text.startup: + +00000000000008f0
: + 8f0: fa010113 add sp,sp,-96 + 8f4: 04813823 sd s0,80(sp) + 8f8: 04113c23 sd ra,88(sp) + 8fc: 04913423 sd s1,72(sp) + 900: 05213023 sd s2,64(sp) + 904: 03313c23 sd s3,56(sp) + 908: 03413823 sd s4,48(sp) + 90c: 03513423 sd s5,40(sp) + 910: 00004617 auipc a2,0x4 + 914: 98860613 add a2,a2,-1656 # 4298 + 918: 00003697 auipc a3,0x3 + 91c: 6e868693 add a3,a3,1768 # 4000 + 920: 00003717 auipc a4,0x3 + 924: 74070713 add a4,a4,1856 # 4060 + 928: 02900413 li s0,41 + 92c: 0d0475d7 vsetvli a1,s0,e32,m1,ta,ma + 930: 0005879b sext.w a5,a1 + 934: 000022b7 lui t0,0x2 + 938: 9192829b addw t0,t0,-1767 # 1919 + 93c: 02075507 vle16.v v10,(a4) + 940: 0206d587 vle16.v v11,(a3) + 944: 9ea5a657 vmulh.vv v12,v10,v11 + 948: 9ec2e657 vmulh.vx v12,v12,t0 + 94c: 02066627 vse32.v v12,(a2) + 950: 00179793 sll a5,a5,0x1 + 954: 40b4043b subw s0,s0,a1 + 958: 00f70733 add a4,a4,a5 + 95c: 00f686b3 add a3,a3,a5 + 960: 00f60633 add a2,a2,a5 + 964: fc0414e3 bnez s0,92c + 968: 86818493 add s1,gp,-1944 # 42f8 + 96c: 00002537 lui a0,0x2 + 970: 00003717 auipc a4,0x3 + 974: 6f070713 add a4,a4,1776 # 4060 + 978: 00003617 auipc a2,0x3 + 97c: 68860613 add a2,a2,1672 # 4000 + 980: 00003817 auipc a6,0x3 + 984: 73280813 add a6,a6,1842 # 40b2 + 988: 00048693 mv a3,s1 + 98c: 9195051b addw a0,a0,-1767 # 1919 + 990: 00071783 lh a5,0(a4) + 994: 00061583 lh a1,0(a2) + 998: 00268693 add a3,a3,2 + 99c: 00270713 add a4,a4,2 + 9a0: 02b787bb mulw a5,a5,a1 + 9a4: 00260613 add a2,a2,2 + 9a8: 02a787bb mulw a5,a5,a0 + 9ac: 4107d79b sraw a5,a5,0x10 + 9b0: fef69f23 sh a5,-2(a3) + 9b4: fd071ee3 bne a4,a6,990 + 9b8: 00004917 auipc s2,0x4 + 9bc: 8e090913 add s2,s2,-1824 # 4298 + 9c0: 00100693 li a3,1 + 9c4: 00003a17 auipc s4,0x3 + 9c8: 72ca0a13 add s4,s4,1836 # 40f0 + 9cc: 00003a97 auipc s5,0x3 + 9d0: 744a8a93 add s5,s5,1860 # 4110 + 9d4: 02900993 li s3,41 + 9d8: 00091703 lh a4,0(s2) + 9dc: 00049783 lh a5,0(s1) + 9e0: 000a0513 mv a0,s4 + 9e4: 00290913 add s2,s2,2 + 9e8: 00248493 add s1,s1,2 + 9ec: 02f70463 beq a4,a5,a14 + 9f0: 87dff0ef jal 26c + 9f4: 00810593 add a1,sp,8 + 9f8: 00040513 mv a0,s0 + 9fc: fe8ff0ef jal 1e4 + a00: 00810513 add a0,sp,8 + a04: 869ff0ef jal 26c + a08: 000a8513 mv a0,s5 + a0c: 861ff0ef jal 26c + a10: 00000693 li a3,0 + a14: 0014041b addw s0,s0,1 + a18: fd3410e3 bne s0,s3,9d8 + a1c: 05813083 ld ra,88(sp) + a20: 05013403 ld s0,80(sp) + a24: 04813483 ld s1,72(sp) + a28: 04013903 ld s2,64(sp) + a2c: 03813983 ld s3,56(sp) + a30: 03013a03 ld s4,48(sp) + a34: 02813a83 ld s5,40(sp) + a38: 0016c513 xor a0,a3,1 + a3c: 06010113 add sp,sp,96 + a40: 00008067 ret + a44: fff00513 li a0,-1 + a48: 00008067 ret + +Disassembly of section .rodata: + +0000000000004000 : + 4000: 4e3d .2byte 0x4e3d + 4002: 352e .2byte 0x352e + 4004: 5981 vmsge.vx v19,v0,zero,v0.t + 4006: 92c8c42f .4byte 0x92c8c42f + 400a: 72b8 .2byte 0x72b8 + 400c: 0ccb9b8f .4byte 0xccb9b8f + 4010: 11fe .2byte 0x11fe + 4012: 6d72 .2byte 0x6d72 + 4014: cf2d .2byte 0xcf2d + 4016: 5cb5 .2byte 0x5cb5 + 4018: 2889 .2byte 0x2889 + 401a: 9d39 .2byte 0x9d39 + 401c: c198 .2byte 0xc198 + 401e: 2985 .2byte 0x2985 + 4020: c80c .2byte 0xc80c + 4022: 3f7a5543 vmsge.vx v10,v23,s4 + 4026: bee5 .2byte 0xbee5 + 4028: 9fe9 .2byte 0x9fe9 + 402a: 450a .2byte 0x450a + 402c: 1379209b .4byte 0x1379209b + 4030: 7226 .2byte 0x7226 + 4032: 47131e37 lui t3,0x47131 + 4036: e84a .2byte 0xe84a + 4038: 4ea0 vmsge.vx v29,v0,zero,v0.t + 403a: 2618 .2byte 0x2618 + 403c: 0196 .2byte 0x196 + 403e: 3374 .2byte 0x3374 + 4040: f9dd .2byte 0xf9dd + 4042: eb10 .2byte 0xeb10 + 4044: 00d2 .2byte 0xd2 + 4046: f7de .2byte 0xf7de + 4048: cbef21af .4byte 0xcbef21af + 404c: b451 .2byte 0xb451 + 404e: 166f2a7b .4byte 0x166f2a7b + 4052: 7d3c .2byte 0x7d3c + 4054: 7c3c5953 .4byte 0x7c3c5953 + 4058: 2b48 .2byte 0x2b48 + 405a: f632 .2byte 0xf632 + 405c: 8798 .2byte 0x8798 + 405e: 2a71 .2byte 0x2a71 + +0000000000004060 : + 4060: 6301b193 sltiu gp,gp,1584 + 4064: 646e .2byte 0x646e + 4066: 35f7c097 auipc ra,0x35f7c + 406a: ccf8 .2byte 0xccf8 + 406c: ea3c .2byte 0xea3c + 406e: 1eed .2byte 0x1eed + 4070: 92b9 .2byte 0x92b9 + 4072: 7bc547c7 .4byte 0x7bc547c7 + 4076: 7226 .2byte 0x7226 + 4078: 3cc2 vmsge.vx v25,v0,zero,v0.t + 407a: b3247aab .4byte 0xb3247aab + 407e: bf99a73b .4byte 0xbf99a73b + 4082: 2690 .2byte 0x2690 + 4084: 6afcb7bf 58050c08 .8byte 0x58050c086afcb7bf + 408c: 1459 .2byte 0x1459 + 408e: 2cc0 vmsge.vx v25,v0,zero,v0.t + 4090: be31 .2byte 0xbe31 + 4092: 7d6c .2byte 0x7d6c + 4094: 8c7e2b5b .4byte 0x8c7e2b5b + 4098: ce5e .2byte 0xce5e + 409a: 2c74 .2byte 0x2c74 + 409c: 4bcd .2byte 0x4bcd + 409e: 3f00 vmsge.vx v30,v0,zero,v0.t + 40a0: 71ba .2byte 0x71ba + 40a2: 42b6 .2byte 0x42b6 + 40a4: 1c41 vmsge.vx v24,v0,zero,v0.t + 40a6: ec1f 7cce 6f70 .byte 0x1f, 0xec, 0xce, 0x7c, 0x70, 0x6f + 40ac: 0406 .2byte 0x406 + 40ae: cded4523 vmsge.vx v10,v30,s10,v0.t + 40b2: 247985ef jal a1,9caf8 <__global_pointer$+0x98068> + 40b6: 4a550d93 add s11,a0,1189 + 40ba: 57c9 .2byte 0x57c9 + 40bc: d555 .2byte 0xd555 + 40be: 938e .2byte 0x938e + 40c0: c420 vmsge.vx v8,v0,ra,v0.t + 40c2: ffff .2byte 0xffff + 40c4: c464 .2byte 0xc464 + 40c6: ffff .2byte 0xffff + 40c8: c4a8 .2byte 0xc4a8 + 40ca: ffff .2byte 0xffff + 40cc: c3b8 .2byte 0xc3b8 + 40ce: ffff .2byte 0xffff + 40d0: c4ec .2byte 0xc4ec + 40d2: ffff .2byte 0xffff + 40d4: c530 .2byte 0xc530 + 40d6: ffff .2byte 0xffff + 40d8: c574 .2byte 0xc574 + 40da: ffff .2byte 0xffff + 40dc: c5b8 .2byte 0xc5b8 + 40de: ffff .2byte 0xffff + 40e0: c3b8 .2byte 0xc3b8 + 40e2: ffff .2byte 0xffff + 40e4: c3b8 .2byte 0xc3b8 + 40e6: ffff .2byte 0xffff + 40e8: c3b8 .2byte 0xc3b8 + 40ea: ffff .2byte 0xffff + 40ec: c5fc .2byte 0xc5fc + 40ee: ffff .2byte 0xffff + +Disassembly of section .rodata.str1.8: + +00000000000040f0 <.rodata.str1.8>: + 40f0: 5241 vmsge.vx v4,v0,zero,v0.t + 40f2: 4152 .2byte 0x4152 + 40f4: 2059 .2byte 0x2059 + 40f6: 4f4e .2byte 0x4f4e + 40f8: 2054 .2byte 0x2054 + 40fa: 52524f43 vmsge.vx v30,v5,tp + 40fe: 4345 .2byte 0x4345 + 4100: 2054 .2byte 0x2054 + 4102: 4e49 .2byte 0x4e49 + 4104: 4920 vmsge.vx v18,v0,zero,v0.t + 4106: 444e .2byte 0x444e + 4108: 5845 .2byte 0x5845 + 410a: 203a .2byte 0x203a + 410c: 0000 vmsge.vx v0,v0,zero,v0.t + 410e: 0000 vmsge.vx v0,v0,zero,v0.t + 4110: 000a .2byte 0xa + 4112: 0000 vmsge.vx v0,v0,zero,v0.t + 4114: 0000 vmsge.vx v0,v0,zero,v0.t + 4116: 0000 vmsge.vx v0,v0,zero,v0.t + 4118: 6c637963 bgeu t1,t1,47ea <_tbss_end+0x492> + 411c: 3a65 .2byte 0x3a65 + 411e: 0020 vmsge.vx v0,v0,zero,v0.t + 4120: 690a .2byte 0x690a + 4122: 736e .2byte 0x736e + 4124: 7274 .2byte 0x7274 + 4126: 7465 .2byte 0x7465 + 4128: 203a .2byte 0x203a + 412a: 0000 vmsge.vx v0,v0,zero,v0.t + 412c: 0000 vmsge.vx v0,v0,zero,v0.t + 412e: 0000 vmsge.vx v0,v0,zero,v0.t + 4130: 7845 .2byte 0x7845 + 4132: 7469 .2byte 0x7469 + 4134: 6320 vmsge.vx v6,v0,zero,v0.t + 4136: 3a65646f jal s0,5a4dc <__global_pointer$+0x55a4c> + 413a: 0020 vmsge.vx v0,v0,zero,v0.t + 413c: 0000 vmsge.vx v0,v0,zero,v0.t + 413e: 0000 vmsge.vx v0,v0,zero,v0.t + 4140: 4e49 .2byte 0x4e49 + 4142: 55525453 .4byte 0x55525453 + 4146: 4f495443 vmsge.vx v8,v20,s2 + 414a: 204e .2byte 0x204e + 414c: 4441 vmsge.vx v8,v0,zero,v0.t + 414e: 5244 .2byte 0x5244 + 4150: 5345 .2byte 0x5345 + 4152: 494d2053 .4byte 0x494d2053 + 4156: 494c4153 .4byte 0x494c4153 + 415a: 44454e47 .4byte 0x44454e47 + 415e: 6120 vmsge.vx v2,v0,zero,v0.t + 4160: 2074 .2byte 0x2074 + 4162: 4350 .2byte 0x4350 + 4164: 203a .2byte 0x203a + 4166: 0000 vmsge.vx v0,v0,zero,v0.t + 4168: 4e49 .2byte 0x4e49 + 416a: 55525453 .4byte 0x55525453 + 416e: 4f495443 vmsge.vx v8,v20,s2 + 4172: 204e .2byte 0x204e + 4174: 4341 vmsge.vx v6,v0,zero,v0.t + 4176: 53534543 vmsge.vx v10,v21,t1 + 417a: 4620 vmsge.vx v12,v0,zero,v0.t + 417c: 5541 vmsge.vx v10,v0,zero,v0.t + 417e: 544c .2byte 0x544c + 4180: 6120 vmsge.vx v2,v0,zero,v0.t + 4182: 2074 .2byte 0x2074 + 4184: 4350 .2byte 0x4350 + 4186: 203a .2byte 0x203a + ... + 4190: 4c49 .2byte 0x4c49 + 4192: 454c .2byte 0x454c + 4194: 204c4147 .4byte 0x204c4147 + 4198: 4e49 .2byte 0x4e49 + 419a: 55525453 .4byte 0x55525453 + 419e: 4f495443 vmsge.vx v8,v20,s2 + 41a2: 204e .2byte 0x204e + 41a4: 7461 vmsge.vx v8,v0,zero,v0.t + 41a6: 5020 vmsge.vx v0,v0,zero,v0.t + 41a8: 00203a43 vmsge.vx v20,v2,zero,v0.t + 41ac: 0000 vmsge.vx v0,v0,zero,v0.t + 41ae: 0000 vmsge.vx v0,v0,zero,v0.t + 41b0: 4f4c .2byte 0x4f4c + 41b2: 4441 vmsge.vx v8,v0,zero,v0.t + 41b4: 4120 vmsge.vx v2,v0,zero,v0.t + 41b6: 4444 .2byte 0x4444 + 41b8: 4552 .2byte 0x4552 + 41ba: 4d205353 .4byte 0x4d205353 + 41be: 5349 .2byte 0x5349 + 41c0: 4c41 vmsge.vx v24,v0,zero,v0.t + 41c2: 4749 .2byte 0x4749 + 41c4: 454e .2byte 0x454e + 41c6: 2044 .2byte 0x2044 + 41c8: 7461 vmsge.vx v8,v0,zero,v0.t + 41ca: 5020 vmsge.vx v0,v0,zero,v0.t + 41cc: 00203a43 vmsge.vx v20,v2,zero,v0.t + 41d0: 4f4c .2byte 0x4f4c + 41d2: 4441 vmsge.vx v8,v0,zero,v0.t + 41d4: 4120 vmsge.vx v2,v0,zero,v0.t + 41d6: 53454343 vmsge.vx v6,v20,a0 + 41da: 41462053 .4byte 0x41462053 + 41de: 4c55 .2byte 0x4c55 + 41e0: 2054 .2byte 0x2054 + 41e2: 7461 vmsge.vx v8,v0,zero,v0.t + 41e4: 5020 vmsge.vx v0,v0,zero,v0.t + 41e6: 00203a43 vmsge.vx v20,v2,zero,v0.t + 41ea: 0000 vmsge.vx v0,v0,zero,v0.t + 41ec: 0000 vmsge.vx v0,v0,zero,v0.t + 41ee: 0000 vmsge.vx v0,v0,zero,v0.t + 41f0: 524f5453 .4byte 0x524f5453 + 41f4: 2045 .2byte 0x2045 + 41f6: 4441 vmsge.vx v8,v0,zero,v0.t + 41f8: 5244 .2byte 0x5244 + 41fa: 5345 .2byte 0x5345 + 41fc: 494d2053 .4byte 0x494d2053 + 4200: 494c4153 .4byte 0x494c4153 + 4204: 44454e47 .4byte 0x44454e47 + 4208: 6120 vmsge.vx v2,v0,zero,v0.t + 420a: 2074 .2byte 0x2074 + 420c: 4350 .2byte 0x4350 + 420e: 203a .2byte 0x203a + ... + 4218: 524f5453 .4byte 0x524f5453 + 421c: 2045 .2byte 0x2045 + 421e: 4341 vmsge.vx v6,v0,zero,v0.t + 4220: 53534543 vmsge.vx v10,v21,t1 + 4224: 4620 vmsge.vx v12,v0,zero,v0.t + 4226: 5541 vmsge.vx v10,v0,zero,v0.t + 4228: 544c .2byte 0x544c + 422a: 6120 vmsge.vx v2,v0,zero,v0.t + 422c: 2074 .2byte 0x2074 + 422e: 4350 .2byte 0x4350 + 4230: 203a .2byte 0x203a + 4232: 0000 vmsge.vx v0,v0,zero,v0.t + 4234: 0000 vmsge.vx v0,v0,zero,v0.t + 4236: 0000 vmsge.vx v0,v0,zero,v0.t + 4238: 4345 .2byte 0x4345 + 423a: 4c41 vmsge.vx v24,v0,zero,v0.t + 423c: 204c .2byte 0x204c + 423e: 5246 .2byte 0x5246 + 4240: 4d204d4f .4byte 0x4d204d4f + 4244: 4d2d .2byte 0x4d2d + 4246: 2045444f .4byte 0x2045444f + 424a: 7461 vmsge.vx v8,v0,zero,v0.t + 424c: 5020 vmsge.vx v0,v0,zero,v0.t + 424e: 00203a43 vmsge.vx v20,v2,zero,v0.t + 4252: 0000 vmsge.vx v0,v0,zero,v0.t + 4254: 0000 vmsge.vx v0,v0,zero,v0.t + 4256: 0000 vmsge.vx v0,v0,zero,v0.t + 4258: 4e55 .2byte 0x4e55 + 425a: 574f4e4b .4byte 0x574f4e4b + 425e: 204e .2byte 0x204e + 4260: 5845 .2byte 0x5845 + 4262: 54504543 vmsge.vx v10,v5,zero,v0.t + 4266: 4f49 .2byte 0x4f49 + 4268: 204e .2byte 0x204e + 426a: 7461 vmsge.vx v8,v0,zero,v0.t + 426c: 5020 vmsge.vx v0,v0,zero,v0.t + 426e: 00203a43 vmsge.vx v20,v2,zero,v0.t + 4272: 0000 vmsge.vx v0,v0,zero,v0.t + 4274: 0000 vmsge.vx v0,v0,zero,v0.t + 4276: 0000 vmsge.vx v0,v0,zero,v0.t + 4278: 430a .2byte 0x430a + 427a: 4548 .2byte 0x4548 + 427c: 4d204b43 vmsge.vx v22,v18,zero,v0.t + 4280: 53554143 vmsge.vx v2,v21,a0 + 4284: 2045 .2byte 0x2045 + 4286: 6e69 .2byte 0x6e69 + 4288: 5220 vmsge.vx v4,v0,zero,v0.t + 428a: 4c54 .2byte 0x4c54 + ... + +Disassembly of section .sdata: + +0000000000004290 <__global_pointer$-0x800>: + 4290: 0101 vmsge.vx v2,v0,zero,v0.t + 4292: 0101 vmsge.vx v2,v0,zero,v0.t + 4294: 0101 vmsge.vx v2,v0,zero,v0.t + 4296: 0101 vmsge.vx v2,v0,zero,v0.t + +Disassembly of section .bss: + +0000000000004298 : + ... + +00000000000042f8 : + ... + +Disassembly of section .tohost: + +0000000010000000 : + ... + +0000000010000040 : + ... + +Disassembly of section .comment: + +0000000000000000 <.comment>: + 0: 3a434347 .4byte 0x3a434347 + 4: 2820 vmsge.vx v16,v0,zero,v0.t + 6: 65653267 .4byte 0x65653267 + a: 6535 .2byte 0x6535 + c: 3334 .2byte 0x3334 + e: 3030 .2byte 0x3030 + 10: 3831 .2byte 0x3831 + 12: 2029 .2byte 0x2029 + 14: 3231 .2byte 0x3231 + 16: 322e .2byte 0x322e + 18: 302e .2byte 0x302e + ... + +Disassembly of section .riscv.attributes: + +0000000000000000 <.riscv.attributes>: + 0: 5e41 vmsge.vx v28,v0,zero,v0.t + 2: 0000 vmsge.vx v0,v0,zero,v0.t + 4: 7200 vmsge.vx v4,v0,zero,v0.t + 6: 7369 .2byte 0x7369 + 8: 01007663 bgeu zero,a6,14 <_start+0x14> + c: 0054 .2byte 0x54 + e: 0000 vmsge.vx v0,v0,zero,v0.t + 10: 1004 .2byte 0x1004 + 12: 7205 .2byte 0x7205 + 14: 3676 .2byte 0x3676 + 16: 6934 .2byte 0x6934 + 18: 7032 .2byte 0x7032 + 1a: 5f31 .2byte 0x5f31 + 1c: 326d .2byte 0x326d + 1e: 3070 .2byte 0x3070 + 20: 7a5f 6369 7273 .byte 0x5f, 0x7a, 0x69, 0x63, 0x73, 0x72 + 26: 7032 .2byte 0x7032 + 28: 5f30 .2byte 0x5f30 + 2a: 6d7a .2byte 0x6d7a + 2c: 756d .2byte 0x756d + 2e: 316c .2byte 0x316c + 30: 3070 .2byte 0x3070 + 32: 7a5f 6576 3233 .byte 0x5f, 0x7a, 0x76, 0x65, 0x33, 0x32 + 38: 3178 .2byte 0x3178 + 3a: 3070 .2byte 0x3070 + 3c: 7a5f 6576 3436 .byte 0x5f, 0x7a, 0x76, 0x65, 0x36, 0x34 + 42: 3178 .2byte 0x3178 + 44: 3070 .2byte 0x3070 + 46: 7a5f 6c76 3233 .byte 0x5f, 0x7a, 0x76, 0x6c, 0x33, 0x32 + 4c: 3162 vmsge.vx v2,v0,zero,v0.t + 4e: 3070 .2byte 0x3070 + 50: 7a5f 6c76 3436 .byte 0x5f, 0x7a, 0x76, 0x6c, 0x36, 0x34 + 56: 3162 vmsge.vx v2,v0,zero,v0.t + 58: 3070 .2byte 0x3070 + 5a: 0800 vmsge.vx v16,v0,zero,v0.t + 5c: 0a01 vmsge.vx v20,v0,zero,v0.t + 5e: 0b Address 0x5e is out of bounds. + diff --git a/src/main/resources/applications_vector/vmulh/vmulh.c b/src/main/resources/applications_vector/vmulh/vmulh.c new file mode 100644 index 00000000..64e31bb3 --- /dev/null +++ b/src/main/resources/applications_vector/vmulh/vmulh.c @@ -0,0 +1,61 @@ +#include "util.h" + +#define size_t long +#define N 48 + +const signed short dataArray0[N] = {-20077, 25345, 25710, -16233, 13815, -13064, -5572, 7917, -27975, 18375, 31685, 29222, 15554, 31403, -19676, -22725, -16487, 9872, -18497, 27388, 3080, 22533, 5209, 11456, -16847, 32108, 11099, -29570, -12706, 11380, 19405, 16128, 29114, 17078, 7233, -5089, 31950, 28528, 1030, 17699, -12819, -31249, 9337, 3475, 19029, 22473, -10923, -27762}; +const signed short dataArray1[N] = {20029, 13614, 22913, -15313, -27960, 29368, -25713, 3275, 4606, 28018, -12499, 23733, 10377, -25287, -15976, 10629, -14324, 21827, 16250, -16667, -24599, 17674, 8347, 4985, 29222, 7735, 18195, -6070, 20128, 9752, 406, 13172, -1571, -5360, 210, -2082, 8623, -13329, -19375, 10875, 5743, 32060, 22867, 31804, 11080, -2510, -30824, 10865}; +signed short resultArray[N] = {0}; +signed short answerArray[N] = {0}; + +extern void printstr(char* str); +extern void int64ToHex(long num, char* str); +extern void int32ToHex(int num, char* str); +extern void clearCounters(); +extern void printCounters(); + +int main(int argc, char** argv) { + int vl, avl = 41; + const signed short *ptr0 = dataArray0; + const signed short *ptr1 = dataArray1; + signed short *ptr2 = resultArray; + while(avl != 0) { + asm volatile ("vsetvli %0, %1, e32, m1, ta, ma" + : "=r"(vl) + : "r"(avl)); + asm volatile ("li t0, 0x1919"); + asm volatile ("vle16.v v10, (%0)" + : + : "r"(ptr0)); + asm volatile ("vle16.v v11, (%0)" + : + : "r"(ptr1)); + asm volatile ("vmulh.vv v12, v10, v11"); + asm volatile ("vmulh.vx v12, v12, t0"); + asm volatile ("vse32.v v12, (%0)" + : + : "r"(ptr2)); + ptr0 += vl; + ptr1 += vl; + ptr2 += vl; + avl -= vl; + } + int i; + for(i=0; i<41; i++) { + answerArray[i] = (signed short)(((signed int)dataArray0[i] * (signed int)dataArray1[i] * (signed int)0x1919) >> 16); + } + + _Bool correct = 1; + char string[19]; + for(i=0; i<41; i++) { + if(resultArray[i] != answerArray[i]) { + printstr("ARRAY NOT CORRECT IN INDEX: "); + int32ToHex(i, string); + printstr(string); + printstr("\n"); + correct = 0; + } + } + return !correct; +} + diff --git a/src/main/resources/applications_vector/vmulh_data.hex b/src/main/resources/applications_vector/vmulh_data.hex new file mode 100644 index 00000000..6e571e15 --- /dev/null +++ b/src/main/resources/applications_vector/vmulh_data.hex @@ -0,0 +1,166 @@ +352e4e3d +c42f5981 +72b892c8 +0ccb9b8f +6d7211fe +5cb5cf2d +9d392889 +2985c198 +5543c80c +bee53f7a +450a9fe9 +1379209b +1e377226 +e84a4713 +26184ea0 +33740196 +eb10f9dd +f7de00d2 +cbef21af +2a7bb451 +7d3c166f +7c3c5953 +f6322b48 +2a718798 +6301b193 +c097646e +ccf835f7 +1eedea3c +47c792b9 +72267bc5 +7aab3cc2 +a73bb324 +2690bf99 +6afcb7bf +58050c08 +2cc01459 +7d6cbe31 +8c7e2b5b +2c74ce5e +3f004bcd +42b671ba +ec1f1c41 +6f707cce +45230406 +85efcded +0d932479 +57c94a55 +938ed555 +ffffc420 +ffffc464 +ffffc4a8 +ffffc3b8 +ffffc4ec +ffffc530 +ffffc574 +ffffc5b8 +ffffc3b8 +ffffc3b8 +ffffc3b8 +ffffc5fc +41525241 +4f4e2059 +4f432054 +43455252 +4e492054 +444e4920 +203a5845 +00000000 +0000000a +00000000 +6c637963 +00203a65 +736e690a +74657274 +0000203a +00000000 +74697845 +646f6320 +00203a65 +00000000 +54534e49 +54435552 +204e4f49 +52444441 +20535345 +4153494d +4e47494c +61204445 +43502074 +0000203a +54534e49 +54435552 +204e4f49 +45434341 +46205353 +544c5541 +20746120 +203a4350 +00000000 +00000000 +454c4c49 +204c4147 +54534e49 +54435552 +204e4f49 +50207461 +00203a43 +00000000 +44414f4c +44444120 +53534552 +53494d20 +47494c41 +2044454e +50207461 +00203a43 +44414f4c +43434120 +20535345 +4c554146 +74612054 +3a435020 +00000020 +00000000 +524f5453 +44412045 +53455244 +494d2053 +494c4153 +44454e47 +20746120 +203a4350 +00000000 +00000000 +524f5453 +43412045 +53534543 +55414620 +6120544c +43502074 +0000203a +00000000 +4c414345 +5246204c +4d204d4f +444f4d2d +74612045 +3a435020 +00000020 +00000000 +4e4b4e55 +204e574f +45435845 +4f495450 +7461204e +3a435020 +00000020 +00000000 +4548430a +4d204b43 +53554143 +6e692045 +4c545220 +00000000 +01010101 +01010101 diff --git a/src/main/resources/applications_vector/vmulh_inst.hex b/src/main/resources/applications_vector/vmulh_inst.hex new file mode 100644 index 00000000..7c6b58b6 --- /dev/null +++ b/src/main/resources/applications_vector/vmulh_inst.hex @@ -0,0 +1,659 @@ +00000093 +00000113 +00000193 +00000213 +00000293 +00000313 +00000393 +00000413 +00000493 +00000513 +00000593 +00000613 +00000693 +00000713 +00000793 +00000813 +00000893 +00000913 +00000993 +00000a13 +00000a93 +00000b13 +00000b93 +00000c13 +00000c93 +00000d13 +00000d93 +00000e13 +00000e93 +00000f13 +00000f93 +00000297 +03828293 +30529073 +00005197 +a0818193 +10000217 +ff720213 +fc027213 +f1402573 +00100593 +00b57063 +00006137 +ff01011b +6580006f +ef010113 +00113423 +00213823 +00313c23 +02413023 +02513423 +02613823 +02713c23 +04813023 +04913423 +04a13823 +04b13c23 +06c13023 +06d13423 +06e13823 +06f13c23 +09013023 +09113423 +09213823 +09313c23 +0b413023 +0b513423 +0b613823 +0b713c23 +0d813023 +0d913423 +0da13823 +0db13c23 +0fc13023 +0fd13423 +0fe13823 +0ff13c23 +34202573 +341025f3 +00010613 +2d0000ef +34151073 +000022b7 +8002829b +3002a073 +00813083 +01013103 +01813183 +02013203 +02813283 +03013303 +03813383 +04013403 +04813483 +05013503 +05813583 +06013603 +06813683 +07013703 +07813783 +08013803 +08813883 +09013903 +09813983 +0a013a03 +0a813a83 +0b013b03 +0b813b83 +0c013c03 +0c813c83 +0d013d03 +0d813d83 +0e013e03 +0e813e83 +0f013f03 +0f813f83 +11010113 +30200073 +b0201073 +b0001073 +00008067 +03000793 +00f58023 +07800793 +00f580a3 +00158813 +00958793 +00900613 +00f57713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +40455513 +fef812e3 +00058523 +00008067 +03000793 +00f58023 +07800793 +00f580a3 +00158813 +01158793 +00900613 +00f57713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +40455513 +fef812e3 +00058923 +00008067 +00054783 +00078c63 +10000737 +00f70023 +00154783 +00150513 +fe079ae3 +00008067 +fe010113 +c0202673 +c00025f3 +00004717 +e8070713 +06300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +ffff8737 +83074713 +01910793 +00e11423 +00910813 +00078713 +00900893 +00f5f693 +03768513 +00d8e463 +03068513 +00a70023 +fff70713 +4045d593 +fee812e3 +00814703 +00010d23 +00810693 +100005b7 +00070a63 +00e58023 +0016c703 +00168693 +fe071ae3 +00004697 +e0868693 +00a00713 +100005b7 +00e58023 +0016c703 +00168693 +fe071ae3 +ffff8737 +83074713 +00060693 +00e11423 +00900593 +00f6f713 +03770613 +00e5e463 +03070613 +00c78023 +fff78793 +4046d693 +fef812e3 +00814783 +00010d23 +00810713 +100006b7 +00078a63 +00f68023 +00174783 +00170713 +fe079ae3 +100007b7 +00a00713 +00e78023 +02010113 +00008067 +fe010113 +00813823 +00113c23 +00050413 +00004717 +d7c70713 +04500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00010593 +00040513 +e09ff0ef +00014703 +00070e63 +00010793 +100006b7 +00e68023 +0017c703 +00178793 +fe071ae3 +00040513 +100007b7 +00078023 +0000006f +ffff87b7 +fd010113 +8307c793 +00f11423 +02113423 +01910793 +00910813 +00900613 +00f5f713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +4045d593 +ff0792e3 +00010d23 +00b00793 +02a7e063 +00004717 +c6470713 +00251513 +00e50533 +00052783 +00e787b3 +00078067 +00004717 +de070713 +05500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +00810713 +100006b7 +00078a63 +00f68023 +00174783 +00170713 +fe079ae3 +00004717 +dc070713 +00a00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +fff00513 +ec9ff0ef +00004717 +c6070713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +00810713 +100006b7 +fc0786e3 +00f68023 +00174783 +00170713 +fe079ae3 +fb9ff06f +00004717 +c4470713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f80788e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +f75ff06f +00004717 +c2870713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f40786e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +f31ff06f +00004717 +c0470713 +04c00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f00784e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +eedff06f +00004717 +be070713 +04c00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +ec0782e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +ea9ff06f +00004717 +bbc70713 +05300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +e80780e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +e65ff06f +00004717 +ba070713 +05300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +e2078ee3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +e21ff06f +00004717 +b7c70713 +04500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +de078ce3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +dddff06f +00051063 +00008067 +ff010113 +00000593 +00000513 +00113423 +1d8000ef +c89ff0ef +00b567b3 +00c7e7b3 +0077f793 +00c50833 +02078463 +00c58633 +00050793 +0b057663 +0005c703 +00158593 +00178793 +fee78fa3 +fec598e3 +00008067 +04050693 +0906f863 +00058713 +00068793 +00073383 +00873283 +01073f83 +01873f03 +02073e83 +02873e03 +03073303 +03873883 +04078793 +f877b023 +f857b423 +f9f7b823 +f9e7bc23 +fbd7b023 +fbc7b423 +fa67b823 +fb17bc23 +04070713 +fb07ece3 +fbf60613 +fc067793 +04078793 +fc067613 +00f585b3 +00c687b3 +f907f4e3 +0005b703 +00878793 +00858593 +fee7bc23 +ff07e8e3 +00008067 +00008067 +00050793 +fddff06f +00c567b3 +0077f793 +00c50633 +0ff5f713 +00078e63 +00050793 +02c57c63 +00178793 +fee78fa3 +fef61ce3 +00008067 +00004797 +a707b783 +02f70733 +fec578e3 +00050793 +00878793 +fee7bc23 +fec7ece3 +00008067 +00008067 +00054783 +00078e63 +00050793 +0017c703 +00178793 +fe071ce3 +40a78533 +00008067 +00000513 +00008067 +00b506b3 +00050793 +00059863 +0240006f +00178793 +00f68a63 +0007c703 +fe071ae3 +40a78533 +00008067 +40a68533 +00008067 +00000513 +00008067 +00054783 +00158593 +00150513 +fff5c703 +00078a63 +fee786e3 +0007851b +40e5053b +00008067 +00000513 +ff5ff06f +00050793 +0005c703 +00178793 +00158593 +fee78fa3 +fe0718e3 +00008067 +fa010113 +04813823 +04113c23 +04913423 +05213023 +03313c23 +03413823 +03513423 +00004617 +98860613 +00003697 +6e868693 +00003717 +74070713 +02900413 +0d0475d7 +0005879b +000022b7 +9192829b +02075507 +0206d587 +9ea5a657 +9ec2e657 +02066627 +00179793 +40b4043b +00f70733 +00f686b3 +00f60633 +fc0414e3 +86818493 +00002537 +00003717 +6f070713 +00003617 +68860613 +00003817 +73280813 +00048693 +9195051b +00071783 +00061583 +00268693 +00270713 +02b787bb +00260613 +02a787bb +4107d79b +fef69f23 +fd071ee3 +00004917 +8e090913 +00100693 +00003a17 +72ca0a13 +00003a97 +744a8a93 +02900993 +00091703 +00049783 +000a0513 +00290913 +00248493 +02f70463 +87dff0ef +00810593 +00040513 +fe8ff0ef +00810513 +869ff0ef +000a8513 +861ff0ef +00000693 +0014041b +fd3410e3 +05813083 +05013403 +04813483 +04013903 +03813983 +03013a03 +02813a83 +0016c513 +06010113 +00008067 +fff00513 +00008067 diff --git a/src/main/scala/my_random_useful_programs/RandomArrayGen.scala b/src/main/scala/my_random_useful_programs/RandomArrayGen.scala index 089eb382..4b0e3f30 100644 --- a/src/main/scala/my_random_useful_programs/RandomArrayGen.scala +++ b/src/main/scala/my_random_useful_programs/RandomArrayGen.scala @@ -23,12 +23,12 @@ object RandomArrayWithElenGen extends App { private def function(): Boolean = { (0 until 4).map(_ => Random.nextBoolean()).reduce(_ && _) } - val randomArray0 = (0 until 48).map(_ => Random.nextInt(0x100)).map("0x" + _.toHexString.toUpperCase) - val randomArray1 = (0 until 48).map(_ => Random.nextInt(0x100)).map("0x" + _.toHexString.toUpperCase) + val randomArray0 = (0 until 48).map(_ => Random.nextInt(0xFFFF) - 0x8000) + val randomArray1 = (0 until 48).map(_ => Random.nextInt(0xFFFF) - 0x8000) val boolArray = (0 until 48).map(_ => function()) val hasEqualArray = randomArray0.lazyZip(randomArray1).lazyZip(boolArray).map { case (v1, v2, b) => if(b) v1 else v2 } println(randomArray0.mkString("{", ", ", "};")) - println(hasEqualArray.mkString("{", ", ", "};")) + println(randomArray1.mkString("{", ", ", "};")) } \ No newline at end of file diff --git a/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala b/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala index 00f522c7..10f630d6 100644 --- a/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala +++ b/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala @@ -139,7 +139,7 @@ class Zve64xAppTestForVecCpu extends AnyFlatSpec with ChiselScalatestTester { "vadd", "vsub", "vand", "vmseq", "vmslt", "vmsle", "vmsgt", "vminmax", "vmerge", "vmv", "vmand", "vmor", "vmxor", - "vmul" + "vmul", "vmulh" ) val applicationTest = Seq( "vector_median" From 5da7e0dd289a9996e809b630112cd06061551112 Mon Sep 17 00:00:00 2001 From: HidetaroTanaka Date: Fri, 10 Nov 2023 11:02:55 +0900 Subject: [PATCH 5/8] fuck this test --- .../resources/applications_vector/vmulh.dump | 136 +++++++++--------- .../applications_vector/vmulh/vmulh.c | 10 +- .../applications_vector/vmulh_inst.hex | 36 ++--- 3 files changed, 85 insertions(+), 97 deletions(-) diff --git a/src/main/resources/applications_vector/vmulh.dump b/src/main/resources/applications_vector/vmulh.dump index e90637e4..13973669 100644 --- a/src/main/resources/applications_vector/vmulh.dump +++ b/src/main/resources/applications_vector/vmulh.dump @@ -630,78 +630,72 @@ Disassembly of section .text.startup: 920: 00003717 auipc a4,0x3 924: 74070713 add a4,a4,1856 # 4060 928: 02900413 li s0,41 - 92c: 0d0475d7 vsetvli a1,s0,e32,m1,ta,ma + 92c: 0c8475d7 vsetvli a1,s0,e16,m1,ta,ma 930: 0005879b sext.w a5,a1 - 934: 000022b7 lui t0,0x2 - 938: 9192829b addw t0,t0,-1767 # 1919 - 93c: 02075507 vle16.v v10,(a4) - 940: 0206d587 vle16.v v11,(a3) - 944: 9ea5a657 vmulh.vv v12,v10,v11 - 948: 9ec2e657 vmulh.vx v12,v12,t0 - 94c: 02066627 vse32.v v12,(a2) - 950: 00179793 sll a5,a5,0x1 - 954: 40b4043b subw s0,s0,a1 - 958: 00f70733 add a4,a4,a5 - 95c: 00f686b3 add a3,a3,a5 - 960: 00f60633 add a2,a2,a5 - 964: fc0414e3 bnez s0,92c - 968: 86818493 add s1,gp,-1944 # 42f8 - 96c: 00002537 lui a0,0x2 - 970: 00003717 auipc a4,0x3 - 974: 6f070713 add a4,a4,1776 # 4060 - 978: 00003617 auipc a2,0x3 - 97c: 68860613 add a2,a2,1672 # 4000 - 980: 00003817 auipc a6,0x3 - 984: 73280813 add a6,a6,1842 # 40b2 - 988: 00048693 mv a3,s1 - 98c: 9195051b addw a0,a0,-1767 # 1919 - 990: 00071783 lh a5,0(a4) - 994: 00061583 lh a1,0(a2) - 998: 00268693 add a3,a3,2 - 99c: 00270713 add a4,a4,2 - 9a0: 02b787bb mulw a5,a5,a1 - 9a4: 00260613 add a2,a2,2 - 9a8: 02a787bb mulw a5,a5,a0 - 9ac: 4107d79b sraw a5,a5,0x10 - 9b0: fef69f23 sh a5,-2(a3) - 9b4: fd071ee3 bne a4,a6,990 - 9b8: 00004917 auipc s2,0x4 - 9bc: 8e090913 add s2,s2,-1824 # 4298 - 9c0: 00100693 li a3,1 - 9c4: 00003a17 auipc s4,0x3 - 9c8: 72ca0a13 add s4,s4,1836 # 40f0 - 9cc: 00003a97 auipc s5,0x3 - 9d0: 744a8a93 add s5,s5,1860 # 4110 - 9d4: 02900993 li s3,41 - 9d8: 00091703 lh a4,0(s2) - 9dc: 00049783 lh a5,0(s1) - 9e0: 000a0513 mv a0,s4 - 9e4: 00290913 add s2,s2,2 - 9e8: 00248493 add s1,s1,2 - 9ec: 02f70463 beq a4,a5,a14 - 9f0: 87dff0ef jal 26c - 9f4: 00810593 add a1,sp,8 - 9f8: 00040513 mv a0,s0 - 9fc: fe8ff0ef jal 1e4 - a00: 00810513 add a0,sp,8 - a04: 869ff0ef jal 26c - a08: 000a8513 mv a0,s5 - a0c: 861ff0ef jal 26c - a10: 00000693 li a3,0 - a14: 0014041b addw s0,s0,1 - a18: fd3410e3 bne s0,s3,9d8 - a1c: 05813083 ld ra,88(sp) - a20: 05013403 ld s0,80(sp) - a24: 04813483 ld s1,72(sp) - a28: 04013903 ld s2,64(sp) - a2c: 03813983 ld s3,56(sp) - a30: 03013a03 ld s4,48(sp) - a34: 02813a83 ld s5,40(sp) - a38: 0016c513 xor a0,a3,1 - a3c: 06010113 add sp,sp,96 - a40: 00008067 ret - a44: fff00513 li a0,-1 - a48: 00008067 ret + 934: 02075507 vle16.v v10,(a4) + 938: 0206d587 vle16.v v11,(a3) + 93c: 9ea5a657 vmulh.vv v12,v10,v11 + 940: 02065627 vse16.v v12,(a2) + 944: 00179793 sll a5,a5,0x1 + 948: 40b4043b subw s0,s0,a1 + 94c: 00f70733 add a4,a4,a5 + 950: 00f686b3 add a3,a3,a5 + 954: 00f60633 add a2,a2,a5 + 958: fc041ae3 bnez s0,92c + 95c: 86818493 add s1,gp,-1944 # 42f8 + 960: 00003717 auipc a4,0x3 + 964: 70070713 add a4,a4,1792 # 4060 + 968: 00003617 auipc a2,0x3 + 96c: 69860613 add a2,a2,1688 # 4000 + 970: 00003517 auipc a0,0x3 + 974: 74250513 add a0,a0,1858 # 40b2 + 978: 00048693 mv a3,s1 + 97c: 00071783 lh a5,0(a4) + 980: 00061583 lh a1,0(a2) + 984: 00268693 add a3,a3,2 + 988: 00270713 add a4,a4,2 + 98c: 02b787bb mulw a5,a5,a1 + 990: 00260613 add a2,a2,2 + 994: 4107d79b sraw a5,a5,0x10 + 998: fef69f23 sh a5,-2(a3) + 99c: fea710e3 bne a4,a0,97c + 9a0: 00004917 auipc s2,0x4 + 9a4: 8f890913 add s2,s2,-1800 # 4298 + 9a8: 00100693 li a3,1 + 9ac: 00003a17 auipc s4,0x3 + 9b0: 744a0a13 add s4,s4,1860 # 40f0 + 9b4: 00003a97 auipc s5,0x3 + 9b8: 75ca8a93 add s5,s5,1884 # 4110 + 9bc: 02900993 li s3,41 + 9c0: 00091703 lh a4,0(s2) + 9c4: 00049783 lh a5,0(s1) + 9c8: 000a0513 mv a0,s4 + 9cc: 00290913 add s2,s2,2 + 9d0: 00248493 add s1,s1,2 + 9d4: 02f70463 beq a4,a5,9fc + 9d8: 895ff0ef jal 26c + 9dc: 00810593 add a1,sp,8 + 9e0: 00040513 mv a0,s0 + 9e4: 801ff0ef jal 1e4 + 9e8: 00810513 add a0,sp,8 + 9ec: 881ff0ef jal 26c + 9f0: 000a8513 mv a0,s5 + 9f4: 879ff0ef jal 26c + 9f8: 00000693 li a3,0 + 9fc: 0014041b addw s0,s0,1 + a00: fd3410e3 bne s0,s3,9c0 + a04: 05813083 ld ra,88(sp) + a08: 05013403 ld s0,80(sp) + a0c: 04813483 ld s1,72(sp) + a10: 04013903 ld s2,64(sp) + a14: 03813983 ld s3,56(sp) + a18: 03013a03 ld s4,48(sp) + a1c: 02813a83 ld s5,40(sp) + a20: 0016c513 xor a0,a3,1 + a24: 06010113 add sp,sp,96 + a28: 00008067 ret + a2c: fff00513 li a0,-1 + a30: 00008067 ret Disassembly of section .rodata: diff --git a/src/main/resources/applications_vector/vmulh/vmulh.c b/src/main/resources/applications_vector/vmulh/vmulh.c index 64e31bb3..0521bfd1 100644 --- a/src/main/resources/applications_vector/vmulh/vmulh.c +++ b/src/main/resources/applications_vector/vmulh/vmulh.c @@ -20,10 +20,10 @@ int main(int argc, char** argv) { const signed short *ptr1 = dataArray1; signed short *ptr2 = resultArray; while(avl != 0) { - asm volatile ("vsetvli %0, %1, e32, m1, ta, ma" + asm volatile ("vsetvli %0, %1, e16, m1, ta, ma" : "=r"(vl) : "r"(avl)); - asm volatile ("li t0, 0x1919"); + // asm volatile ("li t0, 0x1919"); asm volatile ("vle16.v v10, (%0)" : : "r"(ptr0)); @@ -31,8 +31,8 @@ int main(int argc, char** argv) { : : "r"(ptr1)); asm volatile ("vmulh.vv v12, v10, v11"); - asm volatile ("vmulh.vx v12, v12, t0"); - asm volatile ("vse32.v v12, (%0)" + // asm volatile ("vmulh.vx v12, v12, t0"); + asm volatile ("vse16.v v12, (%0)" : : "r"(ptr2)); ptr0 += vl; @@ -42,7 +42,7 @@ int main(int argc, char** argv) { } int i; for(i=0; i<41; i++) { - answerArray[i] = (signed short)(((signed int)dataArray0[i] * (signed int)dataArray1[i] * (signed int)0x1919) >> 16); + answerArray[i] = (signed short)((((signed int)dataArray0[i] * (signed int)dataArray1[i]) >> 16) & 0xFFFF); } _Bool correct = 1; diff --git a/src/main/resources/applications_vector/vmulh_inst.hex b/src/main/resources/applications_vector/vmulh_inst.hex index 7c6b58b6..bf8f5eca 100644 --- a/src/main/resources/applications_vector/vmulh_inst.hex +++ b/src/main/resources/applications_vector/vmulh_inst.hex @@ -585,48 +585,42 @@ fa010113 00003717 74070713 02900413 -0d0475d7 +0c8475d7 0005879b -000022b7 -9192829b 02075507 0206d587 9ea5a657 -9ec2e657 -02066627 +02065627 00179793 40b4043b 00f70733 00f686b3 00f60633 -fc0414e3 +fc041ae3 86818493 -00002537 00003717 -6f070713 +70070713 00003617 -68860613 -00003817 -73280813 +69860613 +00003517 +74250513 00048693 -9195051b 00071783 00061583 00268693 00270713 02b787bb 00260613 -02a787bb 4107d79b fef69f23 -fd071ee3 +fea710e3 00004917 -8e090913 +8f890913 00100693 00003a17 -72ca0a13 +744a0a13 00003a97 -744a8a93 +75ca8a93 02900993 00091703 00049783 @@ -634,14 +628,14 @@ fd071ee3 00290913 00248493 02f70463 -87dff0ef +895ff0ef 00810593 00040513 -fe8ff0ef +801ff0ef 00810513 -869ff0ef +881ff0ef 000a8513 -861ff0ef +879ff0ef 00000693 0014041b fd3410e3 From f15e8d809e17f8fc8bf08db9b52f2a0168de45cd Mon Sep 17 00:00:00 2001 From: HidetaroTanaka Date: Fri, 10 Nov 2023 13:17:55 +0900 Subject: [PATCH 6/8] fuck --- .../resources/applications_vector/vmulh.dump | 1184 +++++++++-------- .../applications_vector/vmulh/vmulh.c | 61 +- .../applications_vector/vmulh_data.hex | 24 +- .../applications_vector/vmulh_inst.hex | 216 +-- 4 files changed, 823 insertions(+), 662 deletions(-) diff --git a/src/main/resources/applications_vector/vmulh.dump b/src/main/resources/applications_vector/vmulh.dump index 13973669..ba4a382c 100644 --- a/src/main/resources/applications_vector/vmulh.dump +++ b/src/main/resources/applications_vector/vmulh.dump @@ -49,7 +49,7 @@ Disassembly of section .text.init: a4: 00b57063 bgeu a0,a1,a4 <_start+0xa4> a8: 00006137 lui sp,0x6 ac: ff01011b addw sp,sp,-16 # 5ff0 <__global_pointer$+0x1560> - b0: 6580006f j 708 <_init> + b0: 71c0006f j 7cc <_init> 00000000000000b4 : b4: ef010113 add sp,sp,-272 @@ -87,10 +87,10 @@ Disassembly of section .text.init: 134: 34202573 csrr a0,mcause 138: 341025f3 csrr a1,mepc 13c: 00010613 mv a2,sp - 140: 2d0000ef jal 410 + 140: 394000ef jal 4d4 144: 34151073 csrw mepc,a0 148: 000022b7 lui t0,0x2 - 14c: 8002829b addw t0,t0,-2048 # 1800 + 14c: 8002829b addw t0,t0,-2048 # 1800 150: 3002a073 csrs mstatus,t0 154: 00813083 ld ra,8(sp) 158: 01013103 ld sp,16(sp) @@ -128,574 +128,636 @@ Disassembly of section .text.init: Disassembly of section .text: -00000000000001d8 : - 1d8: b0201073 csrw minstret,zero - 1dc: b0001073 csrw mcycle,zero - 1e0: 00008067 ret +00000000000001d8 : + 1d8: 0ac05c63 blez a2,290 + 1dc: fa010113 add sp,sp,-96 + 1e0: 00161613 sll a2,a2,0x1 + 1e4: 04813823 sd s0,80(sp) + 1e8: 04913423 sd s1,72(sp) + 1ec: 05213023 sd s2,64(sp) + 1f0: 03313c23 sd s3,56(sp) + 1f4: 03413823 sd s4,48(sp) + 1f8: 03513423 sd s5,40(sp) + 1fc: 04113c23 sd ra,88(sp) + 200: 00050413 mv s0,a0 + 204: 00058493 mv s1,a1 + 208: 00c509b3 add s3,a0,a2 + 20c: 00100693 li a3,1 + 210: 00000913 li s2,0 + 214: 00004a17 auipc s4,0x4 + 218: edca0a13 add s4,s4,-292 # 40f0 + 21c: 00004a97 auipc s5,0x4 + 220: ef4a8a93 add s5,s5,-268 # 4110 + 224: 00045703 lhu a4,0(s0) + 228: 0004d783 lhu a5,0(s1) + 22c: 000a0513 mv a0,s4 + 230: 00240413 add s0,s0,2 + 234: 00248493 add s1,s1,2 + 238: 02f70463 beq a4,a5,260 + 23c: 0f4000ef jal 330 + 240: 00810593 add a1,sp,8 + 244: 00090513 mv a0,s2 + 248: 060000ef jal 2a8 + 24c: 00810513 add a0,sp,8 + 250: 0e0000ef jal 330 + 254: 000a8513 mv a0,s5 + 258: 0d8000ef jal 330 + 25c: 00000693 li a3,0 + 260: 0019091b addw s2,s2,1 + 264: fd3410e3 bne s0,s3,224 + 268: 05813083 ld ra,88(sp) + 26c: 05013403 ld s0,80(sp) + 270: 04813483 ld s1,72(sp) + 274: 04013903 ld s2,64(sp) + 278: 03813983 ld s3,56(sp) + 27c: 03013a03 ld s4,48(sp) + 280: 02813a83 ld s5,40(sp) + 284: 00068513 mv a0,a3 + 288: 06010113 add sp,sp,96 + 28c: 00008067 ret + 290: 00100693 li a3,1 + 294: 00068513 mv a0,a3 + 298: 00008067 ret -00000000000001e4 : - 1e4: 03000793 li a5,48 - 1e8: 00f58023 sb a5,0(a1) - 1ec: 07800793 li a5,120 - 1f0: 00f580a3 sb a5,1(a1) - 1f4: 00158813 add a6,a1,1 - 1f8: 00958793 add a5,a1,9 - 1fc: 00900613 li a2,9 - 200: 00f57713 and a4,a0,15 - 204: 03770693 add a3,a4,55 - 208: 00e66463 bltu a2,a4,210 - 20c: 03070693 add a3,a4,48 - 210: 00d78023 sb a3,0(a5) - 214: fff78793 add a5,a5,-1 - 218: 40455513 sra a0,a0,0x4 - 21c: fef812e3 bne a6,a5,200 - 220: 00058523 sb zero,10(a1) - 224: 00008067 ret +000000000000029c : + 29c: b0201073 csrw minstret,zero + 2a0: b0001073 csrw mcycle,zero + 2a4: 00008067 ret -0000000000000228 : - 228: 03000793 li a5,48 - 22c: 00f58023 sb a5,0(a1) - 230: 07800793 li a5,120 - 234: 00f580a3 sb a5,1(a1) - 238: 00158813 add a6,a1,1 - 23c: 01158793 add a5,a1,17 - 240: 00900613 li a2,9 - 244: 00f57713 and a4,a0,15 - 248: 03770693 add a3,a4,55 - 24c: 00e66463 bltu a2,a4,254 - 250: 03070693 add a3,a4,48 - 254: 00d78023 sb a3,0(a5) - 258: fff78793 add a5,a5,-1 - 25c: 40455513 sra a0,a0,0x4 - 260: fef812e3 bne a6,a5,244 - 264: 00058923 sb zero,18(a1) - 268: 00008067 ret +00000000000002a8 : + 2a8: 03000793 li a5,48 + 2ac: 00f58023 sb a5,0(a1) + 2b0: 07800793 li a5,120 + 2b4: 00f580a3 sb a5,1(a1) + 2b8: 00158813 add a6,a1,1 + 2bc: 00958793 add a5,a1,9 + 2c0: 00900613 li a2,9 + 2c4: 00f57713 and a4,a0,15 + 2c8: 03770693 add a3,a4,55 + 2cc: 00e66463 bltu a2,a4,2d4 + 2d0: 03070693 add a3,a4,48 + 2d4: 00d78023 sb a3,0(a5) + 2d8: fff78793 add a5,a5,-1 + 2dc: 40455513 sra a0,a0,0x4 + 2e0: fef812e3 bne a6,a5,2c4 + 2e4: 00058523 sb zero,10(a1) + 2e8: 00008067 ret -000000000000026c : - 26c: 00054783 lbu a5,0(a0) - 270: 00078c63 beqz a5,288 - 274: 10000737 lui a4,0x10000 - 278: 00f70023 sb a5,0(a4) # 10000000 - 27c: 00154783 lbu a5,1(a0) - 280: 00150513 add a0,a0,1 - 284: fe079ae3 bnez a5,278 - 288: 00008067 ret +00000000000002ec : + 2ec: 03000793 li a5,48 + 2f0: 00f58023 sb a5,0(a1) + 2f4: 07800793 li a5,120 + 2f8: 00f580a3 sb a5,1(a1) + 2fc: 00158813 add a6,a1,1 + 300: 01158793 add a5,a1,17 + 304: 00900613 li a2,9 + 308: 00f57713 and a4,a0,15 + 30c: 03770693 add a3,a4,55 + 310: 00e66463 bltu a2,a4,318 + 314: 03070693 add a3,a4,48 + 318: 00d78023 sb a3,0(a5) + 31c: fff78793 add a5,a5,-1 + 320: 40455513 sra a0,a0,0x4 + 324: fef812e3 bne a6,a5,308 + 328: 00058923 sb zero,18(a1) + 32c: 00008067 ret -000000000000028c : - 28c: fe010113 add sp,sp,-32 - 290: c0202673 rdinstret a2 - 294: c00025f3 rdcycle a1 - 298: 00004717 auipc a4,0x4 - 29c: e8070713 add a4,a4,-384 # 4118 - 2a0: 06300793 li a5,99 - 2a4: 100006b7 lui a3,0x10000 - 2a8: 00f68023 sb a5,0(a3) # 10000000 - 2ac: 00174783 lbu a5,1(a4) - 2b0: 00170713 add a4,a4,1 - 2b4: fe079ae3 bnez a5,2a8 - 2b8: ffff8737 lui a4,0xffff8 - 2bc: 83074713 xor a4,a4,-2000 - 2c0: 01910793 add a5,sp,25 - 2c4: 00e11423 sh a4,8(sp) - 2c8: 00910813 add a6,sp,9 - 2cc: 00078713 mv a4,a5 - 2d0: 00900893 li a7,9 - 2d4: 00f5f693 and a3,a1,15 - 2d8: 03768513 add a0,a3,55 - 2dc: 00d8e463 bltu a7,a3,2e4 - 2e0: 03068513 add a0,a3,48 - 2e4: 00a70023 sb a0,0(a4) # ffffffffffff8000 <_end+0xffffffffefff7fb8> - 2e8: fff70713 add a4,a4,-1 - 2ec: 4045d593 sra a1,a1,0x4 - 2f0: fee812e3 bne a6,a4,2d4 - 2f4: 00814703 lbu a4,8(sp) - 2f8: 00010d23 sb zero,26(sp) - 2fc: 00810693 add a3,sp,8 - 300: 100005b7 lui a1,0x10000 - 304: 00070a63 beqz a4,318 - 308: 00e58023 sb a4,0(a1) # 10000000 - 30c: 0016c703 lbu a4,1(a3) - 310: 00168693 add a3,a3,1 - 314: fe071ae3 bnez a4,308 - 318: 00004697 auipc a3,0x4 - 31c: e0868693 add a3,a3,-504 # 4120 - 320: 00a00713 li a4,10 - 324: 100005b7 lui a1,0x10000 - 328: 00e58023 sb a4,0(a1) # 10000000 - 32c: 0016c703 lbu a4,1(a3) - 330: 00168693 add a3,a3,1 - 334: fe071ae3 bnez a4,328 - 338: ffff8737 lui a4,0xffff8 - 33c: 83074713 xor a4,a4,-2000 - 340: 00060693 mv a3,a2 - 344: 00e11423 sh a4,8(sp) - 348: 00900593 li a1,9 - 34c: 00f6f713 and a4,a3,15 - 350: 03770613 add a2,a4,55 # ffffffffffff8037 <_end+0xffffffffefff7fef> - 354: 00e5e463 bltu a1,a4,35c - 358: 03070613 add a2,a4,48 - 35c: 00c78023 sb a2,0(a5) - 360: fff78793 add a5,a5,-1 - 364: 4046d693 sra a3,a3,0x4 - 368: fef812e3 bne a6,a5,34c - 36c: 00814783 lbu a5,8(sp) - 370: 00010d23 sb zero,26(sp) - 374: 00810713 add a4,sp,8 - 378: 100006b7 lui a3,0x10000 - 37c: 00078a63 beqz a5,390 - 380: 00f68023 sb a5,0(a3) # 10000000 - 384: 00174783 lbu a5,1(a4) - 388: 00170713 add a4,a4,1 - 38c: fe079ae3 bnez a5,380 - 390: 100007b7 lui a5,0x10000 - 394: 00a00713 li a4,10 - 398: 00e78023 sb a4,0(a5) # 10000000 - 39c: 02010113 add sp,sp,32 - 3a0: 00008067 ret +0000000000000330 : + 330: 00054783 lbu a5,0(a0) + 334: 00078c63 beqz a5,34c + 338: 10000737 lui a4,0x10000 + 33c: 00f70023 sb a5,0(a4) # 10000000 + 340: 00154783 lbu a5,1(a0) + 344: 00150513 add a0,a0,1 + 348: fe079ae3 bnez a5,33c + 34c: 00008067 ret -00000000000003a4 : - 3a4: fe010113 add sp,sp,-32 - 3a8: 00813823 sd s0,16(sp) - 3ac: 00113c23 sd ra,24(sp) - 3b0: 00050413 mv s0,a0 - 3b4: 00004717 auipc a4,0x4 - 3b8: d7c70713 add a4,a4,-644 # 4130 - 3bc: 04500793 li a5,69 - 3c0: 100006b7 lui a3,0x10000 - 3c4: 00f68023 sb a5,0(a3) # 10000000 - 3c8: 00174783 lbu a5,1(a4) - 3cc: 00170713 add a4,a4,1 - 3d0: fe079ae3 bnez a5,3c4 - 3d4: 00010593 mv a1,sp - 3d8: 00040513 mv a0,s0 - 3dc: e09ff0ef jal 1e4 - 3e0: 00014703 lbu a4,0(sp) - 3e4: 00070e63 beqz a4,400 - 3e8: 00010793 mv a5,sp - 3ec: 100006b7 lui a3,0x10000 - 3f0: 00e68023 sb a4,0(a3) # 10000000 - 3f4: 0017c703 lbu a4,1(a5) - 3f8: 00178793 add a5,a5,1 - 3fc: fe071ae3 bnez a4,3f0 - 400: 00040513 mv a0,s0 - 404: 100007b7 lui a5,0x10000 - 408: 00078023 sb zero,0(a5) # 10000000 - 40c: 0000006f j 40c +0000000000000350 : + 350: fe010113 add sp,sp,-32 + 354: c0202673 rdinstret a2 + 358: c00025f3 rdcycle a1 + 35c: 00004717 auipc a4,0x4 + 360: dbc70713 add a4,a4,-580 # 4118 + 364: 06300793 li a5,99 + 368: 100006b7 lui a3,0x10000 + 36c: 00f68023 sb a5,0(a3) # 10000000 + 370: 00174783 lbu a5,1(a4) + 374: 00170713 add a4,a4,1 + 378: fe079ae3 bnez a5,36c + 37c: ffff8737 lui a4,0xffff8 + 380: 83074713 xor a4,a4,-2000 + 384: 01910793 add a5,sp,25 + 388: 00e11423 sh a4,8(sp) + 38c: 00910813 add a6,sp,9 + 390: 00078713 mv a4,a5 + 394: 00900893 li a7,9 + 398: 00f5f693 and a3,a1,15 + 39c: 03768513 add a0,a3,55 + 3a0: 00d8e463 bltu a7,a3,3a8 + 3a4: 03068513 add a0,a3,48 + 3a8: 00a70023 sb a0,0(a4) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 3ac: fff70713 add a4,a4,-1 + 3b0: 4045d593 sra a1,a1,0x4 + 3b4: fee812e3 bne a6,a4,398 + 3b8: 00814703 lbu a4,8(sp) + 3bc: 00010d23 sb zero,26(sp) + 3c0: 00810693 add a3,sp,8 + 3c4: 100005b7 lui a1,0x10000 + 3c8: 00070a63 beqz a4,3dc + 3cc: 00e58023 sb a4,0(a1) # 10000000 + 3d0: 0016c703 lbu a4,1(a3) + 3d4: 00168693 add a3,a3,1 + 3d8: fe071ae3 bnez a4,3cc + 3dc: 00004697 auipc a3,0x4 + 3e0: d4468693 add a3,a3,-700 # 4120 + 3e4: 00a00713 li a4,10 + 3e8: 100005b7 lui a1,0x10000 + 3ec: 00e58023 sb a4,0(a1) # 10000000 + 3f0: 0016c703 lbu a4,1(a3) + 3f4: 00168693 add a3,a3,1 + 3f8: fe071ae3 bnez a4,3ec + 3fc: ffff8737 lui a4,0xffff8 + 400: 83074713 xor a4,a4,-2000 + 404: 00060693 mv a3,a2 + 408: 00e11423 sh a4,8(sp) + 40c: 00900593 li a1,9 + 410: 00f6f713 and a4,a3,15 + 414: 03770613 add a2,a4,55 # ffffffffffff8037 <_end+0xffffffffefff7fef> + 418: 00e5e463 bltu a1,a4,420 + 41c: 03070613 add a2,a4,48 + 420: 00c78023 sb a2,0(a5) + 424: fff78793 add a5,a5,-1 + 428: 4046d693 sra a3,a3,0x4 + 42c: fef812e3 bne a6,a5,410 + 430: 00814783 lbu a5,8(sp) + 434: 00010d23 sb zero,26(sp) + 438: 00810713 add a4,sp,8 + 43c: 100006b7 lui a3,0x10000 + 440: 00078a63 beqz a5,454 + 444: 00f68023 sb a5,0(a3) # 10000000 + 448: 00174783 lbu a5,1(a4) + 44c: 00170713 add a4,a4,1 + 450: fe079ae3 bnez a5,444 + 454: 100007b7 lui a5,0x10000 + 458: 00a00713 li a4,10 + 45c: 00e78023 sb a4,0(a5) # 10000000 + 460: 02010113 add sp,sp,32 + 464: 00008067 ret -0000000000000410 : - 410: ffff87b7 lui a5,0xffff8 - 414: fd010113 add sp,sp,-48 - 418: 8307c793 xor a5,a5,-2000 - 41c: 00f11423 sh a5,8(sp) - 420: 02113423 sd ra,40(sp) - 424: 01910793 add a5,sp,25 - 428: 00910813 add a6,sp,9 - 42c: 00900613 li a2,9 - 430: 00f5f713 and a4,a1,15 - 434: 03770693 add a3,a4,55 - 438: 00e66463 bltu a2,a4,440 - 43c: 03070693 add a3,a4,48 - 440: 00d78023 sb a3,0(a5) # ffffffffffff8000 <_end+0xffffffffefff7fb8> - 444: fff78793 add a5,a5,-1 - 448: 4045d593 sra a1,a1,0x4 - 44c: ff0792e3 bne a5,a6,430 - 450: 00010d23 sb zero,26(sp) - 454: 00b00793 li a5,11 - 458: 02a7e063 bltu a5,a0,478 - 45c: 00004717 auipc a4,0x4 - 460: c6470713 add a4,a4,-924 # 40c0 - 464: 00251513 sll a0,a0,0x2 - 468: 00e50533 add a0,a0,a4 - 46c: 00052783 lw a5,0(a0) - 470: 00e787b3 add a5,a5,a4 - 474: 00078067 jr a5 +0000000000000468 : + 468: fe010113 add sp,sp,-32 + 46c: 00813823 sd s0,16(sp) + 470: 00113c23 sd ra,24(sp) + 474: 00050413 mv s0,a0 478: 00004717 auipc a4,0x4 - 47c: de070713 add a4,a4,-544 # 4258 - 480: 05500793 li a5,85 + 47c: cb870713 add a4,a4,-840 # 4130 + 480: 04500793 li a5,69 484: 100006b7 lui a3,0x10000 488: 00f68023 sb a5,0(a3) # 10000000 48c: 00174783 lbu a5,1(a4) 490: 00170713 add a4,a4,1 - 494: fe079ae3 bnez a5,488 - 498: 00814783 lbu a5,8(sp) - 49c: 00810713 add a4,sp,8 - 4a0: 100006b7 lui a3,0x10000 - 4a4: 00078a63 beqz a5,4b8 - 4a8: 00f68023 sb a5,0(a3) # 10000000 - 4ac: 00174783 lbu a5,1(a4) - 4b0: 00170713 add a4,a4,1 - 4b4: fe079ae3 bnez a5,4a8 - 4b8: 00004717 auipc a4,0x4 - 4bc: dc070713 add a4,a4,-576 # 4278 - 4c0: 00a00793 li a5,10 - 4c4: 100006b7 lui a3,0x10000 - 4c8: 00f68023 sb a5,0(a3) # 10000000 - 4cc: 00174783 lbu a5,1(a4) - 4d0: 00170713 add a4,a4,1 - 4d4: fe079ae3 bnez a5,4c8 - 4d8: fff00513 li a0,-1 - 4dc: ec9ff0ef jal 3a4 - 4e0: 00004717 auipc a4,0x4 - 4e4: c6070713 add a4,a4,-928 # 4140 - 4e8: 04900793 li a5,73 - 4ec: 100006b7 lui a3,0x10000 - 4f0: 00f68023 sb a5,0(a3) # 10000000 - 4f4: 00174783 lbu a5,1(a4) - 4f8: 00170713 add a4,a4,1 - 4fc: fe079ae3 bnez a5,4f0 - 500: 00814783 lbu a5,8(sp) - 504: 00810713 add a4,sp,8 - 508: 100006b7 lui a3,0x10000 - 50c: fc0786e3 beqz a5,4d8 - 510: 00f68023 sb a5,0(a3) # 10000000 - 514: 00174783 lbu a5,1(a4) - 518: 00170713 add a4,a4,1 - 51c: fe079ae3 bnez a5,510 - 520: fb9ff06f j 4d8 - 524: 00004717 auipc a4,0x4 - 528: c4470713 add a4,a4,-956 # 4168 - 52c: 04900793 li a5,73 - 530: 100006b7 lui a3,0x10000 - 534: 00f68023 sb a5,0(a3) # 10000000 - 538: 00174783 lbu a5,1(a4) - 53c: 00170713 add a4,a4,1 - 540: fe079ae3 bnez a5,534 - 544: 00814783 lbu a5,8(sp) - 548: f80788e3 beqz a5,4d8 - 54c: 00810713 add a4,sp,8 - 550: 100006b7 lui a3,0x10000 - 554: 00f68023 sb a5,0(a3) # 10000000 - 558: 00174783 lbu a5,1(a4) - 55c: 00170713 add a4,a4,1 - 560: fe079ae3 bnez a5,554 - 564: f75ff06f j 4d8 - 568: 00004717 auipc a4,0x4 - 56c: c2870713 add a4,a4,-984 # 4190 - 570: 04900793 li a5,73 - 574: 100006b7 lui a3,0x10000 - 578: 00f68023 sb a5,0(a3) # 10000000 - 57c: 00174783 lbu a5,1(a4) - 580: 00170713 add a4,a4,1 - 584: fe079ae3 bnez a5,578 - 588: 00814783 lbu a5,8(sp) - 58c: f40786e3 beqz a5,4d8 - 590: 00810713 add a4,sp,8 - 594: 100006b7 lui a3,0x10000 - 598: 00f68023 sb a5,0(a3) # 10000000 - 59c: 00174783 lbu a5,1(a4) - 5a0: 00170713 add a4,a4,1 - 5a4: fe079ae3 bnez a5,598 - 5a8: f31ff06f j 4d8 - 5ac: 00004717 auipc a4,0x4 - 5b0: c0470713 add a4,a4,-1020 # 41b0 - 5b4: 04c00793 li a5,76 - 5b8: 100006b7 lui a3,0x10000 - 5bc: 00f68023 sb a5,0(a3) # 10000000 - 5c0: 00174783 lbu a5,1(a4) - 5c4: 00170713 add a4,a4,1 - 5c8: fe079ae3 bnez a5,5bc - 5cc: 00814783 lbu a5,8(sp) - 5d0: f00784e3 beqz a5,4d8 - 5d4: 00810713 add a4,sp,8 - 5d8: 100006b7 lui a3,0x10000 - 5dc: 00f68023 sb a5,0(a3) # 10000000 - 5e0: 00174783 lbu a5,1(a4) - 5e4: 00170713 add a4,a4,1 - 5e8: fe079ae3 bnez a5,5dc - 5ec: eedff06f j 4d8 - 5f0: 00004717 auipc a4,0x4 - 5f4: be070713 add a4,a4,-1056 # 41d0 - 5f8: 04c00793 li a5,76 - 5fc: 100006b7 lui a3,0x10000 - 600: 00f68023 sb a5,0(a3) # 10000000 - 604: 00174783 lbu a5,1(a4) - 608: 00170713 add a4,a4,1 - 60c: fe079ae3 bnez a5,600 - 610: 00814783 lbu a5,8(sp) - 614: ec0782e3 beqz a5,4d8 - 618: 00810713 add a4,sp,8 - 61c: 100006b7 lui a3,0x10000 - 620: 00f68023 sb a5,0(a3) # 10000000 - 624: 00174783 lbu a5,1(a4) - 628: 00170713 add a4,a4,1 - 62c: fe079ae3 bnez a5,620 - 630: ea9ff06f j 4d8 - 634: 00004717 auipc a4,0x4 - 638: bbc70713 add a4,a4,-1092 # 41f0 - 63c: 05300793 li a5,83 - 640: 100006b7 lui a3,0x10000 - 644: 00f68023 sb a5,0(a3) # 10000000 - 648: 00174783 lbu a5,1(a4) - 64c: 00170713 add a4,a4,1 - 650: fe079ae3 bnez a5,644 - 654: 00814783 lbu a5,8(sp) - 658: e80780e3 beqz a5,4d8 - 65c: 00810713 add a4,sp,8 - 660: 100006b7 lui a3,0x10000 - 664: 00f68023 sb a5,0(a3) # 10000000 - 668: 00174783 lbu a5,1(a4) - 66c: 00170713 add a4,a4,1 - 670: fe079ae3 bnez a5,664 - 674: e65ff06f j 4d8 - 678: 00004717 auipc a4,0x4 - 67c: ba070713 add a4,a4,-1120 # 4218 - 680: 05300793 li a5,83 - 684: 100006b7 lui a3,0x10000 - 688: 00f68023 sb a5,0(a3) # 10000000 - 68c: 00174783 lbu a5,1(a4) - 690: 00170713 add a4,a4,1 - 694: fe079ae3 bnez a5,688 - 698: 00814783 lbu a5,8(sp) - 69c: e2078ee3 beqz a5,4d8 - 6a0: 00810713 add a4,sp,8 - 6a4: 100006b7 lui a3,0x10000 - 6a8: 00f68023 sb a5,0(a3) # 10000000 - 6ac: 00174783 lbu a5,1(a4) - 6b0: 00170713 add a4,a4,1 - 6b4: fe079ae3 bnez a5,6a8 - 6b8: e21ff06f j 4d8 - 6bc: 00004717 auipc a4,0x4 - 6c0: b7c70713 add a4,a4,-1156 # 4238 - 6c4: 04500793 li a5,69 - 6c8: 100006b7 lui a3,0x10000 - 6cc: 00f68023 sb a5,0(a3) # 10000000 - 6d0: 00174783 lbu a5,1(a4) - 6d4: 00170713 add a4,a4,1 - 6d8: fe079ae3 bnez a5,6cc - 6dc: 00814783 lbu a5,8(sp) - 6e0: de078ce3 beqz a5,4d8 - 6e4: 00810713 add a4,sp,8 - 6e8: 100006b7 lui a3,0x10000 - 6ec: 00f68023 sb a5,0(a3) # 10000000 - 6f0: 00174783 lbu a5,1(a4) - 6f4: 00170713 add a4,a4,1 - 6f8: fe079ae3 bnez a5,6ec - 6fc: dddff06f j 4d8 + 494: fe079ae3 bnez a5,488 + 498: 00010593 mv a1,sp + 49c: 00040513 mv a0,s0 + 4a0: e09ff0ef jal 2a8 + 4a4: 00014703 lbu a4,0(sp) + 4a8: 00070e63 beqz a4,4c4 + 4ac: 00010793 mv a5,sp + 4b0: 100006b7 lui a3,0x10000 + 4b4: 00e68023 sb a4,0(a3) # 10000000 + 4b8: 0017c703 lbu a4,1(a5) + 4bc: 00178793 add a5,a5,1 + 4c0: fe071ae3 bnez a4,4b4 + 4c4: 00040513 mv a0,s0 + 4c8: 100007b7 lui a5,0x10000 + 4cc: 00078023 sb zero,0(a5) # 10000000 + 4d0: 0000006f j 4d0 -0000000000000700 : - 700: 00051063 bnez a0,700 - 704: 00008067 ret +00000000000004d4 : + 4d4: ffff87b7 lui a5,0xffff8 + 4d8: fd010113 add sp,sp,-48 + 4dc: 8307c793 xor a5,a5,-2000 + 4e0: 00f11423 sh a5,8(sp) + 4e4: 02113423 sd ra,40(sp) + 4e8: 01910793 add a5,sp,25 + 4ec: 00910813 add a6,sp,9 + 4f0: 00900613 li a2,9 + 4f4: 00f5f713 and a4,a1,15 + 4f8: 03770693 add a3,a4,55 + 4fc: 00e66463 bltu a2,a4,504 + 500: 03070693 add a3,a4,48 + 504: 00d78023 sb a3,0(a5) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 508: fff78793 add a5,a5,-1 + 50c: 4045d593 sra a1,a1,0x4 + 510: ff0792e3 bne a5,a6,4f4 + 514: 00010d23 sb zero,26(sp) + 518: 00b00793 li a5,11 + 51c: 02a7e063 bltu a5,a0,53c + 520: 00004717 auipc a4,0x4 + 524: ba070713 add a4,a4,-1120 # 40c0 + 528: 00251513 sll a0,a0,0x2 + 52c: 00e50533 add a0,a0,a4 + 530: 00052783 lw a5,0(a0) + 534: 00e787b3 add a5,a5,a4 + 538: 00078067 jr a5 + 53c: 00004717 auipc a4,0x4 + 540: d1c70713 add a4,a4,-740 # 4258 + 544: 05500793 li a5,85 + 548: 100006b7 lui a3,0x10000 + 54c: 00f68023 sb a5,0(a3) # 10000000 + 550: 00174783 lbu a5,1(a4) + 554: 00170713 add a4,a4,1 + 558: fe079ae3 bnez a5,54c + 55c: 00814783 lbu a5,8(sp) + 560: 00810713 add a4,sp,8 + 564: 100006b7 lui a3,0x10000 + 568: 00078a63 beqz a5,57c + 56c: 00f68023 sb a5,0(a3) # 10000000 + 570: 00174783 lbu a5,1(a4) + 574: 00170713 add a4,a4,1 + 578: fe079ae3 bnez a5,56c + 57c: 00004717 auipc a4,0x4 + 580: cfc70713 add a4,a4,-772 # 4278 + 584: 00a00793 li a5,10 + 588: 100006b7 lui a3,0x10000 + 58c: 00f68023 sb a5,0(a3) # 10000000 + 590: 00174783 lbu a5,1(a4) + 594: 00170713 add a4,a4,1 + 598: fe079ae3 bnez a5,58c + 59c: fff00513 li a0,-1 + 5a0: ec9ff0ef jal 468 + 5a4: 00004717 auipc a4,0x4 + 5a8: b9c70713 add a4,a4,-1124 # 4140 + 5ac: 04900793 li a5,73 + 5b0: 100006b7 lui a3,0x10000 + 5b4: 00f68023 sb a5,0(a3) # 10000000 + 5b8: 00174783 lbu a5,1(a4) + 5bc: 00170713 add a4,a4,1 + 5c0: fe079ae3 bnez a5,5b4 + 5c4: 00814783 lbu a5,8(sp) + 5c8: 00810713 add a4,sp,8 + 5cc: 100006b7 lui a3,0x10000 + 5d0: fc0786e3 beqz a5,59c + 5d4: 00f68023 sb a5,0(a3) # 10000000 + 5d8: 00174783 lbu a5,1(a4) + 5dc: 00170713 add a4,a4,1 + 5e0: fe079ae3 bnez a5,5d4 + 5e4: fb9ff06f j 59c + 5e8: 00004717 auipc a4,0x4 + 5ec: b8070713 add a4,a4,-1152 # 4168 + 5f0: 04900793 li a5,73 + 5f4: 100006b7 lui a3,0x10000 + 5f8: 00f68023 sb a5,0(a3) # 10000000 + 5fc: 00174783 lbu a5,1(a4) + 600: 00170713 add a4,a4,1 + 604: fe079ae3 bnez a5,5f8 + 608: 00814783 lbu a5,8(sp) + 60c: f80788e3 beqz a5,59c + 610: 00810713 add a4,sp,8 + 614: 100006b7 lui a3,0x10000 + 618: 00f68023 sb a5,0(a3) # 10000000 + 61c: 00174783 lbu a5,1(a4) + 620: 00170713 add a4,a4,1 + 624: fe079ae3 bnez a5,618 + 628: f75ff06f j 59c + 62c: 00004717 auipc a4,0x4 + 630: b6470713 add a4,a4,-1180 # 4190 + 634: 04900793 li a5,73 + 638: 100006b7 lui a3,0x10000 + 63c: 00f68023 sb a5,0(a3) # 10000000 + 640: 00174783 lbu a5,1(a4) + 644: 00170713 add a4,a4,1 + 648: fe079ae3 bnez a5,63c + 64c: 00814783 lbu a5,8(sp) + 650: f40786e3 beqz a5,59c + 654: 00810713 add a4,sp,8 + 658: 100006b7 lui a3,0x10000 + 65c: 00f68023 sb a5,0(a3) # 10000000 + 660: 00174783 lbu a5,1(a4) + 664: 00170713 add a4,a4,1 + 668: fe079ae3 bnez a5,65c + 66c: f31ff06f j 59c + 670: 00004717 auipc a4,0x4 + 674: b4070713 add a4,a4,-1216 # 41b0 + 678: 04c00793 li a5,76 + 67c: 100006b7 lui a3,0x10000 + 680: 00f68023 sb a5,0(a3) # 10000000 + 684: 00174783 lbu a5,1(a4) + 688: 00170713 add a4,a4,1 + 68c: fe079ae3 bnez a5,680 + 690: 00814783 lbu a5,8(sp) + 694: f00784e3 beqz a5,59c + 698: 00810713 add a4,sp,8 + 69c: 100006b7 lui a3,0x10000 + 6a0: 00f68023 sb a5,0(a3) # 10000000 + 6a4: 00174783 lbu a5,1(a4) + 6a8: 00170713 add a4,a4,1 + 6ac: fe079ae3 bnez a5,6a0 + 6b0: eedff06f j 59c + 6b4: 00004717 auipc a4,0x4 + 6b8: b1c70713 add a4,a4,-1252 # 41d0 + 6bc: 04c00793 li a5,76 + 6c0: 100006b7 lui a3,0x10000 + 6c4: 00f68023 sb a5,0(a3) # 10000000 + 6c8: 00174783 lbu a5,1(a4) + 6cc: 00170713 add a4,a4,1 + 6d0: fe079ae3 bnez a5,6c4 + 6d4: 00814783 lbu a5,8(sp) + 6d8: ec0782e3 beqz a5,59c + 6dc: 00810713 add a4,sp,8 + 6e0: 100006b7 lui a3,0x10000 + 6e4: 00f68023 sb a5,0(a3) # 10000000 + 6e8: 00174783 lbu a5,1(a4) + 6ec: 00170713 add a4,a4,1 + 6f0: fe079ae3 bnez a5,6e4 + 6f4: ea9ff06f j 59c + 6f8: 00004717 auipc a4,0x4 + 6fc: af870713 add a4,a4,-1288 # 41f0 + 700: 05300793 li a5,83 + 704: 100006b7 lui a3,0x10000 + 708: 00f68023 sb a5,0(a3) # 10000000 + 70c: 00174783 lbu a5,1(a4) + 710: 00170713 add a4,a4,1 + 714: fe079ae3 bnez a5,708 + 718: 00814783 lbu a5,8(sp) + 71c: e80780e3 beqz a5,59c + 720: 00810713 add a4,sp,8 + 724: 100006b7 lui a3,0x10000 + 728: 00f68023 sb a5,0(a3) # 10000000 + 72c: 00174783 lbu a5,1(a4) + 730: 00170713 add a4,a4,1 + 734: fe079ae3 bnez a5,728 + 738: e65ff06f j 59c + 73c: 00004717 auipc a4,0x4 + 740: adc70713 add a4,a4,-1316 # 4218 + 744: 05300793 li a5,83 + 748: 100006b7 lui a3,0x10000 + 74c: 00f68023 sb a5,0(a3) # 10000000 + 750: 00174783 lbu a5,1(a4) + 754: 00170713 add a4,a4,1 + 758: fe079ae3 bnez a5,74c + 75c: 00814783 lbu a5,8(sp) + 760: e2078ee3 beqz a5,59c + 764: 00810713 add a4,sp,8 + 768: 100006b7 lui a3,0x10000 + 76c: 00f68023 sb a5,0(a3) # 10000000 + 770: 00174783 lbu a5,1(a4) + 774: 00170713 add a4,a4,1 + 778: fe079ae3 bnez a5,76c + 77c: e21ff06f j 59c + 780: 00004717 auipc a4,0x4 + 784: ab870713 add a4,a4,-1352 # 4238 + 788: 04500793 li a5,69 + 78c: 100006b7 lui a3,0x10000 + 790: 00f68023 sb a5,0(a3) # 10000000 + 794: 00174783 lbu a5,1(a4) + 798: 00170713 add a4,a4,1 + 79c: fe079ae3 bnez a5,790 + 7a0: 00814783 lbu a5,8(sp) + 7a4: de078ce3 beqz a5,59c + 7a8: 00810713 add a4,sp,8 + 7ac: 100006b7 lui a3,0x10000 + 7b0: 00f68023 sb a5,0(a3) # 10000000 + 7b4: 00174783 lbu a5,1(a4) + 7b8: 00170713 add a4,a4,1 + 7bc: fe079ae3 bnez a5,7b0 + 7c0: dddff06f j 59c -0000000000000708 <_init>: - 708: ff010113 add sp,sp,-16 - 70c: 00000593 li a1,0 - 710: 00000513 li a0,0 - 714: 00113423 sd ra,8(sp) - 718: 1d8000ef jal 8f0
- 71c: c89ff0ef jal 3a4 +00000000000007c4 : + 7c4: 00051063 bnez a0,7c4 + 7c8: 00008067 ret -0000000000000720 : - 720: 00b567b3 or a5,a0,a1 - 724: 00c7e7b3 or a5,a5,a2 - 728: 0077f793 and a5,a5,7 - 72c: 00c50833 add a6,a0,a2 - 730: 02078463 beqz a5,758 - 734: 00c58633 add a2,a1,a2 - 738: 00050793 mv a5,a0 - 73c: 0b057663 bgeu a0,a6,7e8 - 740: 0005c703 lbu a4,0(a1) - 744: 00158593 add a1,a1,1 - 748: 00178793 add a5,a5,1 - 74c: fee78fa3 sb a4,-1(a5) - 750: fec598e3 bne a1,a2,740 - 754: 00008067 ret - 758: 04050693 add a3,a0,64 - 75c: 0906f863 bgeu a3,a6,7ec - 760: 00058713 mv a4,a1 - 764: 00068793 mv a5,a3 - 768: 00073383 ld t2,0(a4) - 76c: 00873283 ld t0,8(a4) - 770: 01073f83 ld t6,16(a4) - 774: 01873f03 ld t5,24(a4) - 778: 02073e83 ld t4,32(a4) - 77c: 02873e03 ld t3,40(a4) - 780: 03073303 ld t1,48(a4) - 784: 03873883 ld a7,56(a4) - 788: 04078793 add a5,a5,64 - 78c: f877b023 sd t2,-128(a5) - 790: f857b423 sd t0,-120(a5) - 794: f9f7b823 sd t6,-112(a5) - 798: f9e7bc23 sd t5,-104(a5) - 79c: fbd7b023 sd t4,-96(a5) - 7a0: fbc7b423 sd t3,-88(a5) - 7a4: fa67b823 sd t1,-80(a5) - 7a8: fb17bc23 sd a7,-72(a5) - 7ac: 04070713 add a4,a4,64 - 7b0: fb07ece3 bltu a5,a6,768 - 7b4: fbf60613 add a2,a2,-65 - 7b8: fc067793 and a5,a2,-64 - 7bc: 04078793 add a5,a5,64 - 7c0: fc067613 and a2,a2,-64 - 7c4: 00f585b3 add a1,a1,a5 - 7c8: 00c687b3 add a5,a3,a2 - 7cc: f907f4e3 bgeu a5,a6,754 - 7d0: 0005b703 ld a4,0(a1) - 7d4: 00878793 add a5,a5,8 - 7d8: 00858593 add a1,a1,8 - 7dc: fee7bc23 sd a4,-8(a5) - 7e0: ff07e8e3 bltu a5,a6,7d0 - 7e4: 00008067 ret - 7e8: 00008067 ret - 7ec: 00050793 mv a5,a0 - 7f0: fddff06f j 7cc +00000000000007cc <_init>: + 7cc: ff010113 add sp,sp,-16 + 7d0: 00000593 li a1,0 + 7d4: 00000513 li a0,0 + 7d8: 00113423 sd ra,8(sp) + 7dc: 1d8000ef jal 9b4
+ 7e0: c89ff0ef jal 468 -00000000000007f4 : - 7f4: 00c567b3 or a5,a0,a2 - 7f8: 0077f793 and a5,a5,7 - 7fc: 00c50633 add a2,a0,a2 - 800: 0ff5f713 zext.b a4,a1 - 804: 00078e63 beqz a5,820 - 808: 00050793 mv a5,a0 - 80c: 02c57c63 bgeu a0,a2,844 - 810: 00178793 add a5,a5,1 - 814: fee78fa3 sb a4,-1(a5) - 818: fef61ce3 bne a2,a5,810 - 81c: 00008067 ret - 820: 00004797 auipc a5,0x4 - 824: a707b783 ld a5,-1424(a5) # 4290 - 828: 02f70733 mul a4,a4,a5 - 82c: fec578e3 bgeu a0,a2,81c - 830: 00050793 mv a5,a0 - 834: 00878793 add a5,a5,8 - 838: fee7bc23 sd a4,-8(a5) - 83c: fec7ece3 bltu a5,a2,834 - 840: 00008067 ret - 844: 00008067 ret +00000000000007e4 : + 7e4: 00b567b3 or a5,a0,a1 + 7e8: 00c7e7b3 or a5,a5,a2 + 7ec: 0077f793 and a5,a5,7 + 7f0: 00c50833 add a6,a0,a2 + 7f4: 02078463 beqz a5,81c + 7f8: 00c58633 add a2,a1,a2 + 7fc: 00050793 mv a5,a0 + 800: 0b057663 bgeu a0,a6,8ac + 804: 0005c703 lbu a4,0(a1) + 808: 00158593 add a1,a1,1 + 80c: 00178793 add a5,a5,1 + 810: fee78fa3 sb a4,-1(a5) + 814: fec598e3 bne a1,a2,804 + 818: 00008067 ret + 81c: 04050693 add a3,a0,64 + 820: 0906f863 bgeu a3,a6,8b0 + 824: 00058713 mv a4,a1 + 828: 00068793 mv a5,a3 + 82c: 00073383 ld t2,0(a4) + 830: 00873283 ld t0,8(a4) + 834: 01073f83 ld t6,16(a4) + 838: 01873f03 ld t5,24(a4) + 83c: 02073e83 ld t4,32(a4) + 840: 02873e03 ld t3,40(a4) + 844: 03073303 ld t1,48(a4) + 848: 03873883 ld a7,56(a4) + 84c: 04078793 add a5,a5,64 + 850: f877b023 sd t2,-128(a5) + 854: f857b423 sd t0,-120(a5) + 858: f9f7b823 sd t6,-112(a5) + 85c: f9e7bc23 sd t5,-104(a5) + 860: fbd7b023 sd t4,-96(a5) + 864: fbc7b423 sd t3,-88(a5) + 868: fa67b823 sd t1,-80(a5) + 86c: fb17bc23 sd a7,-72(a5) + 870: 04070713 add a4,a4,64 + 874: fb07ece3 bltu a5,a6,82c + 878: fbf60613 add a2,a2,-65 + 87c: fc067793 and a5,a2,-64 + 880: 04078793 add a5,a5,64 + 884: fc067613 and a2,a2,-64 + 888: 00f585b3 add a1,a1,a5 + 88c: 00c687b3 add a5,a3,a2 + 890: f907f4e3 bgeu a5,a6,818 + 894: 0005b703 ld a4,0(a1) + 898: 00878793 add a5,a5,8 + 89c: 00858593 add a1,a1,8 + 8a0: fee7bc23 sd a4,-8(a5) + 8a4: ff07e8e3 bltu a5,a6,894 + 8a8: 00008067 ret + 8ac: 00008067 ret + 8b0: 00050793 mv a5,a0 + 8b4: fddff06f j 890 -0000000000000848 : - 848: 00054783 lbu a5,0(a0) - 84c: 00078e63 beqz a5,868 - 850: 00050793 mv a5,a0 - 854: 0017c703 lbu a4,1(a5) - 858: 00178793 add a5,a5,1 - 85c: fe071ce3 bnez a4,854 - 860: 40a78533 sub a0,a5,a0 - 864: 00008067 ret - 868: 00000513 li a0,0 - 86c: 00008067 ret +00000000000008b8 : + 8b8: 00c567b3 or a5,a0,a2 + 8bc: 0077f793 and a5,a5,7 + 8c0: 00c50633 add a2,a0,a2 + 8c4: 0ff5f713 zext.b a4,a1 + 8c8: 00078e63 beqz a5,8e4 + 8cc: 00050793 mv a5,a0 + 8d0: 02c57c63 bgeu a0,a2,908 + 8d4: 00178793 add a5,a5,1 + 8d8: fee78fa3 sb a4,-1(a5) + 8dc: fef61ce3 bne a2,a5,8d4 + 8e0: 00008067 ret + 8e4: 00004797 auipc a5,0x4 + 8e8: 9ac7b783 ld a5,-1620(a5) # 4290 + 8ec: 02f70733 mul a4,a4,a5 + 8f0: fec578e3 bgeu a0,a2,8e0 + 8f4: 00050793 mv a5,a0 + 8f8: 00878793 add a5,a5,8 + 8fc: fee7bc23 sd a4,-8(a5) + 900: fec7ece3 bltu a5,a2,8f8 + 904: 00008067 ret + 908: 00008067 ret -0000000000000870 : - 870: 00b506b3 add a3,a0,a1 - 874: 00050793 mv a5,a0 - 878: 00059863 bnez a1,888 - 87c: 0240006f j 8a0 - 880: 00178793 add a5,a5,1 - 884: 00f68a63 beq a3,a5,898 - 888: 0007c703 lbu a4,0(a5) - 88c: fe071ae3 bnez a4,880 - 890: 40a78533 sub a0,a5,a0 - 894: 00008067 ret - 898: 40a68533 sub a0,a3,a0 - 89c: 00008067 ret - 8a0: 00000513 li a0,0 - 8a4: 00008067 ret +000000000000090c : + 90c: 00054783 lbu a5,0(a0) + 910: 00078e63 beqz a5,92c + 914: 00050793 mv a5,a0 + 918: 0017c703 lbu a4,1(a5) + 91c: 00178793 add a5,a5,1 + 920: fe071ce3 bnez a4,918 + 924: 40a78533 sub a0,a5,a0 + 928: 00008067 ret + 92c: 00000513 li a0,0 + 930: 00008067 ret -00000000000008a8 : - 8a8: 00054783 lbu a5,0(a0) - 8ac: 00158593 add a1,a1,1 - 8b0: 00150513 add a0,a0,1 - 8b4: fff5c703 lbu a4,-1(a1) - 8b8: 00078a63 beqz a5,8cc - 8bc: fee786e3 beq a5,a4,8a8 - 8c0: 0007851b sext.w a0,a5 - 8c4: 40e5053b subw a0,a0,a4 - 8c8: 00008067 ret - 8cc: 00000513 li a0,0 - 8d0: ff5ff06f j 8c4 +0000000000000934 : + 934: 00b506b3 add a3,a0,a1 + 938: 00050793 mv a5,a0 + 93c: 00059863 bnez a1,94c + 940: 0240006f j 964 + 944: 00178793 add a5,a5,1 + 948: 00f68a63 beq a3,a5,95c + 94c: 0007c703 lbu a4,0(a5) + 950: fe071ae3 bnez a4,944 + 954: 40a78533 sub a0,a5,a0 + 958: 00008067 ret + 95c: 40a68533 sub a0,a3,a0 + 960: 00008067 ret + 964: 00000513 li a0,0 + 968: 00008067 ret -00000000000008d4 : - 8d4: 00050793 mv a5,a0 - 8d8: 0005c703 lbu a4,0(a1) - 8dc: 00178793 add a5,a5,1 - 8e0: 00158593 add a1,a1,1 - 8e4: fee78fa3 sb a4,-1(a5) - 8e8: fe0718e3 bnez a4,8d8 - 8ec: 00008067 ret +000000000000096c : + 96c: 00054783 lbu a5,0(a0) + 970: 00158593 add a1,a1,1 + 974: 00150513 add a0,a0,1 + 978: fff5c703 lbu a4,-1(a1) + 97c: 00078a63 beqz a5,990 + 980: fee786e3 beq a5,a4,96c + 984: 0007851b sext.w a0,a5 + 988: 40e5053b subw a0,a0,a4 + 98c: 00008067 ret + 990: 00000513 li a0,0 + 994: ff5ff06f j 988 + +0000000000000998 : + 998: 00050793 mv a5,a0 + 99c: 0005c703 lbu a4,0(a1) + 9a0: 00178793 add a5,a5,1 + 9a4: 00158593 add a1,a1,1 + 9a8: fee78fa3 sb a4,-1(a5) + 9ac: fe0718e3 bnez a4,99c + 9b0: 00008067 ret Disassembly of section .text.startup: -00000000000008f0
: - 8f0: fa010113 add sp,sp,-96 - 8f4: 04813823 sd s0,80(sp) - 8f8: 04113c23 sd ra,88(sp) - 8fc: 04913423 sd s1,72(sp) - 900: 05213023 sd s2,64(sp) - 904: 03313c23 sd s3,56(sp) - 908: 03413823 sd s4,48(sp) - 90c: 03513423 sd s5,40(sp) - 910: 00004617 auipc a2,0x4 - 914: 98860613 add a2,a2,-1656 # 4298 - 918: 00003697 auipc a3,0x3 - 91c: 6e868693 add a3,a3,1768 # 4000 - 920: 00003717 auipc a4,0x3 - 924: 74070713 add a4,a4,1856 # 4060 - 928: 02900413 li s0,41 - 92c: 0c8475d7 vsetvli a1,s0,e16,m1,ta,ma - 930: 0005879b sext.w a5,a1 - 934: 02075507 vle16.v v10,(a4) - 938: 0206d587 vle16.v v11,(a3) - 93c: 9ea5a657 vmulh.vv v12,v10,v11 - 940: 02065627 vse16.v v12,(a2) - 944: 00179793 sll a5,a5,0x1 - 948: 40b4043b subw s0,s0,a1 - 94c: 00f70733 add a4,a4,a5 - 950: 00f686b3 add a3,a3,a5 - 954: 00f60633 add a2,a2,a5 - 958: fc041ae3 bnez s0,92c - 95c: 86818493 add s1,gp,-1944 # 42f8 - 960: 00003717 auipc a4,0x3 - 964: 70070713 add a4,a4,1792 # 4060 - 968: 00003617 auipc a2,0x3 - 96c: 69860613 add a2,a2,1688 # 4000 - 970: 00003517 auipc a0,0x3 - 974: 74250513 add a0,a0,1858 # 40b2 - 978: 00048693 mv a3,s1 - 97c: 00071783 lh a5,0(a4) - 980: 00061583 lh a1,0(a2) - 984: 00268693 add a3,a3,2 - 988: 00270713 add a4,a4,2 - 98c: 02b787bb mulw a5,a5,a1 - 990: 00260613 add a2,a2,2 - 994: 4107d79b sraw a5,a5,0x10 - 998: fef69f23 sh a5,-2(a3) - 99c: fea710e3 bne a4,a0,97c - 9a0: 00004917 auipc s2,0x4 - 9a4: 8f890913 add s2,s2,-1800 # 4298 - 9a8: 00100693 li a3,1 - 9ac: 00003a17 auipc s4,0x3 - 9b0: 744a0a13 add s4,s4,1860 # 40f0 - 9b4: 00003a97 auipc s5,0x3 - 9b8: 75ca8a93 add s5,s5,1884 # 4110 - 9bc: 02900993 li s3,41 - 9c0: 00091703 lh a4,0(s2) - 9c4: 00049783 lh a5,0(s1) - 9c8: 000a0513 mv a0,s4 - 9cc: 00290913 add s2,s2,2 - 9d0: 00248493 add s1,s1,2 - 9d4: 02f70463 beq a4,a5,9fc - 9d8: 895ff0ef jal 26c - 9dc: 00810593 add a1,sp,8 - 9e0: 00040513 mv a0,s0 - 9e4: 801ff0ef jal 1e4 - 9e8: 00810513 add a0,sp,8 - 9ec: 881ff0ef jal 26c - 9f0: 000a8513 mv a0,s5 - 9f4: 879ff0ef jal 26c - 9f8: 00000693 li a3,0 - 9fc: 0014041b addw s0,s0,1 - a00: fd3410e3 bne s0,s3,9c0 - a04: 05813083 ld ra,88(sp) - a08: 05013403 ld s0,80(sp) - a0c: 04813483 ld s1,72(sp) - a10: 04013903 ld s2,64(sp) - a14: 03813983 ld s3,56(sp) - a18: 03013a03 ld s4,48(sp) - a1c: 02813a83 ld s5,40(sp) - a20: 0016c513 xor a0,a3,1 - a24: 06010113 add sp,sp,96 - a28: 00008067 ret - a2c: fff00513 li a0,-1 - a30: 00008067 ret +00000000000009b4
: + 9b4: fe010113 add sp,sp,-32 + 9b8: 00113c23 sd ra,24(sp) + 9bc: 00813823 sd s0,16(sp) + 9c0: 00913423 sd s1,8(sp) + 9c4: 01213023 sd s2,0(sp) + 9c8: 00004597 auipc a1,0x4 + 9cc: 8d058593 add a1,a1,-1840 # 4298 + 9d0: 00003617 auipc a2,0x3 + 9d4: 63060613 add a2,a2,1584 # 4000 + 9d8: 00003697 auipc a3,0x3 + 9dc: 68868693 add a3,a3,1672 # 4060 + 9e0: 02900713 li a4,41 + 9e4: 0c877557 vsetvli a0,a4,e16,m1,ta,ma + 9e8: 0005079b sext.w a5,a0 + 9ec: 0206d507 vle16.v v10,(a3) + 9f0: 02065587 vle16.v v11,(a2) + 9f4: 9ea5a657 vmulh.vv v12,v10,v11 + 9f8: 0205d627 vse16.v v12,(a1) + 9fc: 00179793 sll a5,a5,0x1 + a00: 40a7073b subw a4,a4,a0 + a04: 00f686b3 add a3,a3,a5 + a08: 00f60633 add a2,a2,a5 + a0c: 00f585b3 add a1,a1,a5 + a10: fc071ae3 bnez a4,9e4 + a14: 00003417 auipc s0,0x3 + a18: 64c40413 add s0,s0,1612 # 4060 + a1c: 86818493 add s1,gp,-1944 # 42f8 + a20: 00003617 auipc a2,0x3 + a24: 5e060613 add a2,a2,1504 # 4000 + a28: 00003917 auipc s2,0x3 + a2c: 68a90913 add s2,s2,1674 # 40b2 + a30: 00048693 mv a3,s1 + a34: 00040713 mv a4,s0 + a38: 00071783 lh a5,0(a4) + a3c: 00061583 lh a1,0(a2) + a40: 00268693 add a3,a3,2 + a44: 00270713 add a4,a4,2 + a48: 02b787bb mulw a5,a5,a1 + a4c: 00260613 add a2,a2,2 + a50: 4107d79b sraw a5,a5,0x10 + a54: fef69f23 sh a5,-2(a3) + a58: ff2710e3 bne a4,s2,a38 + a5c: 02900613 li a2,41 + a60: 86818593 add a1,gp,-1944 # 42f8 + a64: 00004517 auipc a0,0x4 + a68: 83450513 add a0,a0,-1996 # 4298 + a6c: f6cff0ef jal 1d8 + a70: 00050813 mv a6,a0 + a74: 00004617 auipc a2,0x4 + a78: 82460613 add a2,a2,-2012 # 4298 + a7c: 00003697 auipc a3,0x3 + a80: 5e468693 add a3,a3,1508 # 4060 + a84: 02900713 li a4,41 + a88: 0c8775d7 vsetvli a1,a4,e16,m1,ta,ma + a8c: 0005879b sext.w a5,a1 + a90: 000042b7 lui t0,0x4 + a94: 5452829b addw t0,t0,1349 # 4545 <_tbss_end+0x1ed> + a98: 0206d507 vle16.v v10,(a3) + a9c: 9ea2e657 vmulh.vx v12,v10,t0 + aa0: 02065627 vse16.v v12,(a2) + aa4: 00179793 sll a5,a5,0x1 + aa8: 40b7073b subw a4,a4,a1 + aac: 00f686b3 add a3,a3,a5 + ab0: 00f60633 add a2,a2,a5 + ab4: fc071ae3 bnez a4,a88 + ab8: 00004737 lui a4,0x4 + abc: 5457071b addw a4,a4,1349 # 4545 <_tbss_end+0x1ed> + ac0: 00041783 lh a5,0(s0) + ac4: 00248493 add s1,s1,2 + ac8: 00240413 add s0,s0,2 + acc: 02e787bb mulw a5,a5,a4 + ad0: 4107d79b sraw a5,a5,0x10 + ad4: fef49f23 sh a5,-2(s1) + ad8: ff2414e3 bne s0,s2,ac0 + adc: 00100513 li a0,1 + ae0: 00081e63 bnez a6,afc + ae4: 01813083 ld ra,24(sp) + ae8: 01013403 ld s0,16(sp) + aec: 00813483 ld s1,8(sp) + af0: 00013903 ld s2,0(sp) + af4: 02010113 add sp,sp,32 + af8: 00008067 ret + afc: 02900613 li a2,41 + b00: 86818593 add a1,gp,-1944 # 42f8 + b04: 00003517 auipc a0,0x3 + b08: 79450513 add a0,a0,1940 # 4298 + b0c: eccff0ef jal 1d8 + b10: 00154513 xor a0,a0,1 + b14: 0ff57513 zext.b a0,a0 + b18: fcdff06f j ae4 + b1c: fff00513 li a0,-1 + b20: 00008067 ret Disassembly of section .rodata: @@ -776,29 +838,29 @@ Disassembly of section .rodata: 40ba: 57c9 .2byte 0x57c9 40bc: d555 .2byte 0xd555 40be: 938e .2byte 0x938e - 40c0: c420 vmsge.vx v8,v0,ra,v0.t + 40c0: c4e4 .2byte 0xc4e4 40c2: ffff .2byte 0xffff - 40c4: c464 .2byte 0xc464 + 40c4: c528 .2byte 0xc528 40c6: ffff .2byte 0xffff - 40c8: c4a8 .2byte 0xc4a8 + 40c8: c56c .2byte 0xc56c 40ca: ffff .2byte 0xffff - 40cc: c3b8 .2byte 0xc3b8 + 40cc: c47c .2byte 0xc47c 40ce: ffff .2byte 0xffff - 40d0: c4ec .2byte 0xc4ec + 40d0: c5b0 .2byte 0xc5b0 40d2: ffff .2byte 0xffff - 40d4: c530 .2byte 0xc530 + 40d4: c5f4 .2byte 0xc5f4 40d6: ffff .2byte 0xffff - 40d8: c574 .2byte 0xc574 + 40d8: c638 .2byte 0xc638 40da: ffff .2byte 0xffff - 40dc: c5b8 .2byte 0xc5b8 + 40dc: c67c .2byte 0xc67c 40de: ffff .2byte 0xffff - 40e0: c3b8 .2byte 0xc3b8 + 40e0: c47c .2byte 0xc47c 40e2: ffff .2byte 0xffff - 40e4: c3b8 .2byte 0xc3b8 + 40e4: c47c .2byte 0xc47c 40e6: ffff .2byte 0xffff - 40e8: c3b8 .2byte 0xc3b8 + 40e8: c47c .2byte 0xc47c 40ea: ffff .2byte 0xffff - 40ec: c5fc .2byte 0xc5fc + 40ec: c6c0 vmsge.vx v13,v0,ra,v0.t 40ee: ffff .2byte 0xffff Disassembly of section .rodata.str1.8: diff --git a/src/main/resources/applications_vector/vmulh/vmulh.c b/src/main/resources/applications_vector/vmulh/vmulh.c index 0521bfd1..3cb65ef7 100644 --- a/src/main/resources/applications_vector/vmulh/vmulh.c +++ b/src/main/resources/applications_vector/vmulh/vmulh.c @@ -14,6 +14,33 @@ extern void int32ToHex(int num, char* str); extern void clearCounters(); extern void printCounters(); +// #define DEBUG + +_Bool verifyResult(const unsigned short* ptr0, const unsigned short* ptr1, size_t n) { + int i; + _Bool correct = 1; + char string[19]; + for(i=0; i> 16) & 0xFFFF); + answerArray[i] = (signed short)(((signed int)dataArray0[i] * (signed int)dataArray1[i]) >> 16); } - _Bool correct = 1; - char string[19]; + _Bool correct = verifyResult(resultArray, answerArray, 41); + ptr0 = dataArray0; + ptr2 = resultArray; + avl = 41; + while(avl != 0) { + asm volatile ("vsetvli %0, %1, e16, m1, ta, ma" + : "=r"(vl) + : "r"(avl)); + asm volatile ("li t0, 0x4545"); + asm volatile ("vle16.v v10, (%0)" + : + : "r"(ptr0)); + asm volatile ("vmulh.vx v12, v10, t0"); + asm volatile ("vse16.v v12, (%0)" + : + : "r"(ptr2)); + ptr0 += vl; + ptr2 += vl; + avl -= vl; + } for(i=0; i<41; i++) { - if(resultArray[i] != answerArray[i]) { - printstr("ARRAY NOT CORRECT IN INDEX: "); - int32ToHex(i, string); - printstr(string); - printstr("\n"); - correct = 0; - } + answerArray[i] = (signed short)(((signed int)dataArray0[i] * (signed int)0x4545) >> 16); } + correct = correct && verifyResult(resultArray, answerArray, 41); return !correct; } - diff --git a/src/main/resources/applications_vector/vmulh_data.hex b/src/main/resources/applications_vector/vmulh_data.hex index 6e571e15..593aba98 100644 --- a/src/main/resources/applications_vector/vmulh_data.hex +++ b/src/main/resources/applications_vector/vmulh_data.hex @@ -46,18 +46,18 @@ ec1f1c41 0d932479 57c94a55 938ed555 -ffffc420 -ffffc464 -ffffc4a8 -ffffc3b8 -ffffc4ec -ffffc530 -ffffc574 -ffffc5b8 -ffffc3b8 -ffffc3b8 -ffffc3b8 -ffffc5fc +ffffc4e4 +ffffc528 +ffffc56c +ffffc47c +ffffc5b0 +ffffc5f4 +ffffc638 +ffffc67c +ffffc47c +ffffc47c +ffffc47c +ffffc6c0 41525241 4f4e2059 4f432054 diff --git a/src/main/resources/applications_vector/vmulh_inst.hex b/src/main/resources/applications_vector/vmulh_inst.hex index bf8f5eca..924915d2 100644 --- a/src/main/resources/applications_vector/vmulh_inst.hex +++ b/src/main/resources/applications_vector/vmulh_inst.hex @@ -42,7 +42,7 @@ f1402573 00b57063 00006137 ff01011b -6580006f +71c0006f ef010113 00113423 00213823 @@ -78,7 +78,7 @@ ef010113 34202573 341025f3 00010613 -2d0000ef +394000ef 34151073 000022b7 8002829b @@ -116,6 +116,55 @@ ef010113 0f813f83 11010113 30200073 +0ac05c63 +fa010113 +00161613 +04813823 +04913423 +05213023 +03313c23 +03413823 +03513423 +04113c23 +00050413 +00058493 +00c509b3 +00100693 +00000913 +00004a17 +edca0a13 +00004a97 +ef4a8a93 +00045703 +0004d783 +000a0513 +00240413 +00248493 +02f70463 +0f4000ef +00810593 +00090513 +060000ef +00810513 +0e0000ef +000a8513 +0d8000ef +00000693 +0019091b +fd3410e3 +05813083 +05013403 +04813483 +04013903 +03813983 +03013a03 +02813a83 +00068513 +06010113 +00008067 +00100693 +00068513 +00008067 b0201073 b0001073 00008067 @@ -165,7 +214,7 @@ fe010113 c0202673 c00025f3 00004717 -e8070713 +dbc70713 06300793 100006b7 00f68023 @@ -197,7 +246,7 @@ fee812e3 00168693 fe071ae3 00004697 -e0868693 +d4468693 00a00713 100005b7 00e58023 @@ -236,7 +285,7 @@ fe010113 00113c23 00050413 00004717 -d7c70713 +cb870713 04500793 100006b7 00f68023 @@ -278,14 +327,14 @@ ff0792e3 00b00793 02a7e063 00004717 -c6470713 +ba070713 00251513 00e50533 00052783 00e787b3 00078067 00004717 -de070713 +d1c70713 05500793 100006b7 00f68023 @@ -301,7 +350,7 @@ fe079ae3 00170713 fe079ae3 00004717 -dc070713 +cfc70713 00a00793 100006b7 00f68023 @@ -311,7 +360,7 @@ fe079ae3 fff00513 ec9ff0ef 00004717 -c6070713 +b9c70713 04900793 100006b7 00f68023 @@ -328,7 +377,7 @@ fc0786e3 fe079ae3 fb9ff06f 00004717 -c4470713 +b8070713 04900793 100006b7 00f68023 @@ -345,7 +394,7 @@ f80788e3 fe079ae3 f75ff06f 00004717 -c2870713 +b6470713 04900793 100006b7 00f68023 @@ -362,7 +411,7 @@ f40786e3 fe079ae3 f31ff06f 00004717 -c0470713 +b4070713 04c00793 100006b7 00f68023 @@ -379,7 +428,7 @@ f00784e3 fe079ae3 eedff06f 00004717 -be070713 +b1c70713 04c00793 100006b7 00f68023 @@ -396,7 +445,7 @@ ec0782e3 fe079ae3 ea9ff06f 00004717 -bbc70713 +af870713 05300793 100006b7 00f68023 @@ -413,7 +462,7 @@ e80780e3 fe079ae3 e65ff06f 00004717 -ba070713 +adc70713 05300793 100006b7 00f68023 @@ -430,7 +479,7 @@ e2078ee3 fe079ae3 e21ff06f 00004717 -b7c70713 +ab870713 04500793 100006b7 00f68023 @@ -519,7 +568,7 @@ fee78fa3 fef61ce3 00008067 00004797 -a707b783 +9ac7b783 02f70733 fec578e3 00050793 @@ -570,41 +619,39 @@ ff5ff06f fee78fa3 fe0718e3 00008067 -fa010113 -04813823 -04113c23 -04913423 -05213023 -03313c23 -03413823 -03513423 -00004617 -98860613 +fe010113 +00113c23 +00813823 +00913423 +01213023 +00004597 +8d058593 +00003617 +63060613 00003697 -6e868693 -00003717 -74070713 -02900413 -0c8475d7 -0005879b -02075507 -0206d587 +68868693 +02900713 +0c877557 +0005079b +0206d507 +02065587 9ea5a657 -02065627 +0205d627 00179793 -40b4043b -00f70733 +40a7073b 00f686b3 00f60633 -fc041ae3 +00f585b3 +fc071ae3 +00003417 +64c40413 86818493 -00003717 -70070713 00003617 -69860613 -00003517 -74250513 +5e060613 +00003917 +68a90913 00048693 +00040713 00071783 00061583 00268693 @@ -613,41 +660,54 @@ fc041ae3 00260613 4107d79b fef69f23 -fea710e3 -00004917 -8f890913 -00100693 -00003a17 -744a0a13 -00003a97 -75ca8a93 -02900993 -00091703 -00049783 -000a0513 -00290913 +ff2710e3 +02900613 +86818593 +00004517 +83450513 +f6cff0ef +00050813 +00004617 +82460613 +00003697 +5e468693 +02900713 +0c8775d7 +0005879b +000042b7 +5452829b +0206d507 +9ea2e657 +02065627 +00179793 +40b7073b +00f686b3 +00f60633 +fc071ae3 +00004737 +5457071b +00041783 00248493 -02f70463 -895ff0ef -00810593 -00040513 -801ff0ef -00810513 -881ff0ef -000a8513 -879ff0ef -00000693 -0014041b -fd3410e3 -05813083 -05013403 -04813483 -04013903 -03813983 -03013a03 -02813a83 -0016c513 -06010113 +00240413 +02e787bb +4107d79b +fef49f23 +ff2414e3 +00100513 +00081e63 +01813083 +01013403 +00813483 +00013903 +02010113 00008067 +02900613 +86818593 +00003517 +79450513 +eccff0ef +00154513 +0ff57513 +fcdff06f fff00513 00008067 From 83bc831649c7c15e9eca8472e28ad2f9db35c2c5 Mon Sep 17 00:00:00 2001 From: HidetaroTanaka Date: Fri, 10 Nov 2023 14:04:49 +0900 Subject: [PATCH 7/8] a --- .../resources/applications_vector/build.sh | 19 + .../resources/applications_vector/vmulhu.dump | 1110 +++++++++++++++++ .../applications_vector/vmulhu/vmulhu.c | 100 ++ .../applications_vector/vmulhu_data.hex | 166 +++ .../applications_vector/vmulhu_inst.hex | 713 +++++++++++ .../hajime/vectormodules/VectorCpuSpec.scala | 4 +- 6 files changed, 2110 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/applications_vector/vmulhu.dump create mode 100644 src/main/resources/applications_vector/vmulhu/vmulhu.c create mode 100644 src/main/resources/applications_vector/vmulhu_data.hex create mode 100644 src/main/resources/applications_vector/vmulhu_inst.hex diff --git a/src/main/resources/applications_vector/build.sh b/src/main/resources/applications_vector/build.sh index ab7ffdcc..5118e832 100644 --- a/src/main/resources/applications_vector/build.sh +++ b/src/main/resources/applications_vector/build.sh @@ -417,4 +417,23 @@ hexdump -v -e '1/4 "%08x" "\n"' vmulh_text_startup.bin > vmulh_text_startup.temp cat vmulh_rodata.temp vmulh_rodata_str1_8.temp vmulh_sdata.temp > vmulh_data.hex cat vmulh_text_init.temp vmulh_text.temp vmulh_text_startup.temp > vmulh_inst.hex +riscv64-unknown-elf-gcc -I ../application_headers -DPREALLOCATE=1 -mcmodel=medany -static -std=gnu99 -O2 -fno-common -fno-builtin-printf -fno-tree-loop-distribute-patterns -march=rv64im_zicsr_zve64x -mabi=lp64 -o vmulhu.riscv ./vmulhu/vmulhu.c ../application_headers/syscalls.c ../application_headers/crt.S -static -nostdlib -nostartfiles -T ../application_headers/test.ld +riscv64-unknown-elf-objdump --disassemble-all vmulhu.riscv > vmulhu.dump +riscv64-unknown-elf-objdump --disassemble-all vmulhu.riscv > vmulhu.dump +riscv64-unknown-elf-objcopy --dump-section .rodata=vmulhu_rodata.bin vmulhu.riscv +riscv64-unknown-elf-objcopy --dump-section .rodata.str1.8=vmulhu_rodata_str1_8.bin vmulhu.riscv +riscv64-unknown-elf-objcopy --dump-section .sdata=vmulhu_sdata.bin vmulhu.riscv +riscv64-unknown-elf-objcopy --dump-section .text.init=vmulhu_text_init.bin vmulhu.riscv +riscv64-unknown-elf-objcopy --dump-section .text=vmulhu_text.bin vmulhu.riscv +riscv64-unknown-elf-objcopy --dump-section .text.startup=vmulhu_text_startup.bin vmulhu.riscv +hexdump -v -e '1/4 "%08x" "\n"' vmulhu_rodata.bin > vmulhu_rodata.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulhu_rodata_str1_8.bin > vmulhu_rodata_str1_8.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulhu_sdata.bin > vmulhu_sdata.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulhu_text_init.bin > vmulhu_text_init.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulhu_text.bin > vmulhu_text.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulhu_text_startup.bin > vmulhu_text_startup.temp +cat vmulhu_rodata.temp vmulhu_rodata_str1_8.temp vmulhu_sdata.temp > vmulhu_data.hex +cat vmulhu_text_init.temp vmulhu_text.temp vmulhu_text_startup.temp > vmulhu_inst.hex + + rm *.riscv *.bin *.temp \ No newline at end of file diff --git a/src/main/resources/applications_vector/vmulhu.dump b/src/main/resources/applications_vector/vmulhu.dump new file mode 100644 index 00000000..94102f58 --- /dev/null +++ b/src/main/resources/applications_vector/vmulhu.dump @@ -0,0 +1,1110 @@ + +vmulhu.riscv: file format elf64-littleriscv + + +Disassembly of section .text.init: + +0000000000000000 <_start>: + 0: 00000093 li ra,0 + 4: 00000113 li sp,0 + 8: 00000193 li gp,0 + c: 00000213 li tp,0 + 10: 00000293 li t0,0 + 14: 00000313 li t1,0 + 18: 00000393 li t2,0 + 1c: 00000413 li s0,0 + 20: 00000493 li s1,0 + 24: 00000513 li a0,0 + 28: 00000593 li a1,0 + 2c: 00000613 li a2,0 + 30: 00000693 li a3,0 + 34: 00000713 li a4,0 + 38: 00000793 li a5,0 + 3c: 00000813 li a6,0 + 40: 00000893 li a7,0 + 44: 00000913 li s2,0 + 48: 00000993 li s3,0 + 4c: 00000a13 li s4,0 + 50: 00000a93 li s5,0 + 54: 00000b13 li s6,0 + 58: 00000b93 li s7,0 + 5c: 00000c13 li s8,0 + 60: 00000c93 li s9,0 + 64: 00000d13 li s10,0 + 68: 00000d93 li s11,0 + 6c: 00000e13 li t3,0 + 70: 00000e93 li t4,0 + 74: 00000f13 li t5,0 + 78: 00000f93 li t6,0 + 7c: 00000297 auipc t0,0x0 + 80: 03828293 add t0,t0,56 # b4 + 84: 30529073 csrw mtvec,t0 + 88: 00005197 auipc gp,0x5 + 8c: a0818193 add gp,gp,-1528 # 4a90 <__global_pointer$> + 90: 10000217 auipc tp,0x10000 + 94: ff720213 add tp,tp,-9 # 10000087 <_end+0x3f> + 98: fc027213 and tp,tp,-64 + 9c: f1402573 csrr a0,mhartid + a0: 00100593 li a1,1 + a4: 00b57063 bgeu a0,a1,a4 <_start+0xa4> + a8: 00006137 lui sp,0x6 + ac: ff01011b addw sp,sp,-16 # 5ff0 <__global_pointer$+0x1560> + b0: 71c0006f j 7cc <_init> + +00000000000000b4 : + b4: ef010113 add sp,sp,-272 + b8: 00113423 sd ra,8(sp) + bc: 00213823 sd sp,16(sp) + c0: 00313c23 sd gp,24(sp) + c4: 02413023 sd tp,32(sp) + c8: 02513423 sd t0,40(sp) + cc: 02613823 sd t1,48(sp) + d0: 02713c23 sd t2,56(sp) + d4: 04813023 sd s0,64(sp) + d8: 04913423 sd s1,72(sp) + dc: 04a13823 sd a0,80(sp) + e0: 04b13c23 sd a1,88(sp) + e4: 06c13023 sd a2,96(sp) + e8: 06d13423 sd a3,104(sp) + ec: 06e13823 sd a4,112(sp) + f0: 06f13c23 sd a5,120(sp) + f4: 09013023 sd a6,128(sp) + f8: 09113423 sd a7,136(sp) + fc: 09213823 sd s2,144(sp) + 100: 09313c23 sd s3,152(sp) + 104: 0b413023 sd s4,160(sp) + 108: 0b513423 sd s5,168(sp) + 10c: 0b613823 sd s6,176(sp) + 110: 0b713c23 sd s7,184(sp) + 114: 0d813023 sd s8,192(sp) + 118: 0d913423 sd s9,200(sp) + 11c: 0da13823 sd s10,208(sp) + 120: 0db13c23 sd s11,216(sp) + 124: 0fc13023 sd t3,224(sp) + 128: 0fd13423 sd t4,232(sp) + 12c: 0fe13823 sd t5,240(sp) + 130: 0ff13c23 sd t6,248(sp) + 134: 34202573 csrr a0,mcause + 138: 341025f3 csrr a1,mepc + 13c: 00010613 mv a2,sp + 140: 394000ef jal 4d4 + 144: 34151073 csrw mepc,a0 + 148: 000022b7 lui t0,0x2 + 14c: 8002829b addw t0,t0,-2048 # 1800 + 150: 3002a073 csrs mstatus,t0 + 154: 00813083 ld ra,8(sp) + 158: 01013103 ld sp,16(sp) + 15c: 01813183 ld gp,24(sp) + 160: 02013203 ld tp,32(sp) + 164: 02813283 ld t0,40(sp) + 168: 03013303 ld t1,48(sp) + 16c: 03813383 ld t2,56(sp) + 170: 04013403 ld s0,64(sp) + 174: 04813483 ld s1,72(sp) + 178: 05013503 ld a0,80(sp) + 17c: 05813583 ld a1,88(sp) + 180: 06013603 ld a2,96(sp) + 184: 06813683 ld a3,104(sp) + 188: 07013703 ld a4,112(sp) + 18c: 07813783 ld a5,120(sp) + 190: 08013803 ld a6,128(sp) + 194: 08813883 ld a7,136(sp) + 198: 09013903 ld s2,144(sp) + 19c: 09813983 ld s3,152(sp) + 1a0: 0a013a03 ld s4,160(sp) + 1a4: 0a813a83 ld s5,168(sp) + 1a8: 0b013b03 ld s6,176(sp) + 1ac: 0b813b83 ld s7,184(sp) + 1b0: 0c013c03 ld s8,192(sp) + 1b4: 0c813c83 ld s9,200(sp) + 1b8: 0d013d03 ld s10,208(sp) + 1bc: 0d813d83 ld s11,216(sp) + 1c0: 0e013e03 ld t3,224(sp) + 1c4: 0e813e83 ld t4,232(sp) + 1c8: 0f013f03 ld t5,240(sp) + 1cc: 0f813f83 ld t6,248(sp) + 1d0: 11010113 add sp,sp,272 + 1d4: 30200073 mret + +Disassembly of section .text: + +00000000000001d8 : + 1d8: 0ac05c63 blez a2,290 + 1dc: fa010113 add sp,sp,-96 + 1e0: 00161613 sll a2,a2,0x1 + 1e4: 04813823 sd s0,80(sp) + 1e8: 04913423 sd s1,72(sp) + 1ec: 05213023 sd s2,64(sp) + 1f0: 03313c23 sd s3,56(sp) + 1f4: 03413823 sd s4,48(sp) + 1f8: 03513423 sd s5,40(sp) + 1fc: 04113c23 sd ra,88(sp) + 200: 00050413 mv s0,a0 + 204: 00058493 mv s1,a1 + 208: 00c509b3 add s3,a0,a2 + 20c: 00100693 li a3,1 + 210: 00000913 li s2,0 + 214: 00004a17 auipc s4,0x4 + 218: edca0a13 add s4,s4,-292 # 40f0 + 21c: 00004a97 auipc s5,0x4 + 220: ef4a8a93 add s5,s5,-268 # 4110 + 224: 00045703 lhu a4,0(s0) + 228: 0004d783 lhu a5,0(s1) + 22c: 000a0513 mv a0,s4 + 230: 00240413 add s0,s0,2 + 234: 00248493 add s1,s1,2 + 238: 02f70463 beq a4,a5,260 + 23c: 0f4000ef jal 330 + 240: 00810593 add a1,sp,8 + 244: 00090513 mv a0,s2 + 248: 060000ef jal 2a8 + 24c: 00810513 add a0,sp,8 + 250: 0e0000ef jal 330 + 254: 000a8513 mv a0,s5 + 258: 0d8000ef jal 330 + 25c: 00000693 li a3,0 + 260: 0019091b addw s2,s2,1 + 264: fd3410e3 bne s0,s3,224 + 268: 05813083 ld ra,88(sp) + 26c: 05013403 ld s0,80(sp) + 270: 04813483 ld s1,72(sp) + 274: 04013903 ld s2,64(sp) + 278: 03813983 ld s3,56(sp) + 27c: 03013a03 ld s4,48(sp) + 280: 02813a83 ld s5,40(sp) + 284: 00068513 mv a0,a3 + 288: 06010113 add sp,sp,96 + 28c: 00008067 ret + 290: 00100693 li a3,1 + 294: 00068513 mv a0,a3 + 298: 00008067 ret + +000000000000029c : + 29c: b0201073 csrw minstret,zero + 2a0: b0001073 csrw mcycle,zero + 2a4: 00008067 ret + +00000000000002a8 : + 2a8: 03000793 li a5,48 + 2ac: 00f58023 sb a5,0(a1) + 2b0: 07800793 li a5,120 + 2b4: 00f580a3 sb a5,1(a1) + 2b8: 00158813 add a6,a1,1 + 2bc: 00958793 add a5,a1,9 + 2c0: 00900613 li a2,9 + 2c4: 00f57713 and a4,a0,15 + 2c8: 03770693 add a3,a4,55 + 2cc: 00e66463 bltu a2,a4,2d4 + 2d0: 03070693 add a3,a4,48 + 2d4: 00d78023 sb a3,0(a5) + 2d8: fff78793 add a5,a5,-1 + 2dc: 40455513 sra a0,a0,0x4 + 2e0: fef812e3 bne a6,a5,2c4 + 2e4: 00058523 sb zero,10(a1) + 2e8: 00008067 ret + +00000000000002ec : + 2ec: 03000793 li a5,48 + 2f0: 00f58023 sb a5,0(a1) + 2f4: 07800793 li a5,120 + 2f8: 00f580a3 sb a5,1(a1) + 2fc: 00158813 add a6,a1,1 + 300: 01158793 add a5,a1,17 + 304: 00900613 li a2,9 + 308: 00f57713 and a4,a0,15 + 30c: 03770693 add a3,a4,55 + 310: 00e66463 bltu a2,a4,318 + 314: 03070693 add a3,a4,48 + 318: 00d78023 sb a3,0(a5) + 31c: fff78793 add a5,a5,-1 + 320: 40455513 sra a0,a0,0x4 + 324: fef812e3 bne a6,a5,308 + 328: 00058923 sb zero,18(a1) + 32c: 00008067 ret + +0000000000000330 : + 330: 00054783 lbu a5,0(a0) + 334: 00078c63 beqz a5,34c + 338: 10000737 lui a4,0x10000 + 33c: 00f70023 sb a5,0(a4) # 10000000 + 340: 00154783 lbu a5,1(a0) + 344: 00150513 add a0,a0,1 + 348: fe079ae3 bnez a5,33c + 34c: 00008067 ret + +0000000000000350 : + 350: fe010113 add sp,sp,-32 + 354: c0202673 rdinstret a2 + 358: c00025f3 rdcycle a1 + 35c: 00004717 auipc a4,0x4 + 360: dbc70713 add a4,a4,-580 # 4118 + 364: 06300793 li a5,99 + 368: 100006b7 lui a3,0x10000 + 36c: 00f68023 sb a5,0(a3) # 10000000 + 370: 00174783 lbu a5,1(a4) + 374: 00170713 add a4,a4,1 + 378: fe079ae3 bnez a5,36c + 37c: ffff8737 lui a4,0xffff8 + 380: 83074713 xor a4,a4,-2000 + 384: 01910793 add a5,sp,25 + 388: 00e11423 sh a4,8(sp) + 38c: 00910813 add a6,sp,9 + 390: 00078713 mv a4,a5 + 394: 00900893 li a7,9 + 398: 00f5f693 and a3,a1,15 + 39c: 03768513 add a0,a3,55 + 3a0: 00d8e463 bltu a7,a3,3a8 + 3a4: 03068513 add a0,a3,48 + 3a8: 00a70023 sb a0,0(a4) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 3ac: fff70713 add a4,a4,-1 + 3b0: 4045d593 sra a1,a1,0x4 + 3b4: fee812e3 bne a6,a4,398 + 3b8: 00814703 lbu a4,8(sp) + 3bc: 00010d23 sb zero,26(sp) + 3c0: 00810693 add a3,sp,8 + 3c4: 100005b7 lui a1,0x10000 + 3c8: 00070a63 beqz a4,3dc + 3cc: 00e58023 sb a4,0(a1) # 10000000 + 3d0: 0016c703 lbu a4,1(a3) + 3d4: 00168693 add a3,a3,1 + 3d8: fe071ae3 bnez a4,3cc + 3dc: 00004697 auipc a3,0x4 + 3e0: d4468693 add a3,a3,-700 # 4120 + 3e4: 00a00713 li a4,10 + 3e8: 100005b7 lui a1,0x10000 + 3ec: 00e58023 sb a4,0(a1) # 10000000 + 3f0: 0016c703 lbu a4,1(a3) + 3f4: 00168693 add a3,a3,1 + 3f8: fe071ae3 bnez a4,3ec + 3fc: ffff8737 lui a4,0xffff8 + 400: 83074713 xor a4,a4,-2000 + 404: 00060693 mv a3,a2 + 408: 00e11423 sh a4,8(sp) + 40c: 00900593 li a1,9 + 410: 00f6f713 and a4,a3,15 + 414: 03770613 add a2,a4,55 # ffffffffffff8037 <_end+0xffffffffefff7fef> + 418: 00e5e463 bltu a1,a4,420 + 41c: 03070613 add a2,a4,48 + 420: 00c78023 sb a2,0(a5) + 424: fff78793 add a5,a5,-1 + 428: 4046d693 sra a3,a3,0x4 + 42c: fef812e3 bne a6,a5,410 + 430: 00814783 lbu a5,8(sp) + 434: 00010d23 sb zero,26(sp) + 438: 00810713 add a4,sp,8 + 43c: 100006b7 lui a3,0x10000 + 440: 00078a63 beqz a5,454 + 444: 00f68023 sb a5,0(a3) # 10000000 + 448: 00174783 lbu a5,1(a4) + 44c: 00170713 add a4,a4,1 + 450: fe079ae3 bnez a5,444 + 454: 100007b7 lui a5,0x10000 + 458: 00a00713 li a4,10 + 45c: 00e78023 sb a4,0(a5) # 10000000 + 460: 02010113 add sp,sp,32 + 464: 00008067 ret + +0000000000000468 : + 468: fe010113 add sp,sp,-32 + 46c: 00813823 sd s0,16(sp) + 470: 00113c23 sd ra,24(sp) + 474: 00050413 mv s0,a0 + 478: 00004717 auipc a4,0x4 + 47c: cb870713 add a4,a4,-840 # 4130 + 480: 04500793 li a5,69 + 484: 100006b7 lui a3,0x10000 + 488: 00f68023 sb a5,0(a3) # 10000000 + 48c: 00174783 lbu a5,1(a4) + 490: 00170713 add a4,a4,1 + 494: fe079ae3 bnez a5,488 + 498: 00010593 mv a1,sp + 49c: 00040513 mv a0,s0 + 4a0: e09ff0ef jal 2a8 + 4a4: 00014703 lbu a4,0(sp) + 4a8: 00070e63 beqz a4,4c4 + 4ac: 00010793 mv a5,sp + 4b0: 100006b7 lui a3,0x10000 + 4b4: 00e68023 sb a4,0(a3) # 10000000 + 4b8: 0017c703 lbu a4,1(a5) + 4bc: 00178793 add a5,a5,1 + 4c0: fe071ae3 bnez a4,4b4 + 4c4: 00040513 mv a0,s0 + 4c8: 100007b7 lui a5,0x10000 + 4cc: 00078023 sb zero,0(a5) # 10000000 + 4d0: 0000006f j 4d0 + +00000000000004d4 : + 4d4: ffff87b7 lui a5,0xffff8 + 4d8: fd010113 add sp,sp,-48 + 4dc: 8307c793 xor a5,a5,-2000 + 4e0: 00f11423 sh a5,8(sp) + 4e4: 02113423 sd ra,40(sp) + 4e8: 01910793 add a5,sp,25 + 4ec: 00910813 add a6,sp,9 + 4f0: 00900613 li a2,9 + 4f4: 00f5f713 and a4,a1,15 + 4f8: 03770693 add a3,a4,55 + 4fc: 00e66463 bltu a2,a4,504 + 500: 03070693 add a3,a4,48 + 504: 00d78023 sb a3,0(a5) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 508: fff78793 add a5,a5,-1 + 50c: 4045d593 sra a1,a1,0x4 + 510: ff0792e3 bne a5,a6,4f4 + 514: 00010d23 sb zero,26(sp) + 518: 00b00793 li a5,11 + 51c: 02a7e063 bltu a5,a0,53c + 520: 00004717 auipc a4,0x4 + 524: ba070713 add a4,a4,-1120 # 40c0 + 528: 00251513 sll a0,a0,0x2 + 52c: 00e50533 add a0,a0,a4 + 530: 00052783 lw a5,0(a0) + 534: 00e787b3 add a5,a5,a4 + 538: 00078067 jr a5 + 53c: 00004717 auipc a4,0x4 + 540: d1c70713 add a4,a4,-740 # 4258 + 544: 05500793 li a5,85 + 548: 100006b7 lui a3,0x10000 + 54c: 00f68023 sb a5,0(a3) # 10000000 + 550: 00174783 lbu a5,1(a4) + 554: 00170713 add a4,a4,1 + 558: fe079ae3 bnez a5,54c + 55c: 00814783 lbu a5,8(sp) + 560: 00810713 add a4,sp,8 + 564: 100006b7 lui a3,0x10000 + 568: 00078a63 beqz a5,57c + 56c: 00f68023 sb a5,0(a3) # 10000000 + 570: 00174783 lbu a5,1(a4) + 574: 00170713 add a4,a4,1 + 578: fe079ae3 bnez a5,56c + 57c: 00004717 auipc a4,0x4 + 580: cfc70713 add a4,a4,-772 # 4278 + 584: 00a00793 li a5,10 + 588: 100006b7 lui a3,0x10000 + 58c: 00f68023 sb a5,0(a3) # 10000000 + 590: 00174783 lbu a5,1(a4) + 594: 00170713 add a4,a4,1 + 598: fe079ae3 bnez a5,58c + 59c: fff00513 li a0,-1 + 5a0: ec9ff0ef jal 468 + 5a4: 00004717 auipc a4,0x4 + 5a8: b9c70713 add a4,a4,-1124 # 4140 + 5ac: 04900793 li a5,73 + 5b0: 100006b7 lui a3,0x10000 + 5b4: 00f68023 sb a5,0(a3) # 10000000 + 5b8: 00174783 lbu a5,1(a4) + 5bc: 00170713 add a4,a4,1 + 5c0: fe079ae3 bnez a5,5b4 + 5c4: 00814783 lbu a5,8(sp) + 5c8: 00810713 add a4,sp,8 + 5cc: 100006b7 lui a3,0x10000 + 5d0: fc0786e3 beqz a5,59c + 5d4: 00f68023 sb a5,0(a3) # 10000000 + 5d8: 00174783 lbu a5,1(a4) + 5dc: 00170713 add a4,a4,1 + 5e0: fe079ae3 bnez a5,5d4 + 5e4: fb9ff06f j 59c + 5e8: 00004717 auipc a4,0x4 + 5ec: b8070713 add a4,a4,-1152 # 4168 + 5f0: 04900793 li a5,73 + 5f4: 100006b7 lui a3,0x10000 + 5f8: 00f68023 sb a5,0(a3) # 10000000 + 5fc: 00174783 lbu a5,1(a4) + 600: 00170713 add a4,a4,1 + 604: fe079ae3 bnez a5,5f8 + 608: 00814783 lbu a5,8(sp) + 60c: f80788e3 beqz a5,59c + 610: 00810713 add a4,sp,8 + 614: 100006b7 lui a3,0x10000 + 618: 00f68023 sb a5,0(a3) # 10000000 + 61c: 00174783 lbu a5,1(a4) + 620: 00170713 add a4,a4,1 + 624: fe079ae3 bnez a5,618 + 628: f75ff06f j 59c + 62c: 00004717 auipc a4,0x4 + 630: b6470713 add a4,a4,-1180 # 4190 + 634: 04900793 li a5,73 + 638: 100006b7 lui a3,0x10000 + 63c: 00f68023 sb a5,0(a3) # 10000000 + 640: 00174783 lbu a5,1(a4) + 644: 00170713 add a4,a4,1 + 648: fe079ae3 bnez a5,63c + 64c: 00814783 lbu a5,8(sp) + 650: f40786e3 beqz a5,59c + 654: 00810713 add a4,sp,8 + 658: 100006b7 lui a3,0x10000 + 65c: 00f68023 sb a5,0(a3) # 10000000 + 660: 00174783 lbu a5,1(a4) + 664: 00170713 add a4,a4,1 + 668: fe079ae3 bnez a5,65c + 66c: f31ff06f j 59c + 670: 00004717 auipc a4,0x4 + 674: b4070713 add a4,a4,-1216 # 41b0 + 678: 04c00793 li a5,76 + 67c: 100006b7 lui a3,0x10000 + 680: 00f68023 sb a5,0(a3) # 10000000 + 684: 00174783 lbu a5,1(a4) + 688: 00170713 add a4,a4,1 + 68c: fe079ae3 bnez a5,680 + 690: 00814783 lbu a5,8(sp) + 694: f00784e3 beqz a5,59c + 698: 00810713 add a4,sp,8 + 69c: 100006b7 lui a3,0x10000 + 6a0: 00f68023 sb a5,0(a3) # 10000000 + 6a4: 00174783 lbu a5,1(a4) + 6a8: 00170713 add a4,a4,1 + 6ac: fe079ae3 bnez a5,6a0 + 6b0: eedff06f j 59c + 6b4: 00004717 auipc a4,0x4 + 6b8: b1c70713 add a4,a4,-1252 # 41d0 + 6bc: 04c00793 li a5,76 + 6c0: 100006b7 lui a3,0x10000 + 6c4: 00f68023 sb a5,0(a3) # 10000000 + 6c8: 00174783 lbu a5,1(a4) + 6cc: 00170713 add a4,a4,1 + 6d0: fe079ae3 bnez a5,6c4 + 6d4: 00814783 lbu a5,8(sp) + 6d8: ec0782e3 beqz a5,59c + 6dc: 00810713 add a4,sp,8 + 6e0: 100006b7 lui a3,0x10000 + 6e4: 00f68023 sb a5,0(a3) # 10000000 + 6e8: 00174783 lbu a5,1(a4) + 6ec: 00170713 add a4,a4,1 + 6f0: fe079ae3 bnez a5,6e4 + 6f4: ea9ff06f j 59c + 6f8: 00004717 auipc a4,0x4 + 6fc: af870713 add a4,a4,-1288 # 41f0 + 700: 05300793 li a5,83 + 704: 100006b7 lui a3,0x10000 + 708: 00f68023 sb a5,0(a3) # 10000000 + 70c: 00174783 lbu a5,1(a4) + 710: 00170713 add a4,a4,1 + 714: fe079ae3 bnez a5,708 + 718: 00814783 lbu a5,8(sp) + 71c: e80780e3 beqz a5,59c + 720: 00810713 add a4,sp,8 + 724: 100006b7 lui a3,0x10000 + 728: 00f68023 sb a5,0(a3) # 10000000 + 72c: 00174783 lbu a5,1(a4) + 730: 00170713 add a4,a4,1 + 734: fe079ae3 bnez a5,728 + 738: e65ff06f j 59c + 73c: 00004717 auipc a4,0x4 + 740: adc70713 add a4,a4,-1316 # 4218 + 744: 05300793 li a5,83 + 748: 100006b7 lui a3,0x10000 + 74c: 00f68023 sb a5,0(a3) # 10000000 + 750: 00174783 lbu a5,1(a4) + 754: 00170713 add a4,a4,1 + 758: fe079ae3 bnez a5,74c + 75c: 00814783 lbu a5,8(sp) + 760: e2078ee3 beqz a5,59c + 764: 00810713 add a4,sp,8 + 768: 100006b7 lui a3,0x10000 + 76c: 00f68023 sb a5,0(a3) # 10000000 + 770: 00174783 lbu a5,1(a4) + 774: 00170713 add a4,a4,1 + 778: fe079ae3 bnez a5,76c + 77c: e21ff06f j 59c + 780: 00004717 auipc a4,0x4 + 784: ab870713 add a4,a4,-1352 # 4238 + 788: 04500793 li a5,69 + 78c: 100006b7 lui a3,0x10000 + 790: 00f68023 sb a5,0(a3) # 10000000 + 794: 00174783 lbu a5,1(a4) + 798: 00170713 add a4,a4,1 + 79c: fe079ae3 bnez a5,790 + 7a0: 00814783 lbu a5,8(sp) + 7a4: de078ce3 beqz a5,59c + 7a8: 00810713 add a4,sp,8 + 7ac: 100006b7 lui a3,0x10000 + 7b0: 00f68023 sb a5,0(a3) # 10000000 + 7b4: 00174783 lbu a5,1(a4) + 7b8: 00170713 add a4,a4,1 + 7bc: fe079ae3 bnez a5,7b0 + 7c0: dddff06f j 59c + +00000000000007c4 : + 7c4: 00051063 bnez a0,7c4 + 7c8: 00008067 ret + +00000000000007cc <_init>: + 7cc: ff010113 add sp,sp,-16 + 7d0: 00000593 li a1,0 + 7d4: 00000513 li a0,0 + 7d8: 00113423 sd ra,8(sp) + 7dc: 1d8000ef jal 9b4
+ 7e0: c89ff0ef jal 468 + +00000000000007e4 : + 7e4: 00b567b3 or a5,a0,a1 + 7e8: 00c7e7b3 or a5,a5,a2 + 7ec: 0077f793 and a5,a5,7 + 7f0: 00c50833 add a6,a0,a2 + 7f4: 02078463 beqz a5,81c + 7f8: 00c58633 add a2,a1,a2 + 7fc: 00050793 mv a5,a0 + 800: 0b057663 bgeu a0,a6,8ac + 804: 0005c703 lbu a4,0(a1) + 808: 00158593 add a1,a1,1 + 80c: 00178793 add a5,a5,1 + 810: fee78fa3 sb a4,-1(a5) + 814: fec598e3 bne a1,a2,804 + 818: 00008067 ret + 81c: 04050693 add a3,a0,64 + 820: 0906f863 bgeu a3,a6,8b0 + 824: 00058713 mv a4,a1 + 828: 00068793 mv a5,a3 + 82c: 00073383 ld t2,0(a4) + 830: 00873283 ld t0,8(a4) + 834: 01073f83 ld t6,16(a4) + 838: 01873f03 ld t5,24(a4) + 83c: 02073e83 ld t4,32(a4) + 840: 02873e03 ld t3,40(a4) + 844: 03073303 ld t1,48(a4) + 848: 03873883 ld a7,56(a4) + 84c: 04078793 add a5,a5,64 + 850: f877b023 sd t2,-128(a5) + 854: f857b423 sd t0,-120(a5) + 858: f9f7b823 sd t6,-112(a5) + 85c: f9e7bc23 sd t5,-104(a5) + 860: fbd7b023 sd t4,-96(a5) + 864: fbc7b423 sd t3,-88(a5) + 868: fa67b823 sd t1,-80(a5) + 86c: fb17bc23 sd a7,-72(a5) + 870: 04070713 add a4,a4,64 + 874: fb07ece3 bltu a5,a6,82c + 878: fbf60613 add a2,a2,-65 + 87c: fc067793 and a5,a2,-64 + 880: 04078793 add a5,a5,64 + 884: fc067613 and a2,a2,-64 + 888: 00f585b3 add a1,a1,a5 + 88c: 00c687b3 add a5,a3,a2 + 890: f907f4e3 bgeu a5,a6,818 + 894: 0005b703 ld a4,0(a1) + 898: 00878793 add a5,a5,8 + 89c: 00858593 add a1,a1,8 + 8a0: fee7bc23 sd a4,-8(a5) + 8a4: ff07e8e3 bltu a5,a6,894 + 8a8: 00008067 ret + 8ac: 00008067 ret + 8b0: 00050793 mv a5,a0 + 8b4: fddff06f j 890 + +00000000000008b8 : + 8b8: 00c567b3 or a5,a0,a2 + 8bc: 0077f793 and a5,a5,7 + 8c0: 00c50633 add a2,a0,a2 + 8c4: 0ff5f713 zext.b a4,a1 + 8c8: 00078e63 beqz a5,8e4 + 8cc: 00050793 mv a5,a0 + 8d0: 02c57c63 bgeu a0,a2,908 + 8d4: 00178793 add a5,a5,1 + 8d8: fee78fa3 sb a4,-1(a5) + 8dc: fef61ce3 bne a2,a5,8d4 + 8e0: 00008067 ret + 8e4: 00004797 auipc a5,0x4 + 8e8: 9ac7b783 ld a5,-1620(a5) # 4290 + 8ec: 02f70733 mul a4,a4,a5 + 8f0: fec578e3 bgeu a0,a2,8e0 + 8f4: 00050793 mv a5,a0 + 8f8: 00878793 add a5,a5,8 + 8fc: fee7bc23 sd a4,-8(a5) + 900: fec7ece3 bltu a5,a2,8f8 + 904: 00008067 ret + 908: 00008067 ret + +000000000000090c : + 90c: 00054783 lbu a5,0(a0) + 910: 00078e63 beqz a5,92c + 914: 00050793 mv a5,a0 + 918: 0017c703 lbu a4,1(a5) + 91c: 00178793 add a5,a5,1 + 920: fe071ce3 bnez a4,918 + 924: 40a78533 sub a0,a5,a0 + 928: 00008067 ret + 92c: 00000513 li a0,0 + 930: 00008067 ret + +0000000000000934 : + 934: 00b506b3 add a3,a0,a1 + 938: 00050793 mv a5,a0 + 93c: 00059863 bnez a1,94c + 940: 0240006f j 964 + 944: 00178793 add a5,a5,1 + 948: 00f68a63 beq a3,a5,95c + 94c: 0007c703 lbu a4,0(a5) + 950: fe071ae3 bnez a4,944 + 954: 40a78533 sub a0,a5,a0 + 958: 00008067 ret + 95c: 40a68533 sub a0,a3,a0 + 960: 00008067 ret + 964: 00000513 li a0,0 + 968: 00008067 ret + +000000000000096c : + 96c: 00054783 lbu a5,0(a0) + 970: 00158593 add a1,a1,1 + 974: 00150513 add a0,a0,1 + 978: fff5c703 lbu a4,-1(a1) + 97c: 00078a63 beqz a5,990 + 980: fee786e3 beq a5,a4,96c + 984: 0007851b sext.w a0,a5 + 988: 40e5053b subw a0,a0,a4 + 98c: 00008067 ret + 990: 00000513 li a0,0 + 994: ff5ff06f j 988 + +0000000000000998 : + 998: 00050793 mv a5,a0 + 99c: 0005c703 lbu a4,0(a1) + 9a0: 00178793 add a5,a5,1 + 9a4: 00158593 add a1,a1,1 + 9a8: fee78fa3 sb a4,-1(a5) + 9ac: fe0718e3 bnez a4,99c + 9b0: 00008067 ret + +Disassembly of section .text.startup: + +00000000000009b4
: + 9b4: fe010113 add sp,sp,-32 + 9b8: 00113c23 sd ra,24(sp) + 9bc: 00813823 sd s0,16(sp) + 9c0: 00913423 sd s1,8(sp) + 9c4: 01213023 sd s2,0(sp) + 9c8: 00004597 auipc a1,0x4 + 9cc: 8d058593 add a1,a1,-1840 # 4298 + 9d0: 00003617 auipc a2,0x3 + 9d4: 63060613 add a2,a2,1584 # 4000 + 9d8: 00003697 auipc a3,0x3 + 9dc: 68868693 add a3,a3,1672 # 4060 + 9e0: 02900713 li a4,41 + 9e4: 0c877557 vsetvli a0,a4,e16,m1,ta,ma + 9e8: 0005079b sext.w a5,a0 + 9ec: 0206d507 vle16.v v10,(a3) + 9f0: 02065587 vle16.v v11,(a2) + 9f4: 92a5a657 vmulhu.vv v12,v10,v11 + 9f8: 0205d627 vse16.v v12,(a1) + 9fc: 00179793 sll a5,a5,0x1 + a00: 40a7073b subw a4,a4,a0 + a04: 00f686b3 add a3,a3,a5 + a08: 00f60633 add a2,a2,a5 + a0c: 00f585b3 add a1,a1,a5 + a10: fc071ae3 bnez a4,9e4 + a14: 00003417 auipc s0,0x3 + a18: 64c40413 add s0,s0,1612 # 4060 + a1c: 86818493 add s1,gp,-1944 # 42f8 + a20: 00003617 auipc a2,0x3 + a24: 5e060613 add a2,a2,1504 # 4000 + a28: 00003917 auipc s2,0x3 + a2c: 68a90913 add s2,s2,1674 # 40b2 + a30: 00048693 mv a3,s1 + a34: 00040713 mv a4,s0 + a38: 00075783 lhu a5,0(a4) + a3c: 00065583 lhu a1,0(a2) + a40: 00268693 add a3,a3,2 + a44: 00270713 add a4,a4,2 + a48: 02b787bb mulw a5,a5,a1 + a4c: 00260613 add a2,a2,2 + a50: 0107d79b srlw a5,a5,0x10 + a54: fef69f23 sh a5,-2(a3) + a58: ff2710e3 bne a4,s2,a38 + a5c: 02900613 li a2,41 + a60: 86818593 add a1,gp,-1944 # 42f8 + a64: 00004517 auipc a0,0x4 + a68: 83450513 add a0,a0,-1996 # 4298 + a6c: f6cff0ef jal 1d8 + a70: 00050813 mv a6,a0 + a74: 00004617 auipc a2,0x4 + a78: 82460613 add a2,a2,-2012 # 4298 + a7c: 00003697 auipc a3,0x3 + a80: 5e468693 add a3,a3,1508 # 4060 + a84: 02900713 li a4,41 + a88: 0c8775d7 vsetvli a1,a4,e16,m1,ta,ma + a8c: 0005879b sext.w a5,a1 + a90: 000042b7 lui t0,0x4 + a94: 5452829b addw t0,t0,1349 # 4545 <_tbss_end+0x1ed> + a98: 0206d507 vle16.v v10,(a3) + a9c: 92a2e657 vmulhu.vx v12,v10,t0 + aa0: 02065627 vse16.v v12,(a2) + aa4: 00179793 sll a5,a5,0x1 + aa8: 40b7073b subw a4,a4,a1 + aac: 00f686b3 add a3,a3,a5 + ab0: 00f60633 add a2,a2,a5 + ab4: fc071ae3 bnez a4,a88 + ab8: 00004737 lui a4,0x4 + abc: 5457071b addw a4,a4,1349 # 4545 <_tbss_end+0x1ed> + ac0: 00045783 lhu a5,0(s0) + ac4: 00248493 add s1,s1,2 + ac8: 00240413 add s0,s0,2 + acc: 02e787bb mulw a5,a5,a4 + ad0: 0107d79b srlw a5,a5,0x10 + ad4: fef49f23 sh a5,-2(s1) + ad8: ff2414e3 bne s0,s2,ac0 + adc: 00100513 li a0,1 + ae0: 00081e63 bnez a6,afc + ae4: 01813083 ld ra,24(sp) + ae8: 01013403 ld s0,16(sp) + aec: 00813483 ld s1,8(sp) + af0: 00013903 ld s2,0(sp) + af4: 02010113 add sp,sp,32 + af8: 00008067 ret + afc: 02900613 li a2,41 + b00: 86818593 add a1,gp,-1944 # 42f8 + b04: 00003517 auipc a0,0x3 + b08: 79450513 add a0,a0,1940 # 4298 + b0c: eccff0ef jal 1d8 + b10: 00154513 xor a0,a0,1 + b14: 0ff57513 zext.b a0,a0 + b18: fcdff06f j ae4 + b1c: fff00513 li a0,-1 + b20: 00008067 ret + +Disassembly of section .rodata: + +0000000000004000 : + 4000: b018 .2byte 0xb018 + 4002: 1e78c29b .4byte 0x1e78c29b + 4006: 31e9 .2byte 0x31e9 + 4008: 823d016f jal sp,fffffffffffd482a <_end+0xffffffffeffd47e2> + 400c: 4439 .2byte 0x4439 + 400e: 7b9d .2byte 0x7b9d + 4010: d994 .2byte 0xd994 + 4012: 28d6 .2byte 0x28d6 + 4014: 367d .2byte 0x367d + 4016: 7969544f .4byte 0x7969544f + 401a: 831f 7c0d e412 .byte 0x1f, 0x83, 0x0d, 0x7c, 0x12, 0xe4 + 4020: f536 .2byte 0xf536 + 4022: 7c5382e3 beq t2,t0,4fe6 <__global_pointer$+0x556> + 4026: 8e88 .2byte 0x8e88 + 4028: 2dd0 .2byte 0x2dd0 + 402a: 2d5699db .4byte 0x2d5699db + 402e: 6ae2 vmsge.vx v21,v0,zero,v0.t + 4030: 5c4c .2byte 0x5c4c + 4032: 0c82 vmsge.vx v25,v0,zero,v0.t + 4034: 114a .2byte 0x114a + 4036: 4dc8 .2byte 0x4dc8 + 4038: ac60 vmsge.vx v24,v0,ra,v0.t + 403a: 1f77b87f 54fbfab5 .byte 0x7f, 0xb8, 0x77, 0x1f, 0xb5, 0xfa, 0xfb, 0x54, 0x2d, 0x30, 0x74, 0x7f, 0xf9, 0x9f, 0xe2, 0x87 + 4042: 7f74302d 87e29ff9 + 404a: a7ddde87 vluxseg6ei16.v v29,(s11),v29 + 404e: a6dd .2byte 0xa6dd + 4050: 5f38 .2byte 0x5f38 + 4052: 2144 .2byte 0x2144 + 4054: e7e537ff 2247756c .byte 0xff, 0x37, 0xe5, 0xe7, 0x6c, 0x75, 0x47, 0x22, 0x67, 0x35, 0x4f, 0x89, 0xb5, 0x08, 0x8c, 0xf2 + 405c: 894f3567 + +0000000000004060 : + 4060: 08b5 .2byte 0x8b5 + 4062: f28c .2byte 0xf28c + 4064: 3c6d .2byte 0x3c6d + 4066: f218 .2byte 0xf218 + 4068: a53a .2byte 0xa53a + 406a: 37b2 .2byte 0x37b2 + 406c: 0e577dc7 .4byte 0xe577dc7 + 4070: 557e3943 vmsge.vx v18,v23,t3,v0.t + 4074: bdc1 vmsge.vx v27,v0,ra,v0.t + 4076: 15ca .2byte 0x15ca + 4078: 5e8724cb .4byte 0x5e8724cb + 407c: aab8 .2byte 0xaab8 + 407e: 2185ba23 sd s8,532(a1) + 4082: e2a2ddaf .4byte 0xe2a2ddaf + 4086: 850a .2byte 0x850a + 4088: 8736 .2byte 0x8736 + 408a: 9dd4 .2byte 0x9dd4 + 408c: 8e9056a3 vmsge.vx v13,v9,zero + 4090: 4cc8 .2byte 0x4cc8 + 4092: 1cc0 vmsge.vx v25,v0,zero,v0.t + 4094: 6ad0 .2byte 0x6ad0 + 4096: a0e2b643 vmsge.vx v12,v14,t0,v0.t + 409a: bdb5 .2byte 0xbdb5 + 409c: 1a4e0517 auipc a0,0x1a4e0 + 40a0: dce4 .2byte 0xdce4 + 40a2: 1b22 vmsge.vx v22,v0,zero,v0.t + 40a4: bdcd .2byte 0xbdcd + 40a6: 55d0 .2byte 0x55d0 + 40a8: 0ca6 .2byte 0xca6 + 40aa: 560c .2byte 0x560c + 40ac: a1a0 vmsge.vx v3,v0,ra,v0.t + 40ae: f2f0 .2byte 0xf2f0 + 40b0: fa7ae4c3 vmsge.vx v9,v7,s5 + 40b4: 143d .2byte 0x143d + 40b6: 42970493 add s1,a4,1065 + 40ba: bc67420b .4byte 0xbc67420b + 40be: 5ff1 .2byte 0x5ff1 + 40c0: c4e4 .2byte 0xc4e4 + 40c2: ffff .2byte 0xffff + 40c4: c528 .2byte 0xc528 + 40c6: ffff .2byte 0xffff + 40c8: c56c .2byte 0xc56c + 40ca: ffff .2byte 0xffff + 40cc: c47c .2byte 0xc47c + 40ce: ffff .2byte 0xffff + 40d0: c5b0 .2byte 0xc5b0 + 40d2: ffff .2byte 0xffff + 40d4: c5f4 .2byte 0xc5f4 + 40d6: ffff .2byte 0xffff + 40d8: c638 .2byte 0xc638 + 40da: ffff .2byte 0xffff + 40dc: c67c .2byte 0xc67c + 40de: ffff .2byte 0xffff + 40e0: c47c .2byte 0xc47c + 40e2: ffff .2byte 0xffff + 40e4: c47c .2byte 0xc47c + 40e6: ffff .2byte 0xffff + 40e8: c47c .2byte 0xc47c + 40ea: ffff .2byte 0xffff + 40ec: c6c0 vmsge.vx v13,v0,ra,v0.t + 40ee: ffff .2byte 0xffff + +Disassembly of section .rodata.str1.8: + +00000000000040f0 <.rodata.str1.8>: + 40f0: 5241 vmsge.vx v4,v0,zero,v0.t + 40f2: 4152 .2byte 0x4152 + 40f4: 2059 .2byte 0x2059 + 40f6: 4f4e .2byte 0x4f4e + 40f8: 2054 .2byte 0x2054 + 40fa: 52524f43 vmsge.vx v30,v5,tp + 40fe: 4345 .2byte 0x4345 + 4100: 2054 .2byte 0x2054 + 4102: 4e49 .2byte 0x4e49 + 4104: 4920 vmsge.vx v18,v0,zero,v0.t + 4106: 444e .2byte 0x444e + 4108: 5845 .2byte 0x5845 + 410a: 203a .2byte 0x203a + 410c: 0000 vmsge.vx v0,v0,zero,v0.t + 410e: 0000 vmsge.vx v0,v0,zero,v0.t + 4110: 000a .2byte 0xa + 4112: 0000 vmsge.vx v0,v0,zero,v0.t + 4114: 0000 vmsge.vx v0,v0,zero,v0.t + 4116: 0000 vmsge.vx v0,v0,zero,v0.t + 4118: 6c637963 bgeu t1,t1,47ea <_tbss_end+0x492> + 411c: 3a65 .2byte 0x3a65 + 411e: 0020 vmsge.vx v0,v0,zero,v0.t + 4120: 690a .2byte 0x690a + 4122: 736e .2byte 0x736e + 4124: 7274 .2byte 0x7274 + 4126: 7465 .2byte 0x7465 + 4128: 203a .2byte 0x203a + 412a: 0000 vmsge.vx v0,v0,zero,v0.t + 412c: 0000 vmsge.vx v0,v0,zero,v0.t + 412e: 0000 vmsge.vx v0,v0,zero,v0.t + 4130: 7845 .2byte 0x7845 + 4132: 7469 .2byte 0x7469 + 4134: 6320 vmsge.vx v6,v0,zero,v0.t + 4136: 3a65646f jal s0,5a4dc <__global_pointer$+0x55a4c> + 413a: 0020 vmsge.vx v0,v0,zero,v0.t + 413c: 0000 vmsge.vx v0,v0,zero,v0.t + 413e: 0000 vmsge.vx v0,v0,zero,v0.t + 4140: 4e49 .2byte 0x4e49 + 4142: 55525453 .4byte 0x55525453 + 4146: 4f495443 vmsge.vx v8,v20,s2 + 414a: 204e .2byte 0x204e + 414c: 4441 vmsge.vx v8,v0,zero,v0.t + 414e: 5244 .2byte 0x5244 + 4150: 5345 .2byte 0x5345 + 4152: 494d2053 .4byte 0x494d2053 + 4156: 494c4153 .4byte 0x494c4153 + 415a: 44454e47 .4byte 0x44454e47 + 415e: 6120 vmsge.vx v2,v0,zero,v0.t + 4160: 2074 .2byte 0x2074 + 4162: 4350 .2byte 0x4350 + 4164: 203a .2byte 0x203a + 4166: 0000 vmsge.vx v0,v0,zero,v0.t + 4168: 4e49 .2byte 0x4e49 + 416a: 55525453 .4byte 0x55525453 + 416e: 4f495443 vmsge.vx v8,v20,s2 + 4172: 204e .2byte 0x204e + 4174: 4341 vmsge.vx v6,v0,zero,v0.t + 4176: 53534543 vmsge.vx v10,v21,t1 + 417a: 4620 vmsge.vx v12,v0,zero,v0.t + 417c: 5541 vmsge.vx v10,v0,zero,v0.t + 417e: 544c .2byte 0x544c + 4180: 6120 vmsge.vx v2,v0,zero,v0.t + 4182: 2074 .2byte 0x2074 + 4184: 4350 .2byte 0x4350 + 4186: 203a .2byte 0x203a + ... + 4190: 4c49 .2byte 0x4c49 + 4192: 454c .2byte 0x454c + 4194: 204c4147 .4byte 0x204c4147 + 4198: 4e49 .2byte 0x4e49 + 419a: 55525453 .4byte 0x55525453 + 419e: 4f495443 vmsge.vx v8,v20,s2 + 41a2: 204e .2byte 0x204e + 41a4: 7461 vmsge.vx v8,v0,zero,v0.t + 41a6: 5020 vmsge.vx v0,v0,zero,v0.t + 41a8: 00203a43 vmsge.vx v20,v2,zero,v0.t + 41ac: 0000 vmsge.vx v0,v0,zero,v0.t + 41ae: 0000 vmsge.vx v0,v0,zero,v0.t + 41b0: 4f4c .2byte 0x4f4c + 41b2: 4441 vmsge.vx v8,v0,zero,v0.t + 41b4: 4120 vmsge.vx v2,v0,zero,v0.t + 41b6: 4444 .2byte 0x4444 + 41b8: 4552 .2byte 0x4552 + 41ba: 4d205353 .4byte 0x4d205353 + 41be: 5349 .2byte 0x5349 + 41c0: 4c41 vmsge.vx v24,v0,zero,v0.t + 41c2: 4749 .2byte 0x4749 + 41c4: 454e .2byte 0x454e + 41c6: 2044 .2byte 0x2044 + 41c8: 7461 vmsge.vx v8,v0,zero,v0.t + 41ca: 5020 vmsge.vx v0,v0,zero,v0.t + 41cc: 00203a43 vmsge.vx v20,v2,zero,v0.t + 41d0: 4f4c .2byte 0x4f4c + 41d2: 4441 vmsge.vx v8,v0,zero,v0.t + 41d4: 4120 vmsge.vx v2,v0,zero,v0.t + 41d6: 53454343 vmsge.vx v6,v20,a0 + 41da: 41462053 .4byte 0x41462053 + 41de: 4c55 .2byte 0x4c55 + 41e0: 2054 .2byte 0x2054 + 41e2: 7461 vmsge.vx v8,v0,zero,v0.t + 41e4: 5020 vmsge.vx v0,v0,zero,v0.t + 41e6: 00203a43 vmsge.vx v20,v2,zero,v0.t + 41ea: 0000 vmsge.vx v0,v0,zero,v0.t + 41ec: 0000 vmsge.vx v0,v0,zero,v0.t + 41ee: 0000 vmsge.vx v0,v0,zero,v0.t + 41f0: 524f5453 .4byte 0x524f5453 + 41f4: 2045 .2byte 0x2045 + 41f6: 4441 vmsge.vx v8,v0,zero,v0.t + 41f8: 5244 .2byte 0x5244 + 41fa: 5345 .2byte 0x5345 + 41fc: 494d2053 .4byte 0x494d2053 + 4200: 494c4153 .4byte 0x494c4153 + 4204: 44454e47 .4byte 0x44454e47 + 4208: 6120 vmsge.vx v2,v0,zero,v0.t + 420a: 2074 .2byte 0x2074 + 420c: 4350 .2byte 0x4350 + 420e: 203a .2byte 0x203a + ... + 4218: 524f5453 .4byte 0x524f5453 + 421c: 2045 .2byte 0x2045 + 421e: 4341 vmsge.vx v6,v0,zero,v0.t + 4220: 53534543 vmsge.vx v10,v21,t1 + 4224: 4620 vmsge.vx v12,v0,zero,v0.t + 4226: 5541 vmsge.vx v10,v0,zero,v0.t + 4228: 544c .2byte 0x544c + 422a: 6120 vmsge.vx v2,v0,zero,v0.t + 422c: 2074 .2byte 0x2074 + 422e: 4350 .2byte 0x4350 + 4230: 203a .2byte 0x203a + 4232: 0000 vmsge.vx v0,v0,zero,v0.t + 4234: 0000 vmsge.vx v0,v0,zero,v0.t + 4236: 0000 vmsge.vx v0,v0,zero,v0.t + 4238: 4345 .2byte 0x4345 + 423a: 4c41 vmsge.vx v24,v0,zero,v0.t + 423c: 204c .2byte 0x204c + 423e: 5246 .2byte 0x5246 + 4240: 4d204d4f .4byte 0x4d204d4f + 4244: 4d2d .2byte 0x4d2d + 4246: 2045444f .4byte 0x2045444f + 424a: 7461 vmsge.vx v8,v0,zero,v0.t + 424c: 5020 vmsge.vx v0,v0,zero,v0.t + 424e: 00203a43 vmsge.vx v20,v2,zero,v0.t + 4252: 0000 vmsge.vx v0,v0,zero,v0.t + 4254: 0000 vmsge.vx v0,v0,zero,v0.t + 4256: 0000 vmsge.vx v0,v0,zero,v0.t + 4258: 4e55 .2byte 0x4e55 + 425a: 574f4e4b .4byte 0x574f4e4b + 425e: 204e .2byte 0x204e + 4260: 5845 .2byte 0x5845 + 4262: 54504543 vmsge.vx v10,v5,zero,v0.t + 4266: 4f49 .2byte 0x4f49 + 4268: 204e .2byte 0x204e + 426a: 7461 vmsge.vx v8,v0,zero,v0.t + 426c: 5020 vmsge.vx v0,v0,zero,v0.t + 426e: 00203a43 vmsge.vx v20,v2,zero,v0.t + 4272: 0000 vmsge.vx v0,v0,zero,v0.t + 4274: 0000 vmsge.vx v0,v0,zero,v0.t + 4276: 0000 vmsge.vx v0,v0,zero,v0.t + 4278: 430a .2byte 0x430a + 427a: 4548 .2byte 0x4548 + 427c: 4d204b43 vmsge.vx v22,v18,zero,v0.t + 4280: 53554143 vmsge.vx v2,v21,a0 + 4284: 2045 .2byte 0x2045 + 4286: 6e69 .2byte 0x6e69 + 4288: 5220 vmsge.vx v4,v0,zero,v0.t + 428a: 4c54 .2byte 0x4c54 + ... + +Disassembly of section .sdata: + +0000000000004290 <__global_pointer$-0x800>: + 4290: 0101 vmsge.vx v2,v0,zero,v0.t + 4292: 0101 vmsge.vx v2,v0,zero,v0.t + 4294: 0101 vmsge.vx v2,v0,zero,v0.t + 4296: 0101 vmsge.vx v2,v0,zero,v0.t + +Disassembly of section .bss: + +0000000000004298 : + ... + +00000000000042f8 : + ... + +Disassembly of section .tohost: + +0000000010000000 : + ... + +0000000010000040 : + ... + +Disassembly of section .comment: + +0000000000000000 <.comment>: + 0: 3a434347 .4byte 0x3a434347 + 4: 2820 vmsge.vx v16,v0,zero,v0.t + 6: 65653267 .4byte 0x65653267 + a: 6535 .2byte 0x6535 + c: 3334 .2byte 0x3334 + e: 3030 .2byte 0x3030 + 10: 3831 .2byte 0x3831 + 12: 2029 .2byte 0x2029 + 14: 3231 .2byte 0x3231 + 16: 322e .2byte 0x322e + 18: 302e .2byte 0x302e + ... + +Disassembly of section .riscv.attributes: + +0000000000000000 <.riscv.attributes>: + 0: 5e41 vmsge.vx v28,v0,zero,v0.t + 2: 0000 vmsge.vx v0,v0,zero,v0.t + 4: 7200 vmsge.vx v4,v0,zero,v0.t + 6: 7369 .2byte 0x7369 + 8: 01007663 bgeu zero,a6,14 <_start+0x14> + c: 0054 .2byte 0x54 + e: 0000 vmsge.vx v0,v0,zero,v0.t + 10: 1004 .2byte 0x1004 + 12: 7205 .2byte 0x7205 + 14: 3676 .2byte 0x3676 + 16: 6934 .2byte 0x6934 + 18: 7032 .2byte 0x7032 + 1a: 5f31 .2byte 0x5f31 + 1c: 326d .2byte 0x326d + 1e: 3070 .2byte 0x3070 + 20: 7a5f 6369 7273 .byte 0x5f, 0x7a, 0x69, 0x63, 0x73, 0x72 + 26: 7032 .2byte 0x7032 + 28: 5f30 .2byte 0x5f30 + 2a: 6d7a .2byte 0x6d7a + 2c: 756d .2byte 0x756d + 2e: 316c .2byte 0x316c + 30: 3070 .2byte 0x3070 + 32: 7a5f 6576 3233 .byte 0x5f, 0x7a, 0x76, 0x65, 0x33, 0x32 + 38: 3178 .2byte 0x3178 + 3a: 3070 .2byte 0x3070 + 3c: 7a5f 6576 3436 .byte 0x5f, 0x7a, 0x76, 0x65, 0x36, 0x34 + 42: 3178 .2byte 0x3178 + 44: 3070 .2byte 0x3070 + 46: 7a5f 6c76 3233 .byte 0x5f, 0x7a, 0x76, 0x6c, 0x33, 0x32 + 4c: 3162 vmsge.vx v2,v0,zero,v0.t + 4e: 3070 .2byte 0x3070 + 50: 7a5f 6c76 3436 .byte 0x5f, 0x7a, 0x76, 0x6c, 0x36, 0x34 + 56: 3162 vmsge.vx v2,v0,zero,v0.t + 58: 3070 .2byte 0x3070 + 5a: 0800 vmsge.vx v16,v0,zero,v0.t + 5c: 0a01 vmsge.vx v20,v0,zero,v0.t + 5e: 0b Address 0x5e is out of bounds. + diff --git a/src/main/resources/applications_vector/vmulhu/vmulhu.c b/src/main/resources/applications_vector/vmulhu/vmulhu.c new file mode 100644 index 00000000..9f6633f6 --- /dev/null +++ b/src/main/resources/applications_vector/vmulhu/vmulhu.c @@ -0,0 +1,100 @@ +#include "util.h" + +#define size_t long +#define N 48 + +const unsigned short dataArray0[N] = {2229, 62092, 15469, 61976, 42298, 14258, 32199, 3671, 14659, 21886, 48577, 5578, 9419, 24199, 43704, 47651, 8581, 56751, 58018, 34058, 34614, 40404, 22179, 36496, 19656, 7360, 27344, 46659, 41186, 48565, 1303, 6734, 56548, 6946, 48589, 21968, 3238, 22028, 41376, 62192, 58563, 64122, 5181, 1171, 17047, 16907, 48231, 24561}; +const unsigned short dataArray1[N] = {45080, 49819, 7800, 12777, 367, 33341, 17465, 31645, 55700, 10454, 13949, 21583, 31081, 33567, 31757, 58386, 62774, 33507, 31827, 36488, 11728, 39387, 11606, 27362, 23628, 3202, 4426, 19912, 44128, 47231, 8055, 64181, 21755, 12333, 32628, 40953, 34786, 56967, 42973, 42717, 24376, 8516, 14335, 59365, 30060, 8775, 13671, 35151}; +signed short resultArray[N] = {0}; +signed short answerArray[N] = {0}; + +extern void printstr(char* str); +extern void int64ToHex(long num, char* str); +extern void int32ToHex(int num, char* str); +extern void clearCounters(); +extern void printCounters(); + +// #define DEBUG + +_Bool verifyResult(const unsigned short* ptr0, const unsigned short* ptr1, size_t n) { + int i; + _Bool correct = 1; + char string[19]; + for(i=0; i> 16); + } + + _Bool correct = verifyResult(resultArray, answerArray, 41); + ptr0 = dataArray0; + ptr2 = resultArray; + avl = 41; + while(avl != 0) { + asm volatile ("vsetvli %0, %1, e16, m1, ta, ma" + : "=r"(vl) + : "r"(avl)); + asm volatile ("li t0, 0x4545"); + asm volatile ("vle16.v v10, (%0)" + : + : "r"(ptr0)); + asm volatile ("vmulhu.vx v12, v10, t0"); + asm volatile ("vse16.v v12, (%0)" + : + : "r"(ptr2)); + ptr0 += vl; + ptr2 += vl; + avl -= vl; + } + for(i=0; i<41; i++) { + answerArray[i] = (unsigned short)(((unsigned int)dataArray0[i] * (unsigned int)0x4545) >> 16); + } + correct = correct && verifyResult(resultArray, answerArray, 41); + return !correct; +} diff --git a/src/main/resources/applications_vector/vmulhu_data.hex b/src/main/resources/applications_vector/vmulhu_data.hex new file mode 100644 index 00000000..52e5cc70 --- /dev/null +++ b/src/main/resources/applications_vector/vmulhu_data.hex @@ -0,0 +1,166 @@ +c29bb018 +31e91e78 +823d016f +7b9d4439 +28d6d994 +544f367d +831f7969 +e4127c0d +82e3f536 +8e887c53 +99db2dd0 +6ae22d56 +0c825c4c +4dc8114a +b87fac60 +fab51f77 +302d54fb +9ff97f74 +de8787e2 +a6dda7dd +21445f38 +e7e537ff +2247756c +894f3567 +f28c08b5 +f2183c6d +37b2a53a +0e577dc7 +557e3943 +15cabdc1 +5e8724cb +ba23aab8 +ddaf2185 +850ae2a2 +9dd48736 +8e9056a3 +1cc04cc8 +b6436ad0 +bdb5a0e2 +1a4e0517 +1b22dce4 +55d0bdcd +560c0ca6 +f2f0a1a0 +fa7ae4c3 +0493143d +420b4297 +5ff1bc67 +ffffc4e4 +ffffc528 +ffffc56c +ffffc47c +ffffc5b0 +ffffc5f4 +ffffc638 +ffffc67c +ffffc47c +ffffc47c +ffffc47c +ffffc6c0 +41525241 +4f4e2059 +4f432054 +43455252 +4e492054 +444e4920 +203a5845 +00000000 +0000000a +00000000 +6c637963 +00203a65 +736e690a +74657274 +0000203a +00000000 +74697845 +646f6320 +00203a65 +00000000 +54534e49 +54435552 +204e4f49 +52444441 +20535345 +4153494d +4e47494c +61204445 +43502074 +0000203a +54534e49 +54435552 +204e4f49 +45434341 +46205353 +544c5541 +20746120 +203a4350 +00000000 +00000000 +454c4c49 +204c4147 +54534e49 +54435552 +204e4f49 +50207461 +00203a43 +00000000 +44414f4c +44444120 +53534552 +53494d20 +47494c41 +2044454e +50207461 +00203a43 +44414f4c +43434120 +20535345 +4c554146 +74612054 +3a435020 +00000020 +00000000 +524f5453 +44412045 +53455244 +494d2053 +494c4153 +44454e47 +20746120 +203a4350 +00000000 +00000000 +524f5453 +43412045 +53534543 +55414620 +6120544c +43502074 +0000203a +00000000 +4c414345 +5246204c +4d204d4f +444f4d2d +74612045 +3a435020 +00000020 +00000000 +4e4b4e55 +204e574f +45435845 +4f495450 +7461204e +3a435020 +00000020 +00000000 +4548430a +4d204b43 +53554143 +6e692045 +4c545220 +00000000 +01010101 +01010101 diff --git a/src/main/resources/applications_vector/vmulhu_inst.hex b/src/main/resources/applications_vector/vmulhu_inst.hex new file mode 100644 index 00000000..3e9b0798 --- /dev/null +++ b/src/main/resources/applications_vector/vmulhu_inst.hex @@ -0,0 +1,713 @@ +00000093 +00000113 +00000193 +00000213 +00000293 +00000313 +00000393 +00000413 +00000493 +00000513 +00000593 +00000613 +00000693 +00000713 +00000793 +00000813 +00000893 +00000913 +00000993 +00000a13 +00000a93 +00000b13 +00000b93 +00000c13 +00000c93 +00000d13 +00000d93 +00000e13 +00000e93 +00000f13 +00000f93 +00000297 +03828293 +30529073 +00005197 +a0818193 +10000217 +ff720213 +fc027213 +f1402573 +00100593 +00b57063 +00006137 +ff01011b +71c0006f +ef010113 +00113423 +00213823 +00313c23 +02413023 +02513423 +02613823 +02713c23 +04813023 +04913423 +04a13823 +04b13c23 +06c13023 +06d13423 +06e13823 +06f13c23 +09013023 +09113423 +09213823 +09313c23 +0b413023 +0b513423 +0b613823 +0b713c23 +0d813023 +0d913423 +0da13823 +0db13c23 +0fc13023 +0fd13423 +0fe13823 +0ff13c23 +34202573 +341025f3 +00010613 +394000ef +34151073 +000022b7 +8002829b +3002a073 +00813083 +01013103 +01813183 +02013203 +02813283 +03013303 +03813383 +04013403 +04813483 +05013503 +05813583 +06013603 +06813683 +07013703 +07813783 +08013803 +08813883 +09013903 +09813983 +0a013a03 +0a813a83 +0b013b03 +0b813b83 +0c013c03 +0c813c83 +0d013d03 +0d813d83 +0e013e03 +0e813e83 +0f013f03 +0f813f83 +11010113 +30200073 +0ac05c63 +fa010113 +00161613 +04813823 +04913423 +05213023 +03313c23 +03413823 +03513423 +04113c23 +00050413 +00058493 +00c509b3 +00100693 +00000913 +00004a17 +edca0a13 +00004a97 +ef4a8a93 +00045703 +0004d783 +000a0513 +00240413 +00248493 +02f70463 +0f4000ef +00810593 +00090513 +060000ef +00810513 +0e0000ef +000a8513 +0d8000ef +00000693 +0019091b +fd3410e3 +05813083 +05013403 +04813483 +04013903 +03813983 +03013a03 +02813a83 +00068513 +06010113 +00008067 +00100693 +00068513 +00008067 +b0201073 +b0001073 +00008067 +03000793 +00f58023 +07800793 +00f580a3 +00158813 +00958793 +00900613 +00f57713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +40455513 +fef812e3 +00058523 +00008067 +03000793 +00f58023 +07800793 +00f580a3 +00158813 +01158793 +00900613 +00f57713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +40455513 +fef812e3 +00058923 +00008067 +00054783 +00078c63 +10000737 +00f70023 +00154783 +00150513 +fe079ae3 +00008067 +fe010113 +c0202673 +c00025f3 +00004717 +dbc70713 +06300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +ffff8737 +83074713 +01910793 +00e11423 +00910813 +00078713 +00900893 +00f5f693 +03768513 +00d8e463 +03068513 +00a70023 +fff70713 +4045d593 +fee812e3 +00814703 +00010d23 +00810693 +100005b7 +00070a63 +00e58023 +0016c703 +00168693 +fe071ae3 +00004697 +d4468693 +00a00713 +100005b7 +00e58023 +0016c703 +00168693 +fe071ae3 +ffff8737 +83074713 +00060693 +00e11423 +00900593 +00f6f713 +03770613 +00e5e463 +03070613 +00c78023 +fff78793 +4046d693 +fef812e3 +00814783 +00010d23 +00810713 +100006b7 +00078a63 +00f68023 +00174783 +00170713 +fe079ae3 +100007b7 +00a00713 +00e78023 +02010113 +00008067 +fe010113 +00813823 +00113c23 +00050413 +00004717 +cb870713 +04500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00010593 +00040513 +e09ff0ef +00014703 +00070e63 +00010793 +100006b7 +00e68023 +0017c703 +00178793 +fe071ae3 +00040513 +100007b7 +00078023 +0000006f +ffff87b7 +fd010113 +8307c793 +00f11423 +02113423 +01910793 +00910813 +00900613 +00f5f713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +4045d593 +ff0792e3 +00010d23 +00b00793 +02a7e063 +00004717 +ba070713 +00251513 +00e50533 +00052783 +00e787b3 +00078067 +00004717 +d1c70713 +05500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +00810713 +100006b7 +00078a63 +00f68023 +00174783 +00170713 +fe079ae3 +00004717 +cfc70713 +00a00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +fff00513 +ec9ff0ef +00004717 +b9c70713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +00810713 +100006b7 +fc0786e3 +00f68023 +00174783 +00170713 +fe079ae3 +fb9ff06f +00004717 +b8070713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f80788e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +f75ff06f +00004717 +b6470713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f40786e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +f31ff06f +00004717 +b4070713 +04c00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f00784e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +eedff06f +00004717 +b1c70713 +04c00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +ec0782e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +ea9ff06f +00004717 +af870713 +05300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +e80780e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +e65ff06f +00004717 +adc70713 +05300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +e2078ee3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +e21ff06f +00004717 +ab870713 +04500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +de078ce3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +dddff06f +00051063 +00008067 +ff010113 +00000593 +00000513 +00113423 +1d8000ef +c89ff0ef +00b567b3 +00c7e7b3 +0077f793 +00c50833 +02078463 +00c58633 +00050793 +0b057663 +0005c703 +00158593 +00178793 +fee78fa3 +fec598e3 +00008067 +04050693 +0906f863 +00058713 +00068793 +00073383 +00873283 +01073f83 +01873f03 +02073e83 +02873e03 +03073303 +03873883 +04078793 +f877b023 +f857b423 +f9f7b823 +f9e7bc23 +fbd7b023 +fbc7b423 +fa67b823 +fb17bc23 +04070713 +fb07ece3 +fbf60613 +fc067793 +04078793 +fc067613 +00f585b3 +00c687b3 +f907f4e3 +0005b703 +00878793 +00858593 +fee7bc23 +ff07e8e3 +00008067 +00008067 +00050793 +fddff06f +00c567b3 +0077f793 +00c50633 +0ff5f713 +00078e63 +00050793 +02c57c63 +00178793 +fee78fa3 +fef61ce3 +00008067 +00004797 +9ac7b783 +02f70733 +fec578e3 +00050793 +00878793 +fee7bc23 +fec7ece3 +00008067 +00008067 +00054783 +00078e63 +00050793 +0017c703 +00178793 +fe071ce3 +40a78533 +00008067 +00000513 +00008067 +00b506b3 +00050793 +00059863 +0240006f +00178793 +00f68a63 +0007c703 +fe071ae3 +40a78533 +00008067 +40a68533 +00008067 +00000513 +00008067 +00054783 +00158593 +00150513 +fff5c703 +00078a63 +fee786e3 +0007851b +40e5053b +00008067 +00000513 +ff5ff06f +00050793 +0005c703 +00178793 +00158593 +fee78fa3 +fe0718e3 +00008067 +fe010113 +00113c23 +00813823 +00913423 +01213023 +00004597 +8d058593 +00003617 +63060613 +00003697 +68868693 +02900713 +0c877557 +0005079b +0206d507 +02065587 +92a5a657 +0205d627 +00179793 +40a7073b +00f686b3 +00f60633 +00f585b3 +fc071ae3 +00003417 +64c40413 +86818493 +00003617 +5e060613 +00003917 +68a90913 +00048693 +00040713 +00075783 +00065583 +00268693 +00270713 +02b787bb +00260613 +0107d79b +fef69f23 +ff2710e3 +02900613 +86818593 +00004517 +83450513 +f6cff0ef +00050813 +00004617 +82460613 +00003697 +5e468693 +02900713 +0c8775d7 +0005879b +000042b7 +5452829b +0206d507 +92a2e657 +02065627 +00179793 +40b7073b +00f686b3 +00f60633 +fc071ae3 +00004737 +5457071b +00045783 +00248493 +00240413 +02e787bb +0107d79b +fef49f23 +ff2414e3 +00100513 +00081e63 +01813083 +01013403 +00813483 +00013903 +02010113 +00008067 +02900613 +86818593 +00003517 +79450513 +eccff0ef +00154513 +0ff57513 +fcdff06f +fff00513 +00008067 diff --git a/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala b/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala index 10f630d6..4546a6e7 100644 --- a/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala +++ b/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala @@ -139,12 +139,12 @@ class Zve64xAppTestForVecCpu extends AnyFlatSpec with ChiselScalatestTester { "vadd", "vsub", "vand", "vmseq", "vmslt", "vmsle", "vmsgt", "vminmax", "vmerge", "vmv", "vmand", "vmor", "vmxor", - "vmul", "vmulh" + "vmul", "vmulh", "vmulhu" ) val applicationTest = Seq( "vector_median" ) - val zve64xTestList: Seq[String] = ldstTest ++ arithmeticTest ++ applicationTest + val zve64xTestList: Seq[String] = Seq("vmulhu") for (e <- zve64xTestList) { it should s"Vector CPU execute $e" in { test(new Core_and_cache(useVector = true, cpu = classOf[VectorCpu])).withAnnotations(Seq(WriteVcdAnnotation, VerilatorBackendAnnotation)) { dut => From 8f5dc5f909b193e7d76ec8471b6970a228d4cc37 Mon Sep 17 00:00:00 2001 From: HidetaroTanaka Date: Fri, 10 Nov 2023 14:49:16 +0900 Subject: [PATCH 8/8] a --- .../resources/applications_vector/build.sh | 17 + .../applications_vector/vmulhsu.dump | 1112 +++++++++++++++++ .../applications_vector/vmulhsu/vmulhsu.c | 100 ++ .../applications_vector/vmulhsu_data.hex | 166 +++ .../applications_vector/vmulhsu_inst.hex | 713 +++++++++++ .../hajime/vectormodules/VectorCpuSpec.scala | 4 +- 6 files changed, 2110 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/applications_vector/vmulhsu.dump create mode 100644 src/main/resources/applications_vector/vmulhsu/vmulhsu.c create mode 100644 src/main/resources/applications_vector/vmulhsu_data.hex create mode 100644 src/main/resources/applications_vector/vmulhsu_inst.hex diff --git a/src/main/resources/applications_vector/build.sh b/src/main/resources/applications_vector/build.sh index 5118e832..02b316ed 100644 --- a/src/main/resources/applications_vector/build.sh +++ b/src/main/resources/applications_vector/build.sh @@ -435,5 +435,22 @@ hexdump -v -e '1/4 "%08x" "\n"' vmulhu_text_startup.bin > vmulhu_text_startup.te cat vmulhu_rodata.temp vmulhu_rodata_str1_8.temp vmulhu_sdata.temp > vmulhu_data.hex cat vmulhu_text_init.temp vmulhu_text.temp vmulhu_text_startup.temp > vmulhu_inst.hex +riscv64-unknown-elf-gcc -I ../application_headers -DPREALLOCATE=1 -mcmodel=medany -static -std=gnu99 -O2 -fno-common -fno-builtin-printf -fno-tree-loop-distribute-patterns -march=rv64im_zicsr_zve64x -mabi=lp64 -o vmulhsu.riscv ./vmulhsu/vmulhsu.c ../application_headers/syscalls.c ../application_headers/crt.S -static -nostdlib -nostartfiles -T ../application_headers/test.ld +riscv64-unknown-elf-objdump --disassemble-all vmulhsu.riscv > vmulhsu.dump +riscv64-unknown-elf-objdump --disassemble-all vmulhsu.riscv > vmulhsu.dump +riscv64-unknown-elf-objcopy --dump-section .rodata=vmulhsu_rodata.bin vmulhsu.riscv +riscv64-unknown-elf-objcopy --dump-section .rodata.str1.8=vmulhsu_rodata_str1_8.bin vmulhsu.riscv +riscv64-unknown-elf-objcopy --dump-section .sdata=vmulhsu_sdata.bin vmulhsu.riscv +riscv64-unknown-elf-objcopy --dump-section .text.init=vmulhsu_text_init.bin vmulhsu.riscv +riscv64-unknown-elf-objcopy --dump-section .text=vmulhsu_text.bin vmulhsu.riscv +riscv64-unknown-elf-objcopy --dump-section .text.startup=vmulhsu_text_startup.bin vmulhsu.riscv +hexdump -v -e '1/4 "%08x" "\n"' vmulhsu_rodata.bin > vmulhsu_rodata.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulhsu_rodata_str1_8.bin > vmulhsu_rodata_str1_8.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulhsu_sdata.bin > vmulhsu_sdata.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulhsu_text_init.bin > vmulhsu_text_init.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulhsu_text.bin > vmulhsu_text.temp +hexdump -v -e '1/4 "%08x" "\n"' vmulhsu_text_startup.bin > vmulhsu_text_startup.temp +cat vmulhsu_rodata.temp vmulhsu_rodata_str1_8.temp vmulhsu_sdata.temp > vmulhsu_data.hex +cat vmulhsu_text_init.temp vmulhsu_text.temp vmulhsu_text_startup.temp > vmulhsu_inst.hex rm *.riscv *.bin *.temp \ No newline at end of file diff --git a/src/main/resources/applications_vector/vmulhsu.dump b/src/main/resources/applications_vector/vmulhsu.dump new file mode 100644 index 00000000..8aedad60 --- /dev/null +++ b/src/main/resources/applications_vector/vmulhsu.dump @@ -0,0 +1,1112 @@ + +vmulhsu.riscv: file format elf64-littleriscv + + +Disassembly of section .text.init: + +0000000000000000 <_start>: + 0: 00000093 li ra,0 + 4: 00000113 li sp,0 + 8: 00000193 li gp,0 + c: 00000213 li tp,0 + 10: 00000293 li t0,0 + 14: 00000313 li t1,0 + 18: 00000393 li t2,0 + 1c: 00000413 li s0,0 + 20: 00000493 li s1,0 + 24: 00000513 li a0,0 + 28: 00000593 li a1,0 + 2c: 00000613 li a2,0 + 30: 00000693 li a3,0 + 34: 00000713 li a4,0 + 38: 00000793 li a5,0 + 3c: 00000813 li a6,0 + 40: 00000893 li a7,0 + 44: 00000913 li s2,0 + 48: 00000993 li s3,0 + 4c: 00000a13 li s4,0 + 50: 00000a93 li s5,0 + 54: 00000b13 li s6,0 + 58: 00000b93 li s7,0 + 5c: 00000c13 li s8,0 + 60: 00000c93 li s9,0 + 64: 00000d13 li s10,0 + 68: 00000d93 li s11,0 + 6c: 00000e13 li t3,0 + 70: 00000e93 li t4,0 + 74: 00000f13 li t5,0 + 78: 00000f93 li t6,0 + 7c: 00000297 auipc t0,0x0 + 80: 03828293 add t0,t0,56 # b4 + 84: 30529073 csrw mtvec,t0 + 88: 00005197 auipc gp,0x5 + 8c: a0818193 add gp,gp,-1528 # 4a90 <__global_pointer$> + 90: 10000217 auipc tp,0x10000 + 94: ff720213 add tp,tp,-9 # 10000087 <_end+0x3f> + 98: fc027213 and tp,tp,-64 + 9c: f1402573 csrr a0,mhartid + a0: 00100593 li a1,1 + a4: 00b57063 bgeu a0,a1,a4 <_start+0xa4> + a8: 00006137 lui sp,0x6 + ac: ff01011b addw sp,sp,-16 # 5ff0 <__global_pointer$+0x1560> + b0: 71c0006f j 7cc <_init> + +00000000000000b4 : + b4: ef010113 add sp,sp,-272 + b8: 00113423 sd ra,8(sp) + bc: 00213823 sd sp,16(sp) + c0: 00313c23 sd gp,24(sp) + c4: 02413023 sd tp,32(sp) + c8: 02513423 sd t0,40(sp) + cc: 02613823 sd t1,48(sp) + d0: 02713c23 sd t2,56(sp) + d4: 04813023 sd s0,64(sp) + d8: 04913423 sd s1,72(sp) + dc: 04a13823 sd a0,80(sp) + e0: 04b13c23 sd a1,88(sp) + e4: 06c13023 sd a2,96(sp) + e8: 06d13423 sd a3,104(sp) + ec: 06e13823 sd a4,112(sp) + f0: 06f13c23 sd a5,120(sp) + f4: 09013023 sd a6,128(sp) + f8: 09113423 sd a7,136(sp) + fc: 09213823 sd s2,144(sp) + 100: 09313c23 sd s3,152(sp) + 104: 0b413023 sd s4,160(sp) + 108: 0b513423 sd s5,168(sp) + 10c: 0b613823 sd s6,176(sp) + 110: 0b713c23 sd s7,184(sp) + 114: 0d813023 sd s8,192(sp) + 118: 0d913423 sd s9,200(sp) + 11c: 0da13823 sd s10,208(sp) + 120: 0db13c23 sd s11,216(sp) + 124: 0fc13023 sd t3,224(sp) + 128: 0fd13423 sd t4,232(sp) + 12c: 0fe13823 sd t5,240(sp) + 130: 0ff13c23 sd t6,248(sp) + 134: 34202573 csrr a0,mcause + 138: 341025f3 csrr a1,mepc + 13c: 00010613 mv a2,sp + 140: 394000ef jal 4d4 + 144: 34151073 csrw mepc,a0 + 148: 000022b7 lui t0,0x2 + 14c: 8002829b addw t0,t0,-2048 # 1800 + 150: 3002a073 csrs mstatus,t0 + 154: 00813083 ld ra,8(sp) + 158: 01013103 ld sp,16(sp) + 15c: 01813183 ld gp,24(sp) + 160: 02013203 ld tp,32(sp) + 164: 02813283 ld t0,40(sp) + 168: 03013303 ld t1,48(sp) + 16c: 03813383 ld t2,56(sp) + 170: 04013403 ld s0,64(sp) + 174: 04813483 ld s1,72(sp) + 178: 05013503 ld a0,80(sp) + 17c: 05813583 ld a1,88(sp) + 180: 06013603 ld a2,96(sp) + 184: 06813683 ld a3,104(sp) + 188: 07013703 ld a4,112(sp) + 18c: 07813783 ld a5,120(sp) + 190: 08013803 ld a6,128(sp) + 194: 08813883 ld a7,136(sp) + 198: 09013903 ld s2,144(sp) + 19c: 09813983 ld s3,152(sp) + 1a0: 0a013a03 ld s4,160(sp) + 1a4: 0a813a83 ld s5,168(sp) + 1a8: 0b013b03 ld s6,176(sp) + 1ac: 0b813b83 ld s7,184(sp) + 1b0: 0c013c03 ld s8,192(sp) + 1b4: 0c813c83 ld s9,200(sp) + 1b8: 0d013d03 ld s10,208(sp) + 1bc: 0d813d83 ld s11,216(sp) + 1c0: 0e013e03 ld t3,224(sp) + 1c4: 0e813e83 ld t4,232(sp) + 1c8: 0f013f03 ld t5,240(sp) + 1cc: 0f813f83 ld t6,248(sp) + 1d0: 11010113 add sp,sp,272 + 1d4: 30200073 mret + +Disassembly of section .text: + +00000000000001d8 : + 1d8: 0ac05c63 blez a2,290 + 1dc: fa010113 add sp,sp,-96 + 1e0: 00161613 sll a2,a2,0x1 + 1e4: 04813823 sd s0,80(sp) + 1e8: 04913423 sd s1,72(sp) + 1ec: 05213023 sd s2,64(sp) + 1f0: 03313c23 sd s3,56(sp) + 1f4: 03413823 sd s4,48(sp) + 1f8: 03513423 sd s5,40(sp) + 1fc: 04113c23 sd ra,88(sp) + 200: 00050413 mv s0,a0 + 204: 00058493 mv s1,a1 + 208: 00c509b3 add s3,a0,a2 + 20c: 00100693 li a3,1 + 210: 00000913 li s2,0 + 214: 00004a17 auipc s4,0x4 + 218: edca0a13 add s4,s4,-292 # 40f0 + 21c: 00004a97 auipc s5,0x4 + 220: ef4a8a93 add s5,s5,-268 # 4110 + 224: 00045703 lhu a4,0(s0) + 228: 0004d783 lhu a5,0(s1) + 22c: 000a0513 mv a0,s4 + 230: 00240413 add s0,s0,2 + 234: 00248493 add s1,s1,2 + 238: 02f70463 beq a4,a5,260 + 23c: 0f4000ef jal 330 + 240: 00810593 add a1,sp,8 + 244: 00090513 mv a0,s2 + 248: 060000ef jal 2a8 + 24c: 00810513 add a0,sp,8 + 250: 0e0000ef jal 330 + 254: 000a8513 mv a0,s5 + 258: 0d8000ef jal 330 + 25c: 00000693 li a3,0 + 260: 0019091b addw s2,s2,1 + 264: fd3410e3 bne s0,s3,224 + 268: 05813083 ld ra,88(sp) + 26c: 05013403 ld s0,80(sp) + 270: 04813483 ld s1,72(sp) + 274: 04013903 ld s2,64(sp) + 278: 03813983 ld s3,56(sp) + 27c: 03013a03 ld s4,48(sp) + 280: 02813a83 ld s5,40(sp) + 284: 00068513 mv a0,a3 + 288: 06010113 add sp,sp,96 + 28c: 00008067 ret + 290: 00100693 li a3,1 + 294: 00068513 mv a0,a3 + 298: 00008067 ret + +000000000000029c : + 29c: b0201073 csrw minstret,zero + 2a0: b0001073 csrw mcycle,zero + 2a4: 00008067 ret + +00000000000002a8 : + 2a8: 03000793 li a5,48 + 2ac: 00f58023 sb a5,0(a1) + 2b0: 07800793 li a5,120 + 2b4: 00f580a3 sb a5,1(a1) + 2b8: 00158813 add a6,a1,1 + 2bc: 00958793 add a5,a1,9 + 2c0: 00900613 li a2,9 + 2c4: 00f57713 and a4,a0,15 + 2c8: 03770693 add a3,a4,55 + 2cc: 00e66463 bltu a2,a4,2d4 + 2d0: 03070693 add a3,a4,48 + 2d4: 00d78023 sb a3,0(a5) + 2d8: fff78793 add a5,a5,-1 + 2dc: 40455513 sra a0,a0,0x4 + 2e0: fef812e3 bne a6,a5,2c4 + 2e4: 00058523 sb zero,10(a1) + 2e8: 00008067 ret + +00000000000002ec : + 2ec: 03000793 li a5,48 + 2f0: 00f58023 sb a5,0(a1) + 2f4: 07800793 li a5,120 + 2f8: 00f580a3 sb a5,1(a1) + 2fc: 00158813 add a6,a1,1 + 300: 01158793 add a5,a1,17 + 304: 00900613 li a2,9 + 308: 00f57713 and a4,a0,15 + 30c: 03770693 add a3,a4,55 + 310: 00e66463 bltu a2,a4,318 + 314: 03070693 add a3,a4,48 + 318: 00d78023 sb a3,0(a5) + 31c: fff78793 add a5,a5,-1 + 320: 40455513 sra a0,a0,0x4 + 324: fef812e3 bne a6,a5,308 + 328: 00058923 sb zero,18(a1) + 32c: 00008067 ret + +0000000000000330 : + 330: 00054783 lbu a5,0(a0) + 334: 00078c63 beqz a5,34c + 338: 10000737 lui a4,0x10000 + 33c: 00f70023 sb a5,0(a4) # 10000000 + 340: 00154783 lbu a5,1(a0) + 344: 00150513 add a0,a0,1 + 348: fe079ae3 bnez a5,33c + 34c: 00008067 ret + +0000000000000350 : + 350: fe010113 add sp,sp,-32 + 354: c0202673 rdinstret a2 + 358: c00025f3 rdcycle a1 + 35c: 00004717 auipc a4,0x4 + 360: dbc70713 add a4,a4,-580 # 4118 + 364: 06300793 li a5,99 + 368: 100006b7 lui a3,0x10000 + 36c: 00f68023 sb a5,0(a3) # 10000000 + 370: 00174783 lbu a5,1(a4) + 374: 00170713 add a4,a4,1 + 378: fe079ae3 bnez a5,36c + 37c: ffff8737 lui a4,0xffff8 + 380: 83074713 xor a4,a4,-2000 + 384: 01910793 add a5,sp,25 + 388: 00e11423 sh a4,8(sp) + 38c: 00910813 add a6,sp,9 + 390: 00078713 mv a4,a5 + 394: 00900893 li a7,9 + 398: 00f5f693 and a3,a1,15 + 39c: 03768513 add a0,a3,55 + 3a0: 00d8e463 bltu a7,a3,3a8 + 3a4: 03068513 add a0,a3,48 + 3a8: 00a70023 sb a0,0(a4) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 3ac: fff70713 add a4,a4,-1 + 3b0: 4045d593 sra a1,a1,0x4 + 3b4: fee812e3 bne a6,a4,398 + 3b8: 00814703 lbu a4,8(sp) + 3bc: 00010d23 sb zero,26(sp) + 3c0: 00810693 add a3,sp,8 + 3c4: 100005b7 lui a1,0x10000 + 3c8: 00070a63 beqz a4,3dc + 3cc: 00e58023 sb a4,0(a1) # 10000000 + 3d0: 0016c703 lbu a4,1(a3) + 3d4: 00168693 add a3,a3,1 + 3d8: fe071ae3 bnez a4,3cc + 3dc: 00004697 auipc a3,0x4 + 3e0: d4468693 add a3,a3,-700 # 4120 + 3e4: 00a00713 li a4,10 + 3e8: 100005b7 lui a1,0x10000 + 3ec: 00e58023 sb a4,0(a1) # 10000000 + 3f0: 0016c703 lbu a4,1(a3) + 3f4: 00168693 add a3,a3,1 + 3f8: fe071ae3 bnez a4,3ec + 3fc: ffff8737 lui a4,0xffff8 + 400: 83074713 xor a4,a4,-2000 + 404: 00060693 mv a3,a2 + 408: 00e11423 sh a4,8(sp) + 40c: 00900593 li a1,9 + 410: 00f6f713 and a4,a3,15 + 414: 03770613 add a2,a4,55 # ffffffffffff8037 <_end+0xffffffffefff7fef> + 418: 00e5e463 bltu a1,a4,420 + 41c: 03070613 add a2,a4,48 + 420: 00c78023 sb a2,0(a5) + 424: fff78793 add a5,a5,-1 + 428: 4046d693 sra a3,a3,0x4 + 42c: fef812e3 bne a6,a5,410 + 430: 00814783 lbu a5,8(sp) + 434: 00010d23 sb zero,26(sp) + 438: 00810713 add a4,sp,8 + 43c: 100006b7 lui a3,0x10000 + 440: 00078a63 beqz a5,454 + 444: 00f68023 sb a5,0(a3) # 10000000 + 448: 00174783 lbu a5,1(a4) + 44c: 00170713 add a4,a4,1 + 450: fe079ae3 bnez a5,444 + 454: 100007b7 lui a5,0x10000 + 458: 00a00713 li a4,10 + 45c: 00e78023 sb a4,0(a5) # 10000000 + 460: 02010113 add sp,sp,32 + 464: 00008067 ret + +0000000000000468 : + 468: fe010113 add sp,sp,-32 + 46c: 00813823 sd s0,16(sp) + 470: 00113c23 sd ra,24(sp) + 474: 00050413 mv s0,a0 + 478: 00004717 auipc a4,0x4 + 47c: cb870713 add a4,a4,-840 # 4130 + 480: 04500793 li a5,69 + 484: 100006b7 lui a3,0x10000 + 488: 00f68023 sb a5,0(a3) # 10000000 + 48c: 00174783 lbu a5,1(a4) + 490: 00170713 add a4,a4,1 + 494: fe079ae3 bnez a5,488 + 498: 00010593 mv a1,sp + 49c: 00040513 mv a0,s0 + 4a0: e09ff0ef jal 2a8 + 4a4: 00014703 lbu a4,0(sp) + 4a8: 00070e63 beqz a4,4c4 + 4ac: 00010793 mv a5,sp + 4b0: 100006b7 lui a3,0x10000 + 4b4: 00e68023 sb a4,0(a3) # 10000000 + 4b8: 0017c703 lbu a4,1(a5) + 4bc: 00178793 add a5,a5,1 + 4c0: fe071ae3 bnez a4,4b4 + 4c4: 00040513 mv a0,s0 + 4c8: 100007b7 lui a5,0x10000 + 4cc: 00078023 sb zero,0(a5) # 10000000 + 4d0: 0000006f j 4d0 + +00000000000004d4 : + 4d4: ffff87b7 lui a5,0xffff8 + 4d8: fd010113 add sp,sp,-48 + 4dc: 8307c793 xor a5,a5,-2000 + 4e0: 00f11423 sh a5,8(sp) + 4e4: 02113423 sd ra,40(sp) + 4e8: 01910793 add a5,sp,25 + 4ec: 00910813 add a6,sp,9 + 4f0: 00900613 li a2,9 + 4f4: 00f5f713 and a4,a1,15 + 4f8: 03770693 add a3,a4,55 + 4fc: 00e66463 bltu a2,a4,504 + 500: 03070693 add a3,a4,48 + 504: 00d78023 sb a3,0(a5) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 508: fff78793 add a5,a5,-1 + 50c: 4045d593 sra a1,a1,0x4 + 510: ff0792e3 bne a5,a6,4f4 + 514: 00010d23 sb zero,26(sp) + 518: 00b00793 li a5,11 + 51c: 02a7e063 bltu a5,a0,53c + 520: 00004717 auipc a4,0x4 + 524: ba070713 add a4,a4,-1120 # 40c0 + 528: 00251513 sll a0,a0,0x2 + 52c: 00e50533 add a0,a0,a4 + 530: 00052783 lw a5,0(a0) + 534: 00e787b3 add a5,a5,a4 + 538: 00078067 jr a5 + 53c: 00004717 auipc a4,0x4 + 540: d1c70713 add a4,a4,-740 # 4258 + 544: 05500793 li a5,85 + 548: 100006b7 lui a3,0x10000 + 54c: 00f68023 sb a5,0(a3) # 10000000 + 550: 00174783 lbu a5,1(a4) + 554: 00170713 add a4,a4,1 + 558: fe079ae3 bnez a5,54c + 55c: 00814783 lbu a5,8(sp) + 560: 00810713 add a4,sp,8 + 564: 100006b7 lui a3,0x10000 + 568: 00078a63 beqz a5,57c + 56c: 00f68023 sb a5,0(a3) # 10000000 + 570: 00174783 lbu a5,1(a4) + 574: 00170713 add a4,a4,1 + 578: fe079ae3 bnez a5,56c + 57c: 00004717 auipc a4,0x4 + 580: cfc70713 add a4,a4,-772 # 4278 + 584: 00a00793 li a5,10 + 588: 100006b7 lui a3,0x10000 + 58c: 00f68023 sb a5,0(a3) # 10000000 + 590: 00174783 lbu a5,1(a4) + 594: 00170713 add a4,a4,1 + 598: fe079ae3 bnez a5,58c + 59c: fff00513 li a0,-1 + 5a0: ec9ff0ef jal 468 + 5a4: 00004717 auipc a4,0x4 + 5a8: b9c70713 add a4,a4,-1124 # 4140 + 5ac: 04900793 li a5,73 + 5b0: 100006b7 lui a3,0x10000 + 5b4: 00f68023 sb a5,0(a3) # 10000000 + 5b8: 00174783 lbu a5,1(a4) + 5bc: 00170713 add a4,a4,1 + 5c0: fe079ae3 bnez a5,5b4 + 5c4: 00814783 lbu a5,8(sp) + 5c8: 00810713 add a4,sp,8 + 5cc: 100006b7 lui a3,0x10000 + 5d0: fc0786e3 beqz a5,59c + 5d4: 00f68023 sb a5,0(a3) # 10000000 + 5d8: 00174783 lbu a5,1(a4) + 5dc: 00170713 add a4,a4,1 + 5e0: fe079ae3 bnez a5,5d4 + 5e4: fb9ff06f j 59c + 5e8: 00004717 auipc a4,0x4 + 5ec: b8070713 add a4,a4,-1152 # 4168 + 5f0: 04900793 li a5,73 + 5f4: 100006b7 lui a3,0x10000 + 5f8: 00f68023 sb a5,0(a3) # 10000000 + 5fc: 00174783 lbu a5,1(a4) + 600: 00170713 add a4,a4,1 + 604: fe079ae3 bnez a5,5f8 + 608: 00814783 lbu a5,8(sp) + 60c: f80788e3 beqz a5,59c + 610: 00810713 add a4,sp,8 + 614: 100006b7 lui a3,0x10000 + 618: 00f68023 sb a5,0(a3) # 10000000 + 61c: 00174783 lbu a5,1(a4) + 620: 00170713 add a4,a4,1 + 624: fe079ae3 bnez a5,618 + 628: f75ff06f j 59c + 62c: 00004717 auipc a4,0x4 + 630: b6470713 add a4,a4,-1180 # 4190 + 634: 04900793 li a5,73 + 638: 100006b7 lui a3,0x10000 + 63c: 00f68023 sb a5,0(a3) # 10000000 + 640: 00174783 lbu a5,1(a4) + 644: 00170713 add a4,a4,1 + 648: fe079ae3 bnez a5,63c + 64c: 00814783 lbu a5,8(sp) + 650: f40786e3 beqz a5,59c + 654: 00810713 add a4,sp,8 + 658: 100006b7 lui a3,0x10000 + 65c: 00f68023 sb a5,0(a3) # 10000000 + 660: 00174783 lbu a5,1(a4) + 664: 00170713 add a4,a4,1 + 668: fe079ae3 bnez a5,65c + 66c: f31ff06f j 59c + 670: 00004717 auipc a4,0x4 + 674: b4070713 add a4,a4,-1216 # 41b0 + 678: 04c00793 li a5,76 + 67c: 100006b7 lui a3,0x10000 + 680: 00f68023 sb a5,0(a3) # 10000000 + 684: 00174783 lbu a5,1(a4) + 688: 00170713 add a4,a4,1 + 68c: fe079ae3 bnez a5,680 + 690: 00814783 lbu a5,8(sp) + 694: f00784e3 beqz a5,59c + 698: 00810713 add a4,sp,8 + 69c: 100006b7 lui a3,0x10000 + 6a0: 00f68023 sb a5,0(a3) # 10000000 + 6a4: 00174783 lbu a5,1(a4) + 6a8: 00170713 add a4,a4,1 + 6ac: fe079ae3 bnez a5,6a0 + 6b0: eedff06f j 59c + 6b4: 00004717 auipc a4,0x4 + 6b8: b1c70713 add a4,a4,-1252 # 41d0 + 6bc: 04c00793 li a5,76 + 6c0: 100006b7 lui a3,0x10000 + 6c4: 00f68023 sb a5,0(a3) # 10000000 + 6c8: 00174783 lbu a5,1(a4) + 6cc: 00170713 add a4,a4,1 + 6d0: fe079ae3 bnez a5,6c4 + 6d4: 00814783 lbu a5,8(sp) + 6d8: ec0782e3 beqz a5,59c + 6dc: 00810713 add a4,sp,8 + 6e0: 100006b7 lui a3,0x10000 + 6e4: 00f68023 sb a5,0(a3) # 10000000 + 6e8: 00174783 lbu a5,1(a4) + 6ec: 00170713 add a4,a4,1 + 6f0: fe079ae3 bnez a5,6e4 + 6f4: ea9ff06f j 59c + 6f8: 00004717 auipc a4,0x4 + 6fc: af870713 add a4,a4,-1288 # 41f0 + 700: 05300793 li a5,83 + 704: 100006b7 lui a3,0x10000 + 708: 00f68023 sb a5,0(a3) # 10000000 + 70c: 00174783 lbu a5,1(a4) + 710: 00170713 add a4,a4,1 + 714: fe079ae3 bnez a5,708 + 718: 00814783 lbu a5,8(sp) + 71c: e80780e3 beqz a5,59c + 720: 00810713 add a4,sp,8 + 724: 100006b7 lui a3,0x10000 + 728: 00f68023 sb a5,0(a3) # 10000000 + 72c: 00174783 lbu a5,1(a4) + 730: 00170713 add a4,a4,1 + 734: fe079ae3 bnez a5,728 + 738: e65ff06f j 59c + 73c: 00004717 auipc a4,0x4 + 740: adc70713 add a4,a4,-1316 # 4218 + 744: 05300793 li a5,83 + 748: 100006b7 lui a3,0x10000 + 74c: 00f68023 sb a5,0(a3) # 10000000 + 750: 00174783 lbu a5,1(a4) + 754: 00170713 add a4,a4,1 + 758: fe079ae3 bnez a5,74c + 75c: 00814783 lbu a5,8(sp) + 760: e2078ee3 beqz a5,59c + 764: 00810713 add a4,sp,8 + 768: 100006b7 lui a3,0x10000 + 76c: 00f68023 sb a5,0(a3) # 10000000 + 770: 00174783 lbu a5,1(a4) + 774: 00170713 add a4,a4,1 + 778: fe079ae3 bnez a5,76c + 77c: e21ff06f j 59c + 780: 00004717 auipc a4,0x4 + 784: ab870713 add a4,a4,-1352 # 4238 + 788: 04500793 li a5,69 + 78c: 100006b7 lui a3,0x10000 + 790: 00f68023 sb a5,0(a3) # 10000000 + 794: 00174783 lbu a5,1(a4) + 798: 00170713 add a4,a4,1 + 79c: fe079ae3 bnez a5,790 + 7a0: 00814783 lbu a5,8(sp) + 7a4: de078ce3 beqz a5,59c + 7a8: 00810713 add a4,sp,8 + 7ac: 100006b7 lui a3,0x10000 + 7b0: 00f68023 sb a5,0(a3) # 10000000 + 7b4: 00174783 lbu a5,1(a4) + 7b8: 00170713 add a4,a4,1 + 7bc: fe079ae3 bnez a5,7b0 + 7c0: dddff06f j 59c + +00000000000007c4 : + 7c4: 00051063 bnez a0,7c4 + 7c8: 00008067 ret + +00000000000007cc <_init>: + 7cc: ff010113 add sp,sp,-16 + 7d0: 00000593 li a1,0 + 7d4: 00000513 li a0,0 + 7d8: 00113423 sd ra,8(sp) + 7dc: 1d8000ef jal 9b4
+ 7e0: c89ff0ef jal 468 + +00000000000007e4 : + 7e4: 00b567b3 or a5,a0,a1 + 7e8: 00c7e7b3 or a5,a5,a2 + 7ec: 0077f793 and a5,a5,7 + 7f0: 00c50833 add a6,a0,a2 + 7f4: 02078463 beqz a5,81c + 7f8: 00c58633 add a2,a1,a2 + 7fc: 00050793 mv a5,a0 + 800: 0b057663 bgeu a0,a6,8ac + 804: 0005c703 lbu a4,0(a1) + 808: 00158593 add a1,a1,1 + 80c: 00178793 add a5,a5,1 + 810: fee78fa3 sb a4,-1(a5) + 814: fec598e3 bne a1,a2,804 + 818: 00008067 ret + 81c: 04050693 add a3,a0,64 + 820: 0906f863 bgeu a3,a6,8b0 + 824: 00058713 mv a4,a1 + 828: 00068793 mv a5,a3 + 82c: 00073383 ld t2,0(a4) + 830: 00873283 ld t0,8(a4) + 834: 01073f83 ld t6,16(a4) + 838: 01873f03 ld t5,24(a4) + 83c: 02073e83 ld t4,32(a4) + 840: 02873e03 ld t3,40(a4) + 844: 03073303 ld t1,48(a4) + 848: 03873883 ld a7,56(a4) + 84c: 04078793 add a5,a5,64 + 850: f877b023 sd t2,-128(a5) + 854: f857b423 sd t0,-120(a5) + 858: f9f7b823 sd t6,-112(a5) + 85c: f9e7bc23 sd t5,-104(a5) + 860: fbd7b023 sd t4,-96(a5) + 864: fbc7b423 sd t3,-88(a5) + 868: fa67b823 sd t1,-80(a5) + 86c: fb17bc23 sd a7,-72(a5) + 870: 04070713 add a4,a4,64 + 874: fb07ece3 bltu a5,a6,82c + 878: fbf60613 add a2,a2,-65 + 87c: fc067793 and a5,a2,-64 + 880: 04078793 add a5,a5,64 + 884: fc067613 and a2,a2,-64 + 888: 00f585b3 add a1,a1,a5 + 88c: 00c687b3 add a5,a3,a2 + 890: f907f4e3 bgeu a5,a6,818 + 894: 0005b703 ld a4,0(a1) + 898: 00878793 add a5,a5,8 + 89c: 00858593 add a1,a1,8 + 8a0: fee7bc23 sd a4,-8(a5) + 8a4: ff07e8e3 bltu a5,a6,894 + 8a8: 00008067 ret + 8ac: 00008067 ret + 8b0: 00050793 mv a5,a0 + 8b4: fddff06f j 890 + +00000000000008b8 : + 8b8: 00c567b3 or a5,a0,a2 + 8bc: 0077f793 and a5,a5,7 + 8c0: 00c50633 add a2,a0,a2 + 8c4: 0ff5f713 zext.b a4,a1 + 8c8: 00078e63 beqz a5,8e4 + 8cc: 00050793 mv a5,a0 + 8d0: 02c57c63 bgeu a0,a2,908 + 8d4: 00178793 add a5,a5,1 + 8d8: fee78fa3 sb a4,-1(a5) + 8dc: fef61ce3 bne a2,a5,8d4 + 8e0: 00008067 ret + 8e4: 00004797 auipc a5,0x4 + 8e8: 9ac7b783 ld a5,-1620(a5) # 4290 + 8ec: 02f70733 mul a4,a4,a5 + 8f0: fec578e3 bgeu a0,a2,8e0 + 8f4: 00050793 mv a5,a0 + 8f8: 00878793 add a5,a5,8 + 8fc: fee7bc23 sd a4,-8(a5) + 900: fec7ece3 bltu a5,a2,8f8 + 904: 00008067 ret + 908: 00008067 ret + +000000000000090c : + 90c: 00054783 lbu a5,0(a0) + 910: 00078e63 beqz a5,92c + 914: 00050793 mv a5,a0 + 918: 0017c703 lbu a4,1(a5) + 91c: 00178793 add a5,a5,1 + 920: fe071ce3 bnez a4,918 + 924: 40a78533 sub a0,a5,a0 + 928: 00008067 ret + 92c: 00000513 li a0,0 + 930: 00008067 ret + +0000000000000934 : + 934: 00b506b3 add a3,a0,a1 + 938: 00050793 mv a5,a0 + 93c: 00059863 bnez a1,94c + 940: 0240006f j 964 + 944: 00178793 add a5,a5,1 + 948: 00f68a63 beq a3,a5,95c + 94c: 0007c703 lbu a4,0(a5) + 950: fe071ae3 bnez a4,944 + 954: 40a78533 sub a0,a5,a0 + 958: 00008067 ret + 95c: 40a68533 sub a0,a3,a0 + 960: 00008067 ret + 964: 00000513 li a0,0 + 968: 00008067 ret + +000000000000096c : + 96c: 00054783 lbu a5,0(a0) + 970: 00158593 add a1,a1,1 + 974: 00150513 add a0,a0,1 + 978: fff5c703 lbu a4,-1(a1) + 97c: 00078a63 beqz a5,990 + 980: fee786e3 beq a5,a4,96c + 984: 0007851b sext.w a0,a5 + 988: 40e5053b subw a0,a0,a4 + 98c: 00008067 ret + 990: 00000513 li a0,0 + 994: ff5ff06f j 988 + +0000000000000998 : + 998: 00050793 mv a5,a0 + 99c: 0005c703 lbu a4,0(a1) + 9a0: 00178793 add a5,a5,1 + 9a4: 00158593 add a1,a1,1 + 9a8: fee78fa3 sb a4,-1(a5) + 9ac: fe0718e3 bnez a4,99c + 9b0: 00008067 ret + +Disassembly of section .text.startup: + +00000000000009b4
: + 9b4: fe010113 add sp,sp,-32 + 9b8: 00113c23 sd ra,24(sp) + 9bc: 00813823 sd s0,16(sp) + 9c0: 00913423 sd s1,8(sp) + 9c4: 01213023 sd s2,0(sp) + 9c8: 00004597 auipc a1,0x4 + 9cc: 8d058593 add a1,a1,-1840 # 4298 + 9d0: 00003617 auipc a2,0x3 + 9d4: 63060613 add a2,a2,1584 # 4000 + 9d8: 00003697 auipc a3,0x3 + 9dc: 68868693 add a3,a3,1672 # 4060 + 9e0: 02900713 li a4,41 + 9e4: 0c877557 vsetvli a0,a4,e16,m1,ta,ma + 9e8: 0005079b sext.w a5,a0 + 9ec: 0206d507 vle16.v v10,(a3) + 9f0: 02065587 vle16.v v11,(a2) + 9f4: 9aa5a657 vmulhsu.vv v12,v10,v11 + 9f8: 0205d627 vse16.v v12,(a1) + 9fc: 00179793 sll a5,a5,0x1 + a00: 40a7073b subw a4,a4,a0 + a04: 00f686b3 add a3,a3,a5 + a08: 00f60633 add a2,a2,a5 + a0c: 00f585b3 add a1,a1,a5 + a10: fc071ae3 bnez a4,9e4 + a14: 00003417 auipc s0,0x3 + a18: 64c40413 add s0,s0,1612 # 4060 + a1c: 86818493 add s1,gp,-1944 # 42f8 + a20: 00003617 auipc a2,0x3 + a24: 5e060613 add a2,a2,1504 # 4000 + a28: 00003917 auipc s2,0x3 + a2c: 68a90913 add s2,s2,1674 # 40b2 + a30: 00048693 mv a3,s1 + a34: 00040713 mv a4,s0 + a38: 00071783 lh a5,0(a4) + a3c: 00065583 lhu a1,0(a2) + a40: 00268693 add a3,a3,2 + a44: 00270713 add a4,a4,2 + a48: 02b787bb mulw a5,a5,a1 + a4c: 00260613 add a2,a2,2 + a50: 0107d79b srlw a5,a5,0x10 + a54: fef69f23 sh a5,-2(a3) + a58: ff2710e3 bne a4,s2,a38 + a5c: 02900613 li a2,41 + a60: 86818593 add a1,gp,-1944 # 42f8 + a64: 00004517 auipc a0,0x4 + a68: 83450513 add a0,a0,-1996 # 4298 + a6c: f6cff0ef jal 1d8 + a70: 00050813 mv a6,a0 + a74: 00004617 auipc a2,0x4 + a78: 82460613 add a2,a2,-2012 # 4298 + a7c: 00003697 auipc a3,0x3 + a80: 5e468693 add a3,a3,1508 # 4060 + a84: 02900713 li a4,41 + a88: 0c8775d7 vsetvli a1,a4,e16,m1,ta,ma + a8c: 0005879b sext.w a5,a1 + a90: 0000c2b7 lui t0,0xc + a94: eef2829b addw t0,t0,-273 # beef <__global_pointer$+0x745f> + a98: 0206d507 vle16.v v10,(a3) + a9c: 9aa2e657 vmulhsu.vx v12,v10,t0 + aa0: 02065627 vse16.v v12,(a2) + aa4: 00179793 sll a5,a5,0x1 + aa8: 40b7073b subw a4,a4,a1 + aac: 00f686b3 add a3,a3,a5 + ab0: 00f60633 add a2,a2,a5 + ab4: fc071ae3 bnez a4,a88 + ab8: 0000c737 lui a4,0xc + abc: eef7071b addw a4,a4,-273 # beef <__global_pointer$+0x745f> + ac0: 00041783 lh a5,0(s0) + ac4: 00248493 add s1,s1,2 + ac8: 00240413 add s0,s0,2 + acc: 02e787bb mulw a5,a5,a4 + ad0: 0107d79b srlw a5,a5,0x10 + ad4: fef49f23 sh a5,-2(s1) + ad8: fe8914e3 bne s2,s0,ac0 + adc: 00100513 li a0,1 + ae0: 00081e63 bnez a6,afc + ae4: 01813083 ld ra,24(sp) + ae8: 01013403 ld s0,16(sp) + aec: 00813483 ld s1,8(sp) + af0: 00013903 ld s2,0(sp) + af4: 02010113 add sp,sp,32 + af8: 00008067 ret + afc: 02900613 li a2,41 + b00: 86818593 add a1,gp,-1944 # 42f8 + b04: 00003517 auipc a0,0x3 + b08: 79450513 add a0,a0,1940 # 4298 + b0c: eccff0ef jal 1d8 + b10: 00154513 xor a0,a0,1 + b14: 0ff57513 zext.b a0,a0 + b18: fcdff06f j ae4 + b1c: fff00513 li a0,-1 + b20: 00008067 ret + +Disassembly of section .rodata: + +0000000000004000 : + 4000: 731a .2byte 0x731a + 4002: a6a2 vmsge.vx v13,v0,ra,v0.t + 4004: 55b6 .2byte 0x55b6 + 4006: a34e .2byte 0xa34e + 4008: a3de .2byte 0xa3de + 400a: 32872a03 lw s4,808(a4) + 400e: 467c .2byte 0x467c + 4010: 1dc8 .2byte 0x1dc8 + 4012: 5e1e .2byte 0x5e1e + 4014: 3c4c .2byte 0x3c4c + 4016: 42de .2byte 0x42de + 4018: 1c66 .2byte 0x1c66 + 401a: c2a1 vmsge.vx v5,v0,ra,v0.t + 401c: 16b592b7 lui t0,0x16b59 + 4020: 9b22eeb3 .4byte 0x9b22eeb3 + 4024: a1cc .2byte 0xa1cc + 4026: e95da297 auipc t0,0xe95da + 402a: 952fb2af .4byte 0x952fb2af + 402e: b498 .2byte 0xb498 + 4030: 5b2a .2byte 0x5b2a + 4032: cfa6 .2byte 0xcfa6 + 4034: 617a0f7b .4byte 0x617a0f7b + 4038: 068620eb .4byte 0x68620eb + 403c: 4dff 8b66 effc b503 .byte 0xff, 0x4d, 0x66, 0x8b, 0xfc, 0xef, 0x03, 0xb5, 0x9e, 0x92, 0xd8, 0x19, 0xb1, 0x2e, 0xbf, 0x0d, 0x00, 0xb2 + 4044: 929e 19d8 2eb1 0dbf + 404c: b200 + 404e: 927d .2byte 0x927d + 4050: d7ad .2byte 0xd7ad + 4052: 0b25 .2byte 0xb25 + 4054: 4aa8 .2byte 0x4aa8 + 4056: d8799d83 lh s11,-633(s3) + 405a: a8f2 .2byte 0xa8f2 + 405c: 82389bcb .4byte 0x82389bcb + +0000000000004060 : + 4060: fbb4 .2byte 0xfbb4 + 4062: c324 .2byte 0xc324 + 4064: b3ba .2byte 0xb3ba + 4066: 2a45 .2byte 0x2a45 + 4068: d8e1 vmsge.vx v17,v0,ra,v0.t + 406a: 5fc8 .2byte 0x5fc8 + 406c: 33bd .2byte 0x33bd + 406e: 0e616b67 .4byte 0xe616b67 + 4072: e78d .2byte 0xe78d + 4074: cc9a .2byte 0xcc9a + 4076: d77b2a73 csrrs s4,0xd77,s6 + 407a: 9b2110c3 vmsge.vx v1,v18,sp + 407e: 325d .2byte 0x325d + 4080: 2d4de74f .4byte 0x2d4de74f + 4084: 7e3d7327 .4byte 0x7e3d7327 + 4088: f560 vmsge.vx v10,v0,ra,v0.t + 408a: 2538 .2byte 0x2538 + 408c: 148a .2byte 0x148a + 408e: daf5 .2byte 0xdaf5 + 4090: ea8e .2byte 0xea8e + 4092: 5662 vmsge.vx v12,v0,zero,v0.t + 4094: 5e74 .2byte 0x5e74 + 4096: 9a60b17f 2af30262 .byte 0x7f, 0xb1, 0x60, 0x9a, 0x62, 0x02, 0xf3, 0x2a, 0x3a, 0x8b, 0xb1, 0xdc, 0x19, 0xb3, 0xf8, 0x39 + 409e: dcb18b3a 39f8b319 + 40a6: 1ece .2byte 0x1ece + 40a8: 26d9 .2byte 0x26d9 + 40aa: e47a .2byte 0xe47a + 40ac: d332 .2byte 0xd332 + 40ae: 9fb9 .2byte 0x9fb9 + 40b0: 5858 .2byte 0x5858 + 40b2: 61344213 xor tp,s0,1555 + 40b6: b30e .2byte 0xb30e + 40b8: fe10 .2byte 0xfe10 + 40ba: d3d1 .2byte 0xd3d1 + 40bc: efaa .2byte 0xefaa + 40be: 330c .2byte 0x330c + 40c0: c4e4 .2byte 0xc4e4 + 40c2: ffff .2byte 0xffff + 40c4: c528 .2byte 0xc528 + 40c6: ffff .2byte 0xffff + 40c8: c56c .2byte 0xc56c + 40ca: ffff .2byte 0xffff + 40cc: c47c .2byte 0xc47c + 40ce: ffff .2byte 0xffff + 40d0: c5b0 .2byte 0xc5b0 + 40d2: ffff .2byte 0xffff + 40d4: c5f4 .2byte 0xc5f4 + 40d6: ffff .2byte 0xffff + 40d8: c638 .2byte 0xc638 + 40da: ffff .2byte 0xffff + 40dc: c67c .2byte 0xc67c + 40de: ffff .2byte 0xffff + 40e0: c47c .2byte 0xc47c + 40e2: ffff .2byte 0xffff + 40e4: c47c .2byte 0xc47c + 40e6: ffff .2byte 0xffff + 40e8: c47c .2byte 0xc47c + 40ea: ffff .2byte 0xffff + 40ec: c6c0 vmsge.vx v13,v0,ra,v0.t + 40ee: ffff .2byte 0xffff + +Disassembly of section .rodata.str1.8: + +00000000000040f0 <.rodata.str1.8>: + 40f0: 5241 vmsge.vx v4,v0,zero,v0.t + 40f2: 4152 .2byte 0x4152 + 40f4: 2059 .2byte 0x2059 + 40f6: 4f4e .2byte 0x4f4e + 40f8: 2054 .2byte 0x2054 + 40fa: 52524f43 vmsge.vx v30,v5,tp + 40fe: 4345 .2byte 0x4345 + 4100: 2054 .2byte 0x2054 + 4102: 4e49 .2byte 0x4e49 + 4104: 4920 vmsge.vx v18,v0,zero,v0.t + 4106: 444e .2byte 0x444e + 4108: 5845 .2byte 0x5845 + 410a: 203a .2byte 0x203a + 410c: 0000 vmsge.vx v0,v0,zero,v0.t + 410e: 0000 vmsge.vx v0,v0,zero,v0.t + 4110: 000a .2byte 0xa + 4112: 0000 vmsge.vx v0,v0,zero,v0.t + 4114: 0000 vmsge.vx v0,v0,zero,v0.t + 4116: 0000 vmsge.vx v0,v0,zero,v0.t + 4118: 6c637963 bgeu t1,t1,47ea <_tbss_end+0x492> + 411c: 3a65 .2byte 0x3a65 + 411e: 0020 vmsge.vx v0,v0,zero,v0.t + 4120: 690a .2byte 0x690a + 4122: 736e .2byte 0x736e + 4124: 7274 .2byte 0x7274 + 4126: 7465 .2byte 0x7465 + 4128: 203a .2byte 0x203a + 412a: 0000 vmsge.vx v0,v0,zero,v0.t + 412c: 0000 vmsge.vx v0,v0,zero,v0.t + 412e: 0000 vmsge.vx v0,v0,zero,v0.t + 4130: 7845 .2byte 0x7845 + 4132: 7469 .2byte 0x7469 + 4134: 6320 vmsge.vx v6,v0,zero,v0.t + 4136: 3a65646f jal s0,5a4dc <__global_pointer$+0x55a4c> + 413a: 0020 vmsge.vx v0,v0,zero,v0.t + 413c: 0000 vmsge.vx v0,v0,zero,v0.t + 413e: 0000 vmsge.vx v0,v0,zero,v0.t + 4140: 4e49 .2byte 0x4e49 + 4142: 55525453 .4byte 0x55525453 + 4146: 4f495443 vmsge.vx v8,v20,s2 + 414a: 204e .2byte 0x204e + 414c: 4441 vmsge.vx v8,v0,zero,v0.t + 414e: 5244 .2byte 0x5244 + 4150: 5345 .2byte 0x5345 + 4152: 494d2053 .4byte 0x494d2053 + 4156: 494c4153 .4byte 0x494c4153 + 415a: 44454e47 .4byte 0x44454e47 + 415e: 6120 vmsge.vx v2,v0,zero,v0.t + 4160: 2074 .2byte 0x2074 + 4162: 4350 .2byte 0x4350 + 4164: 203a .2byte 0x203a + 4166: 0000 vmsge.vx v0,v0,zero,v0.t + 4168: 4e49 .2byte 0x4e49 + 416a: 55525453 .4byte 0x55525453 + 416e: 4f495443 vmsge.vx v8,v20,s2 + 4172: 204e .2byte 0x204e + 4174: 4341 vmsge.vx v6,v0,zero,v0.t + 4176: 53534543 vmsge.vx v10,v21,t1 + 417a: 4620 vmsge.vx v12,v0,zero,v0.t + 417c: 5541 vmsge.vx v10,v0,zero,v0.t + 417e: 544c .2byte 0x544c + 4180: 6120 vmsge.vx v2,v0,zero,v0.t + 4182: 2074 .2byte 0x2074 + 4184: 4350 .2byte 0x4350 + 4186: 203a .2byte 0x203a + ... + 4190: 4c49 .2byte 0x4c49 + 4192: 454c .2byte 0x454c + 4194: 204c4147 .4byte 0x204c4147 + 4198: 4e49 .2byte 0x4e49 + 419a: 55525453 .4byte 0x55525453 + 419e: 4f495443 vmsge.vx v8,v20,s2 + 41a2: 204e .2byte 0x204e + 41a4: 7461 vmsge.vx v8,v0,zero,v0.t + 41a6: 5020 vmsge.vx v0,v0,zero,v0.t + 41a8: 00203a43 vmsge.vx v20,v2,zero,v0.t + 41ac: 0000 vmsge.vx v0,v0,zero,v0.t + 41ae: 0000 vmsge.vx v0,v0,zero,v0.t + 41b0: 4f4c .2byte 0x4f4c + 41b2: 4441 vmsge.vx v8,v0,zero,v0.t + 41b4: 4120 vmsge.vx v2,v0,zero,v0.t + 41b6: 4444 .2byte 0x4444 + 41b8: 4552 .2byte 0x4552 + 41ba: 4d205353 .4byte 0x4d205353 + 41be: 5349 .2byte 0x5349 + 41c0: 4c41 vmsge.vx v24,v0,zero,v0.t + 41c2: 4749 .2byte 0x4749 + 41c4: 454e .2byte 0x454e + 41c6: 2044 .2byte 0x2044 + 41c8: 7461 vmsge.vx v8,v0,zero,v0.t + 41ca: 5020 vmsge.vx v0,v0,zero,v0.t + 41cc: 00203a43 vmsge.vx v20,v2,zero,v0.t + 41d0: 4f4c .2byte 0x4f4c + 41d2: 4441 vmsge.vx v8,v0,zero,v0.t + 41d4: 4120 vmsge.vx v2,v0,zero,v0.t + 41d6: 53454343 vmsge.vx v6,v20,a0 + 41da: 41462053 .4byte 0x41462053 + 41de: 4c55 .2byte 0x4c55 + 41e0: 2054 .2byte 0x2054 + 41e2: 7461 vmsge.vx v8,v0,zero,v0.t + 41e4: 5020 vmsge.vx v0,v0,zero,v0.t + 41e6: 00203a43 vmsge.vx v20,v2,zero,v0.t + 41ea: 0000 vmsge.vx v0,v0,zero,v0.t + 41ec: 0000 vmsge.vx v0,v0,zero,v0.t + 41ee: 0000 vmsge.vx v0,v0,zero,v0.t + 41f0: 524f5453 .4byte 0x524f5453 + 41f4: 2045 .2byte 0x2045 + 41f6: 4441 vmsge.vx v8,v0,zero,v0.t + 41f8: 5244 .2byte 0x5244 + 41fa: 5345 .2byte 0x5345 + 41fc: 494d2053 .4byte 0x494d2053 + 4200: 494c4153 .4byte 0x494c4153 + 4204: 44454e47 .4byte 0x44454e47 + 4208: 6120 vmsge.vx v2,v0,zero,v0.t + 420a: 2074 .2byte 0x2074 + 420c: 4350 .2byte 0x4350 + 420e: 203a .2byte 0x203a + ... + 4218: 524f5453 .4byte 0x524f5453 + 421c: 2045 .2byte 0x2045 + 421e: 4341 vmsge.vx v6,v0,zero,v0.t + 4220: 53534543 vmsge.vx v10,v21,t1 + 4224: 4620 vmsge.vx v12,v0,zero,v0.t + 4226: 5541 vmsge.vx v10,v0,zero,v0.t + 4228: 544c .2byte 0x544c + 422a: 6120 vmsge.vx v2,v0,zero,v0.t + 422c: 2074 .2byte 0x2074 + 422e: 4350 .2byte 0x4350 + 4230: 203a .2byte 0x203a + 4232: 0000 vmsge.vx v0,v0,zero,v0.t + 4234: 0000 vmsge.vx v0,v0,zero,v0.t + 4236: 0000 vmsge.vx v0,v0,zero,v0.t + 4238: 4345 .2byte 0x4345 + 423a: 4c41 vmsge.vx v24,v0,zero,v0.t + 423c: 204c .2byte 0x204c + 423e: 5246 .2byte 0x5246 + 4240: 4d204d4f .4byte 0x4d204d4f + 4244: 4d2d .2byte 0x4d2d + 4246: 2045444f .4byte 0x2045444f + 424a: 7461 vmsge.vx v8,v0,zero,v0.t + 424c: 5020 vmsge.vx v0,v0,zero,v0.t + 424e: 00203a43 vmsge.vx v20,v2,zero,v0.t + 4252: 0000 vmsge.vx v0,v0,zero,v0.t + 4254: 0000 vmsge.vx v0,v0,zero,v0.t + 4256: 0000 vmsge.vx v0,v0,zero,v0.t + 4258: 4e55 .2byte 0x4e55 + 425a: 574f4e4b .4byte 0x574f4e4b + 425e: 204e .2byte 0x204e + 4260: 5845 .2byte 0x5845 + 4262: 54504543 vmsge.vx v10,v5,zero,v0.t + 4266: 4f49 .2byte 0x4f49 + 4268: 204e .2byte 0x204e + 426a: 7461 vmsge.vx v8,v0,zero,v0.t + 426c: 5020 vmsge.vx v0,v0,zero,v0.t + 426e: 00203a43 vmsge.vx v20,v2,zero,v0.t + 4272: 0000 vmsge.vx v0,v0,zero,v0.t + 4274: 0000 vmsge.vx v0,v0,zero,v0.t + 4276: 0000 vmsge.vx v0,v0,zero,v0.t + 4278: 430a .2byte 0x430a + 427a: 4548 .2byte 0x4548 + 427c: 4d204b43 vmsge.vx v22,v18,zero,v0.t + 4280: 53554143 vmsge.vx v2,v21,a0 + 4284: 2045 .2byte 0x2045 + 4286: 6e69 .2byte 0x6e69 + 4288: 5220 vmsge.vx v4,v0,zero,v0.t + 428a: 4c54 .2byte 0x4c54 + ... + +Disassembly of section .sdata: + +0000000000004290 <__global_pointer$-0x800>: + 4290: 0101 vmsge.vx v2,v0,zero,v0.t + 4292: 0101 vmsge.vx v2,v0,zero,v0.t + 4294: 0101 vmsge.vx v2,v0,zero,v0.t + 4296: 0101 vmsge.vx v2,v0,zero,v0.t + +Disassembly of section .bss: + +0000000000004298 : + ... + +00000000000042f8 : + ... + +Disassembly of section .tohost: + +0000000010000000 : + ... + +0000000010000040 : + ... + +Disassembly of section .comment: + +0000000000000000 <.comment>: + 0: 3a434347 .4byte 0x3a434347 + 4: 2820 vmsge.vx v16,v0,zero,v0.t + 6: 65653267 .4byte 0x65653267 + a: 6535 .2byte 0x6535 + c: 3334 .2byte 0x3334 + e: 3030 .2byte 0x3030 + 10: 3831 .2byte 0x3831 + 12: 2029 .2byte 0x2029 + 14: 3231 .2byte 0x3231 + 16: 322e .2byte 0x322e + 18: 302e .2byte 0x302e + ... + +Disassembly of section .riscv.attributes: + +0000000000000000 <.riscv.attributes>: + 0: 5e41 vmsge.vx v28,v0,zero,v0.t + 2: 0000 vmsge.vx v0,v0,zero,v0.t + 4: 7200 vmsge.vx v4,v0,zero,v0.t + 6: 7369 .2byte 0x7369 + 8: 01007663 bgeu zero,a6,14 <_start+0x14> + c: 0054 .2byte 0x54 + e: 0000 vmsge.vx v0,v0,zero,v0.t + 10: 1004 .2byte 0x1004 + 12: 7205 .2byte 0x7205 + 14: 3676 .2byte 0x3676 + 16: 6934 .2byte 0x6934 + 18: 7032 .2byte 0x7032 + 1a: 5f31 .2byte 0x5f31 + 1c: 326d .2byte 0x326d + 1e: 3070 .2byte 0x3070 + 20: 7a5f 6369 7273 .byte 0x5f, 0x7a, 0x69, 0x63, 0x73, 0x72 + 26: 7032 .2byte 0x7032 + 28: 5f30 .2byte 0x5f30 + 2a: 6d7a .2byte 0x6d7a + 2c: 756d .2byte 0x756d + 2e: 316c .2byte 0x316c + 30: 3070 .2byte 0x3070 + 32: 7a5f 6576 3233 .byte 0x5f, 0x7a, 0x76, 0x65, 0x33, 0x32 + 38: 3178 .2byte 0x3178 + 3a: 3070 .2byte 0x3070 + 3c: 7a5f 6576 3436 .byte 0x5f, 0x7a, 0x76, 0x65, 0x36, 0x34 + 42: 3178 .2byte 0x3178 + 44: 3070 .2byte 0x3070 + 46: 7a5f 6c76 3233 .byte 0x5f, 0x7a, 0x76, 0x6c, 0x33, 0x32 + 4c: 3162 vmsge.vx v2,v0,zero,v0.t + 4e: 3070 .2byte 0x3070 + 50: 7a5f 6c76 3436 .byte 0x5f, 0x7a, 0x76, 0x6c, 0x36, 0x34 + 56: 3162 vmsge.vx v2,v0,zero,v0.t + 58: 3070 .2byte 0x3070 + 5a: 0800 vmsge.vx v16,v0,zero,v0.t + 5c: 0a01 vmsge.vx v20,v0,zero,v0.t + 5e: 0b Address 0x5e is out of bounds. + diff --git a/src/main/resources/applications_vector/vmulhsu/vmulhsu.c b/src/main/resources/applications_vector/vmulhsu/vmulhsu.c new file mode 100644 index 00000000..2857d0e5 --- /dev/null +++ b/src/main/resources/applications_vector/vmulhsu/vmulhsu.c @@ -0,0 +1,100 @@ +#include "util.h" + +#define size_t long +#define N 48 + +const signed short dataArray0[N] = {-1100, -15580, -19526, 10821, -10015, 24520, 13245, 27495, 3681, -6259, -13158, 10867, -10373, 4291, -25823, 12893, -6321, 11597, 29479, 32317, -2720, 9528, 5258, -9483, -5490, 22114, 24180, -20097, -26016, 610, 10995, -29894, -9039, -19687, 14840, 7886, 9945, -7046, -11470, -24647, 22616, 16915, 24884, -19698, -496, -11311, -4182, 13068}; +const unsigned short dataArray1[N] = {29466, 42658, 21942, 41806, 41950, 10755, 12935, 18044, 7624, 24094, 15436, 17118, 7270, 49825, 37559, 5813, 61107, 39714, 41420, 41623, 59741, 45743, 38191, 46232, 23338, 53158, 3963, 24954, 8427, 1670, 19967, 35686, 61436, 46339, 37534, 6616, 11953, 3519, 45568, 37501, 55213, 2853, 19112, 40323, 55417, 43250, 39883, 33336}; +signed short resultArray[N] = {0}; +signed short answerArray[N] = {0}; + +extern void printstr(char* str); +extern void int64ToHex(long num, char* str); +extern void int32ToHex(int num, char* str); +extern void clearCounters(); +extern void printCounters(); + +// #define DEBUG + +_Bool verifyResult(const unsigned short* ptr0, const unsigned short* ptr1, size_t n) { + int i; + _Bool correct = 1; + char string[19]; + for(i=0; i> 16); + } + + _Bool correct = verifyResult(resultArray, answerArray, 41); + ptr0 = dataArray0; + ptr2 = resultArray; + avl = 41; + while(avl != 0) { + asm volatile ("vsetvli %0, %1, e16, m1, ta, ma" + : "=r"(vl) + : "r"(avl)); + asm volatile ("li t0, 0xBEEF"); + asm volatile ("vle16.v v10, (%0)" + : + : "r"(ptr0)); + asm volatile ("vmulhsu.vx v12, v10, t0"); + asm volatile ("vse16.v v12, (%0)" + : + : "r"(ptr2)); + ptr0 += vl; + ptr2 += vl; + avl -= vl; + } + for(i=0; i<41; i++) { + answerArray[i] = (signed short)(((signed int)dataArray0[i] * (unsigned int)0xBEEF) >> 16); + } + correct = correct && verifyResult(resultArray, answerArray, 41); + return !correct; +} diff --git a/src/main/resources/applications_vector/vmulhsu_data.hex b/src/main/resources/applications_vector/vmulhsu_data.hex new file mode 100644 index 00000000..bfc3068b --- /dev/null +++ b/src/main/resources/applications_vector/vmulhsu_data.hex @@ -0,0 +1,166 @@ +a6a2731a +a34e55b6 +2a03a3de +467c3287 +5e1e1dc8 +42de3c4c +c2a11c66 +16b592b7 +9b22eeb3 +a297a1cc +b2afe95d +b498952f +cfa65b2a +617a0f7b +068620eb +8b664dff +b503effc +19d8929e +0dbf2eb1 +927db200 +0b25d7ad +9d834aa8 +a8f2d879 +82389bcb +c324fbb4 +2a45b3ba +5fc8d8e1 +6b6733bd +e78d0e61 +2a73cc9a +10c3d77b +325d9b21 +2d4de74f +7e3d7327 +2538f560 +daf5148a +5662ea8e +b17f5e74 +02629a60 +8b3a2af3 +b319dcb1 +1ece39f8 +e47a26d9 +9fb9d332 +42135858 +b30e6134 +d3d1fe10 +330cefaa +ffffc4e4 +ffffc528 +ffffc56c +ffffc47c +ffffc5b0 +ffffc5f4 +ffffc638 +ffffc67c +ffffc47c +ffffc47c +ffffc47c +ffffc6c0 +41525241 +4f4e2059 +4f432054 +43455252 +4e492054 +444e4920 +203a5845 +00000000 +0000000a +00000000 +6c637963 +00203a65 +736e690a +74657274 +0000203a +00000000 +74697845 +646f6320 +00203a65 +00000000 +54534e49 +54435552 +204e4f49 +52444441 +20535345 +4153494d +4e47494c +61204445 +43502074 +0000203a +54534e49 +54435552 +204e4f49 +45434341 +46205353 +544c5541 +20746120 +203a4350 +00000000 +00000000 +454c4c49 +204c4147 +54534e49 +54435552 +204e4f49 +50207461 +00203a43 +00000000 +44414f4c +44444120 +53534552 +53494d20 +47494c41 +2044454e +50207461 +00203a43 +44414f4c +43434120 +20535345 +4c554146 +74612054 +3a435020 +00000020 +00000000 +524f5453 +44412045 +53455244 +494d2053 +494c4153 +44454e47 +20746120 +203a4350 +00000000 +00000000 +524f5453 +43412045 +53534543 +55414620 +6120544c +43502074 +0000203a +00000000 +4c414345 +5246204c +4d204d4f +444f4d2d +74612045 +3a435020 +00000020 +00000000 +4e4b4e55 +204e574f +45435845 +4f495450 +7461204e +3a435020 +00000020 +00000000 +4548430a +4d204b43 +53554143 +6e692045 +4c545220 +00000000 +01010101 +01010101 diff --git a/src/main/resources/applications_vector/vmulhsu_inst.hex b/src/main/resources/applications_vector/vmulhsu_inst.hex new file mode 100644 index 00000000..d7cd9eb5 --- /dev/null +++ b/src/main/resources/applications_vector/vmulhsu_inst.hex @@ -0,0 +1,713 @@ +00000093 +00000113 +00000193 +00000213 +00000293 +00000313 +00000393 +00000413 +00000493 +00000513 +00000593 +00000613 +00000693 +00000713 +00000793 +00000813 +00000893 +00000913 +00000993 +00000a13 +00000a93 +00000b13 +00000b93 +00000c13 +00000c93 +00000d13 +00000d93 +00000e13 +00000e93 +00000f13 +00000f93 +00000297 +03828293 +30529073 +00005197 +a0818193 +10000217 +ff720213 +fc027213 +f1402573 +00100593 +00b57063 +00006137 +ff01011b +71c0006f +ef010113 +00113423 +00213823 +00313c23 +02413023 +02513423 +02613823 +02713c23 +04813023 +04913423 +04a13823 +04b13c23 +06c13023 +06d13423 +06e13823 +06f13c23 +09013023 +09113423 +09213823 +09313c23 +0b413023 +0b513423 +0b613823 +0b713c23 +0d813023 +0d913423 +0da13823 +0db13c23 +0fc13023 +0fd13423 +0fe13823 +0ff13c23 +34202573 +341025f3 +00010613 +394000ef +34151073 +000022b7 +8002829b +3002a073 +00813083 +01013103 +01813183 +02013203 +02813283 +03013303 +03813383 +04013403 +04813483 +05013503 +05813583 +06013603 +06813683 +07013703 +07813783 +08013803 +08813883 +09013903 +09813983 +0a013a03 +0a813a83 +0b013b03 +0b813b83 +0c013c03 +0c813c83 +0d013d03 +0d813d83 +0e013e03 +0e813e83 +0f013f03 +0f813f83 +11010113 +30200073 +0ac05c63 +fa010113 +00161613 +04813823 +04913423 +05213023 +03313c23 +03413823 +03513423 +04113c23 +00050413 +00058493 +00c509b3 +00100693 +00000913 +00004a17 +edca0a13 +00004a97 +ef4a8a93 +00045703 +0004d783 +000a0513 +00240413 +00248493 +02f70463 +0f4000ef +00810593 +00090513 +060000ef +00810513 +0e0000ef +000a8513 +0d8000ef +00000693 +0019091b +fd3410e3 +05813083 +05013403 +04813483 +04013903 +03813983 +03013a03 +02813a83 +00068513 +06010113 +00008067 +00100693 +00068513 +00008067 +b0201073 +b0001073 +00008067 +03000793 +00f58023 +07800793 +00f580a3 +00158813 +00958793 +00900613 +00f57713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +40455513 +fef812e3 +00058523 +00008067 +03000793 +00f58023 +07800793 +00f580a3 +00158813 +01158793 +00900613 +00f57713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +40455513 +fef812e3 +00058923 +00008067 +00054783 +00078c63 +10000737 +00f70023 +00154783 +00150513 +fe079ae3 +00008067 +fe010113 +c0202673 +c00025f3 +00004717 +dbc70713 +06300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +ffff8737 +83074713 +01910793 +00e11423 +00910813 +00078713 +00900893 +00f5f693 +03768513 +00d8e463 +03068513 +00a70023 +fff70713 +4045d593 +fee812e3 +00814703 +00010d23 +00810693 +100005b7 +00070a63 +00e58023 +0016c703 +00168693 +fe071ae3 +00004697 +d4468693 +00a00713 +100005b7 +00e58023 +0016c703 +00168693 +fe071ae3 +ffff8737 +83074713 +00060693 +00e11423 +00900593 +00f6f713 +03770613 +00e5e463 +03070613 +00c78023 +fff78793 +4046d693 +fef812e3 +00814783 +00010d23 +00810713 +100006b7 +00078a63 +00f68023 +00174783 +00170713 +fe079ae3 +100007b7 +00a00713 +00e78023 +02010113 +00008067 +fe010113 +00813823 +00113c23 +00050413 +00004717 +cb870713 +04500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00010593 +00040513 +e09ff0ef +00014703 +00070e63 +00010793 +100006b7 +00e68023 +0017c703 +00178793 +fe071ae3 +00040513 +100007b7 +00078023 +0000006f +ffff87b7 +fd010113 +8307c793 +00f11423 +02113423 +01910793 +00910813 +00900613 +00f5f713 +03770693 +00e66463 +03070693 +00d78023 +fff78793 +4045d593 +ff0792e3 +00010d23 +00b00793 +02a7e063 +00004717 +ba070713 +00251513 +00e50533 +00052783 +00e787b3 +00078067 +00004717 +d1c70713 +05500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +00810713 +100006b7 +00078a63 +00f68023 +00174783 +00170713 +fe079ae3 +00004717 +cfc70713 +00a00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +fff00513 +ec9ff0ef +00004717 +b9c70713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +00810713 +100006b7 +fc0786e3 +00f68023 +00174783 +00170713 +fe079ae3 +fb9ff06f +00004717 +b8070713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f80788e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +f75ff06f +00004717 +b6470713 +04900793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f40786e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +f31ff06f +00004717 +b4070713 +04c00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +f00784e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +eedff06f +00004717 +b1c70713 +04c00793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +ec0782e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +ea9ff06f +00004717 +af870713 +05300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +e80780e3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +e65ff06f +00004717 +adc70713 +05300793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +e2078ee3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +e21ff06f +00004717 +ab870713 +04500793 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +00814783 +de078ce3 +00810713 +100006b7 +00f68023 +00174783 +00170713 +fe079ae3 +dddff06f +00051063 +00008067 +ff010113 +00000593 +00000513 +00113423 +1d8000ef +c89ff0ef +00b567b3 +00c7e7b3 +0077f793 +00c50833 +02078463 +00c58633 +00050793 +0b057663 +0005c703 +00158593 +00178793 +fee78fa3 +fec598e3 +00008067 +04050693 +0906f863 +00058713 +00068793 +00073383 +00873283 +01073f83 +01873f03 +02073e83 +02873e03 +03073303 +03873883 +04078793 +f877b023 +f857b423 +f9f7b823 +f9e7bc23 +fbd7b023 +fbc7b423 +fa67b823 +fb17bc23 +04070713 +fb07ece3 +fbf60613 +fc067793 +04078793 +fc067613 +00f585b3 +00c687b3 +f907f4e3 +0005b703 +00878793 +00858593 +fee7bc23 +ff07e8e3 +00008067 +00008067 +00050793 +fddff06f +00c567b3 +0077f793 +00c50633 +0ff5f713 +00078e63 +00050793 +02c57c63 +00178793 +fee78fa3 +fef61ce3 +00008067 +00004797 +9ac7b783 +02f70733 +fec578e3 +00050793 +00878793 +fee7bc23 +fec7ece3 +00008067 +00008067 +00054783 +00078e63 +00050793 +0017c703 +00178793 +fe071ce3 +40a78533 +00008067 +00000513 +00008067 +00b506b3 +00050793 +00059863 +0240006f +00178793 +00f68a63 +0007c703 +fe071ae3 +40a78533 +00008067 +40a68533 +00008067 +00000513 +00008067 +00054783 +00158593 +00150513 +fff5c703 +00078a63 +fee786e3 +0007851b +40e5053b +00008067 +00000513 +ff5ff06f +00050793 +0005c703 +00178793 +00158593 +fee78fa3 +fe0718e3 +00008067 +fe010113 +00113c23 +00813823 +00913423 +01213023 +00004597 +8d058593 +00003617 +63060613 +00003697 +68868693 +02900713 +0c877557 +0005079b +0206d507 +02065587 +9aa5a657 +0205d627 +00179793 +40a7073b +00f686b3 +00f60633 +00f585b3 +fc071ae3 +00003417 +64c40413 +86818493 +00003617 +5e060613 +00003917 +68a90913 +00048693 +00040713 +00071783 +00065583 +00268693 +00270713 +02b787bb +00260613 +0107d79b +fef69f23 +ff2710e3 +02900613 +86818593 +00004517 +83450513 +f6cff0ef +00050813 +00004617 +82460613 +00003697 +5e468693 +02900713 +0c8775d7 +0005879b +0000c2b7 +eef2829b +0206d507 +9aa2e657 +02065627 +00179793 +40b7073b +00f686b3 +00f60633 +fc071ae3 +0000c737 +eef7071b +00041783 +00248493 +00240413 +02e787bb +0107d79b +fef49f23 +fe8914e3 +00100513 +00081e63 +01813083 +01013403 +00813483 +00013903 +02010113 +00008067 +02900613 +86818593 +00003517 +79450513 +eccff0ef +00154513 +0ff57513 +fcdff06f +fff00513 +00008067 diff --git a/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala b/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala index 4546a6e7..a4473623 100644 --- a/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala +++ b/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala @@ -139,12 +139,12 @@ class Zve64xAppTestForVecCpu extends AnyFlatSpec with ChiselScalatestTester { "vadd", "vsub", "vand", "vmseq", "vmslt", "vmsle", "vmsgt", "vminmax", "vmerge", "vmv", "vmand", "vmor", "vmxor", - "vmul", "vmulh", "vmulhu" + "vmul", "vmulh", "vmulhu", "vmulhsu" ) val applicationTest = Seq( "vector_median" ) - val zve64xTestList: Seq[String] = Seq("vmulhu") + val zve64xTestList: Seq[String] = ldstTest ++ arithmeticTest ++ applicationTest for (e <- zve64xTestList) { it should s"Vector CPU execute $e" in { test(new Core_and_cache(useVector = true, cpu = classOf[VectorCpu])).withAnnotations(Seq(WriteVcdAnnotation, VerilatorBackendAnnotation)) { dut =>