当前位置:网站首页>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
边栏推荐
- 【五一专属】阿里云ECS大测评#五一专属|向所有热爱分享的“技术劳动者”致敬#
- 第三章 标准单元库(上)
- The Unity of ML - agents interpret parameter Settings
- YOLOV5 V6.1 详细训练方法
- 亚马逊云科技 Build On 2022 - AIot 第二季物联网专场实验心得
- tensorRT教程——使用tensorRT OP 搭建自己的网络
- 光条中心提取方法总结(一)
- 多层LSTM
- TypeError: load() missing 1 required positional argument: ‘Loader‘
- MNIST Handwritten Digit Recognition - Lenet-5's First Commercial Grade Convolutional Neural Network
猜你喜欢

【CV-Learning】Convolutional Neural Network

第三章 标准单元库(下)
![[Deep Learning Diary] Day 1: Hello world, Hello CNN MNIST](/img/06/6f49260732e5832edae2ec80aafc99.png)
[Deep Learning Diary] Day 1: Hello world, Hello CNN MNIST

LeetCode_Dec_1st_Week

深度学习理论——过拟合、欠拟合、正则化、优化器

多层LSTM

Deep Adversarial Decomposition: A Unified Framework for Separating Superimposed Images

Copy攻城狮5分钟在线体验 MindIR 格式模型生成

剪映专业版字幕导出随笔

MNIST handwritten digit recognition, sorted by from two to ten
随机推荐
MNIST Handwritten Digit Recognition - Building a Perceptron from Zero for Two-Classification
tensorRT教程——tensor RT OP理解(实现自定义层,搭建网络)
机器学习——分类问题对于文字标签的处理(特征工程)
TypeError: load() missing 1 required positional argument: ‘Loader‘
YOLOV5 V6.1 详细训练方法
安装pyspider后运行pyspider all后遇到的问题
arm-2-基础阶段
第一章 绪论
【论文阅读】TransReID: Transformer-based Object Re-Identification
LeetCode_Nov_1st_Week
MNIST手写数字识别 —— 从零构建感知机实现二分类
【代码学习】
Comparison of oracle's number and postgresql's numeric
Copy Siege Lion 5-minute online experience MindIR format model generation
MOOSE平台使用入门攻略——如何运行官方教程的例子
Qt日常学习
[Copy Siege Lion Log] Flying Pulp Academy Intensive Learning 7-Day Punch Camp-Study Notes
LeetCode_Dec_2nd_Week
PP-LiteSeg
PostgreSQL schema (Schema)