当前位置:网站首页>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
边栏推荐
- MNIST handwritten digit recognition, sorted by from two to ten
- "A minute" Copy siege lion log 】 【 run MindSpore LeNet model
- YOLOV4流程图(方便理解)
- Deep Adversarial Decomposition: A Unified Framework for Separating Superimposed Images
- sbl_init.asm-适合在编辑模式下看
- SQL注入详解
- DeblurGAN-v2: Deblurring (Orders-of-Magnitude) Faster and Better 图像去模糊
- Code to celebrate the Dragon Boat Festival - Zongzi, your heart
- Pytorch语义分割理解
- 投稿相关
猜你喜欢

Deep Learning Theory - Initialization, Parameter Adjustment

PP-LiteSeg

【深度学习日记】第一天:Hello world,Hello CNN MNIST

Qt日常学习

YOLOV4流程图(方便理解)

tmux概念和使用

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

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

【论文阅读】Further Non-local and Channel Attention Networks for Vehicle Re-identification

Install Minikube Cluster in AWS-EC2
随机推荐
MNIST handwritten digit recognition, sorted by from two to ten
Copy Siege Lion 5-minute online experience MindIR format model generation
迅雷关闭自动更新
CSDN大礼包--高校圆桌派大礼包
软著撰写注意事项
fuser 使用—— YOLOV5内存溢出——kill nvidai-smi 无pid 的 GPU 进程
Introduction to Convolutional Neural Networks
Pytorch语义分割理解
MOOSE平台官方第二个例子分析——关于创建Kernel,求解对流扩散方程
Install Minikube Cluster in AWS-EC2
PyTorch
Rules.make-适合在编辑模式下看
LeetCode_Nov_5th_Week
Android foundation [Super detailed android storage method analysis (SharedPreferences, SQLite database storage)]
Golang环境变量设置(二)--GOMODULE&GOPROXY
Copy攻城狮5分钟在线体验 MindIR 格式模型生成
图像resize
图像线性融合
(Navigation page) OpenStack-M version - manual construction of two nodes - with video from station B
PCL窗口操作