Skip to content

Incorrect __fastcall ABI #1106

@chuggafan

Description

@chuggafan

If I'm reading this right, we treat __fastcall as having three register parameters and the rest passed on the stack, those register parameters for us are ECX, EDX, and EAX.

static char fastcallRegs[3] = {R_ECX, R_EDX, R_EAX};

(Gotten from line 340 of configx86.cpp)

Whereas the Microsoft docs for fastcall state:

Element Implementation
Argument-passing order The first two DWORD or smaller arguments that are found in the argument list from left to right are passed in ECX and EDX registers; all other arguments are passed on the stack from right to left.

https://learn.microsoft.com/en-us/cpp/cpp/fastcall?view=msvc-170
Not sure if just chopping off that EAX portion at the end will work since we have builtins that rely on fastcall ordering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions