当前位置:网站首页>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
边栏推荐
- Deep learning, "grain and grass" first--On the way to obtain data sets
- PCL窗口操作
- arm交叉编译
- 度量学习(Metric learning、损失函数、triplet、三元组损失、fastreid)
- MNIST Handwritten Digit Recognition - Lenet-5's First Commercial Grade Convolutional Neural Network
- Pytorch语义分割理解
- MNIST handwritten digit recognition, sorted by from two to ten
- Rules.make-适合在编辑模式下看
- LeetCode_Nov_5th_Week
- No matching function for call to ‘RCTBridgeModuleNameForClass‘
猜你喜欢

arm学习-1-开发板

亚马逊云科技Build On-Amazon Neptune基于知识图谱的推荐模型构建心得

AWS使用EC2降低DeepRacer的训练成本:DeepRacer-for-cloud的实践操作

基于BiGRU和GAN的数据生成方法

MNIST Handwritten Digit Recognition - Building a Perceptron from Zero for Two-Classification

tmux概念和使用

Amazon Cloud Technology Build On-Amazon Neptune's Knowledge Graph-Based Recommendation Model Building Experience

Pytest common plug-in

中国联通、欧莱雅和钉钉都在争相打造的秘密武器?虚拟IP未来还有怎样的可能

MNIST手写数字识别 —— 从零构建感知机实现二分类
随机推荐
MNIST handwritten digit recognition - based on Mindspore to quickly build a perceptron to achieve ten categories
LeetCode_22_Apr_2nd_Week
Image-Adaptive YOLO for Object Detection in Adverse Weather Conditions
打金?工作室?账号被封?游戏灰黑产离我们有多近
机器学习——分类问题对于文字标签的处理(特征工程)
sbl_init.asm-适合在编辑模式下看
空洞卷积
Copy攻城狮5分钟在线体验 MindIR 格式模型生成
latex-写论文时一些常用设置
Android foundation [Super detailed android storage method analysis (SharedPreferences, SQLite database storage)]
Thunderbolt turns off automatic updates
tensorRT教程——使用tensorRT OP 搭建自己的网络
亚马逊云科技Build On-Amazon Neptune基于知识图谱的推荐模型构建心得
fuser 使用—— YOLOV5内存溢出——kill nvidai-smi 无pid 的 GPU 进程
Pytorch问题总结
Amazon Cloud Technology Build On-Amazon Neptune's Knowledge Graph-Based Recommendation Model Building Experience
【CV-Learning】Convolutional Neural Network
MNIST手写数字识别 —— 从零构建感知机实现二分类
浅谈外挂常识和如何防御
lstm pipeline 过程理解(输入输出)