Skip to content

Commit

Permalink
[dependencies] add disasm for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Clo91eaf committed May 14, 2024
1 parent fb3d95e commit a4f1554
Show file tree
Hide file tree
Showing 354 changed files with 237,391 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dependencies/tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
ELF_FILES := $(shell find elf -type f)
ASM_FILES := $(patsubst elf/%, asm/%, $(ELF_FILES))
BIN_FILES := $(patsubst elf/%, bin/%, $(ELF_FILES))

all: $(BIN_FILES)
all: $(BIN_FILES) $(ASM_FILES)

bin/%: elf/%
riscv64-unknown-elf-objcopy -O binary $< $@

asm/%: elf/%
riscv64-linux-gnu-objdump -d -M no-aliases,numeric $< > $@

clean:
rm -f $(BIN_FILES)
rm -f $(BIN_FILES) $(ASM_FILES)
89 changes: 89 additions & 0 deletions dependencies/tests/asm/am-tests/add
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@

elf/am-tests/add: file format elf64-littleriscv


Disassembly of section .text:

0000000080000000 <_start>:
80000000: 00000413 addi x8,x0,0
80000004: 00009117 auipc x2,0x9
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
8000000c: 0fc000ef jal x1,80000108 <_trm_init>

0000000080000010 <check>:
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
80000014: 00008067 jalr x0,0(x1)
80000018: ff010113 addi x2,x2,-16
8000001c: 00100513 addi x10,x0,1
80000020: 00113423 sd x1,8(x2)
80000024: 0d8000ef jal x1,800000fc <halt>

0000000080000028 <main>:
80000028: fb010113 addi x2,x2,-80
8000002c: 01713423 sd x23,8(x2)
80000030: 00000b97 auipc x23,0x0
80000034: 200b8b93 addi x23,x23,512 # 80000230 <test_data>
80000038: 03313423 sd x19,40(x2)
8000003c: 03413023 sd x20,32(x2)
80000040: 01513c23 sd x21,24(x2)
80000044: 01613823 sd x22,16(x2)
80000048: 01813023 sd x24,0(x2)
8000004c: 04113423 sd x1,72(x2)
80000050: 04813023 sd x8,64(x2)
80000054: 02913c23 sd x9,56(x2)
80000058: 03213823 sd x18,48(x2)
8000005c: 00000b17 auipc x22,0x0
80000060: 0d4b0b13 addi x22,x22,212 # 80000130 <ans>
80000064: 000b8a93 addi x21,x23,0
80000068: 00000a13 addi x20,x0,0
8000006c: 00000997 auipc x19,0x0
80000070: 1e498993 addi x19,x19,484 # 80000250 <_bss_start>
80000074: 04000c13 addi x24,x0,64
80000078: 000aa903 lw x18,0(x21)
8000007c: 000b0493 addi x9,x22,0
80000080: 000b8413 addi x8,x23,0
80000084: 00042503 lw x10,0(x8)
80000088: 0004a783 lw x15,0(x9)
8000008c: 00440413 addi x8,x8,4
80000090: 0125053b addw x10,x10,x18
80000094: 40f50533 sub x10,x10,x15
80000098: 00153513 sltiu x10,x10,1
8000009c: f75ff0ef jal x1,80000010 <check>
800000a0: 00448493 addi x9,x9,4
800000a4: fe8990e3 bne x19,x8,80000084 <main+0x5c>
800000a8: 00100513 addi x10,x0,1
800000ac: 008a0a1b addiw x20,x20,8
800000b0: f61ff0ef jal x1,80000010 <check>
800000b4: 004a8a93 addi x21,x21,4
800000b8: 020b0b13 addi x22,x22,32
800000bc: fb8a1ee3 bne x20,x24,80000078 <main+0x50>
800000c0: 00100513 addi x10,x0,1
800000c4: f4dff0ef jal x1,80000010 <check>
800000c8: 04813083 ld x1,72(x2)
800000cc: 04013403 ld x8,64(x2)
800000d0: 03813483 ld x9,56(x2)
800000d4: 03013903 ld x18,48(x2)
800000d8: 02813983 ld x19,40(x2)
800000dc: 02013a03 ld x20,32(x2)
800000e0: 01813a83 ld x21,24(x2)
800000e4: 01013b03 ld x22,16(x2)
800000e8: 00813b83 ld x23,8(x2)
800000ec: 00013c03 ld x24,0(x2)
800000f0: 00000513 addi x10,x0,0
800000f4: 05010113 addi x2,x2,80
800000f8: 00008067 jalr x0,0(x1)

