thrd test

This commit is contained in:
5eqn 2024-08-19 10:53:00 +08:00
parent b4a3cb98a8
commit 5bfe9a6fb2
88 changed files with 6599 additions and 0 deletions

View File

@ -0,0 +1,111 @@
@M = dso_local global i32 0
@L = dso_local global i32 0
@N = dso_local global i32 0
declare i32 @getint()
declare i32 @getch()
declare float @getfloat()
declare void @putint(i32 %p0)
declare void @putch(i32 %p0)
declare void @putfloat(float %p0)
declare i32 @getarray(i32* %p0)
declare i32 @getfarray(float* %p0)
declare void @putarray(i32 %p0, i32* %p1)
declare void @putfarray(i32 %p0, float* %p1)
declare void @_sysy_starttime(i32 %p0)
declare void @_sysy_stoptime(i32 %p0)
declare i32 @thrd_create(i32 %p0)
declare void @thrd_join()
declare void @putf()
declare void @llvm.memset.p0.i32(i32* %p0, i8 %p1, i32 %p2, i1 %p3)
define i32 @add(float* %a0, float* %a1, float* %a2, float* %b0, float* %b1, float* %b2, float* %c0, float* %c1, float* %c2) {
entry:
br label %cond0
cond0:
%phi_141 = phi i32 [0, %entry], [%Add_69, %body1]
%load_73 = load i32, ptr @M
%icmp_74 = icmp slt i32 %phi_141, %load_73
br i1 %icmp_74, label %body1, label %exit
body1:
%getelementptr_31 = getelementptr float, ptr %a0, i32 %phi_141
%getelementptr_34 = getelementptr float, ptr %b0, i32 %phi_141
%load_35 = load float, ptr %getelementptr_31
%load_36 = load float, ptr %getelementptr_34
%FAdd_37 = fadd float %load_35, %load_36
%getelementptr_40 = getelementptr float, ptr %c0, i32 %phi_141
store float %FAdd_37, ptr %getelementptr_40
%getelementptr_44 = getelementptr float, ptr %a1, i32 %phi_141
%getelementptr_47 = getelementptr float, ptr %b1, i32 %phi_141
%load_48 = load float, ptr %getelementptr_44
%load_49 = load float, ptr %getelementptr_47
%FAdd_50 = fadd float %load_48, %load_49
%getelementptr_53 = getelementptr float, ptr %c1, i32 %phi_141
store float %FAdd_50, ptr %getelementptr_53
%getelementptr_57 = getelementptr float, ptr %a2, i32 %phi_141
%getelementptr_60 = getelementptr float, ptr %b2, i32 %phi_141
%load_61 = load float, ptr %getelementptr_57
%load_62 = load float, ptr %getelementptr_60
%FAdd_63 = fadd float %load_61, %load_62
%getelementptr_66 = getelementptr float, ptr %c2, i32 %phi_141
store float %FAdd_63, ptr %getelementptr_66
%Add_69 = add i32 %phi_141, 1
br label %cond0
exit:
ret i32 0
}
define i32 @main() {
entry:
store i32 3, ptr @N
store i32 3, ptr @M
store i32 3, ptr @L
%alloca_86 = alloca [3 x float]
%alloca_87 = alloca [3 x float]
%alloca_88 = alloca [3 x float]
%alloca_89 = alloca [3 x float]
%alloca_90 = alloca [3 x float]
%alloca_91 = alloca [3 x float]
%getelementptr_143 = getelementptr [3 x float], ptr %alloca_88, i32 0
%getelementptr_144 = getelementptr [3 x float], ptr %alloca_91, i32 0
%getelementptr_145 = getelementptr [3 x float], ptr %alloca_89, i32 0
%getelementptr_146 = getelementptr [3 x float], ptr %alloca_86, i32 0
%getelementptr_147 = getelementptr [3 x float], ptr %alloca_90, i32 0
%getelementptr_148 = getelementptr [3 x float], ptr %alloca_87, i32 0
%call_149 = call i32 @thrd_create(i32 4)
%Mul_151 = mul i32 %call_149, 3
%SDiv_152 = sdiv i32 %Mul_151, 5
%Add_154 = add i32 %Mul_151, 3
%SDiv_155 = sdiv i32 %Add_154, 5
br label %cond0
cond0:
%phi_142 = phi i32 [%SDiv_152, %entry], [%Add_132, %body1]
%icmp_157 = icmp slt i32 %phi_142, %SDiv_155
br i1 %icmp_157, label %body1, label %exit
body1:
%getelementptr_102 = getelementptr [3 x float], ptr %getelementptr_146, i32 0, i32 %phi_142
%itofp_104 = sitofp i32 %phi_142 to float
store float %itofp_104, ptr %getelementptr_102
%getelementptr_107 = getelementptr [3 x float], ptr %getelementptr_148, i32 0, i32 %phi_142
store float %itofp_104, ptr %getelementptr_107
%getelementptr_112 = getelementptr [3 x float], ptr %getelementptr_143, i32 0, i32 %phi_142
store float %itofp_104, ptr %getelementptr_112
%getelementptr_117 = getelementptr [3 x float], ptr %getelementptr_145, i32 0, i32 %phi_142
store float %itofp_104, ptr %getelementptr_117
%getelementptr_122 = getelementptr [3 x float], ptr %getelementptr_147, i32 0, i32 %phi_142
store float %itofp_104, ptr %getelementptr_122
%getelementptr_127 = getelementptr [3 x float], ptr %getelementptr_144, i32 0, i32 %phi_142
store float %itofp_104, ptr %getelementptr_127
%Add_132 = add i32 %phi_142, 1
br label %cond0
exit:
call void @thrd_join()
ret i32 0
}

View File

@ -0,0 +1,211 @@
.file "test.c"
.option pic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.data
.align 2
.globl M
.type M, @object
.size M, 4
M:
.word 0
.data
.align 2
.globl L
.type L, @object
.size L, 4
L:
.word 0
.data
.align 2
.globl N
.type N, @object
.size N, 4
N:
.word 0
.text
.align 3
.globl add
.type add, @function
add:
.Ladd_entry:
mv t1,a5
sd s0,-8(sp)
mv t2,a6
mv t0,a4
mv s0,sp
sd s3,-48(s0)
addi sp,sp,-48
sd s2,-40(s0)
mv s3,a1
li a1,0
sd s4,-32(s0)
mv s2,a0
mv s4,a2
sd s1,-24(s0)
mv a2,a3
ld a0,0(s0)
mv s1,a7
j .Ladd_cond0
.Ladd_cond0:
lla a4,M
lw a3,0(a4)
slt a4,a1,a3
bge a1,a3,.Ladd_exit
j .Ladd_body1
.Ladd_body1:
slli a3,a1,2
add a4,s2,a3
slli a3,a1,2
flw ft0,0(a4)
add a5,a2,a3
flw ft1,0(a5)
slli a3,a1,2
add a4,t2,a3
slli a3,a1,2
fadd.s ft2,ft0,ft1
fsw ft2,0(a4)
add a4,s3,a3
slli a3,a1,2
flw ft0,0(a4)
add a5,t0,a3
slli a3,a1,2
flw ft1,0(a5)
add a4,s1,a3
slli a3,a1,2
fadd.s ft2,ft0,ft1
fsw ft2,0(a4)
add a4,s4,a3
slli a3,a1,2
flw ft0,0(a4)
add a5,t1,a3
flw ft1,0(a5)
slli a3,a1,2
add a4,a0,a3
addiw a3,a1,1
fadd.s ft2,ft0,ft1
mv a1,a3
fsw ft2,0(a4)
j .Ladd_cond0
.Ladd_exit:
ld s1,-24(s0)
mv sp,s0
ld s2,-40(s0)
addiw a0,zero,0
ld s3,-48(s0)
ld s4,-32(s0)
ld s0,-8(s0)
ret
.size add, .-add
.text
.align 3
.globl main
.type main, @function
main:
.Lmain_entry:
sd s0,-16(sp)
lla t1,N
li t0,3
sw t0,0(t1)
mv s0,sp
addi a1,s0,-96
addi t2,s0,-144
li t0,3
addi sp,sp,-144
sd ra,-8(s0)
lla t1,M
sw t0,0(t1)
addi a0,s0,-108
sd s1,112(sp)
li t0,3
lla t1,L
sw t0,0(t1)
addi t0,zero,0
slli t1,t0,2
addi t0,s0,-84
add s1,t0,t1
addi t0,zero,0
slli t1,t0,2
addi t0,s0,-120
add a2,t0,t1
addi t0,zero,0
slli t1,t0,2
add t0,t2,t1
addi t1,zero,0
slli t2,t1,2
add t1,a0,t2
sd t1,104(sp)
addi t2,zero,0
slli a0,t2,2
add t2,a1,a0
sd t2,96(sp)
addi a0,zero,0
slli a3,a0,2
addi a0,s0,-132
add a1,a0,a3
li a0,4
sd a1,88(sp)
sd a2,80(sp)
sd t0,-72(s0)
call thrd_create
ld t1,104(sp)
mv a4,a0
slliw a3,a4,0
slliw a0,a4,2
subw a4,a0,a3
ld t2,96(sp)
li a0,5
ld a2,80(sp)
div a5,a4,a0
ld a1,88(sp)
ld t0,-72(s0)
addiw a6,a4,3
li a3,5
div a0,a6,a3
mv a3,a5
j .Lmain_cond0
.Lmain_cond0:
slt a4,a3,a0
bge a3,a0,.Lmain_exit
j .Lmain_body1
.Lmain_body1:
addi a4,a3,0
fcvt.s.w ft0,a3
slli a5,a4,2
add a4,t0,a5
fsw ft0,0(a4)
addi a4,a3,0
slli a5,a4,2
add a4,t2,a5
fsw ft0,0(a4)
addi a4,a3,0
slli a5,a4,2
add a4,a2,a5
fsw ft0,0(a4)
addi a4,a3,0
slli a5,a4,2
add a4,a1,a5
fsw ft0,0(a4)
addi a4,a3,0
slli a5,a4,2
add a4,s1,a5
fsw ft0,0(a4)
addi a4,a3,0
slli a5,a4,2
add a4,t1,a5
fsw ft0,0(a4)
addiw a4,a3,1
mv a3,a4
j .Lmain_cond0
.Lmain_exit:
call thrd_join
ld ra,-8(s0)
addiw a0,zero,0
ld s1,112(sp)
mv sp,s0
ld s0,-16(s0)
ret
.size main, .-main
.ident "compiler: (visionfive2) 0.1.0"
.section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,95 @@
@M = dso_local global i32 0
@L = dso_local global i32 0
@N = dso_local global i32 0
declare i32 @getint()
declare i32 @getch()
declare float @getfloat()
declare void @putint(i32 %p0)
declare void @putch(i32 %p0)
declare void @putfloat(float %p0)
declare i32 @getarray(i32* %p0)
declare i32 @getfarray(float* %p0)
declare void @putarray(i32 %p0, i32* %p1)
declare void @putfarray(i32 %p0, float* %p1)
declare void @_sysy_starttime(i32 %p0)
declare void @_sysy_stoptime(i32 %p0)
declare i32 @thrd_create(i32 %p0)
declare void @thrd_join()
declare void @putf()
declare void @llvm.memset.p0.i32(i32* %p0, i8 %p1, i32 %p2, i1 %p3)
define i32 @add(float* %a0, float* %a1, float* %a2, float* %b0, float* %b1, float* %b2, float* %c0, float* %c1, float* %c2) {
entry:
br label %cond0
cond0:
%phi_121 = phi i32 [0, %entry], [%Add_69, %body1]
%load_73 = load i32, ptr @M
%icmp_74 = icmp slt i32 %phi_121, %load_73
br i1 %icmp_74, label %body1, label %exit
body1:
%getelementptr_31 = getelementptr float, ptr %a0, i32 %phi_121
%getelementptr_34 = getelementptr float, ptr %b0, i32 %phi_121
%load_35 = load float, ptr %getelementptr_31
%load_36 = load float, ptr %getelementptr_34
%FAdd_37 = fadd float %load_35, %load_36
%getelementptr_40 = getelementptr float, ptr %c0, i32 %phi_121
store float %FAdd_37, ptr %getelementptr_40
%getelementptr_44 = getelementptr float, ptr %a1, i32 %phi_121
%getelementptr_47 = getelementptr float, ptr %b1, i32 %phi_121
%load_48 = load float, ptr %getelementptr_44
%load_49 = load float, ptr %getelementptr_47
%FAdd_50 = fadd float %load_48, %load_49
%getelementptr_53 = getelementptr float, ptr %c1, i32 %phi_121
store float %FAdd_50, ptr %getelementptr_53
%getelementptr_57 = getelementptr float, ptr %a2, i32 %phi_121
%getelementptr_60 = getelementptr float, ptr %b2, i32 %phi_121
%load_61 = load float, ptr %getelementptr_57
%load_62 = load float, ptr %getelementptr_60
%FAdd_63 = fadd float %load_61, %load_62
%getelementptr_66 = getelementptr float, ptr %c2, i32 %phi_121
store float %FAdd_63, ptr %getelementptr_66
%Add_69 = add i32 %phi_121, 1
br label %cond0
exit:
ret i32 0
}
define i32 @main() {
entry:
store i32 3, ptr @N
store i32 3, ptr @M
store i32 3, ptr @L
%alloca_86 = alloca [3 x float]
%alloca_87 = alloca [3 x float]
%getelementptr_123 = getelementptr [3 x float], ptr %alloca_87, i32 0
%getelementptr_124 = getelementptr [3 x float], ptr %alloca_86, i32 0
%call_125 = call i32 @thrd_create(i32 4)
%Mul_127 = mul i32 %call_125, 3
%SDiv_128 = sdiv i32 %Mul_127, 5
%Add_130 = add i32 %Mul_127, 3
%SDiv_131 = sdiv i32 %Add_130, 5
br label %cond0
cond0:
%phi_122 = phi i32 [%SDiv_128, %entry], [%Add_112, %body1]
%icmp_133 = icmp slt i32 %phi_122, %SDiv_131
br i1 %icmp_133, label %body1, label %exit
body1:
%getelementptr_102 = getelementptr [3 x float], ptr %getelementptr_124, i32 0, i32 %phi_122
%itofp_104 = sitofp i32 %phi_122 to float
store float %itofp_104, ptr %getelementptr_102
%getelementptr_107 = getelementptr [3 x float], ptr %getelementptr_123, i32 0, i32 %phi_122
store float %itofp_104, ptr %getelementptr_107
%Add_112 = add i32 %phi_122, 1
br label %cond0
exit:
call void @thrd_join()
ret i32 0
}

View File

@ -0,0 +1,173 @@
.file "test.c"
.option pic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.data
.align 2
.globl M
.type M, @object
.size M, 4
M:
.word 0
.data
.align 2
.globl L
.type L, @object
.size L, 4
L:
.word 0
.data
.align 2
.globl N
.type N, @object
.size N, 4
N:
.word 0
.text
.align 3
.globl add
.type add, @function
add:
.Ladd_entry:
mv t0,a4
mv t2,a6
sd s0,-8(sp)
mv t1,a5
mv s0,sp
addi sp,sp,-48
sd s4,-48(s0)
mv s4,a2
sd s2,-40(s0)
mv a2,a3
sd s3,-32(s0)
mv s2,a0
sd s1,-24(s0)
mv s3,a1
li a1,0
mv s1,a7
ld a0,0(s0)
j .Ladd_cond0
.Ladd_cond0:
lla a4,M
lw a3,0(a4)
slt a4,a1,a3
bge a1,a3,.Ladd_exit
j .Ladd_body1
.Ladd_body1:
slli a3,a1,2
add a4,s2,a3
flw ft0,0(a4)
slli a3,a1,2
add a5,a2,a3
flw ft1,0(a5)
slli a3,a1,2
add a4,t2,a3
slli a3,a1,2
fadd.s ft2,ft0,ft1
fsw ft2,0(a4)
add a4,s3,a3
slli a3,a1,2
flw ft0,0(a4)
add a5,t0,a3
slli a3,a1,2
flw ft1,0(a5)
add a4,s1,a3
slli a3,a1,2
fadd.s ft2,ft0,ft1
fsw ft2,0(a4)
add a4,s4,a3
slli a3,a1,2
flw ft0,0(a4)
add a5,t1,a3
slli a3,a1,2
flw ft1,0(a5)
add a4,a0,a3
addiw a3,a1,1
fadd.s ft2,ft0,ft1
mv a1,a3
fsw ft2,0(a4)
j .Ladd_cond0
.Ladd_exit:
ld s2,-40(s0)
mv sp,s0
addiw a0,zero,0
ld s1,-24(s0)
ld s4,-48(s0)
ld s3,-32(s0)
ld s0,-8(s0)
ret
.size add, .-add
.text
.align 3
.globl main
.type main, @function
main:
.Lmain_entry:
lla t1,N
sd s0,-16(sp)
li a0,4
li t0,3
sw t0,0(t1)
mv s0,sp
sd ra,-8(s0)
addi sp,sp,-64
lla t1,M
li t0,3
sw t0,0(t1)
addi t2,s0,-64
sd s1,40(sp)
li t0,3
lla t1,L
sw t0,0(t1)
addi t0,zero,0
slli t1,t0,2
add t0,t2,t1
addi t1,zero,0
sd t0,-32(s0)
slli t2,t1,2
addi t1,s0,-52
add a1,t1,t2
sd a1,-40(s0)
call thrd_create
ld t0,-32(s0)
mv t1,a0
slliw t2,t1,2
slliw s1,t1,0
subw t1,t2,s1
ld a1,-40(s0)
li s1,5
div t2,t1,s1
addiw s1,t1,3
li t1,5
div a0,s1,t1
mv s1,t2
j .Lmain_cond0
.Lmain_cond0:
slt t1,s1,a0
bge s1,a0,.Lmain_exit
j .Lmain_body1
.Lmain_body1:
addi t1,s1,0
fcvt.s.w ft0,s1
slli t2,t1,2
add t1,a1,t2
fsw ft0,0(t1)
addi t1,s1,0
slli t2,t1,2
add t1,t0,t2
fsw ft0,0(t1)
addiw t1,s1,1
mv s1,t1
j .Lmain_cond0
.Lmain_exit:
call thrd_join
addiw a0,zero,0
ld s1,40(sp)
ld ra,-8(s0)
mv sp,s0
ld s0,-16(s0)
ret
.size main, .-main
.ident "compiler: (visionfive2) 0.1.0"
.section .note.GNU-stack,"",@progbits

79
quick_test/asm/3.s Normal file
View File

@ -0,0 +1,79 @@
.file "test.c"
.option pic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.bss
.align 3
.globl A
.type A, @object
.size A, 36
A:
.zero 36
.bss
.align 3
.globl B
.type B, @object
.size B, 36
B:
.zero 36
.text
.align 3
.globl main
.type main, @function
main:
.Lmain_entry:
sd s0,-16(sp)
lla t0,A
addi t1,t0,0
mv a0,t1
mv s0,sp
addi sp,sp,-32
sd ra,-8(s0)
sd s1,-32(s0)
call getarray
li a0,4
call thrd_create
mv t0,a0
slliw t1,t0,3
li t0,5
div t2,t1,t0
addiw t0,t1,8
li t1,5
div s1,t0,t1
mv t0,t2
j .Lmain_cond0
.Lmain_cond0:
slt t1,t0,s1
bge t0,s1,.Lmain_exit
j .Lmain_body1
.Lmain_body1:
addiw a0,t0,1
addi t1,a0,0
slli t0,t1,2
lla t1,A
add t2,t1,t0
addi t0,a0,0
slli a1,t0,2
lla t0,B
add t1,t0,a1
lw t0,0(t2)
sw t0,0(t1)
mv t0,a0
j .Lmain_cond0
.Lmain_exit:
call thrd_join
lla t0,B
li a0,8
addi t1,t0,0
mv a1,t1
call putarray
addiw a0,zero,0
ld s1,-32(s0)
ld ra,-8(s0)
mv sp,s0
ld s0,-16(s0)
ret
.size main, .-main
.ident "compiler: (visionfive2) 0.1.0"
.section .note.GNU-stack,"",@progbits

60
quick_test/asm/6.s Normal file
View File

@ -0,0 +1,60 @@
.file "test.c"
.option pic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.data
.align 3
.globl A
.type A, @object
.size A, 36
A:
.word 0x1
.word 0x1
.word 0x4
.word 0x5
.word 0x1
.word 0x4
.zero 12
.text
.align 3
.globl main
.type main, @function
main:
.Lmain_exit:
sd s0,-16(sp)
lla t0,A
addi t2,t0,0
li a0,4
li t0,11
mv s0,sp
addi sp,sp,-32
sd ra,-8(s0)
sd s1,-24(s0)
sw t0,0(t2)
sd t2,-32(s0)
call thrd_create
ld t2,-32(s0)
mv t1,a0
addi t0,t1,0
slli t1,t0,2
lla t0,A
add s1,t0,t1
lw t0,0(s1)
slliw t1,t0,1
sw t1,0(s1)
sd t2,-32(s0)
call thrd_join
ld t2,-32(s0)
li a0,8
mv a1,t2
call putarray
addiw a0,zero,0
ld s1,-24(s0)
mv sp,s0
ld ra,-8(s0)
ld s0,-16(s0)
ret
.size main, .-main
.ident "compiler: (visionfive2) 0.1.0"
.section .note.GNU-stack,"",@progbits

