Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
385 B
2
Indexable
"li t0,8\n\t" // t0 = n
"li %[flag],0\n\t" 
"li t1,8\n\t" // t1 = 8
"vsetvli t2, t0, e16 \n\t" // t2 = 8
"vle16.v v0,(%[p_x])\n\t"
"loop:\n\t"
"lh t3,14(%[p_x])\n\t"
"vadd.vx v3,v1,%[target]\n\t"
"vfirst.m t2,v0\n\t"
"bge t1,x0,flag_here\n\t"
"addi t1,t1,-1\n\t"
"bnez t1,end\n\t" // exits the program


"j end\n\t"

"flag_here:\n\t"
"li %[flag],1\n\t"


"end:\n\t"