00000000800000fc <halt>:
800000fc: 00050513 addi x10,x10,0
80000100: 00100073 ebreak
80000104: 0000006f jal x0,80000104 <halt+0x8>

0000000080000108 <_trm_init>:
80000108: ff010113 addi x2,x2,-16
8000010c: 00000517 auipc x10,0x0
80000110: 01c50513 addi x10,x10,28 # 80000128 <_etext>
80000114: 00113423 sd x1,8(x2)
80000118: f11ff0ef jal x1,80000028 <main>
8000011c: 00050513 addi x10,x10,0
80000120: 00100073 ebreak
80000124: 0000006f jal x0,80000124 <_trm_init+0x1c>
85 changes: 85 additions & 0 deletions dependencies/tests/asm/am-tests/add-longlong
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

elf/am-tests/add-longlong: file format elf64-littleriscv


Disassembly of section .text:

0000000080000000 <_start>:
80000000: 00000413 addi x8,x0,0
80000004: 00009117 auipc x2,0x9
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
8000000c: 0ec000ef jal x1,800000f8 <_trm_init>

0000000080000010 <check>:
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
80000014: 00008067 jalr x0,0(x1)
80000018: ff010113 addi x2,x2,-16
8000001c: 00100513 addi x10,x0,1
80000020: 00113423 sd x1,8(x2)
80000024: 0c8000ef jal x1,800000ec <halt>

0000000080000028 <main>:
80000028: fb010113 addi x2,x2,-80
8000002c: 01713423 sd x23,8(x2)
80000030: 00000b97 auipc x23,0x0
80000034: 2f0b8b93 addi x23,x23,752 # 80000320 <test_data>
80000038: 03313423 sd x19,40(x2)
8000003c: 03413023 sd x20,32(x2)
80000040: 01513c23 sd x21,24(x2)
80000044: 01613823 sd x22,16(x2)
80000048: 01813023 sd x24,0(x2)
8000004c: 04113423 sd x1,72(x2)
80000050: 04813023 sd x8,64(x2)
80000054: 02913c23 sd x9,56(x2)
80000058: 03213823 sd x18,48(x2)
8000005c: 00000b17 auipc x22,0x0
80000060: 0c4b0b13 addi x22,x22,196 # 80000120 <ans>
80000064: 000b8a93 addi x21,x23,0
80000068: 00000a13 addi x20,x0,0
8000006c: 00000997 auipc x19,0x0
80000070: 2f498993 addi x19,x19,756 # 80000360 <_bss_start>
80000074: 04000c13 addi x24,x0,64
80000078: 000ab903 ld x18,0(x21)
8000007c: 000b0493 addi x9,x22,0
80000080: 000b8413 addi x8,x23,0
80000084: 00043503 ld x10,0(x8)
80000088: 0004b783 ld x15,0(x9)
8000008c: 00840413 addi x8,x8,8
80000090: 00a90533 add x10,x18,x10
80000094: 40f50533 sub x10,x10,x15
80000098: 00153513 sltiu x10,x10,1
8000009c: f75ff0ef jal x1,80000010 <check>
800000a0: 00848493 addi x9,x9,8
800000a4: fe8990e3 bne x19,x8,80000084 <main+0x5c>
800000a8: 008a0a1b addiw x20,x20,8
800000ac: 008a8a93 addi x21,x21,8
800000b0: 040b0b13 addi x22,x22,64
800000b4: fd8a12e3 bne x20,x24,80000078 <main+0x50>
800000b8: 04813083 ld x1,72(x2)
800000bc: 04013403 ld x8,64(x2)
800000c0: 03813483 ld x9,56(x2)
800000c4: 03013903 ld x18,48(x2)
800000c8: 02813983 ld x19,40(x2)
800000cc: 02013a03 ld x20,32(x2)
800000d0: 01813a83 ld x21,24(x2)
800000d4: 01013b03 ld x22,16(x2)
800000d8: 00813b83 ld x23,8(x2)
800000dc: 00013c03 ld x24,0(x2)
800000e0: 00000513 addi x10,x0,0
800000e4: 05010113 addi x2,x2,80
800000e8: 00008067 jalr x0,0(x1)