68
quick_test/asm/7.s Normal file
View File

@ -0,0 +1,68 @@
.file "test.c"
.option pic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.data
.align 3
.globl A
.type A, @object
.size A, 36
A:
.word 0x1
.word 0x1
.word 0x4
.word 0x5
.word 0x1
.word 0x4
.zero 12
.text
.align 3
.globl main
.type main, @function
main:
.Lmain_exit:
li a0,4
sd s0,-16(sp)
mv s0,sp
sd ra,-8(s0)
addi sp,sp,-32
sd s1,-32(s0)
call thrd_create
mv t0,a0
addi t1,t0,0
slli t0,t1,2
lla t1,A
add t2,t1,t0
lw t0,0(t2)
slliw t1,t0,1
sw t1,0(t2)
call thrd_join
li a0,8
lla t0,A
addi s1,t0,0
mv a1,s1
call putarray
li a0,4
call thrd_create
mv t1,a0
addi t0,t1,0
slli t1,t0,2
lla t0,A
add t2,t0,t1
lw t0,0(t2)
slliw t1,t0,1
sw t1,0(t2)
call thrd_join
mv a1,s1
li a0,8
call putarray
addiw a0,zero,0
mv sp,s0
ld s1,-32(s0)
ld ra,-8(s0)
ld s0,-16(s0)
ret
.size main, .-main
.ident "compiler: (visionfive2) 0.1.0"
.section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,211 @@
.file "test.c"
.option pic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.data
.align 2
.globl M
.type M, @object
.size M, 4
M:
.word 0
.data
.align 2
.globl L
.type L, @object
.size L, 4
L:
.word 0
.data
.align 2
.globl N
.type N, @object
.size N, 4
N:
.word 0
.text
.align 3
.globl add
.type add, @function
add:
.Ladd_entry:
sd s0,-8(sp)
mv t1,a5
mv t2,a6
mv t0,a4
mv s0,sp
sd s2,-48(s0)
addi sp,sp,-48
sd s3,-40(s0)
mv s2,a0
mv s3,a1
sd s4,-32(s0)
li a1,0
mv s4,a2
sd s1,-24(s0)
mv a2,a3
ld a0,0(s0)
mv s1,a7
j .Ladd_cond0
.Ladd_cond0:
lla a4,M
lw a3,0(a4)
slt a4,a1,a3
bge a1,a3,.Ladd_exit
j .Ladd_body1
.Ladd_body1:
slli a3,a1,2
add a4,s2,a3
flw ft0,0(a4)
slli a3,a1,2
add a5,a2,a3
slli a3,a1,2
flw ft1,0(a5)
add a4,t2,a3
slli a3,a1,2
fadd.s ft2,ft0,ft1
fsw ft2,0(a4)
add a4,s3,a3
slli a3,a1,2
flw ft0,0(a4)
add a5,t0,a3
slli a3,a1,2
flw ft1,0(a5)
add a4,s1,a3
slli a3,a1,2
fadd.s ft2,ft0,ft1
fsw ft2,0(a4)
add a4,s4,a3
slli a3,a1,2
flw ft0,0(a4)
add a5,t1,a3
flw ft1,0(a5)
slli a3,a1,2
add a4,a0,a3
addiw a3,a1,1
mv a1,a3
fadd.s ft2,ft0,ft1
fsw ft2,0(a4)
j .Ladd_cond0
.Ladd_exit:
addiw a0,zero,0
ld s3,-40(s0)
mv sp,s0
ld s2,-48(s0)
ld s4,-32(s0)
ld s1,-24(s0)
ld s0,-8(s0)
ret
.size add, .-add
.text
.align 3
.globl main
.type main, @function
main:
.Lmain_entry:
li t0,3
lla t1,N
sd s0,-16(sp)
sw t0,0(t1)
mv s0,sp
addi a1,s0,-144
addi sp,sp,-144
sd ra,-8(s0)
addi t2,s0,-108
addi a0,s0,-132
li t0,3
lla t1,M
sw t0,0(t1)
sd s1,112(sp)
li t0,3
lla t1,L
sw t0,0(t1)
addi t0,zero,0
slli t1,t0,2
addi t0,s0,-84
add s1,t0,t1
addi t0,zero,0
slli t1,t0,2
addi t0,s0,-96
add a2,t0,t1
addi t0,zero,0
slli t1,t0,2
add t0,t2,t1
addi t1,zero,0
slli t2,t1,2
add t1,a0,t2
sd t1,104(sp)
addi t2,zero,0
slli a0,t2,2
add t2,a1,a0
sd t2,96(sp)
addi a0,zero,0
slli a3,a0,2
addi a0,s0,-120
add a1,a0,a3
li a0,4
sd a1,88(sp)
sd a2,80(sp)
sd t0,-72(s0)
call thrd_create
ld t1,104(sp)
mv a4,a0
slliw a0,a4,2
ld a2,80(sp)
ld t0,-72(s0)
slliw a3,a4,0
subw a4,a0,a3
ld a1,88(sp)
li a0,5
li a3,5
div a5,a4,a0
addiw a6,a4,3
ld t2,96(sp)
div a0,a6,a3
mv a3,a5
j .Lmain_cond0
.Lmain_cond0:
slt a4,a3,a0
bge a3,a0,.Lmain_exit
j .Lmain_body1
.Lmain_body1:
addi a4,a3,0
fcvt.s.w ft0,a3
slli a5,a4,2
add a4,t1,a5
fsw ft0,0(a4)
addi a4,a3,0
slli a5,a4,2
add a4,a1,a5
fsw ft0,0(a4)
addi a4,a3,0
slli a5,a4,2
add a4,s1,a5
fsw ft0,0(a4)
addi a4,a3,0
slli a5,a4,2
add a4,t0,a5
fsw ft0,0(a4)
addi a4,a3,0
slli a5,a4,2
add a4,t2,a5
fsw ft0,0(a4)
addi a4,a3,0
slli a5,a4,2
add a4,a2,a5
fsw ft0,0(a4)
addiw a4,a3,1
mv a3,a4
j .Lmain_cond0
.Lmain_exit:
call thrd_join
addiw a0,zero,0
ld s1,112(sp)
ld ra,-8(s0)
mv sp,s0
ld s0,-16(s0)
ret
.size main, .-main
.ident "compiler: (visionfive2) 0.1.0"
.section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,381 @@
.file "test.c"
.option pic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.data
.align 2
.globl N
.type N, @object
.size N, 4
N:
.word 0
.data
.align 2
.globl M
.type M, @object
.size M, 4
M:
.word 0
.data
.align 2
.globl L
.type L, @object
.size L, 4
L:
.word 0
.text
.align 3
.globl main
.type main, @function
main:
.Lmain_entry:
sd s0,-16(sp)
li t0,3
lla t1,N
sw t0,0(t1)
mv s0,sp
addi a0,s0,-128
addi a2,s0,-224
li t0,3
addi t2,s0,-116
addi sp,sp,-224
lla t1,M
sw t0,0(t1)
sd ra,-8(s0)
lla t1,L
li t0,3
sd s3,184(sp)
sw t0,0(t1)
sd s1,192(sp)
addi t0,zero,0
slli t1,t0,2
sd s2,200(sp)
addi s1,s0,-212
addi t0,s0,-200
add a1,t0,t1
addi t0,zero,0
slli t1,t0,2
addi t0,s0,-140
add a3,t0,t1
addi t0,zero,0
sd a3,152(sp)
slli t1,t0,2
add t0,t2,t1
addi t1,zero,0
slli t2,t1,2
add t1,s1,t2
addi t2,zero,0
sd t1,144(sp)
slli s1,t2,2
add t2,a0,s1
addi s1,zero,0
sd t2,136(sp)
slli a0,s1,2
add s1,a2,a0
li a0,4
sd a1,128(sp)
sd t0,120(sp)
call thrd_create
mv a2,a0
ld a3,152(sp)
ld t0,120(sp)
slliw a4,a2,2
ld t1,144(sp)
slliw a0,a2,0
ld t2,136(sp)
subw a2,a4,a0
addiw a4,a2,3
li a0,5
div a5,a2,a0
ld a1,128(sp)
li a0,5
div a2,a4,a0
mv a0,a5
j .Lmain_cond0
.Lmain_cond0:
slt a4,a0,a2
bge a0,a2,.Lmain_entry_inline0
j .Lmain_body1
.Lmain_body1:
fcvt.s.w ft0,a0
addi a5,a0,0
slli a4,a5,2
add a5,t0,a4
addi a4,a0,0
fsw ft0,0(a5)
slli a5,a4,2
add a4,s1,a5
addi a5,a0,0
fsw ft0,0(a4)
slli a4,a5,2
add a5,t1,a4
fsw ft0,0(a5)
addi a4,a0,0
slli a5,a4,2
add a4,a3,a5
addi a5,a0,0
fsw ft0,0(a4)
slli a4,a5,2
add a5,t2,a4
addi a4,a0,0
fsw ft0,0(a5)
slli a5,a4,2
add a4,a1,a5
fsw ft0,0(a4)
addiw a4,a0,1
mv a0,a4
j .Lmain_cond0
.Lmain_entry_inline0:
call thrd_join
addi s1,s0,-200
addi t1,zero,0
slli t0,t1,2
addi t2,s0,-224
add t1,t2,t0
addi a0,s0,-140
addi t2,zero,0
slli t0,t2,2
add t2,s1,t0
addi s1,zero,0
slli t0,s1,2
add s1,a0,t0
addi a0,zero,0
slli t0,a0,2
addi a0,s0,-152
add a1,a0,t0
addi t0,zero,0
slli a0,t0,2
addi t0,s0,-188
add a2,t0,a0
addi t0,zero,0
slli a0,t0,2
addi t0,s0,-128
add a3,t0,a0
addi t0,zero,0
sd a3,176(sp)
slli a0,t0,2
addi t0,s0,-116
add a4,t0,a0
sd t1,168(sp)
addi t0,zero,0
slli a0,t0,2
addi t0,s0,-212
sd a4,160(sp)
add a5,t0,a0
addi t0,zero,0
slli a0,t0,2
sd t2,152(sp)
addi t0,s0,-176
add a6,t0,a0
li a0,4
sd a1,144(sp)
sd a5,136(sp)
sd a2,128(sp)
sd a6,120(sp)
call thrd_create
ld t1,168(sp)
mv a7,a0
ld a3,176(sp)
slliw t0,a7,0
ld t2,152(sp)
slliw a0,a7,2
ld a5,136(sp)
subw s2,a0,t0
ld a4,160(sp)
addiw s3,s2,3
ld a2,128(sp)
li t0,5
div a7,s2,t0
ld a1,144(sp)
ld a6,120(sp)
li t0,5
div a0,s3,t0
mv t0,a7
j .Lmain_cond0_inline1
.Lmain_cond0_inline1:
slt a7,t0,a0
bge t0,a0,.Lmain_final2_split5
j .Lmain_body1_inline4
.Lmain_body1_inline4:
addi s3,t0,0
addi a7,t0,0
slli s2,a7,2
add a7,a4,s2
flw ft0,0(a7)
slli s2,s3,2
add s3,s1,s2
flw ft2,0(s3)
addi a7,t0,0
slli s2,a7,2
add a7,a6,s2
fsub.s ft1,ft0,ft2
addi s2,t0,0
fsw ft1,0(a7)
slli a7,s2,2
add s2,t1,a7
flw ft1,0(s2)
addi a7,t0,0
slli s3,a7,2
add a7,a3,s3
flw ft0,0(a7)
fsub.s ft2,ft1,ft0
addi a7,t0,0
slli s2,a7,2
add a7,a2,s2
addi s2,t0,0
fsw ft2,0(a7)
slli a7,s2,2
add s2,a5,a7
flw ft0,0(s2)
addi a7,t0,0
slli s3,a7,2
add a7,t2,s3
flw ft2,0(a7)
addi s2,t0,0
fsub.s ft1,ft0,ft2
slli a7,s2,2
add s2,a1,a7
addiw a7,t0,1
mv t0,a7
fsw ft1,0(s2)
j .Lmain_cond0_inline1
.Lmain_final2_split5:
call thrd_join
addi t1,zero,0
li a0,4
slli t0,t1,2
addi t1,s0,-176
add t2,t1,t0
sd t2,120(sp)
call thrd_create
ld t2,120(sp)
mv t1,a0
slliw t0,t1,0
slliw s1,t1,2
subw t1,s1,t0
li t0,5
addiw s1,t1,3
div a0,t1,t0
li t1,5
div t0,s1,t1
mv s1,a0
j .Lmain_cond3
.Lmain_cond3:
slt t1,s1,t0
bge s1,t0,.Lmain_final5
j .Lmain_body4
.Lmain_body4:
addi a0,s1,0
slli t1,a0,2
add a0,t2,t1
flw ft0,0(a0)
sd t0,128(sp)
fcvt.w.s t1,ft0,rtz
sd t2,120(sp)
mv a0,t1
call putint
ld t2,120(sp)
addiw t1,s1,1
ld t0,128(sp)
mv s1,t1
j .Lmain_cond3
.Lmain_final5:
call thrd_join
li a0,10
call putch
li a0,4
addi t0,zero,0
slli t1,t0,2
addi t0,s0,-188
add s1,t0,t1
call thrd_create
mv t1,a0
slliw t0,t1,2
slliw t2,t1,0
subw a0,t0,t2
li t0,5
addiw a1,a0,3
div t1,a0,t0
li t2,5
div t0,a1,t2
mv t2,t1
j .Lmain_cond6
.Lmain_cond6:
slt t1,t2,t0
bge t2,t0,.Lmain_final8
j .Lmain_body7
.Lmain_body7:
addi a0,t2,0
slli t1,a0,2
add a0,s1,t1
flw ft0,0(a0)
fcvt.w.s t1,ft0,rtz
sd t0,128(sp)
sd t2,120(sp)
mv a0,t1
call putint
ld t0,128(sp)
ld t2,120(sp)
addiw t1,t2,1
mv t2,t1
j .Lmain_cond6
.Lmain_final8:
call thrd_join
li a0,10
call putch
addi t1,zero,0
li a0,4
slli t0,t1,2
addi t2,s0,-152
add t1,t2,t0
sd t1,120(sp)
call thrd_create
ld t1,120(sp)
mv t2,a0
slliw s1,t2,0
slliw t0,t2,2
subw t2,t0,s1
li t0,5
div s1,t2,t0
addiw t0,t2,3
li t2,5
div a1,t0,t2
mv t0,s1
j .Lmain_cond9
.Lmain_cond9:
slt t2,t0,a1
bge t0,a1,.Lmain_exit
j .Lmain_body10
.Lmain_body10:
addi t2,t0,0
slli s1,t2,2
add t2,t1,s1
flw ft0,0(t2)
fcvt.w.s t2,ft0,rtz
sd t1,136(sp)
sd t0,128(sp)
mv a0,t2
sd a1,120(sp)
call putint
ld a1,120(sp)
ld t1,136(sp)
ld t0,128(sp)
addiw t2,t0,1
mv t0,t2
j .Lmain_cond9
.Lmain_exit:
call thrd_join
li a0,10
call putch
ld s1,192(sp)
addiw a0,zero,0
ld s3,184(sp)
ld s2,200(sp)
ld ra,-8(s0)
mv sp,s0
ld s0,-16(s0)
ret
.size main, .-main
.ident "compiler: (visionfive2) 0.1.0"
.section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,366 @@
.file "test.c"
.option pic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.data
.align 2
.globl M
.type M, @object
.size M, 4
M:
.word 0
.data
.align 2
.globl L
.type L, @object
.size L, 4
L:
.word 0
.data
.align 2
.globl N
.type N, @object
.size N, 4
N:
.word 0
.text
.align 3
.globl main
.type main, @function
main:
.Lmain_entry:
lla t1,N
sd s0,-16(sp)
li t0,3
sw t0,0(t1)
mv s0,sp
sd ra,-8(s0)
addi a2,s0,-196
addi sp,sp,-208
lla t1,M
addi a0,sp,108
li t0,3
fsd fs0,160(sp)
addi t2,s0,-172
sw t0,0(t1)
sd s1,168(sp)
li t0,3
lla t1,L
sw t0,0(t1)
addi s1,s0,-208
fsd fs1,176(sp)
addi t0,zero,0
slli t1,t0,2
addi t0,s0,-136
add a1,t0,t1
addi t0,zero,0
slli t1,t0,2
addi t0,s0,-184
add a3,t0,t1
addi t0,zero,0
sd a3,152(sp)
slli t1,t0,2
add t0,t2,t1
addi t1,zero,0
slli t2,t1,2
add t1,s1,t2
addi t2,zero,0
sd t1,144(sp)
slli s1,t2,2
add t2,a0,s1
addi s1,zero,0
sd t2,136(sp)
slli a0,s1,2
add s1,a2,a0
li a0,4
sd a1,128(sp)
sd t0,120(sp)
call thrd_create
ld a1,128(sp)
mv a2,a0
ld t2,136(sp)
slliw a0,a2,2
ld a3,152(sp)
slliw a4,a2,0
ld t1,144(sp)
subw a2,a0,a4
li a0,5
ld t0,120(sp)
div a5,a2,a0
li a4,5
addiw a0,a2,3
div a2,a0,a4
mv a0,a5
j .Lmain_cond0
.Lmain_cond0:
slt a4,a0,a2
bge a0,a2,.Lmain_final2_split2
j .Lmain_body1
.Lmain_body1:
fcvt.s.w ft0,a0
addi a5,a0,0
slli a4,a5,2
add a5,a1,a4
addi a4,a0,0
fsw ft0,0(a5)
slli a5,a4,2
add a4,s1,a5
fsw ft0,0(a4)
addi a5,a0,0
slli a4,a5,2
add a5,a3,a4
addi a4,a0,0
fsw ft0,0(a5)
slli a5,a4,2
add a4,t2,a5
fsw ft0,0(a4)
addi a5,a0,0
slli a4,a5,2
add a5,t1,a4
fsw ft0,0(a5)
addi a4,a0,0
slli a5,a4,2
add a4,t0,a5
fsw ft0,0(a4)
addiw a4,a0,1
mv a0,a4
j .Lmain_cond0
.Lmain_final2_split2:
call thrd_join
addi t1,sp,108
li a0,4
flw ft4,0(t1)
addi t0,s0,-136
flw ft3,0(t0)
addi t1,s0,-208
flw ft0,0(t1)
addi t0,s0,-136
flw fa0,4(t0)
fmul.s ft1,ft3,ft4
addi t1,s0,-136
flw fa1,8(t1)
addi t0,s0,-172
fmul.s ft5,fa0,ft0
fadd.s ft2,ft1,ft5
flw ft1,0(t0)
addi t0,s0,-160
fmul.s ft6,fa1,ft1
fadd.s ft5,ft2,ft6
fsw ft5,0(t0)
addi t0,sp,108
flw ft5,4(t0)
addi t0,s0,-208
fmul.s ft2,ft3,ft5
flw ft6,4(t0)
addi t0,s0,-172
fmul.s ft7,fa0,ft6
fadd.s fs0,ft2,ft7
flw ft2,4(t0)
fmul.s fs1,fa1,ft2
addi t0,s0,-160
fadd.s ft7,fs0,fs1
fsw ft7,4(t0)
addi t0,sp,108
flw ft7,8(t0)
addi t0,s0,-208
fmul.s fs1,ft3,ft7
flw fs0,8(t0)
addi t0,s0,-172
fmul.s ft3,fa0,fs0
fadd.s fa0,fs1,ft3
flw ft3,8(t0)
addi t0,s0,-160
fmul.s fa2,fa1,ft3
fadd.s fs1,fa0,fa2
fsw fs1,8(t0)
addi t0,s0,-196
flw fs1,0(t0)
addi t0,s0,-196
fmul.s fa2,fs1,ft4
flw fa0,4(t0)
addi t0,s0,-196
fmul.s fa3,fa0,ft0
fadd.s fa1,fa2,fa3
flw fa3,8(t0)
addi t0,s0,-124
fmul.s fa2,fa3,ft1
fadd.s fa4,fa1,fa2
fsw fa4,0(t0)
fmul.s fa1,fs1,ft5
addi t0,s0,-124
fmul.s fa4,fa0,ft6
fadd.s fa2,fa1,fa4
fmul.s fa4,fa3,ft2
fadd.s fa1,fa2,fa4
fsw fa1,4(t0)
addi t0,s0,-124
fmul.s fa1,fs1,ft7
fmul.s fs1,fa0,fs0
fadd.s fa0,fa1,fs1
fmul.s fs1,fa3,ft3
fadd.s fa1,fa0,fs1
fsw fa1,8(t0)
addi t0,s0,-184
flw fs1,0(t0)
addi t0,s0,-184
fmul.s fa0,fs1,ft4
flw ft4,4(t0)
fmul.s fa1,ft4,ft0
addi t0,s0,-184
fadd.s ft0,fa0,fa1
flw fa1,8(t0)
addi t0,s0,-112
fmul.s fa0,fa1,ft1
fadd.s ft1,ft0,fa0
fmul.s ft0,fs1,ft5
fsw ft1,0(t0)
addi t0,s0,-112
fmul.s ft5,ft4,ft6
fadd.s ft1,ft0,ft5
fmul.s ft5,fa1,ft2
fmul.s ft2,ft4,fs0
fadd.s ft0,ft1,ft5
fsw ft0,4(t0)
addi t0,s0,-112
fmul.s ft0,fs1,ft7
fadd.s ft1,ft0,ft2
fmul.s ft2,fa1,ft3
fadd.s ft0,ft1,ft2
fsw ft0,8(t0)
addi t0,zero,0
slli t1,t0,2
addi t0,s0,-160
add s1,t0,t1
call thrd_create
mv t1,a0
slliw t2,t1,0
slliw t0,t1,2
subw a0,t0,t2
li t0,5
addiw a1,a0,3
div t1,a0,t0
li t0,5
div t2,a1,t0
mv a1,t1
j .Lmain_cond3
.Lmain_cond3:
slt t0,a1,t2
bge a1,t2,.Lmain_final5
j .Lmain_body4
.Lmain_body4:
addi t1,a1,0
slli t0,t1,2
add t1,s1,t0
flw ft0,0(t1)
fcvt.w.s t0,ft0,rtz
sd t2,128(sp)
sd a1,120(sp)
mv a0,t0
call putint
ld t2,128(sp)
ld a1,120(sp)
addiw t0,a1,1
mv a1,t0
j .Lmain_cond3
.Lmain_final5:
call thrd_join
li a0,10
call putch
addi t2,s0,-124
addi t1,zero,0
li a0,4
slli t0,t1,2
add t1,t2,t0
sd t1,120(sp)
call thrd_create
mv t0,a0
ld t1,120(sp)
slliw s1,t0,0
slliw t2,t0,2
subw t0,t2,s1
li t2,5
div s1,t0,t2
addiw t2,t0,3
li t0,5
div a1,t2,t0
mv t0,s1
j .Lmain_cond6
.Lmain_cond6:
slt t2,t0,a1
bge t0,a1,.Lmain_final8
j .Lmain_body7
.Lmain_body7:
addi t2,t0,0
slli s1,t2,2
add t2,t1,s1
flw ft0,0(t2)
sd t1,136(sp)
fcvt.w.s t2,ft0,rtz
sd t0,128(sp)
mv a0,t2
sd a1,120(sp)
call putint
ld a1,120(sp)
ld t1,136(sp)
ld t0,128(sp)
addiw t2,t0,1
mv t0,t2
j .Lmain_cond6
.Lmain_final8:
call thrd_join
li a0,10
call putch
li a0,4
addi t1,zero,0
slli t0,t1,2
addi t1,s0,-112
add t2,t1,t0
sd t2,120(sp)
call thrd_create
ld t2,120(sp)
mv s1,a0
slliw t0,s1,2
slliw t1,s1,0
subw s1,t0,t1
li t1,5
addiw a0,s1,3
div t0,s1,t1
li s1,5
div t1,a0,s1
mv s1,t0
j .Lmain_cond9
.Lmain_cond9:
slt t0,s1,t1
bge s1,t1,.Lmain_exit
j .Lmain_body10
.Lmain_body10:
addi a0,s1,0
slli t0,a0,2
add a0,t2,t0
flw ft0,0(a0)
fcvt.w.s t0,ft0,rtz
sd t1,128(sp)
sd t2,120(sp)
mv a0,t0
call putint
ld t1,128(sp)
addiw t0,s1,1
ld t2,120(sp)
mv s1,t0
j .Lmain_cond9
.Lmain_exit:
call thrd_join
li a0,10
call putch
ld ra,-8(s0)
addiw a0,zero,0
fld fs0,160(sp)
fld fs1,176(sp)
ld s1,168(sp)
mv sp,s0
ld s0,-16(s0)
ret
.size main, .-main
.ident "compiler: (visionfive2) 0.1.0"
.section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,301 @@
.file "test.c"
.option pic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.data
.align 2
.globl M
.type M, @object
.size M, 4
M:
.word 0
.data
.align 2
.globl L
.type L, @object
.size L, 4
L:
.word 0
.data
.align 2
.globl N
.type N, @object
.size N, 4
N:
.word 0
.text
.align 3
.globl main
.type main, @function
main:
.Lmain_entry:
lla t1,N
li t0,3
sd s0,-16(sp)
sw t0,0(t1)
mv s0,sp
li t0,3
addi a0,s0,-132
addi t2,s0,-108
lla t1,M
sw t0,0(t1)
addi sp,sp,-192
sd ra,-8(s0)
addi a2,s0,-144
li t0,3
lla t1,L
sw t0,0(t1)
sd s1,160(sp)
addi t0,zero,0
slli t1,t0,2
addi s1,s0,-180
addi t0,s0,-120
add a1,t0,t1
addi t0,zero,0
slli t1,t0,2
addi t0,s0,-192
add a3,t0,t1
addi t0,zero,0
sd a3,152(sp)
slli t1,t0,2
add t0,t2,t1
addi t1,zero,0
slli t2,t1,2
add t1,s1,t2
sd t1,144(sp)
addi t2,zero,0
slli s1,t2,2
add t2,a0,s1
addi s1,zero,0
sd t2,136(sp)
slli a0,s1,2
add s1,a2,a0
sd a1,128(sp)
li a0,4
sd t0,120(sp)
call thrd_create
ld t1,144(sp)
mv a2,a0
ld a1,128(sp)
slliw a0,a2,0
ld t2,136(sp)
slliw a4,a2,2
subw a2,a4,a0
ld a3,152(sp)
li a0,5
ld t0,120(sp)
addiw a4,a2,3
div a5,a2,a0
li a0,5
div a2,a4,a0
mv a0,a5
j .Lmain_cond0
.Lmain_cond0:
slt a4,a0,a2
bge a0,a2,.Lmain_final2_split2
j .Lmain_body1
.Lmain_body1:
fcvt.s.w ft0,a0
addi a5,a0,0
slli a4,a5,2
add a5,t1,a4
addi a4,a0,0
fsw ft0,0(a5)
slli a5,a4,2
add a4,a3,a5
fsw ft0,0(a4)
addi a5,a0,0
slli a4,a5,2
add a5,t0,a4
fsw ft0,0(a5)
addi a4,a0,0
slli a5,a4,2
add a4,t2,a5
fsw ft0,0(a4)
addi a5,a0,0
slli a4,a5,2
add a5,s1,a4
fsw ft0,0(a5)
addi a4,a0,0
slli a5,a4,2
add a4,a1,a5
fsw ft0,0(a4)
addiw a4,a0,1
mv a0,a4
j .Lmain_cond0
.Lmain_final2_split2:
call thrd_join
addi t2,s0,-168
addi t1,s0,-96
addi t0,s0,-108
li a0,4
flw ft0,4(t0)
addi t0,s0,-192
fsw ft0,8(t1)
flw ft0,8(t0)
addi t1,sp,108
fsw ft0,4(t1)
addi t0,s0,-168
addi t1,s0,-192
flw ft0,0(t1)
fsw ft0,4(t0)
addi t1,s0,-108
addi t0,s0,-168
flw ft0,0(t1)
fsw ft0,8(t0)
addi t1,s0,-96
addi t0,s0,-180
flw ft0,4(t0)
addi t0,s0,-180
fsw ft0,0(t1)
addi t1,sp,108
flw ft0,8(t0)
fsw ft0,0(t1)
addi t0,s0,-96
addi t1,s0,-192
flw ft0,4(t1)
fsw ft0,4(t0)
addi t1,s0,-108
addi t0,sp,108
flw ft0,8(t1)
addi t1,s0,-168
fsw ft0,8(t0)
addi t0,s0,-180
flw ft0,0(t0)
fsw ft0,0(t1)
addi t1,zero,0
slli t0,t1,2
add t1,t2,t0
sd t1,120(sp)
call thrd_create
ld t1,120(sp)
mv t2,a0
slliw s1,t2,2
slliw t0,t2,0
subw t2,s1,t0
addiw s1,t2,3
li t0,5
div a0,t2,t0
li t0,5
div a1,s1,t0
mv t0,a0
j .Lmain_cond3
.Lmain_cond3:
slt t2,t0,a1
bge t0,a1,.Lmain_final5
j .Lmain_body4
.Lmain_body4:
addi t2,t0,0
slli s1,t2,2
add t2,t1,s1
flw ft0,0(t2)
fcvt.w.s t2,ft0,rtz
sd t1,136(sp)
sd t0,128(sp)
mv a0,t2
sd a1,120(sp)
call putint
ld t1,136(sp)
ld t0,128(sp)
ld a1,120(sp)
addiw t2,t0,1
mv t0,t2
j .Lmain_cond3
.Lmain_final5:
call thrd_join
li a0,10
call putch
li a0,4
addi t0,zero,0
slli t1,t0,2
addi t0,s0,-96
add s1,t0,t1
call thrd_create
mv t0,a0
slliw a0,t0,2
slliw t1,t0,0
subw t2,a0,t1
addiw a0,t2,3
li t1,5
div t0,t2,t1
li t2,5
div t1,a0,t2
mv t2,t0
j .Lmain_cond6
.Lmain_cond6:
slt t0,t2,t1
bge t2,t1,.Lmain_final8
j .Lmain_body7
.Lmain_body7:
addi a0,t2,0
slli t0,a0,2
add a0,s1,t0
flw ft0,0(a0)
sd t1,128(sp)
fcvt.w.s t0,ft0,rtz
sd t2,120(sp)
mv a0,t0
call putint
ld t1,128(sp)
ld t2,120(sp)
addiw t0,t2,1
mv t2,t0
j .Lmain_cond6
.Lmain_final8:
call thrd_join
li a0,10
call putch
addi t0,zero,0
li a0,4
slli t1,t0,2
addi t0,sp,108
add a1,t0,t1
sd a1,120(sp)
call thrd_create
ld a1,120(sp)
mv t1,a0
slliw t0,t1,0
slliw t2,t1,2
subw s1,t2,t0
li t0,5
addiw a0,s1,3
div t1,s1,t0
li t0,5
div t2,a0,t0
mv t0,t1
j .Lmain_cond9
.Lmain_cond9:
slt t1,t0,t2
bge t0,t2,.Lmain_exit
j .Lmain_body10
.Lmain_body10:
addi t1,t0,0
slli s1,t1,2
add t1,a1,s1
flw ft0,0(t1)
fcvt.w.s t1,ft0,rtz
sd t0,136(sp)
sd t2,128(sp)
mv a0,t1
sd a1,120(sp)
call putint
ld a1,120(sp)
ld t2,128(sp)
ld t0,136(sp)
addiw t1,t0,1
mv t0,t1
j .Lmain_cond9
.Lmain_exit:
call thrd_join
li a0,10
call putch
ld ra,-8(s0)
addiw a0,zero,0
ld s1,160(sp)
mv sp,s0
ld s0,-16(s0)
ret
.size main, .-main
.ident "compiler: (visionfive2) 0.1.0"
.section .note.GNU-stack,"",@progbits

72
quick_test/asm2bin.toml Normal file
View File

@ -0,0 +1,72 @@
start_time = "2024-08-19 10:48:36.108676300 +08:00"
end_time = "2024-08-19 10:48:36.424910880 +08:00"
time_cost = "PT0.31623458S"
all_success = true
success_num = 7
failed_num = 0
total_num = 7
per_timeout_num = 0
case_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/asm/3.s"
bin_path = "./sysy-data/quick_test/bin/3"
start_time = "2024-08-19 10:48:36.154342630 +08:00"
end_time = "2024-08-19 10:48:36.200659359 +08:00"
time_cost = "PT0.046316729S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/asm/6.s"
bin_path = "./sysy-data/quick_test/bin/6"
start_time = "2024-08-19 10:48:36.294797714 +08:00"
end_time = "2024-08-19 10:48:36.340602354 +08:00"
time_cost = "PT0.04580464S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/asm/7.s"
bin_path = "./sysy-data/quick_test/bin/7"
start_time = "2024-08-19 10:48:36.251118613 +08:00"
end_time = "2024-08-19 10:48:36.293606709 +08:00"
time_cost = "PT0.042488096S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/asm/96_matrix_add.s"
bin_path = "./sysy-data/quick_test/bin/96_matrix_add"
start_time = "2024-08-19 10:48:36.202477680 +08:00"
end_time = "2024-08-19 10:48:36.249284425 +08:00"
time_cost = "PT0.046806745S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/asm/97_matrix_sub.s"
bin_path = "./sysy-data/quick_test/bin/97_matrix_sub"
start_time = "2024-08-19 10:48:36.342485420 +08:00"
end_time = "2024-08-19 10:48:36.386292175 +08:00"
time_cost = "PT0.043806755S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/asm/98_matrix_mul.s"
bin_path = "./sysy-data/quick_test/bin/98_matrix_mul"
start_time = "2024-08-19 10:48:36.109906116 +08:00"
end_time = "2024-08-19 10:48:36.152774993 +08:00"
time_cost = "PT0.042868877S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/asm/99_matrix_tran.s"
bin_path = "./sysy-data/quick_test/bin/99_matrix_tran"
start_time = "2024-08-19 10:48:36.387394276 +08:00"
end_time = "2024-08-19 10:48:36.424825872 +08:00"
time_cost = "PT0.037431596S"
success = true
per_timeout = false

BIN
quick_test/bin/3 Executable file

Binary file not shown.

BIN
quick_test/bin/6 Executable file

Binary file not shown.

BIN
quick_test/bin/7 Executable file

Binary file not shown.

BIN
quick_test/bin/96_matrix_add Executable file

Binary file not shown.

BIN
quick_test/bin/97_matrix_sub Executable file

Binary file not shown.

BIN
quick_test/bin/98_matrix_mul Executable file

Binary file not shown.

BIN
quick_test/bin/99_matrix_tran Executable file

Binary file not shown.

72
quick_test/compile.toml Normal file
View File

@ -0,0 +1,72 @@
start_time = "2024-08-19 10:48:35.917414358 +08:00"
end_time = "2024-08-19 10:48:36.100441947 +08:00"
time_cost = "PT0.183027589S"
all_success = true
success_num = 7
failed_num = 0
total_num = 7
per_timeout_num = 0
case_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/3.sy"
asm = "./sysy-data/quick_test/asm/3.s"
start_time = "2024-08-19 10:48:36.023498273 +08:00"
end_time = "2024-08-19 10:48:36.038450057 +08:00"
time_cost = "PT0.014951784S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/6.sy"
asm = "./sysy-data/quick_test/asm/6.s"
start_time = "2024-08-19 10:48:36.011369803 +08:00"
end_time = "2024-08-19 10:48:36.022157891 +08:00"
time_cost = "PT0.010788088S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/7.sy"
asm = "./sysy-data/quick_test/asm/7.s"
start_time = "2024-08-19 10:48:36.039594228 +08:00"
end_time = "2024-08-19 10:48:36.052244250 +08:00"
time_cost = "PT0.012650022S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/96_matrix_add.sy"
asm = "./sysy-data/quick_test/asm/96_matrix_add.s"
start_time = "2024-08-19 10:48:35.991482933 +08:00"
end_time = "2024-08-19 10:48:36.010398249 +08:00"
time_cost = "PT0.018915316S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/97_matrix_sub.sy"
asm = "./sysy-data/quick_test/asm/97_matrix_sub.s"
start_time = "2024-08-19 10:48:35.918738774 +08:00"
end_time = "2024-08-19 10:48:35.954823062 +08:00"
time_cost = "PT0.036084288S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/98_matrix_mul.sy"
asm = "./sysy-data/quick_test/asm/98_matrix_mul.s"
start_time = "2024-08-19 10:48:36.053876120 +08:00"
end_time = "2024-08-19 10:48:36.100244879 +08:00"
time_cost = "PT0.046368759S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/99_matrix_tran.sy"
asm = "./sysy-data/quick_test/asm/99_matrix_tran.s"
start_time = "2024-08-19 10:48:35.956222772 +08:00"
end_time = "2024-08-19 10:48:35.989595600 +08:00"
time_cost = "PT0.033372828S"
success = true
per_timeout = false

63
quick_test/diff.toml Normal file
View File

@ -0,0 +1,63 @@
start_time = "2024-08-19 10:48:37.928981007 +08:00"
end_time = "2024-08-19 10:48:37.942229844 +08:00"
time_cost = "PT0.013248837S"
all_success = false
success_num = 3
failed_num = 4
total_num = 7
[[diff]]
out = "./sysy-data/quick_test/output/6.out"
expect_out = "./sysy-data/quick_test/expect/output/6.out"
start_time = "2024-08-19 10:48:37.929759352 +08:00"
end_time = "2024-08-19 10:48:37.930398286 +08:00"
time_cost = "PT0.000638934S"
status = "Same"
[[diff]]
out = "./sysy-data/quick_test/output/99_matrix_tran.out"
expect_out = "./sysy-data/quick_test/expect/output/99_matrix_tran.out"
start_time = "2024-08-19 10:48:37.931092818 +08:00"
end_time = "2024-08-19 10:48:37.931918325 +08:00"
time_cost = "PT0.000825507S"
status = "Different"
[[diff]]
out = "./sysy-data/quick_test/output/7.out"
expect_out = "./sysy-data/quick_test/expect/output/7.out"
start_time = "2024-08-19 10:48:37.934823461 +08:00"
end_time = "2024-08-19 10:48:37.935734433 +08:00"
time_cost = "PT0.000910972S"
status = "Same"
[[diff]]
out = "./sysy-data/quick_test/output/96_matrix_add.out"
expect_out = "./sysy-data/quick_test/expect/output/96_matrix_add.out"
start_time = "2024-08-19 10:48:37.932973661 +08:00"
end_time = "2024-08-19 10:48:37.933633292 +08:00"
time_cost = "PT0.000659631S"
status = "Different"
[[diff]]
out = "./sysy-data/quick_test/output/98_matrix_mul.out"
expect_out = "./sysy-data/quick_test/expect/output/98_matrix_mul.out"
start_time = "2024-08-19 10:48:37.939581326 +08:00"
end_time = "2024-08-19 10:48:37.940228658 +08:00"
time_cost = "PT0.000647332S"
status = "Different"
[[diff]]
out = "./sysy-data/quick_test/output/97_matrix_sub.out"
expect_out = "./sysy-data/quick_test/expect/output/97_matrix_sub.out"
start_time = "2024-08-19 10:48:37.941393583 +08:00"
end_time = "2024-08-19 10:48:37.942192165 +08:00"
time_cost = "PT0.000798582S"
status = "Different"
[[diff]]
out = "./sysy-data/quick_test/output/3.out"
expect_out = "./sysy-data/quick_test/expect/output/3.out"
start_time = "2024-08-19 10:48:37.936767361 +08:00"
end_time = "2024-08-19 10:48:37.937957244 +08:00"
time_cost = "PT0.001189883S"
status = "Same"

0
quick_test/diff/3.diff Normal file
View File

0
quick_test/diff/6.diff Normal file
View File

0
quick_test/diff/7.diff Normal file
View File

View File

@ -0,0 +1,10 @@
0a1,3
> 024
> 024
> 024
2c5
< ExitStatus(unix_wait_status(139))
\ No newline at end of file
---
> 0
\ No newline at end of file

View File

@ -0,0 +1,10 @@
0a1,3
> 000
> 000
> 000
2c5
< ExitStatus(unix_wait_status(139))
\ No newline at end of file
---
> 0
\ No newline at end of file

View File

@ -0,0 +1,10 @@
0a1,3
> 036
> 036
> 036
2c5
< ExitStatus(unix_wait_status(139))
\ No newline at end of file
---
> 0
\ No newline at end of file

View File

@ -0,0 +1,10 @@
0a1,3
> 000
> 111
> 222
2c5
< ExitStatus(unix_wait_status(139))
\ No newline at end of file
---
> 0
\ No newline at end of file

79
quick_test/execute.toml Normal file
View File

