当前位置:网站首页>counting cycle
counting cycle
2022-08-04 05:30:00 【xcy6666】
.section .data
cycle_str:
.asciz "cycle count is: %lu\n"
long:
.quad 5
.section .text
.globl _start
_start:
# measure base = mov + rdtsc
xorq %rax, %rax
rdtsc # write time stamp to rax
movq %rax, %rcx # %rcx = %rax
rdtsc # write time stamp to rax
subq %rcx, %rax # %rax = %rax -%rcx
movq %rax, %rsi
movq $cycle_str, %rdi
movq $0, %rax
call printf
# measure base + xchgq
xorq %rax, %rax
rdtsc # write time stamp to rax
movq %rax, %rcx # %rcx = %rax
xchgq long, %rdx
rdtsc # write time stamp to rax
subq %rcx, %rax # %rax = %rax -%rcx
# print %rax
movq %rax, %rsi
movq $cycle_str, %rdi
movq $0, %rax
call printf
# exit
movq $1,%rax # syscall id: sys_exit
movq $0,%rbx # exit code 0
int $0x80
all:
as -o hello.o hello.S
ld -o hello hello.o -lc --dynamic-linker /lib64/ld-linux-x86-64.so.2
./hello
clean:
rm *.o hello
https://docs.microsoft.com/en-us/cpp/intrinsics/rdtsc?view=msvc-160
https://cs.brown.edu/courses/cs033/docs/guides/x64_cheatsheet.pdf
https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/ia-32-ia-64-benchmark-code-execution-paper.pdf
边栏推荐
- CSDN大礼包--高校圆桌派大礼包
- 腾讯、网易纷纷出手,火到出圈的元宇宙到底是个啥?
- Comparison of oracle's number and postgresql's numeric
- LeetCode_Nov_5th_Week
- MNIST手写数字识别 —— 基于Mindspore快速构建感知机实现十分类
- Pytest常用插件
- MNIST Handwritten Digit Recognition - Lenet-5's First Commercial Grade Convolutional Neural Network
- FAREWARE ADDRESS
- Copy攻城狮的年度之“战”|回顾2020
- 【论文阅读】Multi-View Spectral Clustering with Optimal Neighborhood Laplacian Matrix
猜你喜欢

安装pyspider后运行pyspider all后遇到的问题

深度学习,“粮草”先行--浅谈数据集获取之道

MNIST手写数字识别 —— 从二分类到十分类

LeetCode_Dec_3rd_Week

Pytest common plug-in

Tencent and NetEase have taken action one after another. What is the metaverse that is so popular that it is out of the circle?

在AWS-EC2中安装Minikube集群

【CV-Learning】Convolutional Neural Network

【论文阅读】TransReID: Transformer-based Object Re-Identification
![[Copy Siege Lion Log] Flying Pulp Academy Intensive Learning 7-Day Punch Camp-Study Notes](/img/af/05caea638de8d75f6d3b42b3d8e28f.png)
[Copy Siege Lion Log] Flying Pulp Academy Intensive Learning 7-Day Punch Camp-Study Notes
随机推荐
Copy Siege Lions "sticky" to AI couplets
度量学习(Metric learning、损失函数、triplet、三元组损失、fastreid)
MNIST手写数字识别 —— 从感知机到卷积神经网络
图像合并水平拼接
基于PyTorch的FCN-8s语义分割模型搭建
基于BiGRU和GAN的数据生成方法
Pytorch语义分割理解
双向LSTM
软著撰写注意事项
[CV-Learning] Convolutional Neural Network Preliminary Knowledge
arm-3-中断体系结构
周志华机器学习
LeetCode_Nov_4th_Week
图像resize
学习资料re-id
[Deep Learning Diary] Day 1: Hello world, Hello CNN MNIST
AWS uses EC2 to reduce the training cost of DeepRacer: DeepRacer-for-cloud practical operation
Use of double pointers
DRA821 环境搭建
图像线性融合