当前位置:网站首页>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
边栏推荐
- PCL1.12 解决memory.h中EIGEN处中断问题
- 度量学习(Metric learning)—— 基于分类损失函数(softmax、交叉熵、cosface、arcface)
- MNIST Handwritten Digit Recognition - Image Analysis Method for Binary Classification
- 投稿相关
- The second official example analysis of the MOOSE platform - about creating a Kernel and solving the convection-diffusion equation
- FAREWARE ADDRESS
- 关于DG(域泛化)领域的PCL方法的代码实例
- 动手学深度学习__数据操作
- 【论文阅读】Mining Cross-Image Semantics for Weakly Supervised Semantic Segmentation
- SQL注入详解
猜你喜欢
随机推荐
MFC 打开与保存点云PCD文件
LeetCode_Nov_2nd_Week
Android foundation [Super detailed android storage method analysis (SharedPreferences, SQLite database storage)]
如何成长为高级工程师?
如何用Pygame制作简单的贪吃蛇游戏
关于DG(域泛化)领域的PCL方法的代码实例
投稿相关
双向LSTM
MNIST手写数字识别 —— 从零构建感知机实现二分类
arm-3-中断体系结构
【CV-Learning】Convolutional Neural Network
tmux概念和使用
Various commands such as creating a new user in postgresql
图像resize
【论文阅读】Multi-View Spectral Clustering with Optimal Neighborhood Laplacian Matrix
MNIST手写数字识别 —— Lenet-5首个商用级别卷积神经网络
2020-10-29
"A minute" Copy siege lion log 】 【 run MindSpore LeNet model
Cut the hit pro subtitles export of essays
基于PyTorch的FCN-8s语义分割模型搭建





![[CV-Learning] Convolutional Neural Network Preliminary Knowledge](/img/7d/58d9649b06e78eeb019d63615a90c4.png)



