From f16525891b52bb8d59e043556c0160c18df409a2 Mon Sep 17 00:00:00 2001 From: HidetaroTanaka Date: Wed, 25 Oct 2023 17:10:30 +0900 Subject: [PATCH] add vmslt (doesn't work) --- .../resources/applications_vector/build.sh | 18 + .../resources/applications_vector/vmslt.dump | 1062 +++++++++++++++++ .../applications_vector/vmslt/vmslt.c | 84 ++ .../applications_vector/vmslt_data.hex | 148 +++ .../applications_vector/vmslt_inst.hex | 685 +++++++++++ .../hajime/vectormodules/VrfReadyTable.scala | 6 +- .../RandomArrayGen.scala | 9 +- .../hajime/vectormodules/VectorCpuSpec.scala | 5 +- 8 files changed, 2006 insertions(+), 11 deletions(-) create mode 100644 src/main/resources/applications_vector/vmslt.dump create mode 100644 src/main/resources/applications_vector/vmslt/vmslt.c create mode 100644 src/main/resources/applications_vector/vmslt_data.hex create mode 100644 src/main/resources/applications_vector/vmslt_inst.hex diff --git a/src/main/resources/applications_vector/build.sh b/src/main/resources/applications_vector/build.sh index 087f9f62..003f5c99 100644 --- a/src/main/resources/applications_vector/build.sh +++ b/src/main/resources/applications_vector/build.sh @@ -199,4 +199,22 @@ hexdump -v -e '1/4 "%08x" "\n"' vmseq_text_startup.bin > vmseq_text_startup.temp cat vmseq_rodata.temp vmseq_rodata_str1_8.temp vmseq_sdata.temp > vmseq_data.hex cat vmseq_text_init.temp vmseq_text.temp vmseq_text_startup.temp > vmseq_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 vmslt.riscv ./vmslt/vmslt.c ../application_headers/syscalls.c ../application_headers/crt.S -static -nostdlib -nostartfiles -T ../application_headers/test.ld +riscv64-unknown-elf-objdump --disassemble-all vmslt.riscv > vmslt.dump +riscv64-unknown-elf-objdump --disassemble-all vmslt.riscv > vmslt.dump +riscv64-unknown-elf-objcopy --dump-section .rodata=vmslt_rodata.bin vmslt.riscv +riscv64-unknown-elf-objcopy --dump-section .rodata.str1.8=vmslt_rodata_str1_8.bin vmslt.riscv +riscv64-unknown-elf-objcopy --dump-section .sdata=vmslt_sdata.bin vmslt.riscv +riscv64-unknown-elf-objcopy --dump-section .text.init=vmslt_text_init.bin vmslt.riscv +riscv64-unknown-elf-objcopy --dump-section .text=vmslt_text.bin vmslt.riscv +riscv64-unknown-elf-objcopy --dump-section .text.startup=vmslt_text_startup.bin vmslt.riscv +hexdump -v -e '1/4 "%08x" "\n"' vmslt_rodata.bin > vmslt_rodata.temp +hexdump -v -e '1/4 "%08x" "\n"' vmslt_rodata_str1_8.bin > vmslt_rodata_str1_8.temp +hexdump -v -e '1/4 "%08x" "\n"' vmslt_sdata.bin > vmslt_sdata.temp +hexdump -v -e '1/4 "%08x" "\n"' vmslt_text_init.bin > vmslt_text_init.temp +hexdump -v -e '1/4 "%08x" "\n"' vmslt_text.bin > vmslt_text.temp +hexdump -v -e '1/4 "%08x" "\n"' vmslt_text_startup.bin > vmslt_text_startup.temp +cat vmslt_rodata.temp vmslt_rodata_str1_8.temp vmslt_sdata.temp > vmslt_data.hex +cat vmslt_text_init.temp vmslt_text.temp vmslt_text_startup.temp > vmslt_inst.hex + rm *.riscv *.bin *.temp \ No newline at end of file diff --git a/src/main/resources/applications_vector/vmslt.dump b/src/main/resources/applications_vector/vmslt.dump new file mode 100644 index 00000000..c8b693e0 --- /dev/null +++ b/src/main/resources/applications_vector/vmslt.dump @@ -0,0 +1,1062 @@ + +vmslt.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: 9c018193 add gp,gp,-1600 # 4a48 <__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$+0x15a8> + b0: 7400006f j 7f0 <_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: 3b8000ef jal 4f8 + 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: 0005859b sext.w a1,a1 + 1dc: 02058063 beqz a1,1fc + 1e0: 0c05f7d7 vsetvli a5,a1,e8,m1,ta,ma + 1e4: 0007871b sext.w a4,a5 + 1e8: 27f03fd7 vand.vi v31,v31,0 + 1ec: 02050fa7 vse8.v v31,(a0) + 1f0: 40f585bb subw a1,a1,a5 + 1f4: 00e50533 add a0,a0,a4 + 1f8: fe0594e3 bnez a1,1e0 + 1fc: 00008067 ret + +0000000000000200 : + 200: 0ac05a63 blez a2,2b4 + 204: fa010113 add sp,sp,-96 + 208: 04813823 sd s0,80(sp) + 20c: 04913423 sd s1,72(sp) + 210: 05213023 sd s2,64(sp) + 214: 03313c23 sd s3,56(sp) + 218: 03413823 sd s4,48(sp) + 21c: 03513423 sd s5,40(sp) + 220: 04113c23 sd ra,88(sp) + 224: 00060493 mv s1,a2 + 228: 00050913 mv s2,a0 + 22c: 00058993 mv s3,a1 + 230: 00000413 li s0,0 + 234: 00100693 li a3,1 + 238: 00004a17 auipc s4,0x4 + 23c: e58a0a13 add s4,s4,-424 # 4090 + 240: 00004a97 auipc s5,0x4 + 244: e70a8a93 add s5,s5,-400 # 40b0 + 248: 00890733 add a4,s2,s0 + 24c: 008987b3 add a5,s3,s0 + 250: 00074703 lbu a4,0(a4) + 254: 0007c783 lbu a5,0(a5) + 258: 000a0513 mv a0,s4 + 25c: 02f70463 beq a4,a5,284 + 260: 0f4000ef jal 354 + 264: 00810593 add a1,sp,8 + 268: 0004051b sext.w a0,s0 + 26c: 060000ef jal 2cc + 270: 00810513 add a0,sp,8 + 274: 0e0000ef jal 354 + 278: 000a8513 mv a0,s5 + 27c: 0d8000ef jal 354 + 280: 00000693 li a3,0 + 284: 00140413 add s0,s0,1 + 288: fc9410e3 bne s0,s1,248 + 28c: 05813083 ld ra,88(sp) + 290: 05013403 ld s0,80(sp) + 294: 04813483 ld s1,72(sp) + 298: 04013903 ld s2,64(sp) + 29c: 03813983 ld s3,56(sp) + 2a0: 03013a03 ld s4,48(sp) + 2a4: 02813a83 ld s5,40(sp) + 2a8: 00068513 mv a0,a3 + 2ac: 06010113 add sp,sp,96 + 2b0: 00008067 ret + 2b4: 00100693 li a3,1 + 2b8: 00068513 mv a0,a3 + 2bc: 00008067 ret + +00000000000002c0 : + 2c0: b0201073 csrw minstret,zero + 2c4: b0001073 csrw mcycle,zero + 2c8: 00008067 ret + +00000000000002cc : + 2cc: 03000793 li a5,48 + 2d0: 00f58023 sb a5,0(a1) + 2d4: 07800793 li a5,120 + 2d8: 00f580a3 sb a5,1(a1) + 2dc: 00158813 add a6,a1,1 + 2e0: 00958793 add a5,a1,9 + 2e4: 00900613 li a2,9 + 2e8: 00f57713 and a4,a0,15 + 2ec: 03770693 add a3,a4,55 + 2f0: 00e66463 bltu a2,a4,2f8 + 2f4: 03070693 add a3,a4,48 + 2f8: 00d78023 sb a3,0(a5) + 2fc: fff78793 add a5,a5,-1 + 300: 40455513 sra a0,a0,0x4 + 304: fef812e3 bne a6,a5,2e8 + 308: 00058523 sb zero,10(a1) + 30c: 00008067 ret + +0000000000000310 : + 310: 03000793 li a5,48 + 314: 00f58023 sb a5,0(a1) + 318: 07800793 li a5,120 + 31c: 00f580a3 sb a5,1(a1) + 320: 00158813 add a6,a1,1 + 324: 01158793 add a5,a1,17 + 328: 00900613 li a2,9 + 32c: 00f57713 and a4,a0,15 + 330: 03770693 add a3,a4,55 + 334: 00e66463 bltu a2,a4,33c + 338: 03070693 add a3,a4,48 + 33c: 00d78023 sb a3,0(a5) + 340: fff78793 add a5,a5,-1 + 344: 40455513 sra a0,a0,0x4 + 348: fef812e3 bne a6,a5,32c + 34c: 00058923 sb zero,18(a1) + 350: 00008067 ret + +0000000000000354 : + 354: 00054783 lbu a5,0(a0) + 358: 00078c63 beqz a5,370 + 35c: 10000737 lui a4,0x10000 + 360: 00f70023 sb a5,0(a4) # 10000000 + 364: 00154783 lbu a5,1(a0) + 368: 00150513 add a0,a0,1 + 36c: fe079ae3 bnez a5,360 + 370: 00008067 ret + +0000000000000374 : + 374: fe010113 add sp,sp,-32 + 378: c0202673 rdinstret a2 + 37c: c00025f3 rdcycle a1 + 380: 00004717 auipc a4,0x4 + 384: d5070713 add a4,a4,-688 # 40d0 + 388: 06300793 li a5,99 + 38c: 100006b7 lui a3,0x10000 + 390: 00f68023 sb a5,0(a3) # 10000000 + 394: 00174783 lbu a5,1(a4) + 398: 00170713 add a4,a4,1 + 39c: fe079ae3 bnez a5,390 + 3a0: ffff8737 lui a4,0xffff8 + 3a4: 83074713 xor a4,a4,-2000 + 3a8: 01910793 add a5,sp,25 + 3ac: 00e11423 sh a4,8(sp) + 3b0: 00910813 add a6,sp,9 + 3b4: 00078713 mv a4,a5 + 3b8: 00900893 li a7,9 + 3bc: 00f5f693 and a3,a1,15 + 3c0: 03768513 add a0,a3,55 + 3c4: 00d8e463 bltu a7,a3,3cc + 3c8: 03068513 add a0,a3,48 + 3cc: 00a70023 sb a0,0(a4) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 3d0: fff70713 add a4,a4,-1 + 3d4: 4045d593 sra a1,a1,0x4 + 3d8: fee812e3 bne a6,a4,3bc + 3dc: 00814703 lbu a4,8(sp) + 3e0: 00010d23 sb zero,26(sp) + 3e4: 00810693 add a3,sp,8 + 3e8: 100005b7 lui a1,0x10000 + 3ec: 00070a63 beqz a4,400 + 3f0: 00e58023 sb a4,0(a1) # 10000000 + 3f4: 0016c703 lbu a4,1(a3) + 3f8: 00168693 add a3,a3,1 + 3fc: fe071ae3 bnez a4,3f0 + 400: 00004697 auipc a3,0x4 + 404: cd868693 add a3,a3,-808 # 40d8 + 408: 00a00713 li a4,10 + 40c: 100005b7 lui a1,0x10000 + 410: 00e58023 sb a4,0(a1) # 10000000 + 414: 0016c703 lbu a4,1(a3) + 418: 00168693 add a3,a3,1 + 41c: fe071ae3 bnez a4,410 + 420: ffff8737 lui a4,0xffff8 + 424: 83074713 xor a4,a4,-2000 + 428: 00060693 mv a3,a2 + 42c: 00e11423 sh a4,8(sp) + 430: 00900593 li a1,9 + 434: 00f6f713 and a4,a3,15 + 438: 03770613 add a2,a4,55 # ffffffffffff8037 <_end+0xffffffffefff7fef> + 43c: 00e5e463 bltu a1,a4,444 + 440: 03070613 add a2,a4,48 + 444: 00c78023 sb a2,0(a5) + 448: fff78793 add a5,a5,-1 + 44c: 4046d693 sra a3,a3,0x4 + 450: fef812e3 bne a6,a5,434 + 454: 00814783 lbu a5,8(sp) + 458: 00010d23 sb zero,26(sp) + 45c: 00810713 add a4,sp,8 + 460: 100006b7 lui a3,0x10000 + 464: 00078a63 beqz a5,478 + 468: 00f68023 sb a5,0(a3) # 10000000 + 46c: 00174783 lbu a5,1(a4) + 470: 00170713 add a4,a4,1 + 474: fe079ae3 bnez a5,468 + 478: 100007b7 lui a5,0x10000 + 47c: 00a00713 li a4,10 + 480: 00e78023 sb a4,0(a5) # 10000000 + 484: 02010113 add sp,sp,32 + 488: 00008067 ret + +000000000000048c : + 48c: fe010113 add sp,sp,-32 + 490: 00813823 sd s0,16(sp) + 494: 00113c23 sd ra,24(sp) + 498: 00050413 mv s0,a0 + 49c: 00004717 auipc a4,0x4 + 4a0: c4c70713 add a4,a4,-948 # 40e8 + 4a4: 04500793 li a5,69 + 4a8: 100006b7 lui a3,0x10000 + 4ac: 00f68023 sb a5,0(a3) # 10000000 + 4b0: 00174783 lbu a5,1(a4) + 4b4: 00170713 add a4,a4,1 + 4b8: fe079ae3 bnez a5,4ac + 4bc: 00010593 mv a1,sp + 4c0: 00040513 mv a0,s0 + 4c4: e09ff0ef jal 2cc + 4c8: 00014703 lbu a4,0(sp) + 4cc: 00070e63 beqz a4,4e8 + 4d0: 00010793 mv a5,sp + 4d4: 100006b7 lui a3,0x10000 + 4d8: 00e68023 sb a4,0(a3) # 10000000 + 4dc: 0017c703 lbu a4,1(a5) + 4e0: 00178793 add a5,a5,1 + 4e4: fe071ae3 bnez a4,4d8 + 4e8: 00040513 mv a0,s0 + 4ec: 100007b7 lui a5,0x10000 + 4f0: 00078023 sb zero,0(a5) # 10000000 + 4f4: 0000006f j 4f4 + +00000000000004f8 : + 4f8: ffff87b7 lui a5,0xffff8 + 4fc: fd010113 add sp,sp,-48 + 500: 8307c793 xor a5,a5,-2000 + 504: 00f11423 sh a5,8(sp) + 508: 02113423 sd ra,40(sp) + 50c: 01910793 add a5,sp,25 + 510: 00910813 add a6,sp,9 + 514: 00900613 li a2,9 + 518: 00f5f713 and a4,a1,15 + 51c: 03770693 add a3,a4,55 + 520: 00e66463 bltu a2,a4,528 + 524: 03070693 add a3,a4,48 + 528: 00d78023 sb a3,0(a5) # ffffffffffff8000 <_end+0xffffffffefff7fb8> + 52c: fff78793 add a5,a5,-1 + 530: 4045d593 sra a1,a1,0x4 + 534: ff0792e3 bne a5,a6,518 + 538: 00010d23 sb zero,26(sp) + 53c: 00b00793 li a5,11 + 540: 02a7e063 bltu a5,a0,560 + 544: 00004717 auipc a4,0x4 + 548: b1c70713 add a4,a4,-1252 # 4060 + 54c: 00251513 sll a0,a0,0x2 + 550: 00e50533 add a0,a0,a4 + 554: 00052783 lw a5,0(a0) + 558: 00e787b3 add a5,a5,a4 + 55c: 00078067 jr a5 + 560: 00004717 auipc a4,0x4 + 564: cb070713 add a4,a4,-848 # 4210 + 568: 05500793 li a5,85 + 56c: 100006b7 lui a3,0x10000 + 570: 00f68023 sb a5,0(a3) # 10000000 + 574: 00174783 lbu a5,1(a4) + 578: 00170713 add a4,a4,1 + 57c: fe079ae3 bnez a5,570 + 580: 00814783 lbu a5,8(sp) + 584: 00810713 add a4,sp,8 + 588: 100006b7 lui a3,0x10000 + 58c: 00078a63 beqz a5,5a0 + 590: 00f68023 sb a5,0(a3) # 10000000 + 594: 00174783 lbu a5,1(a4) + 598: 00170713 add a4,a4,1 + 59c: fe079ae3 bnez a5,590 + 5a0: 00004717 auipc a4,0x4 + 5a4: c9070713 add a4,a4,-880 # 4230 + 5a8: 00a00793 li a5,10 + 5ac: 100006b7 lui a3,0x10000 + 5b0: 00f68023 sb a5,0(a3) # 10000000 + 5b4: 00174783 lbu a5,1(a4) + 5b8: 00170713 add a4,a4,1 + 5bc: fe079ae3 bnez a5,5b0 + 5c0: fff00513 li a0,-1 + 5c4: ec9ff0ef jal 48c + 5c8: 00004717 auipc a4,0x4 + 5cc: b3070713 add a4,a4,-1232 # 40f8 + 5d0: 04900793 li a5,73 + 5d4: 100006b7 lui a3,0x10000 + 5d8: 00f68023 sb a5,0(a3) # 10000000 + 5dc: 00174783 lbu a5,1(a4) + 5e0: 00170713 add a4,a4,1 + 5e4: fe079ae3 bnez a5,5d8 + 5e8: 00814783 lbu a5,8(sp) + 5ec: 00810713 add a4,sp,8 + 5f0: 100006b7 lui a3,0x10000 + 5f4: fc0786e3 beqz a5,5c0 + 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: fb9ff06f j 5c0 + 60c: 00004717 auipc a4,0x4 + 610: b1470713 add a4,a4,-1260 # 4120 + 614: 04900793 li a5,73 + 618: 100006b7 lui a3,0x10000 + 61c: 00f68023 sb a5,0(a3) # 10000000 + 620: 00174783 lbu a5,1(a4) + 624: 00170713 add a4,a4,1 + 628: fe079ae3 bnez a5,61c + 62c: 00814783 lbu a5,8(sp) + 630: f80788e3 beqz a5,5c0 + 634: 00810713 add a4,sp,8 + 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: f75ff06f j 5c0 + 650: 00004717 auipc a4,0x4 + 654: af870713 add a4,a4,-1288 # 4148 + 658: 04900793 li a5,73 + 65c: 100006b7 lui a3,0x10000 + 660: 00f68023 sb a5,0(a3) # 10000000 + 664: 00174783 lbu a5,1(a4) + 668: 00170713 add a4,a4,1 + 66c: fe079ae3 bnez a5,660 + 670: 00814783 lbu a5,8(sp) + 674: f40786e3 beqz a5,5c0 + 678: 00810713 add a4,sp,8 + 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: f31ff06f j 5c0 + 694: 00004717 auipc a4,0x4 + 698: ad470713 add a4,a4,-1324 # 4168 + 69c: 04c00793 li a5,76 + 6a0: 100006b7 lui a3,0x10000 + 6a4: 00f68023 sb a5,0(a3) # 10000000 + 6a8: 00174783 lbu a5,1(a4) + 6ac: 00170713 add a4,a4,1 + 6b0: fe079ae3 bnez a5,6a4 + 6b4: 00814783 lbu a5,8(sp) + 6b8: f00784e3 beqz a5,5c0 + 6bc: 00810713 add a4,sp,8 + 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: eedff06f j 5c0 + 6d8: 00004717 auipc a4,0x4 + 6dc: ab070713 add a4,a4,-1360 # 4188 + 6e0: 04c00793 li a5,76 + 6e4: 100006b7 lui a3,0x10000 + 6e8: 00f68023 sb a5,0(a3) # 10000000 + 6ec: 00174783 lbu a5,1(a4) + 6f0: 00170713 add a4,a4,1 + 6f4: fe079ae3 bnez a5,6e8 + 6f8: 00814783 lbu a5,8(sp) + 6fc: ec0782e3 beqz a5,5c0 + 700: 00810713 add a4,sp,8 + 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: ea9ff06f j 5c0 + 71c: 00004717 auipc a4,0x4 + 720: a8c70713 add a4,a4,-1396 # 41a8 + 724: 05300793 li a5,83 + 728: 100006b7 lui a3,0x10000 + 72c: 00f68023 sb a5,0(a3) # 10000000 + 730: 00174783 lbu a5,1(a4) + 734: 00170713 add a4,a4,1 + 738: fe079ae3 bnez a5,72c + 73c: 00814783 lbu a5,8(sp) + 740: e80780e3 beqz a5,5c0 + 744: 00810713 add a4,sp,8 + 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: e65ff06f j 5c0 + 760: 00004717 auipc a4,0x4 + 764: a7070713 add a4,a4,-1424 # 41d0 + 768: 05300793 li a5,83 + 76c: 100006b7 lui a3,0x10000 + 770: 00f68023 sb a5,0(a3) # 10000000 + 774: 00174783 lbu a5,1(a4) + 778: 00170713 add a4,a4,1 + 77c: fe079ae3 bnez a5,770 + 780: 00814783 lbu a5,8(sp) + 784: e2078ee3 beqz a5,5c0 + 788: 00810713 add a4,sp,8 + 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: e21ff06f j 5c0 + 7a4: 00004717 auipc a4,0x4 + 7a8: a4c70713 add a4,a4,-1460 # 41f0 + 7ac: 04500793 li a5,69 + 7b0: 100006b7 lui a3,0x10000 + 7b4: 00f68023 sb a5,0(a3) # 10000000 + 7b8: 00174783 lbu a5,1(a4) + 7bc: 00170713 add a4,a4,1 + 7c0: fe079ae3 bnez a5,7b4 + 7c4: 00814783 lbu a5,8(sp) + 7c8: de078ce3 beqz a5,5c0 + 7cc: 00810713 add a4,sp,8 + 7d0: 100006b7 lui a3,0x10000 + 7d4: 00f68023 sb a5,0(a3) # 10000000 + 7d8: 00174783 lbu a5,1(a4) + 7dc: 00170713 add a4,a4,1 + 7e0: fe079ae3 bnez a5,7d4 + 7e4: dddff06f j 5c0 + +00000000000007e8 : + 7e8: 00051063 bnez a0,7e8 + 7ec: 00008067 ret + +00000000000007f0 <_init>: + 7f0: ff010113 add sp,sp,-16 + 7f4: 00000593 li a1,0 + 7f8: 00000513 li a0,0 + 7fc: 00113423 sd ra,8(sp) + 800: 1d8000ef jal 9d8
+ 804: c89ff0ef jal 48c + +0000000000000808 : + 808: 00b567b3 or a5,a0,a1 + 80c: 00c7e7b3 or a5,a5,a2 + 810: 0077f793 and a5,a5,7 + 814: 00c50833 add a6,a0,a2 + 818: 02078463 beqz a5,840 + 81c: 00c58633 add a2,a1,a2 + 820: 00050793 mv a5,a0 + 824: 0b057663 bgeu a0,a6,8d0 + 828: 0005c703 lbu a4,0(a1) + 82c: 00158593 add a1,a1,1 + 830: 00178793 add a5,a5,1 + 834: fee78fa3 sb a4,-1(a5) + 838: fec598e3 bne a1,a2,828 + 83c: 00008067 ret + 840: 04050693 add a3,a0,64 + 844: 0906f863 bgeu a3,a6,8d4 + 848: 00058713 mv a4,a1 + 84c: 00068793 mv a5,a3 + 850: 00073383 ld t2,0(a4) + 854: 00873283 ld t0,8(a4) + 858: 01073f83 ld t6,16(a4) + 85c: 01873f03 ld t5,24(a4) + 860: 02073e83 ld t4,32(a4) + 864: 02873e03 ld t3,40(a4) + 868: 03073303 ld t1,48(a4) + 86c: 03873883 ld a7,56(a4) + 870: 04078793 add a5,a5,64 + 874: f877b023 sd t2,-128(a5) + 878: f857b423 sd t0,-120(a5) + 87c: f9f7b823 sd t6,-112(a5) + 880: f9e7bc23 sd t5,-104(a5) + 884: fbd7b023 sd t4,-96(a5) + 888: fbc7b423 sd t3,-88(a5) + 88c: fa67b823 sd t1,-80(a5) + 890: fb17bc23 sd a7,-72(a5) + 894: 04070713 add a4,a4,64 + 898: fb07ece3 bltu a5,a6,850 + 89c: fbf60613 add a2,a2,-65 + 8a0: fc067793 and a5,a2,-64 + 8a4: 04078793 add a5,a5,64 + 8a8: fc067613 and a2,a2,-64 + 8ac: 00f585b3 add a1,a1,a5 + 8b0: 00c687b3 add a5,a3,a2 + 8b4: f907f4e3 bgeu a5,a6,83c + 8b8: 0005b703 ld a4,0(a1) + 8bc: 00878793 add a5,a5,8 + 8c0: 00858593 add a1,a1,8 + 8c4: fee7bc23 sd a4,-8(a5) + 8c8: ff07e8e3 bltu a5,a6,8b8 + 8cc: 00008067 ret + 8d0: 00008067 ret + 8d4: 00050793 mv a5,a0 + 8d8: fddff06f j 8b4 + +00000000000008dc : + 8dc: 00c567b3 or a5,a0,a2 + 8e0: 0077f793 and a5,a5,7 + 8e4: 00c50633 add a2,a0,a2 + 8e8: 0ff5f713 zext.b a4,a1 + 8ec: 00078e63 beqz a5,908 + 8f0: 00050793 mv a5,a0 + 8f4: 02c57c63 bgeu a0,a2,92c + 8f8: 00178793 add a5,a5,1 + 8fc: fee78fa3 sb a4,-1(a5) + 900: fef61ce3 bne a2,a5,8f8 + 904: 00008067 ret + 908: 00004797 auipc a5,0x4 + 90c: 9407b783 ld a5,-1728(a5) # 4248 + 910: 02f70733 mul a4,a4,a5 + 914: fec578e3 bgeu a0,a2,904 + 918: 00050793 mv a5,a0 + 91c: 00878793 add a5,a5,8 + 920: fee7bc23 sd a4,-8(a5) + 924: fec7ece3 bltu a5,a2,91c + 928: 00008067 ret + 92c: 00008067 ret + +0000000000000930 : + 930: 00054783 lbu a5,0(a0) + 934: 00078e63 beqz a5,950 + 938: 00050793 mv a5,a0 + 93c: 0017c703 lbu a4,1(a5) + 940: 00178793 add a5,a5,1 + 944: fe071ce3 bnez a4,93c + 948: 40a78533 sub a0,a5,a0 + 94c: 00008067 ret + 950: 00000513 li a0,0 + 954: 00008067 ret + +0000000000000958 : + 958: 00b506b3 add a3,a0,a1 + 95c: 00050793 mv a5,a0 + 960: 00059863 bnez a1,970 + 964: 0240006f j 988 + 968: 00178793 add a5,a5,1 + 96c: 00f68a63 beq a3,a5,980 + 970: 0007c703 lbu a4,0(a5) + 974: fe071ae3 bnez a4,968 + 978: 40a78533 sub a0,a5,a0 + 97c: 00008067 ret + 980: 40a68533 sub a0,a3,a0 + 984: 00008067 ret + 988: 00000513 li a0,0 + 98c: 00008067 ret + +0000000000000990 : + 990: 00054783 lbu a5,0(a0) + 994: 00158593 add a1,a1,1 + 998: 00150513 add a0,a0,1 + 99c: fff5c703 lbu a4,-1(a1) + 9a0: 00078a63 beqz a5,9b4 + 9a4: fee786e3 beq a5,a4,990 + 9a8: 0007851b sext.w a0,a5 + 9ac: 40e5053b subw a0,a0,a4 + 9b0: 00008067 ret + 9b4: 00000513 li a0,0 + 9b8: ff5ff06f j 9ac + +00000000000009bc : + 9bc: 00050793 mv a5,a0 + 9c0: 0005c703 lbu a4,0(a1) + 9c4: 00178793 add a5,a5,1 + 9c8: 00158593 add a1,a1,1 + 9cc: fee78fa3 sb a4,-1(a5) + 9d0: fe0718e3 bnez a4,9c0 + 9d4: 00008067 ret + +Disassembly of section .text.startup: + +00000000000009d8
: + 9d8: ff010113 add sp,sp,-16 + 9dc: 00003517 auipc a0,0x3 + 9e0: 6dc50513 add a0,a0,1756 # 40b8 + 9e4: 00113423 sd ra,8(sp) + 9e8: 96dff0ef jal 354 + 9ec: 00003817 auipc a6,0x3 + 9f0: 64480813 add a6,a6,1604 # 4030 + 9f4: 00003697 auipc a3,0x3 + 9f8: 60c68693 add a3,a3,1548 # 4000 + 9fc: 00080713 mv a4,a6 + a00: 03000793 li a5,48 + a04: 00004517 auipc a0,0x4 + a08: 84c50513 add a0,a0,-1972 # 4250 + a0c: 0c07f5d7 vsetvli a1,a5,e8,m1,ta,ma + a10: 0005861b sext.w a2,a1 + a14: 02070507 vle8.v v10,(a4) + a18: 02068587 vle8.v v11,(a3) + a1c: 6aa58057 vmsltu.vv v0,v10,v11 + a20: 00a2b557 vadd.vi v10,v10,5,v0.t + a24: 02050527 vse8.v v10,(a0) + a28: 40b787bb subw a5,a5,a1 + a2c: 00c70733 add a4,a4,a2 + a30: 00c686b3 add a3,a3,a2 + a34: fc079ce3 bnez a5,a0c + a38: 00003717 auipc a4,0x3 + a3c: 5c870713 add a4,a4,1480 # 4000 + a40: 00003617 auipc a2,0x3 + a44: 5f160613 add a2,a2,1521 # 4031 + a48: 00004697 auipc a3,0x4 + a4c: 83868693 add a3,a3,-1992 # 4280 + a50: 0a600793 li a5,166 + a54: 00c0006f j a60 + a58: 00064783 lbu a5,0(a2) + a5c: 00160613 add a2,a2,1 + a60: 00074583 lbu a1,0(a4) + a64: 0057851b addw a0,a5,5 + a68: 00170713 add a4,a4,1 + a6c: 00b7f463 bgeu a5,a1,a74 + a70: 0ff57793 zext.b a5,a0 + a74: 00f68023 sb a5,0(a3) + a78: 00168693 add a3,a3,1 + a7c: fd071ee3 bne a4,a6,a58 + a80: 03000613 li a2,48 + a84: 00003597 auipc a1,0x3 + a88: 7fc58593 add a1,a1,2044 # 4280 + a8c: 00003517 auipc a0,0x3 + a90: 7c450513 add a0,a0,1988 # 4250 + a94: f6cff0ef jal 200 + a98: 00813083 ld ra,8(sp) + a9c: 00154513 xor a0,a0,1 + aa0: 0ff57513 zext.b a0,a0 + aa4: 01010113 add sp,sp,16 + aa8: 00008067 ret + aac: fff00513 li a0,-1 + ab0: 00008067 ret + +Disassembly of section .rodata: + +0000000000004000 : + 4000: 91b60657 .4byte 0x91b60657 + 4004: 0c81 vmsge.vx v25,v0,zero,v0.t + 4006: f05ead13 slti s10,t4,-251 + 400a: ce667353 .4byte 0xce667353 + 400e: cf69 .2byte 0xcf69 + 4010: fcdf 1933 cce0 .byte 0xdf, 0xfc, 0x33, 0x19, 0xe0, 0xcc + 4016: 3fec .2byte 0x3fec + 4018: 8e41 vmsge.vx v28,v0,ra,v0.t + 401a: fe6c .2byte 0xfe6c + 401c: c0df 69c7 6106 .byte 0xdf, 0xc0, 0xc7, 0x69, 0x06, 0x61 + 4022: 88cd .2byte 0x88cd + 4024: 1805 .2byte 0x1805 + 4026: be89 .2byte 0xbe89 + 4028: 4499 .2byte 0x4499 + 402a: b0bc .2byte 0xb0bc + 402c: bfd4 .2byte 0xbfd4 + 402e: 652e .2byte 0x652e + +0000000000004030 : + 4030: afa6 .2byte 0xafa6 + 4032: 7ff5 .2byte 0x7ff5 + 4034: 9fc2 vmsge.vx v31,v0,ra,v0.t + 4036: 4969e70b .4byte 0x4969e70b + 403a: ed3a186b .4byte 0xed3a186b + 403e: b606 .2byte 0xb606 + 4040: 8fc9 .2byte 0x8fc9 + 4042: f964 .2byte 0xf964 + 4044: b30e .2byte 0xb30e + 4046: 8b0e5267 .4byte 0x8b0e5267 + 404a: 4554 .2byte 0x4554 + 404c: eb81 vmsge.vx v23,v0,ra,v0.t + 404e: e735 .2byte 0xe735 + 4050: 1f2a .2byte 0x1f2a + 4052: 2385 .2byte 0x2385 + 4054: 71931d93 .4byte 0x71931d93 + 4058: 4d18 .2byte 0x4d18 + 405a: b70bda0b .4byte 0xb70bda0b + 405e: 12b2 .2byte 0x12b2 + 4060: c568 .2byte 0xc568 + 4062: ffff .2byte 0xffff + 4064: c5ac .2byte 0xc5ac + 4066: ffff .2byte 0xffff + 4068: c5f0 .2byte 0xc5f0 + 406a: ffff .2byte 0xffff + 406c: c500 vmsge.vx v10,v0,ra,v0.t + 406e: ffff .2byte 0xffff + 4070: c634 .2byte 0xc634 + 4072: ffff .2byte 0xffff + 4074: c678 .2byte 0xc678 + 4076: ffff .2byte 0xffff + 4078: c6bc .2byte 0xc6bc + 407a: ffff .2byte 0xffff + 407c: c700 vmsge.vx v14,v0,ra,v0.t + 407e: ffff .2byte 0xffff + 4080: c500 vmsge.vx v10,v0,ra,v0.t + 4082: ffff .2byte 0xffff + 4084: c500 vmsge.vx v10,v0,ra,v0.t + 4086: ffff .2byte 0xffff + 4088: c500 vmsge.vx v10,v0,ra,v0.t + 408a: ffff .2byte 0xffff + 408c: c744 .2byte 0xc744 + 408e: ffff .2byte 0xffff + +Disassembly of section .rodata.str1.8: + +0000000000004090 <.rodata.str1.8>: + 4090: 5241 vmsge.vx v4,v0,zero,v0.t + 4092: 4152 .2byte 0x4152 + 4094: 2059 .2byte 0x2059 + 4096: 4f4e .2byte 0x4f4e + 4098: 2054 .2byte 0x2054 + 409a: 52524f43 vmsge.vx v30,v5,tp + 409e: 4345 .2byte 0x4345 + 40a0: 2054 .2byte 0x2054 + 40a2: 4e49 .2byte 0x4e49 + 40a4: 4920 vmsge.vx v18,v0,zero,v0.t + 40a6: 444e .2byte 0x444e + 40a8: 5845 .2byte 0x5845 + 40aa: 203a .2byte 0x203a + 40ac: 0000 vmsge.vx v0,v0,zero,v0.t + 40ae: 0000 vmsge.vx v0,v0,zero,v0.t + 40b0: 000a .2byte 0xa + 40b2: 0000 vmsge.vx v0,v0,zero,v0.t + 40b4: 0000 vmsge.vx v0,v0,zero,v0.t + 40b6: 0000 vmsge.vx v0,v0,zero,v0.t + 40b8: 52415453 .4byte 0x52415453 + 40bc: 2054 .2byte 0x2054 + 40be: 5620464f .4byte 0x5620464f + 40c2: 534d .2byte 0x534d + 40c4: 544c .2byte 0x544c + 40c6: 2055 .2byte 0x2055 + 40c8: 4554 .2byte 0x4554 + 40ca: 0a3a5453 .4byte 0xa3a5453 + 40ce: 0000 vmsge.vx v0,v0,zero,v0.t + 40d0: 6c637963 bgeu t1,t1,47a2 <_tbss_end+0x4f2> + 40d4: 3a65 .2byte 0x3a65 + 40d6: 0020 vmsge.vx v0,v0,zero,v0.t + 40d8: 690a .2byte 0x690a + 40da: 736e .2byte 0x736e + 40dc: 7274 .2byte 0x7274 + 40de: 7465 .2byte 0x7465 + 40e0: 203a .2byte 0x203a + 40e2: 0000 vmsge.vx v0,v0,zero,v0.t + 40e4: 0000 vmsge.vx v0,v0,zero,v0.t + 40e6: 0000 vmsge.vx v0,v0,zero,v0.t + 40e8: 7845 .2byte 0x7845 + 40ea: 7469 .2byte 0x7469 + 40ec: 6320 vmsge.vx v6,v0,zero,v0.t + 40ee: 3a65646f jal s0,5a494 <__global_pointer$+0x55a4c> + 40f2: 0020 vmsge.vx v0,v0,zero,v0.t + 40f4: 0000 vmsge.vx v0,v0,zero,v0.t + 40f6: 0000 vmsge.vx v0,v0,zero,v0.t + 40f8: 4e49 .2byte 0x4e49 + 40fa: 55525453 .4byte 0x55525453 + 40fe: 4f495443 vmsge.vx v8,v20,s2 + 4102: 204e .2byte 0x204e + 4104: 4441 vmsge.vx v8,v0,zero,v0.t + 4106: 5244 .2byte 0x5244 + 4108: 5345 .2byte 0x5345 + 410a: 494d2053 .4byte 0x494d2053 + 410e: 494c4153 .4byte 0x494c4153 + 4112: 44454e47 .4byte 0x44454e47 + 4116: 6120 vmsge.vx v2,v0,zero,v0.t + 4118: 2074 .2byte 0x2074 + 411a: 4350 .2byte 0x4350 + 411c: 203a .2byte 0x203a + 411e: 0000 vmsge.vx v0,v0,zero,v0.t + 4120: 4e49 .2byte 0x4e49 + 4122: 55525453 .4byte 0x55525453 + 4126: 4f495443 vmsge.vx v8,v20,s2 + 412a: 204e .2byte 0x204e + 412c: 4341 vmsge.vx v6,v0,zero,v0.t + 412e: 53534543 vmsge.vx v10,v21,t1 + 4132: 4620 vmsge.vx v12,v0,zero,v0.t + 4134: 5541 vmsge.vx v10,v0,zero,v0.t + 4136: 544c .2byte 0x544c + 4138: 6120 vmsge.vx v2,v0,zero,v0.t + 413a: 2074 .2byte 0x2074 + 413c: 4350 .2byte 0x4350 + 413e: 203a .2byte 0x203a + ... + 4148: 4c49 .2byte 0x4c49 + 414a: 454c .2byte 0x454c + 414c: 204c4147 .4byte 0x204c4147 + 4150: 4e49 .2byte 0x4e49 + 4152: 55525453 .4byte 0x55525453 + 4156: 4f495443 vmsge.vx v8,v20,s2 + 415a: 204e .2byte 0x204e + 415c: 7461 vmsge.vx v8,v0,zero,v0.t + 415e: 5020 vmsge.vx v0,v0,zero,v0.t + 4160: 00203a43 vmsge.vx v20,v2,zero,v0.t + 4164: 0000 vmsge.vx v0,v0,zero,v0.t + 4166: 0000 vmsge.vx v0,v0,zero,v0.t + 4168: 4f4c .2byte 0x4f4c + 416a: 4441 vmsge.vx v8,v0,zero,v0.t + 416c: 4120 vmsge.vx v2,v0,zero,v0.t + 416e: 4444 .2byte 0x4444 + 4170: 4552 .2byte 0x4552 + 4172: 4d205353 .4byte 0x4d205353 + 4176: 5349 .2byte 0x5349 + 4178: 4c41 vmsge.vx v24,v0,zero,v0.t + 417a: 4749 .2byte 0x4749 + 417c: 454e .2byte 0x454e + 417e: 2044 .2byte 0x2044 + 4180: 7461 vmsge.vx v8,v0,zero,v0.t + 4182: 5020 vmsge.vx v0,v0,zero,v0.t + 4184: 00203a43 vmsge.vx v20,v2,zero,v0.t + 4188: 4f4c .2byte 0x4f4c + 418a: 4441 vmsge.vx v8,v0,zero,v0.t + 418c: 4120 vmsge.vx v2,v0,zero,v0.t + 418e: 53454343 vmsge.vx v6,v20,a0 + 4192: 41462053 .4byte 0x41462053 + 4196: 4c55 .2byte 0x4c55 + 4198: 2054 .2byte 0x2054 + 419a: 7461 vmsge.vx v8,v0,zero,v0.t + 419c: 5020 vmsge.vx v0,v0,zero,v0.t + 419e: 00203a43 vmsge.vx v20,v2,zero,v0.t + 41a2: 0000 vmsge.vx v0,v0,zero,v0.t + 41a4: 0000 vmsge.vx v0,v0,zero,v0.t + 41a6: 0000 vmsge.vx v0,v0,zero,v0.t + 41a8: 524f5453 .4byte 0x524f5453 + 41ac: 2045 .2byte 0x2045 + 41ae: 4441 vmsge.vx v8,v0,zero,v0.t + 41b0: 5244 .2byte 0x5244 + 41b2: 5345 .2byte 0x5345 + 41b4: 494d2053 .4byte 0x494d2053 + 41b8: 494c4153 .4byte 0x494c4153 + 41bc: 44454e47 .4byte 0x44454e47 + 41c0: 6120 vmsge.vx v2,v0,zero,v0.t + 41c2: 2074 .2byte 0x2074 + 41c4: 4350 .2byte 0x4350 + 41c6: 203a .2byte 0x203a + ... + 41d0: 524f5453 .4byte 0x524f5453 + 41d4: 2045 .2byte 0x2045 + 41d6: 4341 vmsge.vx v6,v0,zero,v0.t + 41d8: 53534543 vmsge.vx v10,v21,t1 + 41dc: 4620 vmsge.vx v12,v0,zero,v0.t + 41de: 5541 vmsge.vx v10,v0,zero,v0.t + 41e0: 544c .2byte 0x544c + 41e2: 6120 vmsge.vx v2,v0,zero,v0.t + 41e4: 2074 .2byte 0x2074 + 41e6: 4350 .2byte 0x4350 + 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: 4345 .2byte 0x4345 + 41f2: 4c41 vmsge.vx v24,v0,zero,v0.t + 41f4: 204c .2byte 0x204c + 41f6: 5246 .2byte 0x5246 + 41f8: 4d204d4f .4byte 0x4d204d4f + 41fc: 4d2d .2byte 0x4d2d + 41fe: 2045444f .4byte 0x2045444f + 4202: 7461 vmsge.vx v8,v0,zero,v0.t + 4204: 5020 vmsge.vx v0,v0,zero,v0.t + 4206: 00203a43 vmsge.vx v20,v2,zero,v0.t + 420a: 0000 vmsge.vx v0,v0,zero,v0.t + 420c: 0000 vmsge.vx v0,v0,zero,v0.t + 420e: 0000 vmsge.vx v0,v0,zero,v0.t + 4210: 4e55 .2byte 0x4e55 + 4212: 574f4e4b .4byte 0x574f4e4b + 4216: 204e .2byte 0x204e + 4218: 5845 .2byte 0x5845 + 421a: 54504543 vmsge.vx v10,v5,zero,v0.t + 421e: 4f49 .2byte 0x4f49 + 4220: 204e .2byte 0x204e + 4222: 7461 vmsge.vx v8,v0,zero,v0.t + 4224: 5020 vmsge.vx v0,v0,zero,v0.t + 4226: 00203a43 vmsge.vx v20,v2,zero,v0.t + 422a: 0000 vmsge.vx v0,v0,zero,v0.t + 422c: 0000 vmsge.vx v0,v0,zero,v0.t + 422e: 0000 vmsge.vx v0,v0,zero,v0.t + 4230: 430a .2byte 0x430a + 4232: 4548 .2byte 0x4548 + 4234: 4d204b43 vmsge.vx v22,v18,zero,v0.t + 4238: 53554143 vmsge.vx v2,v21,a0 + 423c: 2045 .2byte 0x2045 + 423e: 6e69 .2byte 0x6e69 + 4240: 5220 vmsge.vx v4,v0,zero,v0.t + 4242: 4c54 .2byte 0x4c54 + ... + +Disassembly of section .sdata: + +0000000000004248 <__global_pointer$-0x800>: + 4248: 0101 vmsge.vx v2,v0,zero,v0.t + 424a: 0101 vmsge.vx v2,v0,zero,v0.t + 424c: 0101 vmsge.vx v2,v0,zero,v0.t + 424e: 0101 vmsge.vx v2,v0,zero,v0.t + +Disassembly of section .bss: + +0000000000004250 : + ... + +0000000000004280 : + ... + +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/vmslt/vmslt.c b/src/main/resources/applications_vector/vmslt/vmslt.c new file mode 100644 index 00000000..a258194e --- /dev/null +++ b/src/main/resources/applications_vector/vmslt/vmslt.c @@ -0,0 +1,84 @@ +#include "util.h" + +#define size_t long +#define N 48 + +const unsigned char dataArray0[N] = {0xA6, 0xAF, 0xF5, 0x7F, 0xC2, 0x9F, 0xB, 0xE7, 0x69, 0x49, 0x6B, 0x18, 0x3A, 0xED, 0x6, 0xB6, 0xC9, 0x8F, 0x64, 0xF9, 0xE, 0xB3, 0x67, 0x52, 0xE, 0x8B, 0x54, 0x45, 0x81, 0xEB, 0x35, 0xE7, 0x2A, 0x1F, 0x85, 0x23, 0x93, 0x1D, 0x93, 0x71, 0x18, 0x4D, 0xB, 0xDA, 0xB, 0xB7, 0xB2, 0x12}; +const unsigned char dataArray1[N] = {0x57, 0x6, 0xB6, 0x91, 0x81, 0xC, 0x13, 0xAD, 0x5E, 0xF0, 0x53, 0x73, 0x66, 0xCE, 0x69, 0xCF, 0xDF, 0xFC, 0x33, 0x19, 0xE0, 0xCC, 0xEC, 0x3F, 0x41, 0x8E, 0x6C, 0xFE, 0xDF, 0xC0, 0xC7, 0x69, 0x6, 0x61, 0xCD, 0x88, 0x5, 0x18, 0x89, 0xBE, 0x99, 0x44, 0xBC, 0xB0, 0xD4, 0xBF, 0x2E, 0x65}; +unsigned char resultArray[N] = {0}; +unsigned char 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(); + +void* memReset(void* dest, size_t n) { + int vl, avl = n; + void *ptr = dest; + while(avl != 0) { + asm volatile ("vsetvli %0, %1, e8, m1, ta, ma" + : "=r"(vl) + : "r"(avl)); + asm volatile ("vand.vi v31, v31, 0"); + asm volatile ("vse8.v v31, (%0)" + : + : "r"(ptr)); + ptr += vl; + avl -= vl; + } + return ptr; +} + +_Bool verifyResult(const unsigned char* ptr0, const unsigned char* ptr1, size_t n) { + int i; + _Bool correct = 1; + char string[19]; + for(i=0; i sigs.valid && sigs.bits.vd === sigFromVEU.bits.vd).reduce(_ || _) when(!otherWritesSameVd) { diff --git a/src/main/scala/my_random_useful_programs/RandomArrayGen.scala b/src/main/scala/my_random_useful_programs/RandomArrayGen.scala index 4c1e22bf..009f6bd7 100644 --- a/src/main/scala/my_random_useful_programs/RandomArrayGen.scala +++ b/src/main/scala/my_random_useful_programs/RandomArrayGen.scala @@ -20,11 +20,8 @@ object RandomIntTupleGen extends App { } object RandomArrayWithElenGen extends App { - val randomArray0 = (0 until 36).map(_ => Random.nextInt(0x10000)).map("0x" + _.toHexString.toUpperCase) - val randomArray1 = (0 until 36).map(_ => Random.nextInt(0x10000)).map("0x" + _.toHexString.toUpperCase) - val equalArray = (0 until 36).map(_ => Random.nextBoolean()) + 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) println(randomArray0.mkString("{", ", ", "};")) - println(randomArray0.lazyZip(randomArray1).lazyZip(equalArray).map { - case (n0, n1, b) => if(b) n0 else n1 - }.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 fa0695c1..f5eb50eb 100644 --- a/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala +++ b/src/test/scala/hajime/vectormodules/VectorCpuSpec.scala @@ -137,9 +137,10 @@ class Zve64xAppTestForVecCpu extends AnyFlatSpec with ChiselScalatestTester { val ldstTest = Seq("vector_conf", "vector_ldst", "vector_memcpy", "vector_stride", "vector_index") val arithmeticTest = Seq( "vadd", "vsub", // "vmadc", "vmsbc", - "vand", "vmseq" + "vand", "vmseq", + "vmslt" ) - val zve64xTestList: Seq[String] = (if(false) ldstTest else Nil) ++ (if(true) arithmeticTest else Nil) + val zve64xTestList: Seq[String] = (if(true) ldstTest else Nil) ++ (if(true) arithmeticTest else Nil) 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 =>