数据结构是如何装入 CPU 寄存器的?
k8s技术圈
共 1858字,需浏览 4分钟
·
2021-08-16 08:54
内存与数据
![](https://filescdn.proginn.com/21e1bd13589ac386c1967d863c47bbc6/600bc8bb0c38d0cf6a3b4879ecc3cf99.webp)
![](https://filescdn.proginn.com/d70df2b57714bf1129d33d11b29bf412/8ff9fb0a419f04e43e1eff8e4bbe3679.webp)
搬运数据的机器指令
int* huge_arr = new int[1 * 1024* 1024 *1024];
long int sum = 0;
for (int i = 0; i < 1 * 1024* 1024 *1024; i++) {
sum += huge_arr[i];
}
sum += huge_arr[i];
load $r0 100($r2)
add $r1 $r1 $r0
![](https://filescdn.proginn.com/320a4cd3881696fbd848c05b31cb9856/6273e971ef3965ad1753dd611d5f1578.webp)
编译器
总结
评论