@ -0,0 +1,79 @@
start_time = "2024-08-19 10:48:36.430522756 +08:00"
end_time = "2024-08-19 10:48:37.908763935 +08:00"
time_cost = "PT1.478241179S"
all_success = true
success_num = 7
failed_num = 0
total_num = 7
per_timeout_num = 0
case_timeout = false
[[execute_bin]]
bin_path = "./sysy-data/quick_test/bin/3"
input_path = "./sysy-data/quick_test/input/3.in"
output_path = "./sysy-data/quick_test/output/3.out"
start_time = "2024-08-19 10:48:37.882813716 +08:00"
end_time = "2024-08-19 10:48:37.908638058 +08:00"
time_cost = "PT0.025824342S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/bin/6"
input_path = "./sysy-data/quick_test/input/6.in"
output_path = "./sysy-data/quick_test/output/6.out"
start_time = "2024-08-19 10:48:37.155747910 +08:00"
end_time = "2024-08-19 10:48:37.178043778 +08:00"
time_cost = "PT0.022295868S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/bin/7"
input_path = "./sysy-data/quick_test/input/7.in"
output_path = "./sysy-data/quick_test/output/7.out"
start_time = "2024-08-19 10:48:37.514335137 +08:00"
end_time = "2024-08-19 10:48:37.544210775 +08:00"
time_cost = "PT0.029875638S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/bin/96_matrix_add"
input_path = "./sysy-data/quick_test/input/96_matrix_add.in"
output_path = "./sysy-data/quick_test/output/96_matrix_add.out"
start_time = "2024-08-19 10:48:36.432267300 +08:00"
end_time = "2024-08-19 10:48:36.774847170 +08:00"
time_cost = "PT0.34257987S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/bin/97_matrix_sub"
input_path = "./sysy-data/quick_test/input/97_matrix_sub.in"
output_path = "./sysy-data/quick_test/output/97_matrix_sub.out"
start_time = "2024-08-19 10:48:37.545762887 +08:00"
end_time = "2024-08-19 10:48:37.881000271 +08:00"
time_cost = "PT0.335237384S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/bin/98_matrix_mul"
input_path = "./sysy-data/quick_test/input/98_matrix_mul.in"
output_path = "./sysy-data/quick_test/output/98_matrix_mul.out"
start_time = "2024-08-19 10:48:36.776139802 +08:00"
end_time = "2024-08-19 10:48:37.153948244 +08:00"
time_cost = "PT0.377808442S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/bin/99_matrix_tran"
input_path = "./sysy-data/quick_test/input/99_matrix_tran.in"
output_path = "./sysy-data/quick_test/output/99_matrix_tran.out"
start_time = "2024-08-19 10:48:37.179460152 +08:00"
end_time = "2024-08-19 10:48:37.513118892 +08:00"
time_cost = "PT0.33365874S"
per_timeout = false
success = true

79
quick_test/expect/asm/3.s Normal file
View File

@ -0,0 +1,79 @@
.file "3.sy"
.option nopic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.text
.globl A
.bss
.align 3
.type A, @object
.size A, 36
A:
.zero 36
.globl B
.align 3
.type B, @object
.size B, 36
B:
.zero 36
.text
.align 1
.globl main
.type main, @function
main:
.LFB6:
.cfi_startproc
addi sp,sp,-32
.cfi_def_cfa_offset 32
sd ra,24(sp)
sd s0,16(sp)
.cfi_offset 1, -8
.cfi_offset 8, -16
addi s0,sp,32
.cfi_def_cfa 8, 0
sw zero,-20(s0)
lui a5,%hi(A)
addi a0,a5,%lo(A)
call getarray
j .L2
.L3:
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
lui a5,%hi(A)
addi a4,a5,%lo(A)
lw a5,-20(s0)
slli a5,a5,2
add a5,a4,a5
lw a4,0(a5)
lui a5,%hi(B)
addi a3,a5,%lo(B)
lw a5,-20(s0)
slli a5,a5,2
add a5,a3,a5
sw a4,0(a5)
.L2:
lw a5,-20(s0)
sext.w a4,a5
li a5,7
ble a4,a5,.L3
lui a5,%hi(B)
addi a1,a5,%lo(B)
li a0,8
call putarray
li a5,0
mv a0,a5
ld ra,24(sp)
.cfi_restore 1
ld s0,16(sp)
.cfi_restore 8
.cfi_def_cfa 2, 32
addi sp,sp,32
.cfi_def_cfa_offset 0
jr ra
.cfi_endproc
.LFE6:
.size main, .-main
.ident "GCC: (GNU) 13.3.0"
.section .note.GNU-stack,"",@progbits

76
quick_test/expect/asm/6.s Normal file
View File

@ -0,0 +1,76 @@
.file "6.sy"
.option nopic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.text
.globl A
.data
.align 3
.type A, @object
.size A, 36
A:
.word 1
.word 1
.word 4
.word 5
.word 1
.word 4
.zero 12
.text
.align 1
.globl main
.type main, @function
main:
.LFB6:
.cfi_startproc
addi sp,sp,-32
.cfi_def_cfa_offset 32
sd ra,24(sp)
sd s0,16(sp)
.cfi_offset 1, -8
.cfi_offset 8, -16
addi s0,sp,32
.cfi_def_cfa 8, 0
lui a5,%hi(A)
addi a5,a5,%lo(A)
li a4,11
sw a4,0(a5)
li a0,4
call thrd_create
mv a5,a0
sw a5,-20(s0)
lui a5,%hi(A)
addi a4,a5,%lo(A)
lw a5,-20(s0)
slli a5,a5,2
add a5,a4,a5
lw a5,0(a5)
slliw a5,a5,1
sext.w a4,a5
lui a5,%hi(A)
addi a3,a5,%lo(A)
lw a5,-20(s0)
slli a5,a5,2
add a5,a3,a5
sw a4,0(a5)
call thrd_join
lui a5,%hi(A)
addi a1,a5,%lo(A)
li a0,8
call putarray
li a5,0
mv a0,a5
ld ra,24(sp)
.cfi_restore 1
ld s0,16(sp)
.cfi_restore 8
.cfi_def_cfa 2, 32
addi sp,sp,32
.cfi_def_cfa_offset 0
jr ra
.cfi_endproc
.LFE6:
.size main, .-main
.ident "GCC: (GNU) 13.3.0"
.section .note.GNU-stack,"",@progbits

95
quick_test/expect/asm/7.s Normal file
View File

