Hi im jongsang who is user of DC-ROMA Gen2 Laptop.
Actually i have lots of interest in RVV.
now, i have curious of "vsetvli", "vle32.v", "vse32.v" Instruction's execution time.
I try to write test code like this.
`
#include <stdio.h>
#include <stdint.h>
#define VECTOR_SIZE 8
int main() {
uint64_t start, end, cycle;
asm volatile (
"fence.i\n\t" // Invalidate the instruction cache
"rdcycle %0 \n\t"
"vsetvli t0, %2, e32\n\t"
"vsetvli t0, %2, e32\n\t"
"vsetvli t0, %2, e32\n\t"
"vsetvli t0, %2, e32\n\t"
"vsetvli t0, %2, e32\n\t"
"vsetvli t0, %2, e32\n\t"
"vsetvli t0, %2, e32\n\t"
"vsetvli t0, %2, e32\n\t"
"vsetvli t0, %2, e32\n\t"
"vsetvli t0, %2, e32\n\t"
"fence.i\n\t" // Invalidate the instruction cache
"rdcycle %1 \n\t"
: "=r"(start), "=r"(end) // Output operands
: "r"(VECTOR_SIZE) // Input operand
: "t0" // Clobbered register
);
printf("start: %ld\n", start);
printf("end: %ld\n", end);
cycle = end - start;
printf("cycle: %ld\n", cycle);
return 0;
}
`
But, result is confuse.

I cant understand about this result.
How does it take 0 cycles to perform "vsetvli" 10 times?
Is there any problem to my method?
If it has problem, please give some advice...
Thank you.
Best regard,
Hi im jongsang who is user of DC-ROMA Gen2 Laptop.
Actually i have lots of interest in RVV.
now, i have curious of "vsetvli", "vle32.v", "vse32.v" Instruction's execution time.
I try to write test code like this.
`
#include <stdio.h>
#include <stdint.h>
#define VECTOR_SIZE 8
int main() {
uint64_t start, end, cycle;
}
`
But, result is confuse.

I cant understand about this result.
How does it take 0 cycles to perform "vsetvli" 10 times?
Is there any problem to my method?
If it has problem, please give some advice...
Thank you.
Best regard,