当前位置:网站首页>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
边栏推荐
- TypeError: load() missing 1 required positional argument: ‘Loader‘
- Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
- 【论文阅读】Mining Cross-Image Semantics for Weakly Supervised Semantic Segmentation
- 光条提取中的连通域筛除
- 典型CCN网络——efficientNet(2019-Google-已开源)
- A code example of the PCL method in the domain of DG (Domain Generalization)
- MNIST Handwritten Digit Recognition - Image Analysis Method for Binary Classification
- YOLOV5 V6.1 详细训练方法
- 学习资料re-id
- MOOSE平台使用入门攻略——如何运行官方教程的例子
猜你喜欢

LeetCode_Dec_2nd_Week

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

Pytest common plug-in

基于asp.net的法律援助平台的设计与实现(附项目链接)

安装pyspider后运行pyspider all后遇到的问题

【论文阅读】TransReID: Transformer-based Object Re-Identification

Brief description of database and common operation guide

【论文阅读】Anchor-Free Person Search

TensorRT 5 初步认识

fuser 使用—— YOLOV5内存溢出——kill nvidai-smi 无pid 的 GPU 进程
随机推荐
[CV-Learning] Linear Classifier (SVM Basics)
光条中心提取方法总结(二)
Data reading in yolov3 (1)
MNIST Handwritten Digit Recognition - From Perceptrons to Convolutional Neural Networks
yoloV5 使用——训练速度慢,加速训练
2020-10-29
tensorRT5.15 使用中的注意点
CAS无锁队列的实现
软著撰写注意事项
LeetCode_Dec_1st_Week
周志华机器学习
MNIST手写数字识别 —— 基于Mindspore快速构建感知机实现十分类
YOLOV5 V6.1 详细训练方法
PostgreSQL schema (Schema)
latex-写论文时一些常用设置
arm-3-中断体系结构
度量学习(Metric learning、损失函数、triplet、三元组损失、fastreid)
【五一专属】阿里云ECS大测评#五一专属|向所有热爱分享的“技术劳动者”致敬#
PCL1.12 解决memory.h中EIGEN处中断问题
PCL窗口操作