00000000800000ec <halt>:
800000ec: 00050513 addi x10,x10,0
800000f0: 00100073 ebreak
800000f4: 0000006f jal x0,800000f4 <halt+0x8>

00000000800000f8 <_trm_init>:
800000f8: ff010113 addi x2,x2,-16
800000fc: 00000517 auipc x10,0x0
80000100: 01c50513 addi x10,x10,28 # 80000118 <_etext>
80000104: 00113423 sd x1,8(x2)
80000108: f21ff0ef jal x1,80000028 <main>
8000010c: 00050513 addi x10,x10,0
80000110: 00100073 ebreak
80000114: 0000006f jal x0,80000114 <_trm_init+0x1c>
156 changes: 156 additions & 0 deletions dependencies/tests/asm/am-tests/bit
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@

elf/am-tests/bit: file format elf64-littleriscv


Disassembly of section .text:

0000000080000000 <_start>:
80000000: 00000413 addi x8,x0,0
80000004: 00009117 auipc x2,0x9
80000008: ffc10113 addi x2,x2,-4 # 80009000 <_end>
8000000c: 1f8000ef jal x1,80000204 <_trm_init>

0000000080000010 <check>:
80000010: 00050463 beq x10,x0,80000018 <check+0x8>
80000014: 00008067 jalr x0,0(x1)
80000018: ff010113 addi x2,x2,-16
8000001c: 00100513 addi x10,x0,1
80000020: 00113423 sd x1,8(x2)
80000024: 1d4000ef jal x1,800001f8 <halt>

0000000080000028 <getbit>:
80000028: 4035d793 srai x15,x11,0x3
8000002c: 00f50533 add x10,x10,x15
80000030: 00054503 lbu x10,0(x10)
80000034: 0075f593 andi x11,x11,7
80000038: 00100793 addi x15,x0,1
8000003c: 00b797bb sllw x15,x15,x11
80000040: 00f57533 and x10,x10,x15
80000044: 00a03533 sltu x10,x0,x10
80000048: 00008067 jalr x0,0(x1)

000000008000004c <setbit>:
8000004c: 4035d793 srai x15,x11,0x3
80000050: ff010113 addi x2,x2,-16
80000054: 00f50533 add x10,x10,x15
80000058: 00a13423 sd x10,8(x2)
8000005c: 00813783 ld x15,8(x2)
80000060: 0075f593 andi x11,x11,7
80000064: 00100713 addi x14,x0,1
80000068: 00b7173b sllw x14,x14,x11
8000006c: 02061063 bne x12,x0,8000008c <setbit+0x40>
80000070: 0007c783 lbu x15,0(x15)
80000074: fff74713 xori x14,x14,-1
80000078: 00e7f7b3 and x15,x15,x14
8000007c: 00813703 ld x14,8(x2)
80000080: 00f70023 sb x15,0(x14)
80000084: 01010113 addi x2,x2,16
80000088: 00008067 jalr x0,0(x1)
8000008c: 0007c783 lbu x15,0(x15)
80000090: 00e7e7b3 or x15,x15,x14
80000094: 00813703 ld x14,8(x2)
80000098: 0ff7f793 andi x15,x15,255
8000009c: 00f70023 sb x15,0(x14)
800000a0: 01010113 addi x2,x2,16
800000a4: 00008067 jalr x0,0(x1)

