X86-64 Reference Sheet I

https://www.cs.cmu.edu/afs/cs/academic/class/15213-s20/www/recitations/x86-cheat-sheet.pdf


X86-64 Reference Sheet II

Registers

Register

Purpose

Saved across calls

%rax

temp register; return value

No

%rbx

callee-saved

Yes

%rcx

used to pass 4th argument to functions

No

%rdx

used to pass 3rd argument to functions

No

%rsp

stack pointer

Yes

%rbp

callee-saved; base pointer

Yes

%rsi

used to pass 2nd argument to functions

No

%rdi

used to pass 1st argument to functions

No

%r8

used to pass 5th argument to functions

No

%r9

used to pass 6th argument to functions

No

%r10-r11

temporary

No

%r12-r15

callee-saved registers

Yes



Stack Organization

Position

Contents

Frame

8n+16(%rbp)

argument n

Previous

...

...

16(%rbp)

argument 7

8(%rbp)

return address

Current

0(%rbp)

previous %rbp value

-8(%rbp)

locals and temps

...

0(%rsp)


Prologue: 

// call -> pushs %rip onto stack
push %ebp
mov %esp, %ebp

Epilogue:

mov %ebp, %esp
pop %ebp
// ret -> pops %rip from stack

 

SIMD: MMX, SSE, AVX

512-bit

256-bit

128-bit

Preserved

Usage

zmm0

ymm0

xmm0

 

arg1, return

zmm1

ymm1

xmm1

 

arg2

zmm7

ymm7

xmm7

 

arg8

zmm8

ymm8

xmm8

   

zmm15

ymm15

xmm15

   

Example:

double foo(double x, int y) {
  return x + (double) y;
}

_Z3foodi:
	cvtsi2sd	%edi, %xmm1
	addsd	%xmm1, %xmm0
	ret

 

posted @ 2024-08-18 17:56 william-cheung 阅读(12) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <string> #include <typeinfo> #include <cxxabi.h> template <typename T> class TypeTraits { public: static std::string Name 阅读全文
posted @ 2024-08-01 22:17 william-cheung 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 1 #pragma once 2 3 #include <string> 4 #include <unordered_map> 5 #include <mutex> 6 #include <random> 7 #include <ctime> 8 9 #ifdef FI_FLAG 10 11 // 阅读全文
posted @ 2024-02-19 15:44 william-cheung 阅读(10) 评论(0) 推荐(0) 编辑
摘要: C++ enum 转 string 阅读全文
posted @ 2023-05-17 23:40 william-cheung 阅读(557) 评论(0) 推荐(0) 编辑
摘要: /* uint16_t xorsum(const char *buf, int len); */ .global xorsum .text xorsum: mov $0xffffffff,%eax mov %esi, %edx shr %edx jz loop_done mov %edx, %ecx 阅读全文
posted @ 2021-03-27 14:01 william-cheung 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 1. SerializableSame results as if transactions executed one-by-one.Even though they may actually execute concurrently.r/w transactions are serializabl 阅读全文
posted @ 2019-08-10 22:24 william-cheung 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Linearizablity at a Single Site Note that: In (1)(2)(3) get()s and inc()s appear to be executed in sequential order (Edited on Mar. 15th, 2020) More p 阅读全文
posted @ 2019-07-22 22:37 william-cheung 阅读(303) 评论(0) 推荐(0) 编辑
摘要: Comparisons between HDFS and GFS 阅读全文
posted @ 2019-04-20 12:05 william-cheung 阅读(362) 评论(0) 推荐(0) 编辑
摘要: Typical Properties of Consensus Algorithms 1. safety: produce correct results under all non-Byzantine conditions include network delays/partitions, pa 阅读全文
posted @ 2019-04-11 22:26 william-cheung 阅读(226) 评论(0) 推荐(0) 编辑
摘要: Zookeeper is a general-purpose coordination service. The ZooKeeper service comprises an ensemble of servers that use replication to achieve high avail 阅读全文
posted @ 2019-03-20 15:00 william-cheung 阅读(268) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示