Home

fastcall

Fastcall is a calling convention used by some 32-bit x86 compilers to improve function call efficiency by passing some arguments in registers rather than on the stack. The main idea is to reduce stack traffic for the common case of functions with a few parameters, thereby speeding up calls on slower memory systems.

In typical 32-bit implementations, the first two arguments are passed in registers (commonly ECX and EDX on

Fastcall originated in early C and C++ toolchains as an optimization over the more general cdecl calling

Portability is a key consideration: code using fastcall is generally not portable across compilers or architectures,

In summary, fastcall is a historical 32-bit x86 optimization that passes initial arguments in registers to

x86),
with
any
remaining
arguments
pushed
on
the
stack
in
right-to-left
order.
The
callee
is
often
responsible
for
cleaning
the
stack.
The
exact
registers
used
and
who
cleans
up
the
stack
can
vary
by
compiler
and
platform,
so
the
details
are
not
standardized
across
all
implementations.
convention.
It
was
popular
in
some
32-bit
Windows
and
Borland
compilers
but
has
become
less
common
as
modern
32-bit
and
64-bit
ABIs
favor
standardized
conventions
with
more
arguments
passed
in
registers
by
the
architecture
itself.
On
64-bit
targets,
the
concept
of
fastcall
is
largely
superseded
by
the
platform’s
standard
calling
conventions,
and
many
compilers
ignore
or
deprecate
the
fastcall
keyword
for
64-bit
code.
and
name
decoration
or
linkage
can
differ
between
environments.
When
cross-compiler
or
cross-language
boundaries
are
involved,
using
standard
conventions
like
cdecl
or
the
platform-specific
ABI
is
typically
preferable.
speed
calls,
with
variations
in
practice
and
limited
relevance
on
modern
64-bit
systems.