当前位置:网站首页>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
边栏推荐
- Introduction to Convolutional Neural Networks
- 代码庆端午--粽你心意
- Deep Adversarial Decomposition: A Unified Framework for Separating Superimposed Images
- MNIST Handwritten Digit Recognition - Lenet-5's First Commercial Grade Convolutional Neural Network
- 光条中心提取方法总结(一)
- arm-2-基础阶段
- Use of double pointers
- 语音驱动嘴型与面部动画生成的现状和趋势
- 【论文阅读】TransReID: Transformer-based Object Re-Identification
- fuser 使用—— YOLOV5内存溢出——kill nvidai-smi 无pid 的 GPU 进程
猜你喜欢
Data reading in yolov3 (1)
Deep learning, "grain and grass" first--On the way to obtain data sets
Copy Siege Lion 5-minute online experience MindIR format model generation
Cut the hit pro subtitles export of essays
YOLOV4流程图(方便理解)
Amazon Cloud Technology Build On-Amazon Neptune's Knowledge Graph-Based Recommendation Model Building Experience
Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
深度学习理论 —— 初始化、参数调节
腾讯、网易纷纷出手,火到出圈的元宇宙到底是个啥?
How to get started with MOOSE platform - an example of how to run the official tutorial
随机推荐
【论文阅读】Exploring Spatial Significance via Hybrid Pyramidal Graph Network for Vehicle Re-identificatio
How to grow into a senior engineer?
MNIST手写数字识别 —— Lenet-5首个商用级别卷积神经网络
makefile基础学习
空洞卷积
Code to celebrate the Dragon Boat Festival - Zongzi, your heart
浅谈外挂常识和如何防御
latex-写论文时一些常用设置
双向LSTM
Copy Siege Lion 5-minute online experience MindIR format model generation
深度学习理论——过拟合、欠拟合、正则化、优化器
[Deep Learning Diary] Day 1: Hello world, Hello CNN MNIST
SQL注入详解
AWS uses EC2 to reduce the training cost of DeepRacer: DeepRacer-for-cloud practical operation
审稿意见回复
FAREWARE ADDRESS
Copy攻城狮5分钟在线体验 MindIR 格式模型生成
2020-10-29
TensorRT 5 初步认识
MNIST手写数字识别 —— 从感知机到卷积神经网络