holey-bytes/lang/tests/son_tests_tests_ptr_to_ptr_copy.txt
Jakub Doka 7837eeb90d
implementing the loop iteration optimization
the multiplication and addition to a pointer is replaced with simply
incremrnting the pointer it self

Signed-off-by: Jakub Doka <jakub.doka2@gmail.com>
2024-12-15 19:37:37 +01:00

29 lines
557 B
Plaintext

main:
ADDI64 r254, r254, -10240d
LI8 r15, 64b
LI64 r16, 1024d
CP r13, r0
ADDI64 r17, r254, 0d
4: JLTU r13, r16, :0
ADDI64 r13, r17, 1024d
ADDI64 r15, r17, 10240d
3: LD r14, r254, 2048a, 1h
JLTU r13, r15, :1
ANDI r13, r14, 255d
CP r1, r13
JMP :2
1: ADDI64 r14, r13, 1024d
BMC r17, r13, 1024h
CP r13, r14
JMP :3
0: ADDI64 r14, r13, 1d
ADD64 r13, r17, r13
ST r15, r13, 0a, 1h
CP r13, r14
JMP :4
2: ADDI64 r254, r254, 10240d
JALA r0, r31, 0a
code size: 192
ret: 64
status: Ok(())