From 4fd0c68f10072c27ddcbda2a261f2fb3dc5f07e0 Mon Sep 17 00:00:00 2001 From: inixyz Date: Sun, 22 Oct 2023 14:56:03 +0300 Subject: [PATCH] mult test --- tests/a.out | Bin 4920 -> 0 bytes tests/mult.c | 9 +++++++++ tests/mult.s | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) delete mode 100755 tests/a.out create mode 100644 tests/mult.c create mode 100644 tests/mult.s diff --git a/tests/a.out b/tests/a.out deleted file mode 100755 index fa74bf130eb45d2ee2e069128c82d449c51e3412..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4920 zcmeHLO>fgc5Pch`wK&z(2axC?G!YaIR+ILG5K@|^6$q6>I7Y0T)GDUUhwP;aCxR+e z&h!s(<0tf7iC+Q-t{^xEX6&pn7D8OO?MUODc{8)N-|p$XY(Lx)LO@#y-=MQi0xQdD zWfK*Yum&58uz>NQqbGosd03{EXOsC{y-OJT0y%Oxr^XBeh5^HXVZbn87%&VN1`Gp+ z0mFb{z%XDK`2P&JLd>e(E4XD*I=3-BJGGapH@?qKZhn}#wu9=s&lq7UI6rxB!#%wM zjv3e3r?>X(%m&=oHmur(pgl_mQ((8%x>H%ZRjF@y4R0OIYxFx&8267ME>l=`7NX;g zM%WnF|Nfs=rbwiH7AX;Vvq+K9ng!!!eEpGV4Ox>&WQXq66mY1%N?~`dML0Cw%6e0Y zqEV>dE94L6{j6&&)BK}C{YfDY3OVXtAGJwFfRqPEqn>{x$D?qlf~W>5JKN32O}W+H zy}u_Vu=PMP3z2_>3>6`!6_-y$M7WDve%iL&VZHVnUIrpt|LdIvXl!nQZYwWkl zS!YT>da&NKq7z!VhmF_#ZFoa{UkKy#=WpTn5`;_Sv|nZux`EHK?ALyLG4p*N3Ap=* FzMmJCahw1E diff --git a/tests/mult.c b/tests/mult.c new file mode 100644 index 0000000..01a3041 --- /dev/null +++ b/tests/mult.c @@ -0,0 +1,9 @@ +#include + +int main(){ + unsigned int x, y; + x = 20; + x = 5; + + x *= y; +} \ No newline at end of file diff --git a/tests/mult.s b/tests/mult.s new file mode 100644 index 0000000..6f36c87 --- /dev/null +++ b/tests/mult.s @@ -0,0 +1,32 @@ + .file "mult.c" + .option nopic + .attribute arch, "rv32i2p1" + .attribute unaligned_access, 0 + .attribute stack_align, 16 + .text + .globl __mulsi3 + .align 2 + .globl main + .type main, @function +main: + addi sp,sp,-32 + sw ra,28(sp) + sw s0,24(sp) + addi s0,sp,32 + li a5,20 + sw a5,-20(s0) + li a5,5 + sw a5,-20(s0) + lw a1,-24(s0) + lw a0,-20(s0) + call __mulsi3 + mv a5,a0 + sw a5,-20(s0) + li a5,0 + mv a0,a5 + lw ra,28(sp) + lw s0,24(sp) + addi sp,sp,32 + jr ra + .size main, .-main + .ident "GCC: () 13.2.0"