@ -0,0 +1,95 @@
.file "7.sy"
.option nopic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.text
.globl A
.data
.align 3
.type A, @object
.size A, 36
A:
.word 1
.word 1
.word 4
.word 5
.word 1
.word 4
.zero 12
.text
.align 1
.globl main
.type main, @function
main:
.LFB6:
.cfi_startproc
addi sp,sp,-32
.cfi_def_cfa_offset 32
sd ra,24(sp)
sd s0,16(sp)
.cfi_offset 1, -8
.cfi_offset 8, -16
addi s0,sp,32
.cfi_def_cfa 8, 0
li a0,4
call thrd_create
mv a5,a0
sw a5,-20(s0)
lui a5,%hi(A)
addi a4,a5,%lo(A)
lw a5,-20(s0)
slli a5,a5,2
add a5,a4,a5
lw a5,0(a5)
slliw a5,a5,1
sext.w a4,a5
lui a5,%hi(A)
addi a3,a5,%lo(A)
lw a5,-20(s0)
slli a5,a5,2
add a5,a3,a5
sw a4,0(a5)
call thrd_join
lui a5,%hi(A)
addi a1,a5,%lo(A)
li a0,8
call putarray
li a0,4
call thrd_create
mv a5,a0
sw a5,-24(s0)
lui a5,%hi(A)
addi a4,a5,%lo(A)
lw a5,-24(s0)
slli a5,a5,2
add a5,a4,a5
lw a5,0(a5)
slliw a5,a5,1
sext.w a4,a5
lui a5,%hi(A)
addi a3,a5,%lo(A)
lw a5,-24(s0)
slli a5,a5,2
add a5,a3,a5
sw a4,0(a5)
call thrd_join
lui a5,%hi(A)
addi a1,a5,%lo(A)
li a0,8
call putarray
li a5,0
mv a0,a5
ld ra,24(sp)
.cfi_restore 1
ld s0,16(sp)
.cfi_restore 8
.cfi_def_cfa 2, 32
addi sp,sp,32
.cfi_def_cfa_offset 0
jr ra
.cfi_endproc
.LFE6:
.size main, .-main
.ident "GCC: (GNU) 13.3.0"
.section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,303 @@
.file "96_matrix_add.sy"
.option nopic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.text
.globl M
.section .sbss,"aw",@nobits
.align 2
.type M, @object
.size M, 4
M:
.zero 4
.globl L
.align 2
.type L, @object
.size L, 4
L:
.zero 4
.globl N
.align 2
.type N, @object
.size N, 4
N:
.zero 4
.text
.align 1
.globl add
.type add, @function
add:
.LFB0:
.cfi_startproc
addi sp,sp,-96
.cfi_def_cfa_offset 96
sd s0,88(sp)
.cfi_offset 8, -8
addi s0,sp,96
.cfi_def_cfa 8, 0
sd a0,-40(s0)
sd a1,-48(s0)
sd a2,-56(s0)
sd a3,-64(s0)
sd a4,-72(s0)
sd a5,-80(s0)
sd a6,-88(s0)
sd a7,-96(s0)
sw zero,-20(s0)
j .L2
.L3:
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
flw fa4,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-64(s0)
add a5,a4,a5
flw fa5,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-88(s0)
add a5,a4,a5
fadd.s fa5,fa4,fa5
fsw fa5,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-48(s0)
add a5,a4,a5
flw fa4,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-72(s0)
add a5,a4,a5
flw fa5,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-96(s0)
add a5,a4,a5
fadd.s fa5,fa4,fa5
fsw fa5,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-56(s0)
add a5,a4,a5
flw fa4,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-80(s0)
add a5,a4,a5
flw fa5,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,0(s0)
add a5,a4,a5
fadd.s fa5,fa4,fa5
fsw fa5,0(a5)
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L2:
lui a5,%hi(M)
lw a4,%lo(M)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L3
li a5,0
mv a0,a5
ld s0,88(sp)
.cfi_restore 8
.cfi_def_cfa 2, 96
addi sp,sp,96
.cfi_def_cfa_offset 0
jr ra
.cfi_endproc
.LFE0:
.size add, .-add
.align 1
.globl main
.type main, @function
main:
.LFB1:
.cfi_startproc
addi sp,sp,-192
.cfi_def_cfa_offset 192
sd ra,184(sp)
sd s0,176(sp)
.cfi_offset 1, -8
.cfi_offset 8, -16
addi s0,sp,192
.cfi_def_cfa 8, 0
lui a5,%hi(N)
li a4,3
sw a4,%lo(N)(a5)
lui a5,%hi(M)
li a4,3
sw a4,%lo(M)(a5)
lui a5,%hi(L)
li a4,3
sw a4,%lo(L)(a5)
sw zero,-20(s0)
j .L6
.L7:
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-24(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-40(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-56(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-72(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-88(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-104(a5)
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L6:
lui a5,%hi(M)
lw a4,%lo(M)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L7
addi a7,s0,-160
addi a6,s0,-144
addi t1,s0,-120
addi a4,s0,-104
addi a3,s0,-88
addi a2,s0,-72
addi a1,s0,-56
addi a0,s0,-40
addi a5,s0,-176
sd a5,0(sp)
mv a5,t1
call add
mv a5,a0
sw a5,-20(s0)
j .L8
.L9:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-128(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L8:
lui a5,%hi(N)
lw a4,%lo(N)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L9
li a5,10
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putch
sw zero,-20(s0)
j .L10
.L11:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-144(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L10:
lui a5,%hi(N)
lw a4,%lo(N)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L11
li a5,10
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putch
sw zero,-20(s0)
j .L12
.L13:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-160(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L12:
lui a5,%hi(N)
lw a4,%lo(N)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L13
li a5,10
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putch
li a5,0
mv a0,a5
ld ra,184(sp)
.cfi_restore 1
ld s0,176(sp)
.cfi_restore 8
.cfi_def_cfa 2, 192
addi sp,sp,192
.cfi_def_cfa_offset 0
jr ra
.cfi_endproc
.LFE1:
.size main, .-main
.ident "GCC: (GNU) 13.3.0"
.section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,298 @@
.file "97_matrix_sub.sy"
.option nopic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.text
.globl N
.section .sbss,"aw",@nobits
.align 2
.type N, @object
.size N, 4
N:
.zero 4
.globl M
.align 2
.type M, @object
.size M, 4
M:
.zero 4
.globl L
.align 2
.type L, @object
.size L, 4
L:
.zero 4
.text
.align 1
.globl sub
.type sub, @function
sub:
.LFB0:
.cfi_startproc
addi sp,sp,-96
.cfi_def_cfa_offset 96
sd s0,88(sp)
.cfi_offset 8, -8
addi s0,sp,96
.cfi_def_cfa 8, 0
sd a0,-40(s0)
sd a1,-48(s0)
sd a2,-56(s0)
sd a3,-64(s0)
sd a4,-72(s0)
sd a5,-80(s0)
sd a6,-88(s0)
sd a7,-96(s0)
sw zero,-20(s0)
j .L2
.L3:
lw a5,-20(s0)
slli a5,a5,2
ld a4,-40(s0)
add a5,a4,a5
flw fa4,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-64(s0)
add a5,a4,a5
flw fa5,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-88(s0)
add a5,a4,a5
fsub.s fa5,fa4,fa5
fsw fa5,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-48(s0)
add a5,a4,a5
flw fa4,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-72(s0)
add a5,a4,a5
flw fa5,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-96(s0)
add a5,a4,a5
fsub.s fa5,fa4,fa5
fsw fa5,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-56(s0)
add a5,a4,a5
flw fa4,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,-80(s0)
add a5,a4,a5
flw fa5,0(a5)
lw a5,-20(s0)
slli a5,a5,2
ld a4,0(s0)
add a5,a4,a5
fsub.s fa5,fa4,fa5
fsw fa5,0(a5)
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L2:
lw a5,-20(s0)
sext.w a4,a5
li a5,2
ble a4,a5,.L3
li a5,0
mv a0,a5
ld s0,88(sp)
.cfi_restore 8
.cfi_def_cfa 2, 96
addi sp,sp,96
.cfi_def_cfa_offset 0
jr ra
.cfi_endproc
.LFE0:
.size sub, .-sub
.align 1
.globl main
.type main, @function
main:
.LFB1:
.cfi_startproc
addi sp,sp,-192
.cfi_def_cfa_offset 192
sd ra,184(sp)
sd s0,176(sp)
.cfi_offset 1, -8
.cfi_offset 8, -16
addi s0,sp,192
.cfi_def_cfa 8, 0
lui a5,%hi(N)
li a4,3
sw a4,%lo(N)(a5)
lui a5,%hi(M)
li a4,3
sw a4,%lo(M)(a5)
lui a5,%hi(L)
li a4,3
sw a4,%lo(L)(a5)
sw zero,-20(s0)
j .L6
.L7:
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-24(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-40(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-56(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-72(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-88(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-104(a5)
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L6:
lw a5,-20(s0)
sext.w a4,a5
li a5,2
ble a4,a5,.L7
addi a7,s0,-160
addi a6,s0,-144
addi t1,s0,-120
addi a4,s0,-104
addi a3,s0,-88
addi a2,s0,-72
addi a1,s0,-56
addi a0,s0,-40
addi a5,s0,-176
sd a5,0(sp)
mv a5,t1
call sub
mv a5,a0
sw a5,-20(s0)
j .L8
.L9:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-128(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L8:
lw a5,-20(s0)
sext.w a4,a5
li a5,2
ble a4,a5,.L9
li a5,10
sw a5,-24(s0)
sw zero,-20(s0)
lw a5,-24(s0)
mv a0,a5
call putch
j .L10
.L11:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-144(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L10:
lw a5,-20(s0)
sext.w a4,a5
li a5,2
ble a4,a5,.L11
li a5,10
sw a5,-24(s0)
sw zero,-20(s0)
lw a5,-24(s0)
mv a0,a5
call putch
j .L12
.L13:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-160(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L12:
lw a5,-20(s0)
sext.w a4,a5
li a5,2
ble a4,a5,.L13
li a5,10
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putch
li a5,0
mv a0,a5
ld ra,184(sp)
.cfi_restore 1
ld s0,176(sp)
.cfi_restore 8
.cfi_def_cfa 2, 192
addi sp,sp,192
.cfi_def_cfa_offset 0
jr ra
.cfi_endproc
.LFE1:
.size main, .-main
.ident "GCC: (GNU) 13.3.0"
.section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,457 @@
.file "98_matrix_mul.sy"
.option nopic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.text
.globl M
.section .sbss,"aw",@nobits
.align 2
.type M, @object
.size M, 4
M:
.zero 4
.globl L
.align 2
.type L, @object
.size L, 4
L:
.zero 4
.globl N
.align 2
.type N, @object
.size N, 4
N:
.zero 4
.text
.align 1
.globl mul
.type mul, @function
mul:
.LFB0:
.cfi_startproc
addi sp,sp,-96
.cfi_def_cfa_offset 96
sd s0,88(sp)
.cfi_offset 8, -8
addi s0,sp,96
.cfi_def_cfa 8, 0
sd a0,-40(s0)
sd a1,-48(s0)
sd a2,-56(s0)
sd a3,-64(s0)
sd a4,-72(s0)
sd a5,-80(s0)
sd a6,-88(s0)
sd a7,-96(s0)
sw zero,-20(s0)
ld a5,-40(s0)
flw fa4,0(a5)
ld a5,-64(s0)
flw fa5,0(a5)
fmul.s fa4,fa4,fa5
ld a5,-40(s0)
addi a5,a5,4
flw fa3,0(a5)
ld a5,-72(s0)
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa4,fa4,fa5
ld a5,-40(s0)
addi a5,a5,8
flw fa3,0(a5)
ld a5,-80(s0)
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa5,fa4,fa5
ld a5,-88(s0)
fsw fa5,0(a5)
ld a5,-40(s0)
flw fa4,0(a5)
ld a5,-64(s0)
addi a5,a5,4
flw fa5,0(a5)
fmul.s fa4,fa4,fa5
ld a5,-40(s0)
addi a5,a5,4
flw fa3,0(a5)
ld a5,-72(s0)
addi a5,a5,4
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa4,fa4,fa5
ld a5,-40(s0)
addi a5,a5,8
flw fa3,0(a5)
ld a5,-80(s0)
addi a5,a5,4
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
ld a5,-88(s0)
addi a5,a5,4
fadd.s fa5,fa4,fa5
fsw fa5,0(a5)
ld a5,-40(s0)
flw fa4,0(a5)
ld a5,-64(s0)
addi a5,a5,8
flw fa5,0(a5)
fmul.s fa4,fa4,fa5
ld a5,-40(s0)
addi a5,a5,4
flw fa3,0(a5)
ld a5,-72(s0)
addi a5,a5,8
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa4,fa4,fa5
ld a5,-40(s0)
addi a5,a5,8
flw fa3,0(a5)
ld a5,-80(s0)
addi a5,a5,8
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
ld a5,-88(s0)
addi a5,a5,8
fadd.s fa5,fa4,fa5
fsw fa5,0(a5)
ld a5,-48(s0)
flw fa4,0(a5)
ld a5,-64(s0)
flw fa5,0(a5)
fmul.s fa4,fa4,fa5
ld a5,-48(s0)
addi a5,a5,4
flw fa3,0(a5)
ld a5,-72(s0)
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa4,fa4,fa5
ld a5,-48(s0)
addi a5,a5,8
flw fa3,0(a5)
ld a5,-80(s0)
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa5,fa4,fa5
ld a5,-96(s0)
fsw fa5,0(a5)
ld a5,-48(s0)
flw fa4,0(a5)
ld a5,-64(s0)
addi a5,a5,4
flw fa5,0(a5)
fmul.s fa4,fa4,fa5
ld a5,-48(s0)
addi a5,a5,4
flw fa3,0(a5)
ld a5,-72(s0)
addi a5,a5,4
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa4,fa4,fa5
ld a5,-48(s0)
addi a5,a5,8
flw fa3,0(a5)
ld a5,-80(s0)
addi a5,a5,4
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
ld a5,-96(s0)
addi a5,a5,4
fadd.s fa5,fa4,fa5
fsw fa5,0(a5)
ld a5,-48(s0)
flw fa4,0(a5)
ld a5,-64(s0)
addi a5,a5,8
flw fa5,0(a5)
fmul.s fa4,fa4,fa5
ld a5,-48(s0)
addi a5,a5,4
flw fa3,0(a5)
ld a5,-72(s0)
addi a5,a5,8
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa4,fa4,fa5
ld a5,-48(s0)
addi a5,a5,8
flw fa3,0(a5)
ld a5,-80(s0)
addi a5,a5,8
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
ld a5,-96(s0)
addi a5,a5,8
fadd.s fa5,fa4,fa5
fsw fa5,0(a5)
ld a5,-56(s0)
flw fa4,0(a5)
ld a5,-64(s0)
flw fa5,0(a5)
fmul.s fa4,fa4,fa5
ld a5,-56(s0)
addi a5,a5,4
flw fa3,0(a5)
ld a5,-72(s0)
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa4,fa4,fa5
ld a5,-56(s0)
addi a5,a5,8
flw fa3,0(a5)
ld a5,-80(s0)
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa5,fa4,fa5
ld a5,0(s0)
fsw fa5,0(a5)
ld a5,-56(s0)
flw fa4,0(a5)
ld a5,-64(s0)
addi a5,a5,4
flw fa5,0(a5)
fmul.s fa4,fa4,fa5
ld a5,-56(s0)
addi a5,a5,4
flw fa3,0(a5)
ld a5,-72(s0)
addi a5,a5,4
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa4,fa4,fa5
ld a5,-56(s0)
addi a5,a5,8
flw fa3,0(a5)
ld a5,-80(s0)
addi a5,a5,4
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
ld a5,0(s0)
addi a5,a5,4
fadd.s fa5,fa4,fa5
fsw fa5,0(a5)
ld a5,-56(s0)
flw fa4,0(a5)
ld a5,-64(s0)
addi a5,a5,8
flw fa5,0(a5)
fmul.s fa4,fa4,fa5
ld a5,-56(s0)
addi a5,a5,4
flw fa3,0(a5)
ld a5,-72(s0)
addi a5,a5,8
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
fadd.s fa4,fa4,fa5
ld a5,-56(s0)
addi a5,a5,8
flw fa3,0(a5)
ld a5,-80(s0)
addi a5,a5,8
flw fa5,0(a5)
fmul.s fa5,fa3,fa5
ld a5,0(s0)
addi a5,a5,8
fadd.s fa5,fa4,fa5
fsw fa5,0(a5)
li a5,0
mv a0,a5
ld s0,88(sp)
.cfi_restore 8
.cfi_def_cfa 2, 96
addi sp,sp,96
.cfi_def_cfa_offset 0
jr ra
.cfi_endproc
.LFE0:
.size mul, .-mul
.align 1
.globl main
.type main, @function
main:
.LFB1:
.cfi_startproc
addi sp,sp,-192
.cfi_def_cfa_offset 192
sd ra,184(sp)
sd s0,176(sp)
.cfi_offset 1, -8
.cfi_offset 8, -16
addi s0,sp,192
.cfi_def_cfa 8, 0
lui a5,%hi(N)
li a4,3
sw a4,%lo(N)(a5)
lui a5,%hi(M)
li a4,3
sw a4,%lo(M)(a5)
lui a5,%hi(L)
li a4,3
sw a4,%lo(L)(a5)
sw zero,-20(s0)
j .L4
.L5:
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-24(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-40(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-56(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-72(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-88(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-104(a5)
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L4:
lui a5,%hi(M)
lw a4,%lo(M)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L5
addi a7,s0,-160
addi a6,s0,-144
addi t1,s0,-120
addi a4,s0,-104
addi a3,s0,-88
addi a2,s0,-72
addi a1,s0,-56
addi a0,s0,-40
addi a5,s0,-176
sd a5,0(sp)
mv a5,t1
call mul
mv a5,a0
sw a5,-20(s0)
j .L6
.L7:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-128(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L6:
lui a5,%hi(N)
lw a4,%lo(N)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L7
li a5,10
sw a5,-24(s0)
sw zero,-20(s0)
lw a5,-24(s0)
mv a0,a5
call putch
j .L8
.L9:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-144(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L8:
lui a5,%hi(N)
lw a4,%lo(N)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L9
li a5,10
sw a5,-24(s0)
sw zero,-20(s0)
lw a5,-24(s0)
mv a0,a5
call putch
j .L10
.L11:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-160(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L10:
lui a5,%hi(N)
lw a4,%lo(N)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L11
li a5,10
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putch
li a5,0
mv a0,a5
ld ra,184(sp)
.cfi_restore 1
ld s0,176(sp)
.cfi_restore 8
.cfi_def_cfa 2, 192
addi sp,sp,192
.cfi_def_cfa_offset 0
jr ra
.cfi_endproc
.LFE1:
.size main, .-main
.ident "GCC: (GNU) 13.3.0"
.section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,286 @@
.file "99_matrix_tran.sy"
.option nopic
.attribute arch, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0"
.attribute unaligned_access, 0
.attribute stack_align, 16
.text
.globl M
.section .sbss,"aw",@nobits
.align 2
.type M, @object
.size M, 4
M:
.zero 4
.globl L
.align 2
.type L, @object
.size L, 4
L:
.zero 4
.globl N
.align 2
.type N, @object
.size N, 4
N:
.zero 4
.text
.align 1
.globl tran
.type tran, @function
tran:
.LFB0:
.cfi_startproc
addi sp,sp,-96
.cfi_def_cfa_offset 96
sd s0,88(sp)
.cfi_offset 8, -8
addi s0,sp,96
.cfi_def_cfa 8, 0
sd a0,-40(s0)
sd a1,-48(s0)
sd a2,-56(s0)
sd a3,-64(s0)
sd a4,-72(s0)
sd a5,-80(s0)
sd a6,-88(s0)
sd a7,-96(s0)
sw zero,-20(s0)
ld a5,-96(s0)
addi a5,a5,8
ld a4,-56(s0)
flw fa5,4(a4)
fsw fa5,0(a5)
ld a5,0(s0)
addi a5,a5,4
ld a4,-48(s0)
flw fa5,8(a4)
fsw fa5,0(a5)
ld a5,-88(s0)
addi a5,a5,4
ld a4,-48(s0)
flw fa5,0(a4)
fsw fa5,0(a5)
ld a5,-88(s0)
addi a5,a5,8
ld a4,-56(s0)
flw fa5,0(a4)
fsw fa5,0(a5)
ld a5,-40(s0)
flw fa5,4(a5)
ld a5,-96(s0)
fsw fa5,0(a5)
ld a5,-40(s0)
flw fa5,8(a5)
ld a5,0(s0)
fsw fa5,0(a5)
ld a5,-96(s0)
addi a5,a5,4
ld a4,-48(s0)
flw fa5,4(a4)
fsw fa5,0(a5)
ld a5,0(s0)
addi a5,a5,8
ld a4,-56(s0)
flw fa5,8(a4)
fsw fa5,0(a5)
ld a5,-40(s0)
flw fa5,0(a5)
ld a5,-88(s0)
fsw fa5,0(a5)
li a5,0
mv a0,a5
ld s0,88(sp)
.cfi_restore 8
.cfi_def_cfa 2, 96
addi sp,sp,96
.cfi_def_cfa_offset 0
jr ra
.cfi_endproc
.LFE0:
.size tran, .-tran
.align 1
.globl main
.type main, @function
main:
.LFB1:
.cfi_startproc
addi sp,sp,-192
.cfi_def_cfa_offset 192
sd ra,184(sp)
sd s0,176(sp)
.cfi_offset 1, -8
.cfi_offset 8, -16
addi s0,sp,192
.cfi_def_cfa 8, 0
lui a5,%hi(N)
li a4,3
sw a4,%lo(N)(a5)
lui a5,%hi(M)
li a4,3
sw a4,%lo(M)(a5)
lui a5,%hi(L)
li a4,3
sw a4,%lo(L)(a5)
sw zero,-20(s0)
j .L4
.L5:
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-24(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-40(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-56(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-72(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-88(a5)
lw a5,-20(s0)
fcvt.s.w fa5,a5
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
fsw fa5,-104(a5)
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L4:
lui a5,%hi(M)
lw a4,%lo(M)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L5
addi a7,s0,-160
addi a6,s0,-144
addi t1,s0,-120
addi a4,s0,-104
addi a3,s0,-88
addi a2,s0,-72
addi a1,s0,-56
addi a0,s0,-40
addi a5,s0,-176
sd a5,0(sp)
mv a5,t1
call tran
mv a5,a0
sw a5,-20(s0)
j .L6
.L7:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-128(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L6:
lui a5,%hi(N)
lw a4,%lo(N)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L7
li a5,10
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putch
sw zero,-20(s0)
j .L8
.L9:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-144(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L8:
lui a5,%hi(N)
lw a4,%lo(N)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L9
li a5,10
sw a5,-24(s0)
sw zero,-20(s0)
lw a5,-24(s0)
mv a0,a5
call putch
j .L10
.L11:
lw a5,-20(s0)
slli a5,a5,2
addi a5,a5,-16
add a5,a5,s0
flw fa5,-160(a5)
fcvt.w.s a5,fa5,rtz
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putint
lw a5,-20(s0)
addiw a5,a5,1
sw a5,-20(s0)
.L10:
lui a5,%hi(N)
lw a4,%lo(N)(a5)
lw a5,-20(s0)
sext.w a5,a5
blt a5,a4,.L11
li a5,10
sw a5,-24(s0)
lw a5,-24(s0)
mv a0,a5
call putch
li a5,0
mv a0,a5
ld ra,184(sp)
.cfi_restore 1
ld s0,176(sp)
.cfi_restore 8
.cfi_def_cfa 2, 192
addi sp,sp,192
.cfi_def_cfa_offset 0
jr ra
.cfi_endproc
.LFE1:
.size main, .-main
.ident "GCC: (GNU) 13.3.0"
.section .note.GNU-stack,"",@progbits

View File

@ -0,0 +1,72 @@
start_time = "2024-08-19 10:40:41.959101387 +08:00"
end_time = "2024-08-19 10:40:42.231883071 +08:00"
time_cost = "PT0.272781684S"
all_success = true
success_num = 7
failed_num = 0
total_num = 7
per_timeout_num = 0
case_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/expect/asm/3.s"
bin_path = "./sysy-data/quick_test/expect/bin/3"
start_time = "2024-08-19 10:40:41.996936324 +08:00"
end_time = "2024-08-19 10:40:42.039136575 +08:00"
time_cost = "PT0.042200251S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/expect/asm/6.s"
bin_path = "./sysy-data/quick_test/expect/bin/6"
start_time = "2024-08-19 10:40:42.115555121 +08:00"
end_time = "2024-08-19 10:40:42.154711390 +08:00"
time_cost = "PT0.039156269S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/expect/asm/7.s"
bin_path = "./sysy-data/quick_test/expect/bin/7"
start_time = "2024-08-19 10:40:42.078437068 +08:00"
end_time = "2024-08-19 10:40:42.114346725 +08:00"
time_cost = "PT0.035909657S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/expect/asm/96_matrix_add.s"
bin_path = "./sysy-data/quick_test/expect/bin/96_matrix_add"
start_time = "2024-08-19 10:40:42.040208875 +08:00"
end_time = "2024-08-19 10:40:42.077342720 +08:00"
time_cost = "PT0.037133845S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/expect/asm/97_matrix_sub.s"
bin_path = "./sysy-data/quick_test/expect/bin/97_matrix_sub"
start_time = "2024-08-19 10:40:42.155871996 +08:00"
end_time = "2024-08-19 10:40:42.192251180 +08:00"
time_cost = "PT0.036379184S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/expect/asm/98_matrix_mul.s"
bin_path = "./sysy-data/quick_test/expect/bin/98_matrix_mul"
start_time = "2024-08-19 10:40:41.960070976 +08:00"
end_time = "2024-08-19 10:40:41.995800509 +08:00"
time_cost = "PT0.035729533S"
success = true
per_timeout = false
[[asm2bin_asm]]
asm_path = "./sysy-data/quick_test/expect/asm/99_matrix_tran.s"
bin_path = "./sysy-data/quick_test/expect/bin/99_matrix_tran"
start_time = "2024-08-19 10:40:42.193347329 +08:00"
end_time = "2024-08-19 10:40:42.231805441 +08:00"
time_cost = "PT0.038458112S"
success = true
per_timeout = false

BIN
quick_test/expect/bin/3 Executable file

Binary file not shown.

BIN
quick_test/expect/bin/6 Executable file

Binary file not shown.

BIN
quick_test/expect/bin/7 Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,72 @@
start_time = "2024-08-19 10:40:41.789470145 +08:00"
end_time = "2024-08-19 10:40:41.956642093 +08:00"
time_cost = "PT0.167171948S"
all_success = true
success_num = 7
failed_num = 0
total_num = 7
per_timeout_num = 0
case_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/3.sy"
asm = "./sysy-data/quick_test/expect/asm/3.s"
start_time = "2024-08-19 10:40:41.881476368 +08:00"
end_time = "2024-08-19 10:40:41.906471431 +08:00"
time_cost = "PT0.024995063S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/6.sy"
asm = "./sysy-data/quick_test/expect/asm/6.s"
start_time = "2024-08-19 10:40:41.848049371 +08:00"
end_time = "2024-08-19 10:40:41.879859649 +08:00"
time_cost = "PT0.031810278S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/7.sy"
asm = "./sysy-data/quick_test/expect/asm/7.s"
start_time = "2024-08-19 10:40:41.907593006 +08:00"
end_time = "2024-08-19 10:40:41.938505146 +08:00"
time_cost = "PT0.03091214S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/96_matrix_add.sy"
asm = "./sysy-data/quick_test/expect/asm/96_matrix_add.s"
start_time = "2024-08-19 10:40:41.828553042 +08:00"
end_time = "2024-08-19 10:40:41.847141164 +08:00"
time_cost = "PT0.018588122S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/97_matrix_sub.sy"
asm = "./sysy-data/quick_test/expect/asm/97_matrix_sub.s"
start_time = "2024-08-19 10:40:41.790579105 +08:00"
end_time = "2024-08-19 10:40:41.808370739 +08:00"
time_cost = "PT0.017791634S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/98_matrix_mul.sy"
asm = "./sysy-data/quick_test/expect/asm/98_matrix_mul.s"
start_time = "2024-08-19 10:40:41.939650490 +08:00"
end_time = "2024-08-19 10:40:41.956567399 +08:00"
time_cost = "PT0.016916909S"
success = true
per_timeout = false
[[compile_sy]]
sy = "./sysy-data/quick_test/sy/99_matrix_tran.sy"
asm = "./sysy-data/quick_test/expect/asm/99_matrix_tran.s"
start_time = "2024-08-19 10:40:41.809391051 +08:00"
end_time = "2024-08-19 10:40:41.827769965 +08:00"
time_cost = "PT0.018378914S"
success = true
per_timeout = false

View File

@ -0,0 +1,79 @@
start_time = "2024-08-19 10:40:42.233943665 +08:00"
end_time = "2024-08-19 10:40:42.381256409 +08:00"
time_cost = "PT0.147312744S"
all_success = true
success_num = 7
failed_num = 0
total_num = 7
per_timeout_num = 0
case_timeout = false
[[execute_bin]]
bin_path = "./sysy-data/quick_test/expect/bin/3"
input_path = "./sysy-data/quick_test/input/3.in"
output_path = "./sysy-data/quick_test/expect/output/3.out"
start_time = "2024-08-19 10:40:42.365521373 +08:00"
end_time = "2024-08-19 10:40:42.381131749 +08:00"
time_cost = "PT0.015610376S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/expect/bin/6"
input_path = "./sysy-data/quick_test/input/6.in"
output_path = "./sysy-data/quick_test/expect/output/6.out"
start_time = "2024-08-19 10:40:42.277847781 +08:00"
end_time = "2024-08-19 10:40:42.298414266 +08:00"
time_cost = "PT0.020566485S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/expect/bin/7"
input_path = "./sysy-data/quick_test/input/7.in"
output_path = "./sysy-data/quick_test/expect/output/7.out"
start_time = "2024-08-19 10:40:42.324830814 +08:00"
end_time = "2024-08-19 10:40:42.346191709 +08:00"
time_cost = "PT0.021360895S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/expect/bin/96_matrix_add"
input_path = "./sysy-data/quick_test/input/96_matrix_add.in"
output_path = "./sysy-data/quick_test/expect/output/96_matrix_add.out"
start_time = "2024-08-19 10:40:42.235238892 +08:00"
end_time = "2024-08-19 10:40:42.255301634 +08:00"
time_cost = "PT0.020062742S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/expect/bin/97_matrix_sub"
input_path = "./sysy-data/quick_test/input/97_matrix_sub.in"
output_path = "./sysy-data/quick_test/expect/output/97_matrix_sub.out"
start_time = "2024-08-19 10:40:42.347704022 +08:00"
end_time = "2024-08-19 10:40:42.364089989 +08:00"
time_cost = "PT0.016385967S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/expect/bin/98_matrix_mul"
input_path = "./sysy-data/quick_test/input/98_matrix_mul.in"
output_path = "./sysy-data/quick_test/expect/output/98_matrix_mul.out"
start_time = "2024-08-19 10:40:42.256932188 +08:00"
end_time = "2024-08-19 10:40:42.276185888 +08:00"
time_cost = "PT0.0192537S"
per_timeout = false
success = true
[[execute_bin]]
bin_path = "./sysy-data/quick_test/expect/bin/99_matrix_tran"
input_path = "./sysy-data/quick_test/input/99_matrix_tran.in"
output_path = "./sysy-data/quick_test/expect/output/99_matrix_tran.out"
start_time = "2024-08-19 10:40:42.299621770 +08:00"
end_time = "2024-08-19 10:40:42.323521978 +08:00"
time_cost = "PT0.023900208S"
per_timeout = false
success = true

View File

@ -0,0 +1,63 @@
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us

View File

@ -0,0 +1,61 @@
stdout:
stderr:
stdout:
stderr:
stdout:
stderr:
stdout:
stderr:
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us

View File

@ -0,0 +1,69 @@
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
./sysy-data/quick_test/sy/7.sy: In function 'main':
./sysy-data/quick_test/sy/7.sy:11:9: error: redefinition of 'n'
11 | int n = thrd_create(4);
| ^
./sysy-data/quick_test/sy/7.sy:7:9: note: previous definition of 'n' with type 'int'
7 | int n = thrd_create(4);
| ^
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
./sysy-data/quick_test/sy/7.sy: In function 'main':
./sysy-data/quick_test/sy/7.sy:11:9: error: redefinition of 'n'
11 | int n = thrd_create(4);
| ^
./sysy-data/quick_test/sy/7.sy:7:9: note: previous definition of 'n' with type 'int'
7 | int n = thrd_create(4);
| ^
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us

View File

@ -0,0 +1,36 @@
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us

View File

@ -0,0 +1,36 @@
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us

View File

@ -0,0 +1,36 @@
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us

View File

@ -0,0 +1,36 @@
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us
stdout:
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us

View File

@ -0,0 +1,3 @@
8: 0 0 0 0 0 0 0 0
0

View File

@ -0,0 +1,3 @@
8: 22 2 8 10 2 4 0 0
0

View File

@ -0,0 +1,4 @@
8: 2 2 8 10 2 4 0 0
8: 4 4 16 20 4 4 0 0
0

View File

@ -0,0 +1,5 @@
024
024
024
0

View File

@ -0,0 +1,5 @@
000
000
000
0

View File

@ -0,0 +1,5 @@
036
036
036
0

View File

@ -0,0 +1,5 @@
000
111
222
0

50
quick_test/ll/3.ll Normal file
View File

@ -0,0 +1,50 @@
@A = dso_local global [9 x i32] zeroinitializer
@B = dso_local global [9 x i32] zeroinitializer
declare i32 @getint()
declare i32 @getch()
declare float @getfloat()
declare void @putint(i32 %p0)
declare void @putch(i32 %p0)
declare void @putfloat(float %p0)
declare i32 @getarray(i32* %p0)
declare i32 @getfarray(float* %p0)
declare void @putarray(i32 %p0, i32* %p1)
declare void @putfarray(i32 %p0, float* %p1)
declare void @_sysy_starttime(i32 %p0)
declare void @_sysy_stoptime(i32 %p0)
declare i32 @thrd_create(i32 %p0)
declare void @thrd_join()
declare void @putf()
declare void @llvm.memset.p0.i32(i32* %p0, i8 %p1, i32 %p2, i1 %p3)
define i32 @main() {
entry:
%getelementptr_7 = getelementptr [9 x i32], ptr @A, i32 0, i32 0
%call_8 = call i32 @getarray(i32* %getelementptr_7)
%call_31 = call i32 @thrd_create(i32 4)
%Mul_33 = mul i32 %call_31, 8
%SDiv_34 = sdiv i32 %Mul_33, 5
%Add_36 = add i32 %Mul_33, 8
%SDiv_37 = sdiv i32 %Add_36, 5
br label %cond0
cond0:
%phi_30 = phi i32 [%SDiv_34, %entry], [%Add_14, %body1]
%icmp_39 = icmp slt i32 %phi_30, %SDiv_37
br i1 %icmp_39, label %body1, label %exit
body1:
%Add_14 = add i32 %phi_30, 1
%getelementptr_17 = getelementptr [9 x i32], ptr @A, i32 0, i32 %Add_14
%getelementptr_19 = getelementptr [9 x i32], ptr @B, i32 0, i32 %Add_14
%load_20 = load i32, ptr %getelementptr_17
store i32 %load_20, ptr %getelementptr_19
br label %cond0
exit:
call void @thrd_join()
%getelementptr_26 = getelementptr [9 x i32], ptr @B, i32 0, i32 0
call void @putarray(i32 8, i32* %getelementptr_26)
ret i32 0
}

32
quick_test/ll/6.ll Normal file
View File

@ -0,0 +1,32 @@
@A = dso_local global [9 x i32] [i32 1, i32 1, i32 4, i32 5, i32 1, i32 4, i32 0, i32 0, i32 0]
declare i32 @getint()
declare i32 @getch()
declare float @getfloat()
declare void @putint(i32 %p0)
declare void @putch(i32 %p0)
declare void @putfloat(float %p0)
declare i32 @getarray(i32* %p0)
declare i32 @getfarray(float* %p0)
declare void @putarray(i32 %p0, i32* %p1)
declare void @putfarray(i32 %p0, float* %p1)
declare void @_sysy_starttime(i32 %p0)
declare void @_sysy_stoptime(i32 %p0)
declare i32 @thrd_create(i32 %p0)
declare void @thrd_join()
declare void @putf()
declare void @llvm.memset.p0.i32(i32* %p0, i8 %p1, i32 %p2, i1 %p3)
define i32 @main() {
exit:
%getelementptr_5 = getelementptr [9 x i32], ptr @A, i32 0, i32 0
store i32 11, ptr %getelementptr_5
%call_8 = call i32 @thrd_create(i32 4)
%getelementptr_11 = getelementptr [9 x i32], ptr @A, i32 0, i32 %call_8
%load_12 = load i32, ptr %getelementptr_11
%Mul_13 = mul i32 %load_12, 2
store i32 %Mul_13, ptr %getelementptr_11
call void @thrd_join()
call void @putarray(i32 8, i32* %getelementptr_5)
ret i32 0
}

38
quick_test/ll/7.ll Normal file
View File

@ -0,0 +1,38 @@
@A = dso_local global [9 x i32] [i32 1, i32 1, i32 4, i32 5, i32 1, i32 4, i32 0, i32 0, i32 0]
declare i32 @getint()
declare i32 @getch()
declare float @getfloat()
declare void @putint(i32 %p0)
declare void @putch(i32 %p0)
declare void @putfloat(float %p0)
declare i32 @getarray(i32* %p0)
declare i32 @getfarray(float* %p0)
declare void @putarray(i32 %p0, i32* %p1)
declare void @putfarray(i32 %p0, float* %p1)
declare void @_sysy_starttime(i32 %p0)
declare void @_sysy_stoptime(i32 %p0)
declare i32 @thrd_create(i32 %p0)
declare void @thrd_join()
declare void @putf()
declare void @llvm.memset.p0.i32(i32* %p0, i8 %p1, i32 %p2, i1 %p3)
define i32 @main() {
exit:
%call_6 = call i32 @thrd_create(i32 4)
%getelementptr_9 = getelementptr [9 x i32], ptr @A, i32 0, i32 %call_6
%load_10 = load i32, ptr %getelementptr_9
%Mul_11 = mul i32 %load_10, 2
store i32 %Mul_11, ptr %getelementptr_9
call void @thrd_join()
%getelementptr_16 = getelementptr [9 x i32], ptr @A, i32 0, i32 0
call void @putarray(i32 8, i32* %getelementptr_16)
%call_19 = call i32 @thrd_create(i32 4)
%getelementptr_22 = getelementptr [9 x i32], ptr @A, i32 0, i32 %call_19
%load_23 = load i32, ptr %getelementptr_22
%Mul_24 = mul i32 %load_23, 2
store i32 %Mul_24, ptr %getelementptr_22
call void @thrd_join()
call void @putarray(i32 8, i32* %getelementptr_16)
ret i32 0
}

View File

@ -0,0 +1,111 @@
@M = dso_local global i32 0
@L = dso_local global i32 0
@N = dso_local global i32 0
declare i32 @getint()
declare i32 @getch()
declare float @getfloat()
declare void @putint(i32 %p0)
declare void @putch(i32 %p0)
declare void @putfloat(float %p0)
declare i32 @getarray(i32* %p0)
declare i32 @getfarray(float* %p0)
declare void @putarray(i32 %p0, i32* %p1)
declare void @putfarray(i32 %p0, float* %p1)
declare void @_sysy_starttime(i32 %p0)
declare void @_sysy_stoptime(i32 %p0)
declare i32 @thrd_create(i32 %p0)
declare void @thrd_join()
declare void @putf()
declare void @llvm.memset.p0.i32(i32* %p0, i8 %p1, i32 %p2, i1 %p3)
define i32 @add(float* %a0, float* %a1, float* %a2, float* %b0, float* %b1, float* %b2, float* %c0, float* %c1, float* %c2) {
entry:
br label %cond0
cond0:
%phi_141 = phi i32 [0, %entry], [%Add_69, %body1]
%load_73 = load i32, ptr @M
%icmp_74 = icmp slt i32 %phi_141, %load_73
br i1 %icmp_74, label %body1, label %exit
body1:
%getelementptr_31 = getelementptr float, ptr %a0, i32 %phi_141
%getelementptr_34 = getelementptr float, ptr %b0, i32 %phi_141
%load_35 = load float, ptr %getelementptr_31
%load_36 = load float, ptr %getelementptr_34
%FAdd_37 = fadd float %load_35, %load_36
%getelementptr_40 = getelementptr float, ptr %c0, i32 %phi_141
store float %FAdd_37, ptr %getelementptr_40
%getelementptr_44 = getelementptr float, ptr %a1, i32 %phi_141
%getelementptr_47 = getelementptr float, ptr %b1, i32 %phi_141
%load_48 = load float, ptr %getelementptr_44
%load_49 = load float, ptr %getelementptr_47
%FAdd_50 = fadd float %load_48, %load_49
%getelementptr_53 = getelementptr float, ptr %c1, i32 %phi_141
store float %FAdd_50, ptr %getelementptr_53
%getelementptr_57 = getelementptr float, ptr %a2, i32 %phi_141
%getelementptr_60 = getelementptr float, ptr %b2, i32 %phi_141
%load_61 = load float, ptr %getelementptr_57
%load_62 = load float, ptr %getelementptr_60
%FAdd_63 = fadd float %load_61, %load_62
%getelementptr_66 = getelementptr float, ptr %c2, i32 %phi_141
store float %FAdd_63, ptr %getelementptr_66
%Add_69 = add i32 %phi_141, 1
br label %cond0
exit:
ret i32 0
}
define i32 @main() {
entry:
store i32 3, ptr @N
store i32 3, ptr @M
store i32 3, ptr @L
%alloca_86 = alloca [3 x float]
%alloca_87 = alloca [3 x float]
%alloca_88 = alloca [3 x float]
%alloca_89 = alloca [3 x float]
%alloca_90 = alloca [3 x float]
%alloca_91 = alloca [3 x float]
%getelementptr_143 = getelementptr [3 x float], ptr %alloca_88, i32 0
%getelementptr_144 = getelementptr [3 x float], ptr %alloca_91, i32 0
%getelementptr_145 = getelementptr [3 x float], ptr %alloca_89, i32 0
%getelementptr_146 = getelementptr [3 x float], ptr %alloca_86, i32 0
%getelementptr_147 = getelementptr [3 x float], ptr %alloca_90, i32 0
%getelementptr_148 = getelementptr [3 x float], ptr %alloca_87, i32 0
%call_149 = call i32 @thrd_create(i32 4)
%Mul_151 = mul i32 %call_149, 3
%SDiv_152 = sdiv i32 %Mul_151, 5
%Add_154 = add i32 %Mul_151, 3
%SDiv_155 = sdiv i32 %Add_154, 5
br label %cond0
cond0:
%phi_142 = phi i32 [%SDiv_152, %entry], [%Add_132, %body1]
%icmp_157 = icmp slt i32 %phi_142, %SDiv_155
br i1 %icmp_157, label %body1, label %exit
body1:
%getelementptr_102 = getelementptr [3 x float], ptr %getelementptr_146, i32 0, i32 %phi_142
%itofp_104 = sitofp i32 %phi_142 to float
store float %itofp_104, ptr %getelementptr_102
%getelementptr_107 = getelementptr [3 x float], ptr %getelementptr_148, i32 0, i32 %phi_142
store float %itofp_104, ptr %getelementptr_107
%getelementptr_112 = getelementptr [3 x float], ptr %getelementptr_143, i32 0, i32 %phi_142
store float %itofp_104, ptr %getelementptr_112
%getelementptr_117 = getelementptr [3 x float], ptr %getelementptr_145, i32 0, i32 %phi_142
store float %itofp_104, ptr %getelementptr_117
%getelementptr_122 = getelementptr [3 x float], ptr %getelementptr_147, i32 0, i32 %phi_142
store float %itofp_104, ptr %getelementptr_122
%getelementptr_127 = getelementptr [3 x float], ptr %getelementptr_144, i32 0, i32 %phi_142
store float %itofp_104, ptr %getelementptr_127
%Add_132 = add i32 %phi_142, 1
br label %cond0
exit:
call void @thrd_join()
ret i32 0
}

View File

@ -0,0 +1,194 @@
@N = dso_local global i32 0
@M = dso_local global i32 0
@L = dso_local global i32 0
declare i32 @getint()
declare i32 @getch()
declare float @getfloat()
declare void @putint(i32 %p0)
declare void @putch(i32 %p0)
declare void @putfloat(float %p0)
declare i32 @getarray(i32* %p0)
declare i32 @getfarray(float* %p0)
declare void @putarray(i32 %p0, i32* %p1)
declare void @putfarray(i32 %p0, float* %p1)
declare void @_sysy_starttime(i32 %p0)
declare void @_sysy_stoptime(i32 %p0)
declare i32 @thrd_create(i32 %p0)
declare void @thrd_join()
declare void @putf()
declare void @llvm.memset.p0.i32(i32* %p0, i8 %p1, i32 %p2, i1 %p3)
define i32 @main() {
entry:
store i32 3, ptr @N
store i32 3, ptr @M
store i32 3, ptr @L
%alloca_85 = alloca [3 x float]
%alloca_86 = alloca [3 x float]
%alloca_87 = alloca [3 x float]
%alloca_88 = alloca [3 x float]
%alloca_89 = alloca [3 x float]
%alloca_90 = alloca [3 x float]
%alloca_91 = alloca [6 x float]
%alloca_92 = alloca [3 x float]
%alloca_93 = alloca [3 x float]
%getelementptr_281 = getelementptr [3 x float], ptr %alloca_90, i32 0
%getelementptr_282 = getelementptr [3 x float], ptr %alloca_88, i32 0
%getelementptr_283 = getelementptr [3 x float], ptr %alloca_85, i32 0
%getelementptr_284 = getelementptr [3 x float], ptr %alloca_87, i32 0
%getelementptr_285 = getelementptr [3 x float], ptr %alloca_89, i32 0
%getelementptr_286 = getelementptr [3 x float], ptr %alloca_86, i32 0
%call_287 = call i32 @thrd_create(i32 4)
%Mul_289 = mul i32 %call_287, 3
%SDiv_290 = sdiv i32 %Mul_289, 5
%Add_292 = add i32 %Mul_289, 3
%SDiv_293 = sdiv i32 %Add_292, 5
br label %cond0
cond0:
%phi_217 = phi i32 [%SDiv_290, %entry], [%Add_131, %body1]
%icmp_295 = icmp slt i32 %phi_217, %SDiv_293
br i1 %icmp_295, label %body1, label %entry_inline0
body1:
%getelementptr_101 = getelementptr [3 x float], ptr %getelementptr_283, i32 0, i32 %phi_217
%itofp_103 = sitofp i32 %phi_217 to float
store float %itofp_103, ptr %getelementptr_101
%getelementptr_106 = getelementptr [3 x float], ptr %getelementptr_286, i32 0, i32 %phi_217
store float %itofp_103, ptr %getelementptr_106
%getelementptr_111 = getelementptr [3 x float], ptr %getelementptr_284, i32 0, i32 %phi_217
store float %itofp_103, ptr %getelementptr_111
%getelementptr_116 = getelementptr [3 x float], ptr %getelementptr_282, i32 0, i32 %phi_217
store float %itofp_103, ptr %getelementptr_116
%getelementptr_121 = getelementptr [3 x float], ptr %getelementptr_285, i32 0, i32 %phi_217
store float %itofp_103, ptr %getelementptr_121
%getelementptr_126 = getelementptr [3 x float], ptr %getelementptr_281, i32 0, i32 %phi_217
store float %itofp_103, ptr %getelementptr_126
%Add_131 = add i32 %phi_217, 1
br label %cond0
entry_inline0:
call void @thrd_join()
%getelementptr_297 = getelementptr [3 x float], ptr %alloca_86, i32 0
%getelementptr_298 = getelementptr [3 x float], ptr %alloca_90, i32 0
%getelementptr_299 = getelementptr [3 x float], ptr %alloca_88, i32 0
%getelementptr_300 = getelementptr [3 x float], ptr %alloca_93, i32 0
%getelementptr_301 = getelementptr [3 x float], ptr %alloca_92, i32 0
%getelementptr_302 = getelementptr [3 x float], ptr %alloca_89, i32 0
%getelementptr_303 = getelementptr [3 x float], ptr %alloca_85, i32 0
%getelementptr_304 = getelementptr [3 x float], ptr %alloca_87, i32 0
%getelementptr_305 = getelementptr [6 x float], ptr %alloca_91, i32 0
%call_306 = call i32 @thrd_create(i32 4)
%Mul_308 = mul i32 %call_306, 3
%SDiv_309 = sdiv i32 %Mul_308, 5
%Add_311 = add i32 %Mul_308, 3
%SDiv_312 = sdiv i32 %Add_311, 5
br label %cond0_inline1
cond0_inline1:
%phi_238 = phi i32 [%SDiv_309, %entry_inline0], [%Add_267, %body1_inline4]
%icmp_314 = icmp slt i32 %phi_238, %SDiv_312
br i1 %icmp_314, label %body1_inline4, label %final2_split5
body1_inline4:
%getelementptr_272 = getelementptr [3 x float], ptr %getelementptr_303, i32 0, i32 %phi_238
%getelementptr_273 = getelementptr [3 x float], ptr %getelementptr_299, i32 0, i32 %phi_238
%load_248 = load float, ptr %getelementptr_272
%load_249 = load float, ptr %getelementptr_273
%FSub_250 = fsub float %load_248, %load_249
%getelementptr_274 = getelementptr [6 x float], ptr %getelementptr_305, i32 0, i32 %phi_238
store float %FSub_250, ptr %getelementptr_274
%getelementptr_275 = getelementptr [3 x float], ptr %getelementptr_297, i32 0, i32 %phi_238
%getelementptr_276 = getelementptr [3 x float], ptr %getelementptr_302, i32 0, i32 %phi_238
%load_255 = load float, ptr %getelementptr_275
%load_256 = load float, ptr %getelementptr_276
%FSub_257 = fsub float %load_255, %load_256
%getelementptr_277 = getelementptr [3 x float], ptr %getelementptr_301, i32 0, i32 %phi_238
store float %FSub_257, ptr %getelementptr_277
%getelementptr_278 = getelementptr [3 x float], ptr %getelementptr_304, i32 0, i32 %phi_238
%getelementptr_279 = getelementptr [3 x float], ptr %getelementptr_298, i32 0, i32 %phi_238
%load_262 = load float, ptr %getelementptr_278
%load_263 = load float, ptr %getelementptr_279
%FSub_264 = fsub float %load_262, %load_263
%getelementptr_280 = getelementptr [3 x float], ptr %getelementptr_300, i32 0, i32 %phi_238
store float %FSub_264, ptr %getelementptr_280
%Add_267 = add i32 %phi_238, 1
br label %cond0_inline1
final2_split5:
call void @thrd_join()
%getelementptr_316 = getelementptr [6 x float], ptr %alloca_91, i32 0
%call_317 = call i32 @thrd_create(i32 4)
%Mul_319 = mul i32 %call_317, 3
%SDiv_320 = sdiv i32 %Mul_319, 5
%Add_322 = add i32 %Mul_319, 3
%SDiv_323 = sdiv i32 %Add_322, 5
br label %cond3
cond3:
%phi_218 = phi i32 [%SDiv_320, %final2_split5], [%Add_161, %body4]
%icmp_325 = icmp slt i32 %phi_218, %SDiv_323
br i1 %icmp_325, label %body4, label %final5
body4:
%getelementptr_154 = getelementptr [6 x float], ptr %getelementptr_316, i32 0, i32 %phi_218
%load_155 = load float, ptr %getelementptr_154
%fptoi_156 = fptosi float %load_155 to i32
call void @putint(i32 %fptoi_156)
%Add_161 = add i32 %phi_218, 1
br label %cond3
final5:
call void @thrd_join()
call void @putch(i32 10)
%getelementptr_327 = getelementptr [3 x float], ptr %alloca_92, i32 0
%call_328 = call i32 @thrd_create(i32 4)
%Mul_330 = mul i32 %call_328, 3
%SDiv_331 = sdiv i32 %Mul_330, 5
%Add_333 = add i32 %Mul_330, 3
%SDiv_334 = sdiv i32 %Add_333, 5
br label %cond6
cond6:
%phi_219 = phi i32 [%SDiv_331, %final5], [%Add_183, %body7]
%icmp_336 = icmp slt i32 %phi_219, %SDiv_334
br i1 %icmp_336, label %body7, label %final8
body7:
%getelementptr_176 = getelementptr [3 x float], ptr %getelementptr_327, i32 0, i32 %phi_219
%load_177 = load float, ptr %getelementptr_176
%fptoi_178 = fptosi float %load_177 to i32
call void @putint(i32 %fptoi_178)
%Add_183 = add i32 %phi_219, 1
br label %cond6
final8:
call void @thrd_join()
call void @putch(i32 10)
%getelementptr_338 = getelementptr [3 x float], ptr %alloca_93, i32 0
%call_339 = call i32 @thrd_create(i32 4)
%Mul_341 = mul i32 %call_339, 3
%SDiv_342 = sdiv i32 %Mul_341, 5
%Add_344 = add i32 %Mul_341, 3
%SDiv_345 = sdiv i32 %Add_344, 5
br label %cond9
cond9:
%phi_220 = phi i32 [%SDiv_342, %final8], [%Add_205, %body10]
%icmp_347 = icmp slt i32 %phi_220, %SDiv_345
br i1 %icmp_347, label %body10, label %exit
body10:
%getelementptr_198 = getelementptr [3 x float], ptr %getelementptr_338, i32 0, i32 %phi_220
%load_199 = load float, ptr %getelementptr_198
%fptoi_200 = fptosi float %load_199 to i32
call void @putint(i32 %fptoi_200)
%Add_205 = add i32 %phi_220, 1
br label %cond9
exit:
call void @thrd_join()
call void @putch(i32 10)
ret i32 0
}

View File

@ -0,0 +1,245 @@
@M = dso_local global i32 0
@L = dso_local global i32 0
@N = dso_local global i32 0
declare i32 @getint()
declare i32 @getch()
declare float @getfloat()
declare void @putint(i32 %p0)
declare void @putch(i32 %p0)
declare void @putfloat(float %p0)
declare i32 @getarray(i32* %p0)
declare i32 @getfarray(float* %p0)
declare void @putarray(i32 %p0, i32* %p1)
declare void @putfarray(i32 %p0, float* %p1)
declare void @_sysy_starttime(i32 %p0)
declare void @_sysy_stoptime(i32 %p0)
declare i32 @thrd_create(i32 %p0)
declare void @thrd_join()
declare void @putf()
declare void @llvm.memset.p0.i32(i32* %p0, i8 %p1, i32 %p2, i1 %p3)
define i32 @main() {
entry:
store i32 3, ptr @N
store i32 3, ptr @M
store i32 3, ptr @L
%alloca_269 = alloca [3 x float]
%alloca_270 = alloca [3 x float]
%alloca_271 = alloca [3 x float]
%alloca_272 = alloca [3 x float]
%alloca_273 = alloca [3 x float]
%alloca_274 = alloca [3 x float]
%alloca_275 = alloca [6 x float]
%alloca_276 = alloca [3 x float]
%alloca_277 = alloca [3 x float]
%getelementptr_663 = getelementptr [3 x float], ptr %alloca_269, i32 0
%getelementptr_664 = getelementptr [3 x float], ptr %alloca_271, i32 0
%getelementptr_665 = getelementptr [3 x float], ptr %alloca_274, i32 0
%getelementptr_666 = getelementptr [3 x float], ptr %alloca_273, i32 0
%getelementptr_667 = getelementptr [3 x float], ptr %alloca_272, i32 0
%getelementptr_668 = getelementptr [3 x float], ptr %alloca_270, i32 0
%call_669 = call i32 @thrd_create(i32 4)
%Mul_671 = mul i32 %call_669, 3
%SDiv_672 = sdiv i32 %Mul_671, 5
%Add_674 = add i32 %Mul_671, 3
%SDiv_675 = sdiv i32 %Add_674, 5
br label %cond0
cond0:
%phi_404 = phi i32 [%SDiv_672, %entry], [%Add_315, %body1]
%icmp_677 = icmp slt i32 %phi_404, %SDiv_675
br i1 %icmp_677, label %body1, label %final2_split2
body1:
%getelementptr_285 = getelementptr [3 x float], ptr %getelementptr_663, i32 0, i32 %phi_404
%itofp_287 = sitofp i32 %phi_404 to float
store float %itofp_287, ptr %getelementptr_285
%getelementptr_290 = getelementptr [3 x float], ptr %getelementptr_668, i32 0, i32 %phi_404
store float %itofp_287, ptr %getelementptr_290
%getelementptr_295 = getelementptr [3 x float], ptr %getelementptr_664, i32 0, i32 %phi_404
store float %itofp_287, ptr %getelementptr_295
%getelementptr_300 = getelementptr [3 x float], ptr %getelementptr_667, i32 0, i32 %phi_404
store float %itofp_287, ptr %getelementptr_300
%getelementptr_305 = getelementptr [3 x float], ptr %getelementptr_666, i32 0, i32 %phi_404
store float %itofp_287, ptr %getelementptr_305
%getelementptr_310 = getelementptr [3 x float], ptr %getelementptr_665, i32 0, i32 %phi_404
store float %itofp_287, ptr %getelementptr_310
%Add_315 = add i32 %phi_404, 1
br label %cond0
final2_split2:
call void @thrd_join()
%getelementptr_600 = getelementptr [3 x float], ptr %alloca_269, i32 0, i32 0
%getelementptr_601 = getelementptr [3 x float], ptr %alloca_272, i32 0, i32 0
%load_425 = load float, ptr %getelementptr_600
%load_426 = load float, ptr %getelementptr_601
%FMul_427 = fmul float %load_425, %load_426
%getelementptr_602 = getelementptr [3 x float], ptr %alloca_269, i32 0, i32 1
%getelementptr_603 = getelementptr [3 x float], ptr %alloca_273, i32 0, i32 0
%load_430 = load float, ptr %getelementptr_602
%load_431 = load float, ptr %getelementptr_603
%FMul_432 = fmul float %load_430, %load_431
%FAdd_433 = fadd float %FMul_427, %FMul_432
%getelementptr_604 = getelementptr [3 x float], ptr %alloca_269, i32 0, i32 2
%getelementptr_605 = getelementptr [3 x float], ptr %alloca_274, i32 0, i32 0
%load_436 = load float, ptr %getelementptr_604
%load_437 = load float, ptr %getelementptr_605
%FMul_438 = fmul float %load_436, %load_437
%FAdd_439 = fadd float %FAdd_433, %FMul_438
%getelementptr_606 = getelementptr [6 x float], ptr %alloca_275, i32 0, i32 0
store float %FAdd_439, ptr %getelementptr_606
%getelementptr_608 = getelementptr [3 x float], ptr %alloca_272, i32 0, i32 1
%load_445 = load float, ptr %getelementptr_608
%FMul_446 = fmul float %load_425, %load_445
%getelementptr_610 = getelementptr [3 x float], ptr %alloca_273, i32 0, i32 1
%load_450 = load float, ptr %getelementptr_610
%FMul_451 = fmul float %load_430, %load_450
%FAdd_452 = fadd float %FMul_446, %FMul_451
%getelementptr_612 = getelementptr [3 x float], ptr %alloca_274, i32 0, i32 1
%load_456 = load float, ptr %getelementptr_612
%FMul_457 = fmul float %load_436, %load_456
%FAdd_458 = fadd float %FAdd_452, %FMul_457
%getelementptr_613 = getelementptr [6 x float], ptr %alloca_275, i32 0, i32 1
store float %FAdd_458, ptr %getelementptr_613
%getelementptr_615 = getelementptr [3 x float], ptr %alloca_272, i32 0, i32 2
%load_464 = load float, ptr %getelementptr_615
%FMul_465 = fmul float %load_425, %load_464
%getelementptr_617 = getelementptr [3 x float], ptr %alloca_273, i32 0, i32 2
%load_469 = load float, ptr %getelementptr_617
%FMul_470 = fmul float %load_430, %load_469
%FAdd_471 = fadd float %FMul_465, %FMul_470
%getelementptr_619 = getelementptr [3 x float], ptr %alloca_274, i32 0, i32 2
%load_475 = load float, ptr %getelementptr_619
%FMul_476 = fmul float %load_436, %load_475
%FAdd_477 = fadd float %FAdd_471, %FMul_476
%getelementptr_620 = getelementptr [6 x float], ptr %alloca_275, i32 0, i32 2
store float %FAdd_477, ptr %getelementptr_620
%getelementptr_621 = getelementptr [3 x float], ptr %alloca_270, i32 0, i32 0
%load_482 = load float, ptr %getelementptr_621
%FMul_484 = fmul float %load_482, %load_426
%getelementptr_623 = getelementptr [3 x float], ptr %alloca_270, i32 0, i32 1
%load_487 = load float, ptr %getelementptr_623
%FMul_489 = fmul float %load_487, %load_431
%FAdd_490 = fadd float %FMul_484, %FMul_489
%getelementptr_625 = getelementptr [3 x float], ptr %alloca_270, i32 0, i32 2
%load_493 = load float, ptr %getelementptr_625
%FMul_495 = fmul float %load_493, %load_437
%FAdd_496 = fadd float %FAdd_490, %FMul_495
%getelementptr_627 = getelementptr [3 x float], ptr %alloca_276, i32 0, i32 0
store float %FAdd_496, ptr %getelementptr_627
%FMul_503 = fmul float %load_482, %load_445
%FMul_508 = fmul float %load_487, %load_450
%FAdd_509 = fadd float %FMul_503, %FMul_508
%FMul_514 = fmul float %load_493, %load_456
%FAdd_515 = fadd float %FAdd_509, %FMul_514
%getelementptr_634 = getelementptr [3 x float], ptr %alloca_276, i32 0, i32 1
store float %FAdd_515, ptr %getelementptr_634
%FMul_522 = fmul float %load_482, %load_464
%FMul_527 = fmul float %load_487, %load_469
%FAdd_528 = fadd float %FMul_522, %FMul_527
%FMul_533 = fmul float %load_493, %load_475
%FAdd_534 = fadd float %FAdd_528, %FMul_533
%getelementptr_641 = getelementptr [3 x float], ptr %alloca_276, i32 0, i32 2
store float %FAdd_534, ptr %getelementptr_641
%getelementptr_642 = getelementptr [3 x float], ptr %alloca_271, i32 0, i32 0
%load_539 = load float, ptr %getelementptr_642
%FMul_541 = fmul float %load_539, %load_426
%getelementptr_644 = getelementptr [3 x float], ptr %alloca_271, i32 0, i32 1
%load_544 = load float, ptr %getelementptr_644
%FMul_546 = fmul float %load_544, %load_431
%FAdd_547 = fadd float %FMul_541, %FMul_546
%getelementptr_646 = getelementptr [3 x float], ptr %alloca_271, i32 0, i32 2
%load_550 = load float, ptr %getelementptr_646
%FMul_552 = fmul float %load_550, %load_437
%FAdd_553 = fadd float %FAdd_547, %FMul_552
%getelementptr_648 = getelementptr [3 x float], ptr %alloca_277, i32 0, i32 0
store float %FAdd_553, ptr %getelementptr_648
%FMul_560 = fmul float %load_539, %load_445
%FMul_565 = fmul float %load_544, %load_450
%FAdd_566 = fadd float %FMul_560, %FMul_565
%FMul_571 = fmul float %load_550, %load_456
%FAdd_572 = fadd float %FAdd_566, %FMul_571
%getelementptr_655 = getelementptr [3 x float], ptr %alloca_277, i32 0, i32 1
store float %FAdd_572, ptr %getelementptr_655
%FMul_579 = fmul float %load_539, %load_464
%FMul_584 = fmul float %load_544, %load_469
%FAdd_585 = fadd float %FMul_579, %FMul_584
%FMul_590 = fmul float %load_550, %load_475
%FAdd_591 = fadd float %FAdd_585, %FMul_590
%getelementptr_662 = getelementptr [3 x float], ptr %alloca_277, i32 0, i32 2
store float %FAdd_591, ptr %getelementptr_662
%getelementptr_679 = getelementptr [6 x float], ptr %alloca_275, i32 0
%call_680 = call i32 @thrd_create(i32 4)
%Mul_682 = mul i32 %call_680, 3
%SDiv_683 = sdiv i32 %Mul_682, 5
%Add_685 = add i32 %Mul_682, 3
%SDiv_686 = sdiv i32 %Add_685, 5
br label %cond3
cond3:
%phi_405 = phi i32 [%SDiv_683, %final2_split2], [%Add_346, %body4]
%icmp_688 = icmp slt i32 %phi_405, %SDiv_686
br i1 %icmp_688, label %body4, label %final5
body4:
%getelementptr_339 = getelementptr [6 x float], ptr %getelementptr_679, i32 0, i32 %phi_405
%load_340 = load float, ptr %getelementptr_339
%fptoi_341 = fptosi float %load_340 to i32
call void @putint(i32 %fptoi_341)
%Add_346 = add i32 %phi_405, 1
br label %cond3
final5:
call void @thrd_join()
call void @putch(i32 10)
%getelementptr_690 = getelementptr [3 x float], ptr %alloca_276, i32 0
%call_691 = call i32 @thrd_create(i32 4)
%Mul_693 = mul i32 %call_691, 3
%SDiv_694 = sdiv i32 %Mul_693, 5
%Add_696 = add i32 %Mul_693, 3
%SDiv_697 = sdiv i32 %Add_696, 5
br label %cond6
cond6:
%phi_406 = phi i32 [%SDiv_694, %final5], [%Add_369, %body7]
%icmp_699 = icmp slt i32 %phi_406, %SDiv_697
br i1 %icmp_699, label %body7, label %final8
body7:
%getelementptr_362 = getelementptr [3 x float], ptr %getelementptr_690, i32 0, i32 %phi_406
%load_363 = load float, ptr %getelementptr_362
%fptoi_364 = fptosi float %load_363 to i32
call void @putint(i32 %fptoi_364)
%Add_369 = add i32 %phi_406, 1
br label %cond6
final8:
call void @thrd_join()
call void @putch(i32 10)
%getelementptr_701 = getelementptr [3 x float], ptr %alloca_277, i32 0
%call_702 = call i32 @thrd_create(i32 4)
%Mul_704 = mul i32 %call_702, 3
%SDiv_705 = sdiv i32 %Mul_704, 5
%Add_707 = add i32 %Mul_704, 3
%SDiv_708 = sdiv i32 %Add_707, 5
br label %cond9
cond9:
%phi_407 = phi i32 [%SDiv_705, %final8], [%Add_392, %body10]
%icmp_710 = icmp slt i32 %phi_407, %SDiv_708
br i1 %icmp_710, label %body10, label %exit
body10:
%getelementptr_385 = getelementptr [3 x float], ptr %getelementptr_701, i32 0, i32 %phi_407
%load_386 = load float, ptr %getelementptr_385
%fptoi_387 = fptosi float %load_386 to i32
call void @putint(i32 %fptoi_387)
%Add_392 = add i32 %phi_407, 1
br label %cond9
exit:
call void @thrd_join()
call void @putch(i32 10)
ret i32 0
}

View File

@ -0,0 +1,182 @@
@M = dso_local global i32 0
@L = dso_local global i32 0
@N = dso_local global i32 0
declare i32 @getint()
declare i32 @getch()
declare float @getfloat()
declare void @putint(i32 %p0)
declare void @putch(i32 %p0)
declare void @putfloat(float %p0)
declare i32 @getarray(i32* %p0)
declare i32 @getfarray(float* %p0)
declare void @putarray(i32 %p0, i32* %p1)
declare void @putfarray(i32 %p0, float* %p1)
declare void @_sysy_starttime(i32 %p0)
declare void @_sysy_stoptime(i32 %p0)
declare i32 @thrd_create(i32 %p0)
declare void @thrd_join()
declare void @putf()
declare void @llvm.memset.p0.i32(i32* %p0, i8 %p1, i32 %p2, i1 %p3)
define i32 @main() {
entry:
store i32 3, ptr @N
store i32 3, ptr @M
store i32 3, ptr @L
%alloca_89 = alloca [3 x float]
%alloca_90 = alloca [3 x float]
%alloca_91 = alloca [3 x float]
%alloca_92 = alloca [3 x float]
%alloca_93 = alloca [3 x float]
%alloca_94 = alloca [3 x float]
%alloca_95 = alloca [6 x float]
%alloca_96 = alloca [3 x float]
%alloca_97 = alloca [3 x float]
%getelementptr_303 = getelementptr [3 x float], ptr %alloca_94, i32 0
%getelementptr_304 = getelementptr [3 x float], ptr %alloca_90, i32 0
%getelementptr_305 = getelementptr [3 x float], ptr %alloca_91, i32 0
%getelementptr_306 = getelementptr [3 x float], ptr %alloca_89, i32 0
%getelementptr_307 = getelementptr [3 x float], ptr %alloca_92, i32 0
%getelementptr_308 = getelementptr [3 x float], ptr %alloca_93, i32 0
%call_309 = call i32 @thrd_create(i32 4)
%Mul_311 = mul i32 %call_309, 3
%SDiv_312 = sdiv i32 %Mul_311, 5
%Add_314 = add i32 %Mul_311, 3
%SDiv_315 = sdiv i32 %Add_314, 5
br label %cond0
cond0:
%phi_224 = phi i32 [%SDiv_312, %entry], [%Add_135, %body1]
%icmp_317 = icmp slt i32 %phi_224, %SDiv_315
br i1 %icmp_317, label %body1, label %final2_split2
body1:
%getelementptr_105 = getelementptr [3 x float], ptr %getelementptr_306, i32 0, i32 %phi_224
%itofp_107 = sitofp i32 %phi_224 to float
store float %itofp_107, ptr %getelementptr_105
%getelementptr_110 = getelementptr [3 x float], ptr %getelementptr_304, i32 0, i32 %phi_224
store float %itofp_107, ptr %getelementptr_110
%getelementptr_115 = getelementptr [3 x float], ptr %getelementptr_305, i32 0, i32 %phi_224
store float %itofp_107, ptr %getelementptr_115
%getelementptr_120 = getelementptr [3 x float], ptr %getelementptr_307, i32 0, i32 %phi_224
store float %itofp_107, ptr %getelementptr_120
%getelementptr_125 = getelementptr [3 x float], ptr %getelementptr_308, i32 0, i32 %phi_224
store float %itofp_107, ptr %getelementptr_125
%getelementptr_130 = getelementptr [3 x float], ptr %getelementptr_303, i32 0, i32 %phi_224
store float %itofp_107, ptr %getelementptr_130
%Add_135 = add i32 %phi_224, 1
br label %cond0
final2_split2:
call void @thrd_join()
%getelementptr_285 = getelementptr [3 x float], ptr %alloca_91, i32 0, i32 1
%getelementptr_286 = getelementptr [3 x float], ptr %alloca_96, i32 0, i32 2
%load_245 = load float, ptr %getelementptr_285
store float %load_245, ptr %getelementptr_286
%getelementptr_287 = getelementptr [3 x float], ptr %alloca_90, i32 0, i32 2
%getelementptr_288 = getelementptr [3 x float], ptr %alloca_97, i32 0, i32 1
%load_249 = load float, ptr %getelementptr_287
store float %load_249, ptr %getelementptr_288
%getelementptr_289 = getelementptr [3 x float], ptr %alloca_90, i32 0, i32 0
%getelementptr_290 = getelementptr [6 x float], ptr %alloca_95, i32 0, i32 1
%load_253 = load float, ptr %getelementptr_289
store float %load_253, ptr %getelementptr_290
%getelementptr_291 = getelementptr [3 x float], ptr %alloca_91, i32 0, i32 0
%getelementptr_292 = getelementptr [6 x float], ptr %alloca_95, i32 0, i32 2
%load_257 = load float, ptr %getelementptr_291
store float %load_257, ptr %getelementptr_292
%getelementptr_293 = getelementptr [3 x float], ptr %alloca_89, i32 0, i32 1
%getelementptr_294 = getelementptr [3 x float], ptr %alloca_96, i32 0, i32 0
%load_261 = load float, ptr %getelementptr_293
store float %load_261, ptr %getelementptr_294
%getelementptr_295 = getelementptr [3 x float], ptr %alloca_89, i32 0, i32 2
%getelementptr_296 = getelementptr [3 x float], ptr %alloca_97, i32 0, i32 0
%load_265 = load float, ptr %getelementptr_295
store float %load_265, ptr %getelementptr_296
%getelementptr_297 = getelementptr [3 x float], ptr %alloca_90, i32 0, i32 1
%getelementptr_298 = getelementptr [3 x float], ptr %alloca_96, i32 0, i32 1
%load_269 = load float, ptr %getelementptr_297
store float %load_269, ptr %getelementptr_298
%getelementptr_299 = getelementptr [3 x float], ptr %alloca_91, i32 0, i32 2
%getelementptr_300 = getelementptr [3 x float], ptr %alloca_97, i32 0, i32 2
%load_273 = load float, ptr %getelementptr_299
store float %load_273, ptr %getelementptr_300
%getelementptr_301 = getelementptr [3 x float], ptr %alloca_89, i32 0, i32 0
%getelementptr_302 = getelementptr [6 x float], ptr %alloca_95, i32 0, i32 0
%load_277 = load float, ptr %getelementptr_301
store float %load_277, ptr %getelementptr_302
%getelementptr_319 = getelementptr [6 x float], ptr %alloca_95, i32 0
%call_320 = call i32 @thrd_create(i32 4)
%Mul_322 = mul i32 %call_320, 3
%SDiv_323 = sdiv i32 %Mul_322, 5
%Add_325 = add i32 %Mul_322, 3
%SDiv_326 = sdiv i32 %Add_325, 5
br label %cond3
cond3:
%phi_225 = phi i32 [%SDiv_323, %final2_split2], [%Add_166, %body4]
%icmp_328 = icmp slt i32 %phi_225, %SDiv_326
br i1 %icmp_328, label %body4, label %final5
body4:
%getelementptr_159 = getelementptr [6 x float], ptr %getelementptr_319, i32 0, i32 %phi_225
%load_160 = load float, ptr %getelementptr_159
%fptoi_161 = fptosi float %load_160 to i32
call void @putint(i32 %fptoi_161)
%Add_166 = add i32 %phi_225, 1
br label %cond3
final5:
call void @thrd_join()
call void @putch(i32 10)
%getelementptr_330 = getelementptr [3 x float], ptr %alloca_96, i32 0
%call_331 = call i32 @thrd_create(i32 4)
%Mul_333 = mul i32 %call_331, 3
%SDiv_334 = sdiv i32 %Mul_333, 5
%Add_336 = add i32 %Mul_333, 3
%SDiv_337 = sdiv i32 %Add_336, 5
br label %cond6
cond6:
%phi_226 = phi i32 [%SDiv_334, %final5], [%Add_189, %body7]
%icmp_339 = icmp slt i32 %phi_226, %SDiv_337
br i1 %icmp_339, label %body7, label %final8
body7:
%getelementptr_182 = getelementptr [3 x float], ptr %getelementptr_330, i32 0, i32 %phi_226
%load_183 = load float, ptr %getelementptr_182
%fptoi_184 = fptosi float %load_183 to i32
call void @putint(i32 %fptoi_184)
%Add_189 = add i32 %phi_226, 1
br label %cond6
final8:
call void @thrd_join()
call void @putch(i32 10)
%getelementptr_341 = getelementptr [3 x float], ptr %alloca_97, i32 0
%call_342 = call i32 @thrd_create(i32 4)
%Mul_344 = mul i32 %call_342, 3
%SDiv_345 = sdiv i32 %Mul_344, 5
%Add_347 = add i32 %Mul_344, 3
%SDiv_348 = sdiv i32 %Add_347, 5
br label %cond9
cond9:
%phi_227 = phi i32 [%SDiv_345, %final8], [%Add_212, %body10]
%icmp_350 = icmp slt i32 %phi_227, %SDiv_348
br i1 %icmp_350, label %body10, label %exit
body10:
%getelementptr_205 = getelementptr [3 x float], ptr %getelementptr_341, i32 0, i32 %phi_227
%load_206 = load float, ptr %getelementptr_205
%fptoi_207 = fptosi float %load_206 to i32
call void @putint(i32 %fptoi_207)
%Add_212 = add i32 %phi_227, 1
br label %cond9
exit:
call void @thrd_join()
call void @putch(i32 10)
ret i32 0
}

109
quick_test/log/3.log Normal file
View File

@ -0,0 +1,109 @@
stdout:
## Pass mem2reg [CHANGED]
Time elapsed = 109 µs
## Pass func_inline
Time elapsed = 4 µs
## Pass symbolic_eval
Time elapsed = 17 µs
## Pass load_elim
Time elapsed = 9 µs
## Pass store_elim [CHANGED]
Time elapsed = 12 µs
## Pass dead_code_elim
Time elapsed = 6 µs
## Pass symbolic_eval
Time elapsed = 12 µs
## Pass load_elim
Time elapsed = 6 µs
## Pass store_elim
Time elapsed = 6 µs
## Pass dead_code_elim
Time elapsed = 4 µs
## Pass redundance_elim
Time elapsed = 35 µs
## Pass symbolic_eval
Time elapsed = 12 µs
## Pass block_fuse [CHANGED]
Time elapsed = 8 µs
## Pass func_inline
Time elapsed = 1 µs
## Pass symbolic_eval
Time elapsed = 9 µs
## Pass load_elim
Time elapsed = 6 µs
## Pass store_elim
Time elapsed = 7 µs
## Pass dead_code_elim
Time elapsed = 4 µs
## Pass redundance_elim
Time elapsed = 25 µs
## Pass symbolic_eval
Time elapsed = 11 µs
## Pass block_fuse
Time elapsed = 3 µs
[INFO] loop entry is made candidate Candidate {
indvar: %phi_30 = phi i32 [0, %entry], [%Add_14, %body1],
exit: br i1 %icmp_24, label %body1, label %exit,
init_val: 0,
init_bb: entry,
exit_val: 8,
exit_bb: exit,
}!
## Pass sink_code [CHANGED]
Time elapsed = 48 µs
## Pass symbolic_eval [CHANGED]
Time elapsed = 33 µs
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us

101
quick_test/log/6.log Normal file
View File

@ -0,0 +1,101 @@
stdout:
## Pass mem2reg [CHANGED]
Time elapsed = 72 µs
## Pass func_inline
Time elapsed = 5 µs
## Pass symbolic_eval
Time elapsed = 9 µs
## Pass load_elim
Time elapsed = 8 µs
## Pass store_elim [CHANGED]
Time elapsed = 12 µs
## Pass dead_code_elim
Time elapsed = 4 µs
## Pass symbolic_eval
Time elapsed = 5 µs
## Pass load_elim
Time elapsed = 5 µs
## Pass store_elim
Time elapsed = 5 µs
## Pass dead_code_elim
Time elapsed = 2 µs
## Pass redundance_elim [CHANGED]
Time elapsed = 42 µs
## Pass symbolic_eval
Time elapsed = 5 µs
## Pass block_fuse [CHANGED]
Time elapsed = 6 µs
## Pass func_inline
Time elapsed = 1 µs
## Pass symbolic_eval
Time elapsed = 3 µs
## Pass load_elim
Time elapsed = 5 µs
## Pass store_elim
Time elapsed = 5 µs
## Pass dead_code_elim
Time elapsed = 2 µs
## Pass redundance_elim
Time elapsed = 13 µs
## Pass symbolic_eval
Time elapsed = 3 µs
## Pass block_fuse
Time elapsed = 1 µs
## Pass sink_code [CHANGED]
Time elapsed = 16 µs
## Pass symbolic_eval
Time elapsed = 2 µs
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us

101
quick_test/log/7.log Normal file
View File

@ -0,0 +1,101 @@
stdout:
## Pass mem2reg [CHANGED]
Time elapsed = 72 µs
## Pass func_inline
Time elapsed = 4 µs
## Pass symbolic_eval
Time elapsed = 9 µs
## Pass load_elim
Time elapsed = 13 µs
## Pass store_elim [CHANGED]
Time elapsed = 13 µs
## Pass dead_code_elim
Time elapsed = 5 µs
## Pass symbolic_eval
Time elapsed = 5 µs
## Pass load_elim
Time elapsed = 8 µs
## Pass store_elim
Time elapsed = 6 µs
## Pass dead_code_elim
Time elapsed = 3 µs
## Pass redundance_elim [CHANGED]
Time elapsed = 58 µs
## Pass symbolic_eval
Time elapsed = 6 µs
## Pass block_fuse [CHANGED]
Time elapsed = 7 µs
## Pass func_inline
Time elapsed = 2 µs
## Pass symbolic_eval
Time elapsed = 3 µs
## Pass load_elim
Time elapsed = 8 µs
## Pass store_elim
Time elapsed = 7 µs
## Pass dead_code_elim
Time elapsed = 3 µs
## Pass redundance_elim
Time elapsed = 23 µs
## Pass symbolic_eval
Time elapsed = 4 µs
## Pass block_fuse
Time elapsed = 1 µs
## Pass sink_code [CHANGED]
Time elapsed = 18 µs
## Pass symbolic_eval
Time elapsed = 3 µs
stderr:
stdout:
stderr:
TOTAL: 0H-0M-0S-0us

View File

@ -0,0 +1,110 @@
stdout:
## Pass mem2reg [CHANGED]
Time elapsed = 182 µs
## Pass func_inline
Time elapsed = 4 µs
## Pass symbolic_eval
Time elapsed = 31 µs
## Pass load_elim [CHANGED]
Time elapsed = 28 µs
## Pass store_elim [CHANGED]
Time elapsed = 27 µs
## Pass dead_code_elim [CHANGED]
Time elapsed = 12 µs
## Pass symbolic_eval
Time elapsed = 25 µs
## Pass load_elim
Time elapsed = 19 µs
## Pass store_elim
Time elapsed = 22 µs
## Pass dead_code_elim
Time elapsed = 9 µs
## Pass redundance_elim [CHANGED]
Time elapsed = 133 µs
## Pass symbolic_eval
Time elapsed = 27 µs
## Pass block_fuse [CHANGED]
Time elapsed = 11 µs
## Pass func_inline
Time elapsed = 2 µs
## Pass symbolic_eval
Time elapsed = 20 µs
## Pass load_elim
Time elapsed = 18 µs
## Pass store_elim
Time elapsed = 23 µs
## Pass dead_code_elim
Time elapsed = 8 µs
## Pass redundance_elim
Time elapsed = 88 µs
## Pass symbolic_eval
Time elapsed = 28 µs
## Pass block_fuse
Time elapsed = 6 µs
[INFO] loop entry fails because %load_73 = load i32, ptr @M is not calculated before loop
[INFO] loop entry does not have indvar
[INFO] loop entry is made candidate Candidate {
indvar: %phi_142 = phi i32 [0, %entry], [%Add_132, %body1],
exit: br i1 %icmp_137, label %body1, label %exit,
init_val: 0,
init_bb: entry,
exit_val: 3,
exit_bb: exit,
}!
## Pass sink_code [CHANGED]
Time elapsed = 92 µs
## Pass symbolic_eval [CHANGED]
Time elapsed = 43 µs
stderr:
stdout:
stderr:

View File

@ -0,0 +1,140 @@
stdout:
## Pass mem2reg [CHANGED]
Time elapsed = 322 µs
## Pass func_inline [CHANGED]
Time elapsed = 106 µs
## Pass symbolic_eval [CHANGED]
Time elapsed = 73 µs
## Pass load_elim
Time elapsed = 25 µs
## Pass store_elim [CHANGED]
Time elapsed = 68 µs
## Pass dead_code_elim
Time elapsed = 23 µs
## Pass symbolic_eval
Time elapsed = 53 µs
## Pass load_elim
Time elapsed = 21 µs
## Pass store_elim
Time elapsed = 43 µs
## Pass dead_code_elim
Time elapsed = 21 µs
## Pass redundance_elim [CHANGED]
Time elapsed = 272 µs
## Pass symbolic_eval
Time elapsed = 54 µs
## Pass block_fuse [CHANGED]
Time elapsed = 31 µs
## Pass func_inline
Time elapsed = 6 µs
## Pass symbolic_eval
Time elapsed = 41 µs
## Pass load_elim
Time elapsed = 19 µs
## Pass store_elim
Time elapsed = 41 µs
## Pass dead_code_elim
Time elapsed = 20 µs
## Pass redundance_elim
Time elapsed = 151 µs
## Pass symbolic_eval
Time elapsed = 44 µs
## Pass block_fuse
Time elapsed = 12 µs
[INFO] loop entry is made candidate Candidate {
indvar: %phi_217 = phi i32 [0, %entry], [%Add_131, %body1],
exit: br i1 %icmp_135, label %body1, label %entry_inline0,
init_val: 0,
init_bb: entry,
exit_val: 3,
exit_bb: entry_inline0,
}!
[INFO] loop entry_inline0 is made candidate Candidate {
indvar: %phi_238 = phi i32 [0, %entry_inline0], [%Add_267, %body1_inline4],
exit: br i1 %icmp_239, label %body1_inline4, label %final2_split5,
init_val: 0,
init_bb: entry_inline0,
exit_val: 3,
exit_bb: final2_split5,
}!
[INFO] loop final2_split5 is made candidate Candidate {
indvar: %phi_218 = phi i32 [0, %final2_split5], [%Add_161, %body4],
exit: br i1 %icmp_165, label %body4, label %final5,
init_val: 0,
init_bb: final2_split5,
exit_val: 3,
exit_bb: final5,
}!
[INFO] loop final5 is made candidate Candidate {
indvar: %phi_219 = phi i32 [0, %final5], [%Add_183, %body7],
exit: br i1 %icmp_187, label %body7, label %final8,
init_val: 0,
init_bb: final5,
exit_val: 3,
exit_bb: final8,
}!
[INFO] loop final8 is made candidate Candidate {
indvar: %phi_220 = phi i32 [0, %final8], [%Add_205, %body10],
exit: br i1 %icmp_209, label %body10, label %exit,
init_val: 0,
init_bb: final8,
exit_val: 3,
exit_bb: exit,
}!
## Pass sink_code [CHANGED]
Time elapsed = 132 µs
## Pass symbolic_eval [CHANGED]
Time elapsed = 95 µs
stderr:
stdout:
stderr:

View File

@ -0,0 +1,132 @@
stdout:
## Pass mem2reg [CHANGED]
Time elapsed = 346 µs
## Pass func_inline [CHANGED]
Time elapsed = 244 µs
## Pass symbolic_eval [CHANGED]
Time elapsed = 143 µs
## Pass load_elim [CHANGED]
Time elapsed = 85 µs
## Pass store_elim [CHANGED]
Time elapsed = 101 µs
## Pass dead_code_elim
Time elapsed = 28 µs
## Pass symbolic_eval
Time elapsed = 64 µs
## Pass load_elim
Time elapsed = 58 µs
## Pass store_elim
Time elapsed = 66 µs
## Pass dead_code_elim
Time elapsed = 26 µs
## Pass redundance_elim [CHANGED]
Time elapsed = 672 µs
## Pass symbolic_eval
Time elapsed = 58 µs
## Pass block_fuse [CHANGED]
Time elapsed = 35 µs
## Pass func_inline
Time elapsed = 3 µs
## Pass symbolic_eval
Time elapsed = 39 µs
## Pass load_elim
Time elapsed = 32 µs
## Pass store_elim
Time elapsed = 49 µs
## Pass dead_code_elim
Time elapsed = 18 µs
## Pass redundance_elim
Time elapsed = 284 µs
## Pass symbolic_eval
Time elapsed = 43 µs
## Pass block_fuse
Time elapsed = 9 µs
[INFO] loop entry is made candidate Candidate {
indvar: %phi_404 = phi i32 [0, %entry], [%Add_315, %body1],
exit: br i1 %icmp_320, label %body1, label %final2_split2,
init_val: 0,
init_bb: entry,
exit_val: 3,
exit_bb: final2_split2,
}!
[INFO] loop final2_split2 is made candidate Candidate {
indvar: %phi_405 = phi i32 [0, %final2_split2], [%Add_346, %body4],
exit: br i1 %icmp_351, label %body4, label %final5,
init_val: 0,
init_bb: final2_split2,
exit_val: 3,
exit_bb: final5,
}!
[INFO] loop final5 is made candidate Candidate {
indvar: %phi_406 = phi i32 [0, %final5], [%Add_369, %body7],
exit: br i1 %icmp_374, label %body7, label %final8,
init_val: 0,
init_bb: final5,
exit_val: 3,
exit_bb: final8,
}!
[INFO] loop final8 is made candidate Candidate {
indvar: %phi_407 = phi i32 [0, %final8], [%Add_392, %body10],
exit: br i1 %icmp_397, label %body10, label %exit,
init_val: 0,
init_bb: final8,
exit_val: 3,
exit_bb: exit,
}!
## Pass sink_code [CHANGED]
Time elapsed = 134 µs
## Pass symbolic_eval [CHANGED]
Time elapsed = 69 µs
stderr:
stdout:
stderr:

View File

@ -0,0 +1,132 @@
stdout:
## Pass mem2reg [CHANGED]
Time elapsed = 420 µs
## Pass func_inline [CHANGED]
Time elapsed = 150 µs
## Pass symbolic_eval [CHANGED]
Time elapsed = 92 µs
## Pass load_elim [CHANGED]
Time elapsed = 62 µs
## Pass store_elim [CHANGED]
Time elapsed = 79 µs
## Pass dead_code_elim
Time elapsed = 24 µs
## Pass symbolic_eval
Time elapsed = 46 µs
## Pass load_elim
Time elapsed = 30 µs
## Pass store_elim
Time elapsed = 54 µs
## Pass dead_code_elim
Time elapsed = 20 µs
## Pass redundance_elim [CHANGED]
Time elapsed = 235 µs
## Pass symbolic_eval
Time elapsed = 45 µs
## Pass block_fuse [CHANGED]
Time elapsed = 25 µs
## Pass func_inline
Time elapsed = 2 µs
## Pass symbolic_eval
Time elapsed = 30 µs
## Pass load_elim
Time elapsed = 29 µs
## Pass store_elim
Time elapsed = 55 µs
## Pass dead_code_elim
Time elapsed = 17 µs
## Pass redundance_elim
Time elapsed = 166 µs
## Pass symbolic_eval
Time elapsed = 34 µs
## Pass block_fuse
Time elapsed = 9 µs
[INFO] loop entry is made candidate Candidate {
indvar: %phi_224 = phi i32 [0, %entry], [%Add_135, %body1],
exit: br i1 %icmp_140, label %body1, label %final2_split2,
init_val: 0,
init_bb: entry,
exit_val: 3,
exit_bb: final2_split2,
}!
[INFO] loop final2_split2 is made candidate Candidate {
indvar: %phi_225 = phi i32 [0, %final2_split2], [%Add_166, %body4],
exit: br i1 %icmp_171, label %body4, label %final5,
init_val: 0,
init_bb: final2_split2,
exit_val: 3,
exit_bb: final5,
}!
[INFO] loop final5 is made candidate Candidate {
indvar: %phi_226 = phi i32 [0, %final5], [%Add_189, %body7],
exit: br i1 %icmp_194, label %body7, label %final8,
init_val: 0,
init_bb: final5,
exit_val: 3,
exit_bb: final8,
}!
[INFO] loop final8 is made candidate Candidate {
indvar: %phi_227 = phi i32 [0, %final8], [%Add_212, %body10],
exit: br i1 %icmp_217, label %body10, label %exit,
init_val: 0,
init_bb: final8,
exit_val: 3,
exit_bb: exit,
}!
## Pass sink_code [CHANGED]
Time elapsed = 103 µs
## Pass symbolic_eval [CHANGED]
Time elapsed = 70 µs
stderr:
stdout:
stderr:

3
quick_test/output/3.out Normal file
View File

@ -0,0 +1,3 @@
8: 0 0 0 0 0 0 0 0
0

3
quick_test/output/6.out Normal file
View File

@ -0,0 +1,3 @@
8: 22 2 8 10 2 4 0 0
0

4
quick_test/output/7.out Normal file
View File

@ -0,0 +1,4 @@
8: 2 2 8 10 2 4 0 0
8: 4 4 16 20 4 4 0 0
0

View File

@ -0,0 +1,2 @@
ExitStatus(unix_wait_status(139))

View File

@ -0,0 +1,2 @@
ExitStatus(unix_wait_status(139))

View File

@ -0,0 +1,2 @@
ExitStatus(unix_wait_status(139))

View File

@ -0,0 +1,2 @@
ExitStatus(unix_wait_status(139))

17
quick_test/sy/3.sy Normal file
View File

@ -0,0 +1,17 @@
#include "../../lib/thrd.h"
#include "../../lib/sylib.h"
int A[9];
int B[9];
int main()
{
int i = 0;
getarray(A);
while (i < 8)
{
i = i + 1;
B[i] = A[i];
}
putarray(8, B);
return 0;
}

13
quick_test/sy/6.sy Normal file
View File

@ -0,0 +1,13 @@
#include "../../lib/thrd.h"
#include "../../lib/sylib.h"
int A[9] = {1, 1, 4, 5, 1, 4};
int main()
{
A[0] = 11;
int n = thrd_create(4);
A[n] = A[n] * 2;
thrd_join();
putarray(8, A);
return 0;
}

16
quick_test/sy/7.sy Normal file
View File

@ -0,0 +1,16 @@
#include "../../lib/thrd.h"
#include "../../lib/sylib.h"
int A[9] = {1, 1, 4, 5, 1, 4};
int main()
{
int n = thrd_create(4);
A[n] = A[n] * 2;
thrd_join();
putarray(8, A);
int m = thrd_create(4);
A[m] = A[m] * 2;
thrd_join();
putarray(8, A);
return 0;
}

View File

@ -0,0 +1,69 @@
#include "../../lib/sylib.h"
int M;
int L;
int N;
int add(float a0[], float a1[], float a2[], float b0[], float b1[], float b2[], float c0[], float c1[], float c2[])
{
int i;
i = 0;
while (i < M)
{
c0[i] = a0[i] + b0[i];
c1[i] = a1[i] + b1[i];
c2[i] = a2[i] + b2[i];
i = i + 1;
}
return 0;
}
int main()
{
N = 3;
M = 3;
L = 3;
float a0[3], a1[3], a2[3], b0[3], b1[3], b2[3], c0[6], c1[3], c2[3];
int i;
i = 0;
while (i < M)
{
a0[i] = i;
a1[i] = i;
a2[i] = i;
b0[i] = i;
b1[i] = i;
b2[i] = i;
i = i + 1;
}
// i = add(a0, a1, a2, b0, b1, b2, c0, c1, c2);
// int x;
// while(i<N)
// {
// x = c0[i];
// putint(x);
// i=i+1;
// }
// x = 10;
// putch(x);
// i=0;
// while(i<N)
// {
// x = c1[i];
// putint(x);
// i=i+1;
// }
// x = 10;
// putch(x);
// i=0;
// while(i<N)
// {
// x = c2[i];
// putint(x);
// i=i+1;
// }
// x = 10;
// putch(x);
return 0;
}

View File

@ -0,0 +1,73 @@
#include "../../lib/sylib.h"
int N;
int M;
int L;
int sub(float a0[],float a1[], float a2[],float b0[],float b1[],float b2[],float c0[],float c1[],float c2[])
{
int i;
i=0;
while(i<3)
{
c0[i]=a0[i]-b0[i];
c1[i]=a1[i]-b1[i];
c2[i]=a2[i]-b2[i];
i=i+1;
}
return 0;
}
int main()
{
N=3;
M=3;
L=3;
float a0[3], a1[3], a2[3], b0[3], b1[3], b2[3], c0[6], c1[3], c2[3];
int i;
i=0;
while(i<3)
{
a0[i]=i;
a1[i]=i;
a2[i]=i;
b0[i]=i;
b1[i]=i;
b2[i]=i;
i=i+1;
}
i=sub( a0, a1, a2, b0, b1, b2, c0, c1, c2);
int x;
while(i<3)
{
x = c0[i];
putint(x);
i=i+1;
}
x = 10;
i=0;
putch(x);
while(i<3)
{
x = c1[i];
putint(x);
i=i+1;
}
x = 10;
i=0;
putch(x);
while(i<3)
{
x = c2[i];
putint(x);
i=i+1;
}
x =10;
putch(x);
return 0;
}

View File

@ -0,0 +1,75 @@
#include "../../lib/sylib.h"
int M;
int L;
int N;
int mul(float a0[],float a1[], float a2[],float b0[],float b1[],float b2[],float c0[],float c1[],float c2[])
{
int i;
i=0;
c0[0]=a0[0]*b0[0]+a0[1]*b1[0]+a0[2]*b2[0];
c0[1]=a0[0]*b0[1]+a0[1]*b1[1]+a0[2]*b2[1];
c0[2]=a0[0]*b0[2]+a0[1]*b1[2]+a0[2]*b2[2];
c1[0]=a1[0]*b0[0]+a1[1]*b1[0]+a1[2]*b2[0];
c1[1]=a1[0]*b0[1]+a1[1]*b1[1]+a1[2]*b2[1];
c1[2]=a1[0]*b0[2]+a1[1]*b1[2]+a1[2]*b2[2];
c2[0]=a2[0]*b0[0]+a2[1]*b1[0]+a2[2]*b2[0];
c2[1]=a2[0]*b0[1]+a2[1]*b1[1]+a2[2]*b2[1];
c2[2]=a2[0]*b0[2]+a2[1]*b1[2]+a2[2]*b2[2];
return 0;
}
int main()
{
N=3;
M=3;
L=3;
float a0[3], a1[3], a2[3], b0[3], b1[3], b2[3], c0[6], c1[3], c2[3];
int i;
i=0;
while(i<M)
{
a0[i]=i;
a1[i]=i;
a2[i]=i;
b0[i]=i;
b1[i]=i;
b2[i]=i;
i=i+1;
}
i=mul( a0, a1, a2, b0, b1, b2, c0, c1, c2);
int x;
while(i<N)
{
x = c0[i];
putint(x);
i=i+1;
}
x = 10;
i=0;
putch(x);
while(i<N)
{
x = c1[i];
putint(x);
i=i+1;
}
x = 10;
i=0;
putch(x);
while(i<N)
{
x = c2[i];
putint(x);
i=i+1;
}
x = 10;
putch(x);
return 0;
}

View File

@ -0,0 +1,75 @@
#include "../../lib/sylib.h"
int M;
int L;
int N;
int tran(float a0[],float a1[], float a2[],float b0[],float b1[],float b2[],float c0[],float c1[],float c2[])
{
int i;
i=0;
c1[2]=a2[1];
c2[1]=a1[2];
c0[1]=a1[0];
c0[2]=a2[0];
c1[0]=a0[1];
c2[0]=a0[2];
c1[1]=a1[1];
c2[2]=a2[2];
c0[0]=a0[0];
return 0;
}
int main()
{
N=3;
M=3;
L=3;
float a0[3], a1[3], a2[3], b0[3], b1[3], b2[3], c0[6], c1[3], c2[3];
int i;
i=0;
while(i<M)
{
a0[i]=i;
a1[i]=i;
a2[i]=i;
b0[i]=i;
b1[i]=i;
b2[i]=i;
i=i+1;
}
i=tran( a0, a1, a2, b0, b1, b2, c0, c1, c2);
int x;
while(i<N)
{
x = c0[i];
putint(x);
i=i+1;
}
x = 10;
putch(x);
i=0;
while(i<N)
{
x = c1[i];
putint(x);
i=i+1;
}
x = 10;
i=0;
putch(x);
while(i<N)
{
x = c2[i];
putint(x);
i=i+1;
}
x = 10;
putch(x);
return 0;
}