==

mail@pastecode.io avatar
unknown
plain_text
2 months ago
912 B
2
Indexable
Never
"li a0,16;"

"addi %[lw_cnt],%[lw_cnt],1;"



"improved_loop:\n\t"

    "vsetvli t0, a0, e16,m2\n\t"

    "addi %[others_cnt],%[others_cnt],1;"

    

    "vle16.v v0,(%[h]);"

    "addi %[lw_cnt],%[lw_cnt],1;"

    	"sub %[arr_size],%[arr_size],t0;"

    	"addi %[sub_cnt],%[sub_cnt],1;"

    	"slli t0,t0,1;"

    	"addi %[others_cnt],%[others_cnt],1;"

    	

    	"add %[h],%[h],t0;"

    	"addi %[add_cnt],%[add_cnt],1;"

    	

    "vle16.v v4,(%[x]);"

    "addi %[lw_cnt],%[lw_cnt],1;"

    

    	"add %[x],%[x],t0;"

    	"addi %[add_cnt],%[add_cnt],1;"

    	

    "vmul.vv v8,v0,v4;"

    "addi %[mul_cnt],%[mul_cnt],1;"

    

    "vadd.vx v8,v8,%[id];"

    "addi %[add_cnt],%[add_cnt],1;"



    "vse16.v v8,(%[y]);"

    "addi %[sw_cnt],%[sw_cnt],1;"

    	

    	"add %[y],%[y],t0;"

	"addi %[add_cnt],%[add_cnt],1;"

	

"addi %[others_cnt],%[others_cnt],1;"

"bnez %[arr_size],improved_loop;"

Leave a Comment