This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

关于vld1q和vld2q的效率测试

最近在移植算法时发现有限优化出来的耗时不是自己当初设计的那样,我对其中的一些指令的效率进行了测试,测试的主要代码如下:

测试方法:对两个函数计时T,然后ave_cyc = T * 主频/len,测试环境tx1(A57),主频1.6G,32位,单核单线程
我对上述两个函数进行了测试,发现在len一致的情况下,运行平均运行一次func_vld1q要16cycle,func_vld2q要21cycle,
我的理解是两个函数耗时应该差不多,或者func_vld2q比func_vld1q更快。

void func_vld1q(float *a,int len)
{
asm violate
{
"0:\n"
"vld1.32 {d0-d1},[%0:128]\n"
"vld1.32 {d2-d3},[%0:128]\n"
"vld1.32 {d4-d5},[%0:128]\n"
"vld1.32 {d6-d7},[%0:128]\n"
"vld1.32 {d8-d9},[%0:128]\n"
"vld1.32 {d10-d11},[%0:128]\n"
"vld1.32 {d12-d13},[%0:128]\n"
"vld1.32 {d14-d15},[%0:128]\n"
"vld1.32 {d16-d17},[%0:128]\n"
"vld1.32 {d18-d19},[%0:128]\n"
"vld1.32 {d20-d21},[%0:128]\n"
"vld1.32 {d22-d23},[%0:128]\n"
"vld1.32 {d24-d25},[%0:128]\n"
"vld1.32 {d26-d27},[%0:128]\n"
"vld1.32 {d28-d29},[%0:128]\n"
"vld1.32 {d30-d31},[%0:128]\n"
"subs %1,#1 \n"
"bne 0b \n"
:....
:....
:....
}
}


void func_vld2q(float *a,int len)
{
asm violate
{
"0:\n"
"vld2.32 {d0-d3},[%0:256]\n"
"vld2.32 {d4-d7},[%0:256]\n"
"vld2.32 {d8-d11},[%0:256]\n"
"vld2.32 {d12-d15},[%0:256]\n"
"vld2.32 {d16-d19},[%0:256]\n"
"vld2.32 {d20-d23},[%0:256]\n"
"vld2.32 {d24-d27},[%0:256]\n"
"vld2.32 {d28-d31},[%0:256]\n"
"subs %1,#1 \n"
"bne 0b \n"
:....
:....
:....
}
}

我不清楚是不是我的测试代码有问题还是底层有什么我没理解清楚的,请各位专家能帮我解惑一下,谢谢!

Parents Reply Children
No data