当前位置:网站首页>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
- IEEE802.X协议族
- MNIST手写数字识别 —— 从零构建感知机实现二分类
- MOOSE平台使用入门攻略——如何运行官方教程的例子
- 【Copy攻城狮日志】“一分钟”跑通MindSpore的LeNet模型
- Pytest common plug-in
- target has libraries with conflicting names: libcrypto.a and libssl.a.
- 理想的生活
- "A minute" Copy siege lion log 】 【 run MindSpore LeNet model
猜你喜欢

fuser 使用—— YOLOV5内存溢出——kill nvidai-smi 无pid 的 GPU 进程

"A minute" Copy siege lion log 】 【 run MindSpore LeNet model

【Copy攻城狮日志】飞浆学院强化学习7日打卡营-学习笔记

Halcon缺陷检测

DeblurGAN-v2: Deblurring (Orders-of-Magnitude) Faster and Better 图像去模糊

AWS uses EC2 to reduce the training cost of DeepRacer: DeepRacer-for-cloud practical operation

浅谈游戏音效测试点

MNIST手写数字识别 —— ResNet-经典卷积神经网络

典型CCN网络——efficientNet(2019-Google-已开源)

MNIST手写数字识别 —— 图像分析法实现二分类
随机推荐
【CV-Learning】Convolutional Neural Network
软著撰写注意事项
第三章 标准单元库(下)
亚马逊云科技 Build On 2022 - AIot 第二季物联网专场实验心得
动手学深度学习__数据操作
Lee‘s way of Deep Learning 深度学习笔记
【代码学习】
度量学习(Metric learning)—— 基于分类损失函数(softmax、交叉熵、cosface、arcface)
第一章 绪论
Windows10重置MySQL用户密码
LeetCode_Nov_2nd_Week
Attention Is All You Need(Transformer)
MNIST手写数字识别 —— ResNet-经典卷积神经网络
Install Minikube Cluster in AWS-EC2
【论文阅读】Exploring Spatial Significance via Hybrid Pyramidal Graph Network for Vehicle Re-identificatio
MNIST手写数字识别 —— 基于Mindspore快速构建感知机实现十分类
浅谈游戏音效测试点
LeetCode_Dec_2nd_Week
MNIST Handwritten Digit Recognition - Building a Perceptron from Zero for Two-Classification
No matching function for call to 'RCTBridgeModuleNameForClass'