Skip to content

Update x64-calling-convention.md #5005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/build/x64-calling-convention.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,23 +109,23 @@ These examples show how parameters and return values are passed for functions wi

### Example of return value 1 - 64-bit result

```Output
```cpp
__int64 func1(int a, float b, int c, int d, int e);
// Caller passes a in RCX, b in XMM1, c in R8, d in R9, e pushed on stack,
// callee returns __int64 result in RAX.
```

### Example of return value 2 - 128-bit result

```Output
```cpp
__m128 func2(float a, double b, int c, __m64 d);
// Caller passes a in XMM0, b in XMM1, c in R8, d in R9,
// callee returns __m128 result in XMM0.
```

### Example of return value 3 - user type result by pointer

```Output
```cpp
struct Struct1 {
int j, k, l; // Struct1 exceeds 64 bits.
};
Expand All @@ -137,7 +137,7 @@ Struct1 func3(int a, double b, int c, float d);

### Example of return value 4 - user type result by value

```Output
```cpp
struct Struct2 {
int j, k; // Struct2 fits in 64 bits, and meets requirements for return by value.
};
Expand Down