当前位置:网站首页>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
边栏推荐
- PP-LiteSeg
- Code to celebrate the Dragon Boat Festival - Zongzi, your heart
- (Navigation page) OpenStack-M version - manual construction of two nodes - with video from station B
- 学习资料re-id
- Golang environment variable settings (2)--GOMODULE & GOPROXY
- 【论文阅读】Further Non-local and Channel Attention Networks for Vehicle Re-identification
- yoloV5 使用——训练速度慢,加速训练
- arm-3-中断体系结构
- AWS使用EC2降低DeepRacer的训练成本:DeepRacer-for-cloud的实践操作
- 中国联通、欧莱雅和钉钉都在争相打造的秘密武器?虚拟IP未来还有怎样的可能
猜你喜欢
第二章 STA相关概念
Install Minikube Cluster in AWS-EC2
第三章 标准单元库(下)
Windows10重置MySQL用户密码
安装pyspider后运行pyspider all后遇到的问题
【论文阅读】Exploring Spatial Significance via Hybrid Pyramidal Graph Network for Vehicle Re-identificatio
【论文阅读】Multi-View Spectral Clustering with Optimal Neighborhood Laplacian Matrix
度量学习(Metric learning)—— 基于分类损失函数(softmax、交叉熵、cosface、arcface)
【Copy攻城狮日志】“一分钟”跑通MindSpore的LeNet模型
How to get started with MOOSE platform - an example of how to run the official tutorial
随机推荐
arm交叉编译
PCL窗口操作
机器学习——分类问题对于文字标签的处理(特征工程)
深度学习理论 —— 初始化、参数调节
PyTorch
Thunderbolt turns off automatic updates
MNIST Handwritten Digit Recognition - From Perceptrons to Convolutional Neural Networks
MNIST Handwritten Digit Recognition - Lenet-5's First Commercial Grade Convolutional Neural Network
latex-写论文时一些常用设置
【CV-Learning】Convolutional Neural Network
【Copy攻城狮日志】飞浆学院强化学习7日打卡营-学习笔记
第二章 STA相关概念
图像合并水平拼接
tmux概念和使用
A code example of the PCL method in the domain of DG (Domain Generalization)
Cut the hit pro subtitles export of essays
Windows10重置MySQL用户密码
MNIST手写数字识别 —— 从感知机到卷积神经网络
Lee‘s way of Deep Learning 深度学习笔记
lstm pipeline 过程理解(输入输出)