00000000800000a8 <main>:
800000a8: fe010113 addi x2,x2,-32
800000ac: 0aa00793 addi x15,x0,170
800000b0: 00000593 addi x11,x0,0
800000b4: 00810513 addi x10,x2,8
800000b8: 00113c23 sd x1,24(x2)
800000bc: 00f11423 sh x15,8(x2)
800000c0: f69ff0ef jal x1,80000028 <getbit>
800000c4: 00154513 xori x10,x10,1
800000c8: 0ff57513 andi x10,x10,255
800000cc: f45ff0ef jal x1,80000010 <check>
800000d0: 00100593 addi x11,x0,1
800000d4: 00810513 addi x10,x2,8
800000d8: f51ff0ef jal x1,80000028 <getbit>
800000dc: f35ff0ef jal x1,80000010 <check>
800000e0: 00200593 addi x11,x0,2
800000e4: 00810513 addi x10,x2,8
800000e8: f41ff0ef jal x1,80000028 <getbit>
800000ec: 00154513 xori x10,x10,1
800000f0: 0ff57513 andi x10,x10,255
800000f4: f1dff0ef jal x1,80000010 <check>
800000f8: 00300593 addi x11,x0,3
800000fc: 00810513 addi x10,x2,8
80000100: f29ff0ef jal x1,80000028 <getbit>
80000104: f0dff0ef jal x1,80000010 <check>
80000108: 00400593 addi x11,x0,4
8000010c: 00810513 addi x10,x2,8
80000110: f19ff0ef jal x1,80000028 <getbit>
80000114: 00154513 xori x10,x10,1
80000118: 0ff57513 andi x10,x10,255
8000011c: ef5ff0ef jal x1,80000010 <check>
80000120: 00500593 addi x11,x0,5
80000124: 00810513 addi x10,x2,8
80000128: f01ff0ef jal x1,80000028 <getbit>
8000012c: ee5ff0ef jal x1,80000010 <check>
80000130: 00600593 addi x11,x0,6
80000134: 00810513 addi x10,x2,8
80000138: ef1ff0ef jal x1,80000028 <getbit>
8000013c: 00154513 xori x10,x10,1
80000140: 0ff57513 andi x10,x10,255
80000144: ecdff0ef jal x1,80000010 <check>
80000148: 00700593 addi x11,x0,7
8000014c: 00810513 addi x10,x2,8
80000150: ed9ff0ef jal x1,80000028 <getbit>
80000154: ebdff0ef jal x1,80000010 <check>
80000158: 00810513 addi x10,x2,8
8000015c: 00100613 addi x12,x0,1
80000160: 00800593 addi x11,x0,8
80000164: ee9ff0ef jal x1,8000004c <setbit>
80000168: 00810513 addi x10,x2,8
8000016c: 00000613 addi x12,x0,0
80000170: 00900593 addi x11,x0,9
80000174: ed9ff0ef jal x1,8000004c <setbit>
80000178: 00810513 addi x10,x2,8
8000017c: 00100613 addi x12,x0,1
80000180: 00a00593 addi x11,x0,10
80000184: ec9ff0ef jal x1,8000004c <setbit>
80000188: 00810513 addi x10,x2,8
8000018c: 00000613 addi x12,x0,0
80000190: 00b00593 addi x11,x0,11
80000194: eb9ff0ef jal x1,8000004c <setbit>
80000198: 00810513 addi x10,x2,8
8000019c: 00100613 addi x12,x0,1
800001a0: 00c00593 addi x11,x0,12
800001a4: ea9ff0ef jal x1,8000004c <setbit>
800001a8: 00810513 addi x10,x2,8
800001ac: 00000613 addi x12,x0,0
800001b0: 00d00593 addi x11,x0,13
800001b4: e99ff0ef jal x1,8000004c <setbit>
800001b8: 00810513 addi x10,x2,8
800001bc: 00100613 addi x12,x0,1
800001c0: 00e00593 addi x11,x0,14
800001c4: e89ff0ef jal x1,8000004c <setbit>
800001c8: 00810513 addi x10,x2,8
800001cc: 00000613 addi x12,x0,0
800001d0: 00f00593 addi x11,x0,15
800001d4: e79ff0ef jal x1,8000004c <setbit>
800001d8: 00914503 lbu x10,9(x2)
800001dc: fab50513 addi x10,x10,-85
800001e0: 00153513 sltiu x10,x10,1
800001e4: e2dff0ef jal x1,80000010 <check>
800001e8: 01813083 ld x1,24(x2)
800001ec: 00000513 addi x10,x0,0
800001f0: 02010113 addi x2,x2,32
800001f4: 00008067 jalr x0,0(x1)

00000000800001f8 <halt>:
800001f8: 00050513 addi x10,x10,0
800001fc: 00100073 ebreak
80000200: 0000006f jal x0,80000200 <halt+0x8>

0000000080000204 <_trm_init>:
80000204: ff010113 addi x2,x2,-16
80000208: 00000517 auipc x10,0x0
8000020c: 02050513 addi x10,x10,32 # 80000228 <mainargs>
80000210: 00113423 sd x1,8(x2)
80000214: e95ff0ef jal x1,800000a8 <main>
80000218: 00050513 addi x10,x10,0
8000021c: 00100073 ebreak
80000220: 0000006f jal x0,80000220 <_trm_init+0x1c>
Loading

0 comments on commit a4f1554

Please sign in to comment.